:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: rgba(13, 22, 40, 0.88);
  --panel-2: #15233d;
  --text: #ebf1ff;
  --muted: #95a8cb;
  --accent: #7de7cb;
  --accent-2: #86a7ff;
  --danger: #ff8394;
  --border: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.035);
}

/* Phone focus v2: compact file, thinking, and composer components. */
@media (max-width: 720px) {
  .log {
    gap: 12px;
    padding: 10px 10px 92px;
  }

  .message:has(.message-file-list),
  .message.thinking {
    width: 100%;
    max-width: 100%;
  }

  .message-file-list {
    gap: 6px;
  }

  .message-file-card,
  .message-file-card.image {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    min-height: 98px;
    padding: 8px;
    border: 1px solid #e3e8f1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  }

  button.message-file-preview-button {
    height: 82px;
    border-radius: 10px;
    overflow: hidden;
  }

  .message-file-preview {
    width: 100%;
    height: 82px;
    max-height: 82px;
    border: 0;
    border-radius: 10px;
    object-fit: cover;
    background: #eef2f7;
  }

  .message-file-body {
    align-content: center;
    gap: 5px;
  }

  .message-file-name {
    display: -webkit-box;
    overflow: hidden;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .message-file-path {
    display: none;
  }

  .message-file-meta {
    overflow: hidden;
    color: #8a94a6;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .message-file-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .message-file-actions .secondary-button {
    display: inline-flex;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    background: #f7f9fc;
    color: #344054;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    box-shadow: none;
  }

  .message-file-card.image .message-file-actions a:first-of-type {
    display: none;
  }

  .message.thinking > .message-meta {
    display: none;
  }

  .thinking-card,
  html[data-theme="minimal-light"] .thinking-card {
    border: 1px solid #dfe7e5;
    border-radius: 13px;
    background: #f8fbfa;
    box-shadow: none;
  }

  .thinking-summary,
  .thinking-card[open] .thinking-summary {
    min-height: 44px;
    align-content: center;
    gap: 0;
    padding: 9px 12px;
  }

  .thinking-title-row {
    gap: 8px;
  }

  .thinking-title {
    color: #344054;
    font-size: 0;
  }

  .thinking-title::before {
    width: 6px;
    height: 6px;
    margin-right: 7px;
    box-shadow: none;
  }

  .thinking-title::after {
    content: "思考过程";
    font-size: 12px;
    font-weight: 700;
  }

  .thinking-phase {
    color: #7b8794;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .thinking-preview,
  .thinking-note {
    display: none;
  }

  .thinking-card[open] .thinking-content {
    max-height: 52dvh;
    padding: 0 48px 10px 10px;
  }

  .composer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 68px;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .composer-input-wrap textarea,
  .composer-main-row textarea {
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 120px;
    padding: 12px 13px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.35;
  }

  .composer-action-stack button {
    min-height: 48px;
    border-radius: 15px;
  }

  #codex-send-button {
    min-width: 62px;
  }

  .message-file-meta {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(125, 231, 203, 0.15), transparent 24%),
    radial-gradient(circle at top right, rgba(134, 167, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #09111f 0%, #0d1527 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 231, 203, 0.2), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(134, 167, 255, 0.22), transparent 30%),
    rgba(4, 8, 16, 0.86);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(125, 231, 203, 0.22);
  border-radius: 26px;
  background: rgba(13, 22, 40, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card input {
  width: 100%;
}

.auth-recovery {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-recovery summary {
  cursor: pointer;
  color: var(--muted);
}

.auth-recovery input {
  margin-top: 10px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-card .meta,
.auth-card .auth-error {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-error {
  min-height: 20px;
  color: var(--danger);
}

.shell {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.shell.navigator-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar,
.main {
  padding: 20px;
  min-height: 0;
}

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--border);
  background: rgba(8, 13, 24, 0.72);
  backdrop-filter: blur(20px);
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease;
}

.sidebar.overview-collapsed {
  gap: 14px;
}

.brand-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.brand-row h1 {
  min-width: 0;
}

.navigator-toggle-button {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.sidebar-close-button {
  display: none;
}

.shell.navigator-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.shell.navigator-collapsed .brand .eyebrow,
.shell.navigator-collapsed .brand h1,
.shell.navigator-collapsed .nav-section {
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
}

.brand h1,
.section-header h2,
.detail-header h2 {
  margin: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.nav-section,
.panel,
.composer {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
}

.nav-section,
.panel {
  padding: 16px;
}

.nav-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: visible;
  scrollbar-gutter: stable;
  transition:
    opacity 190ms ease,
    transform 230ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.collapsible-body {
  min-height: 0;
}

.overview-section {
  max-height: min(42vh, 420px);
  overflow: auto;
}

.sidebar.overview-collapsed .overview-section {
  max-height: none;
}

.selected-host-section {
  flex: 1 1 auto;
  gap: 10px;
  overflow: hidden;
}

.selected-host-section > .section-header,
.selected-host-section > .host-switcher-row,
.selected-host-section > .collapsible-body,
.selected-host-section > .collection-toolbar,
.selected-host-section > .collection-popover,
.selected-host-section > .session-search-form,
.selected-host-section > .session-sort-form,
.selected-host-section > .session-search-summary {
  flex: 0 0 auto;
  min-width: 0;
}

.selected-host-section .conversation-list {
  flex: 1 1 auto;
  max-height: none;
}

.selected-host-section .section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.selected-host-heading {
  min-width: 0;
}

.selected-host-heading h2,
.selected-host-heading .meta {
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-header,
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-toggle {
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 12px;
  white-space: nowrap;
}

.meta,
.muted,
.sub,
.detail-copy {
  color: var(--muted);
}

#new-session-status.error {
  color: var(--danger);
  overflow-wrap: anywhere;
}

.session-meta-path {
  display: inline-block;
  max-width: min(960px, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}

.mini-stat {
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mini-stat .value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

.import-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.new-session-form {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
}

.collection-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 4;
}

.collection-icon-button {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  font-size: 18px;
}

.mobile-select-anchor {
  position: relative;
  min-width: 0;
}

.native-select-control {
  width: 100%;
}

.mobile-select-button {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}

.mobile-select-button::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
}

.mobile-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 80;
  max-height: min(48dvh, 320px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.46);
}

.mobile-select-option {
  width: 100%;
  justify-content: flex-start;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mobile-select-option:hover,
.mobile-select-option.active {
  background: rgba(125, 231, 203, 0.14);
  color: var(--text);
}

.mobile-select-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.collection-popover {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(134, 167, 255, 0.2);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 5;
}

.collection-popover-header,
.collection-create-row,
.collection-manager-row,
.collection-manager-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.collection-popover-header,
.collection-manager-row {
  justify-content: space-between;
}

.collection-create-row input,
.collection-manager-copy {
  min-width: 0;
  flex: 1;
}

.collection-manager-list {
  display: grid;
  gap: 8px;
}

.collection-manager-row {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.collection-manager-copy {
  display: grid;
  gap: 3px;
}

.collection-manager-copy span,
.collection-manager-badge {
  color: var(--muted);
  font-size: 12px;
}

.collection-manager-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.session-search-form {
  display: grid;
  grid-template-columns: minmax(92px, 0.58fr) minmax(0, 1.42fr);
  gap: 8px;
  margin: 0 0 8px;
}

.search-input-wrap {
  position: relative;
  min-width: 0;
}

.search-input-wrap input {
  width: 100%;
  padding-right: 44px;
}

.search-clear-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}

.session-search-form button {
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  line-height: 1.15;
}

.session-sort-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: -2px 0 8px;
}

.session-sort-form button,
.session-sort-form select {
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  line-height: 1.15;
}

.session-sort-dir-button {
  width: 78px;
}

.session-search-summary {
  min-height: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.conversation-search-hits {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.conversation-search-hit {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(134, 167, 255, 0.22);
  background: rgba(134, 167, 255, 0.08);
  color: var(--text);
  text-align: left;
}

.conversation-search-hit-meta {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.conversation-search-hit-snippet {
  font-size: 12px;
  line-height: 1.35;
}

.conversation-search-hit mark,
.search-match-message mark,
.search-focused-message mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(255, 213, 105, 0.48);
  color: inherit;
}

.host-switcher-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.host-switcher-row label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

.path-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.inline-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 10px 9px;
  line-height: 1.12;
  overflow-wrap: normal;
  word-break: normal;
}

.directory-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 18, 0.56);
  backdrop-filter: blur(14px);
}

.connector-cta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.connector-cta .meta {
  margin-top: 4px;
  line-height: 1.4;
}

.connector-manager-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 9, 18, 0.6);
  backdrop-filter: blur(16px);
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 20%, rgba(125, 231, 203, 0.18), transparent 28%),
    rgba(4, 9, 18, 0.68);
  backdrop-filter: blur(18px);
}

.skills-manager-overlay {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 9, 18, 0.66);
  backdrop-filter: blur(18px);
}

.settings-modal {
  width: min(720px, 100%);
  min-width: 0;
  max-width: calc(100vw - 44px);
  display: grid;
  gap: 16px;
  max-height: min(90vh, 860px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(134, 167, 255, 0.22);
  border-radius: 26px;
  background: rgba(10, 18, 34, 0.98);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.skills-manager-modal {
  width: min(1080px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(134, 167, 255, 0.22);
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.98);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.settings-header,
.settings-section,
.settings-actions {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.skills-manager-header,
.skills-actions-bar {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.skills-manager-header h2 {
  margin: 0;
}

.skills-manager-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skills-tab {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.skills-tab.active {
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.48);
  background: rgba(45, 212, 191, 0.12);
}

.skills-manager-grid {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 14px;
  min-height: 420px;
}

.skills-host-panel,
.skills-main-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.skills-panel-title {
  margin-bottom: 10px;
  font-weight: 800;
}

.skills-host-list,
.skills-list {
  display: grid;
  gap: 10px;
}

.skills-host-row,
.skills-row {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.skills-host-row {
  grid-template-columns: auto minmax(0, 1fr);
  cursor: pointer;
}

.skills-host-row small,
.skills-row-copy small,
.skills-row-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.skills-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.skills-row-actions {
  display: grid;
  grid-template-columns: minmax(92px, auto);
  gap: 8px;
  min-width: 148px;
}

.skills-row-actions button {
  min-width: 0;
  min-height: 36px;
  white-space: normal;
}

.skills-actions-bar input {
  flex: 1 1 220px;
}

.skills-action-summary {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.skills-deployment-controls {
  display: grid;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.skills-deployment-options,
.skills-deployment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.skills-scope-segment {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  min-height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.skills-scope-segment button {
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.skills-scope-segment button.active {
  color: var(--text);
  background: rgba(45, 212, 191, 0.16);
}

#skills-project-cwd-select {
  flex: 1 1 260px;
  min-width: min(260px, 100%);
}

.skills-project-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--text);
  font-size: 12px;
}

.skills-deployment-actions button {
  min-height: 36px;
  white-space: normal;
}

.skills-deployment-progress {
  display: grid;
  gap: 6px;
  min-height: 0;
  max-height: 168px;
  overflow: auto;
}

.skills-deployment-progress-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.skills-deployment-progress-copy,
.skills-deployment-progress-results {
  min-width: 0;
}

.skills-deployment-progress-copy strong,
.skills-deployment-progress-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skills-deployment-progress-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.skills-deployment-progress-results {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  overflow-x: auto;
}

.skills-deployment-result {
  flex: 0 0 112px;
  min-width: 112px;
  height: 30px;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skills-inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

#skills-inventory-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.skills-inventory-matrix {
  --skills-host-count: 1;
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(var(--skills-host-count), minmax(112px, 1fr));
  max-width: 100%;
  margin-bottom: 12px;
  overflow: auto;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 6px;
}

.skills-inventory-cell {
  min-height: 44px;
  min-width: 112px;
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.skills-inventory-corner,
.skills-inventory-skill {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  background: var(--panel-2);
}

.skills-inventory-corner {
  z-index: 3;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.skills-inventory-host {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
}

.skills-inventory-host strong,
.skills-inventory-skill strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.skills-inventory-skill-select {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.skills-inventory-skill-select input {
  margin: 2px 0 0;
}

.skills-inventory-skill span,
.skills-inventory-skill small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.skills-inventory-status {
  font-size: 11px;
  font-weight: 700;
}

.skills-inventory-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.skills-adopt-button {
  min-height: 28px;
  min-width: 72px;
  padding: 4px 8px;
  font-size: 11px;
}

.skills-adoption-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.skills-inventory-status.state-fresh,
.skills-inventory-state.state-enabled {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
}

.skills-inventory-status.state-refreshing,
.skills-inventory-state.state-pending,
.skills-inventory-state.state-queued,
.skills-inventory-state.state-running,
.skills-deployment-result.state-pending,
.skills-deployment-result.state-queued,
.skills-deployment-result.state-running {
  color: var(--accent-2);
  background: rgba(134, 167, 255, 0.08);
}

.skills-inventory-state.state-succeeded,
.skills-deployment-result.state-succeeded {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
}

.skills-inventory-status.state-stale,
.skills-inventory-state.state-drifted,
.skills-inventory-state.state-conflict {
  color: #ffd87d;
  background: rgba(255, 216, 125, 0.08);
}

.skills-inventory-status.state-error,
.skills-inventory-state.state-conflict,
.skills-inventory-state.state-failed,
.skills-deployment-result.state-failed {
  color: var(--danger);
  background: rgba(255, 98, 112, 0.08);
}

.skills-inventory-status.state-offline,
.skills-inventory-state.state-offline,
.skills-inventory-state.state-missing,
.skills-inventory-state.state-disabled,
.skills-inventory-state.state-readonly,
.skills-inventory-state.state-shadowed {
  color: var(--muted);
  background: rgba(149, 168, 203, 0.06);
}

.skills-inventory-empty {
  grid-column: 1 / -1;
  min-height: 64px;
  padding: 18px;
  color: var(--muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.skills-daily-digest,
.skills-source-editor,
.skills-github-import-editor,
.skills-library-lifecycle-toolbar,
.skills-source-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.skills-github-import-editor {
  border-radius: 6px;
}

.skills-daily-digest {
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  align-items: center;
}

.skills-daily-digest span,
.skills-source-row span,
.skills-source-row small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.skills-source-editor {
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) auto;
}

.skills-github-import-editor {
  grid-template-columns: minmax(190px, 1.4fr) minmax(84px, 0.45fr) minmax(180px, 1fr) auto;
}

.skills-source-list {
  display: grid;
  gap: 10px;
}

.skills-source-section-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.skills-library-lifecycle-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.skills-library-lifecycle-toolbar button {
  min-width: 126px;
}

.skills-source-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.skills-source-row strong {
  overflow-wrap: anywhere;
}

.skills-source-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.skills-source-automation {
  display: grid;
  grid-template-columns: minmax(118px, 0.8fr) minmax(146px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 7px;
}

.skills-source-automation label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.skills-source-automation label > span {
  font-size: 0.74rem;
  font-weight: 700;
}

.skills-source-automation select,
.skills-source-automation button {
  min-height: 36px;
}

.skills-source-automation-status {
  grid-column: 1 / -1;
}

.skills-source-automation-status.success {
  color: var(--accent);
}

.skills-source-automation-status.error,
.skills-audit-section .skills-source-status-error {
  color: var(--danger);
}

.skills-audit-section,
.skills-audit-list {
  display: grid;
  gap: 8px;
}

.skills-audit-toolbar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skills-audit-item {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.skills-audit-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.skills-audit-item span,
.skills-audit-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.skills-source-actions {
  display: flex;
  min-width: 92px;
  min-height: 36px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.skills-source-actions button {
  min-width: 92px;
}

.skills-source-actions .skills-library-action {
  min-width: 148px;
}

.skills-library-row.archived {
  border-style: dashed;
}

.skills-source-row .skills-source-status-error {
  color: var(--danger);
  overflow-wrap: anywhere;
}

.settings-header h1,
.settings-header p {
  margin: 0;
}

.settings-section {
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-header > *,
.settings-section > * {
  min-width: 0;
  max-width: 100%;
}

.settings-section-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.settings-section-copy,
.settings-warning {
  color: var(--muted);
  line-height: 1.45;
}

.settings-checkbox.compact {
  min-height: 42px;
  border-radius: 8px;
}

#settings-provider-capability-status:empty {
  display: none;
}

.host-settings-section,
.session-defaults-section,
.api-settings-section {
  display: grid;
}

.settings-host-management {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.settings-host-management .compact-list {
  max-height: min(36vh, 360px);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.settings-control-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.settings-profile-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  width: 100%;
}

.settings-profile-toolbar label,
.settings-field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-profile-toolbar select,
.settings-field-grid label input,
.settings-field-grid label select {
  width: 100%;
}

.settings-checkbox {
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  align-self: end;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.settings-checkbox input {
  width: auto;
}

.settings-warning {
  padding: 12px 14px;
  border: 1px solid rgba(255, 215, 128, 0.2);
  border-radius: 16px;
  background: rgba(255, 215, 128, 0.06);
}

.settings-host-api-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.settings-host-api-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.settings-host-api-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-api-ping-button {
  min-height: 34px;
  padding: 0 12px;
}

.settings-api-ping-result {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.settings-api-ping-result.success {
  color: var(--accent);
}

.settings-api-ping-result.failure {
  color: var(--danger);
}

.settings-empty {
  color: var(--muted);
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.settings-actions {
  align-items: center;
}

.settings-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-update-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
}

.settings-update-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.settings-update-summary {
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.settings-update-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 999px;
  color: #92400e;
  background: rgba(251, 191, 36, 0.18);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.settings-update-details {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.settings-update-details > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.connector-manager-modal {
  width: min(1180px, 100%);
  max-height: min(90vh, 1040px);
  overflow: auto;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.98);
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.connector-manager-header,
.connector-library-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.connector-manager-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.connector-manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  min-height: 0;
}

.connector-library,
.connector-editor-panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.connector-library {
  display: grid;
  gap: 12px;
}

.connector-library-title,
.connector-editor-title {
  font-size: 16px;
  font-weight: 800;
}

.connector-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.connector-card {
  width: 100%;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 12px 14px;
  cursor: pointer;
}

.connector-card.active {
  outline: 1px solid rgba(125, 231, 203, 0.34);
}

.connector-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.connector-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 16, 31, 0.36);
  font-size: 11px;
  color: var(--text);
}

.connector-meta,
.connector-plan {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.connector-meta {
  margin-top: 8px;
}

.connector-plan {
  margin-top: 6px;
}

.connector-editor-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.connector-runbook {
  border: 1px solid rgba(125, 231, 203, 0.2);
  border-radius: 18px;
  padding: 14px;
  background: rgba(125, 231, 203, 0.06);
  display: grid;
  gap: 10px;
}

.connector-runbook-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.connector-runbook-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.connector-runbook-actions button {
  flex: 0 0 auto;
}

.connector-command-preview {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 16, 31, 0.52);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 12px;
}

.connector-action-result {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  display: grid;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.connector-action-result.success {
  border-color: rgba(125, 231, 203, 0.36);
  background: rgba(125, 231, 203, 0.08);
  color: var(--text);
}

.connector-action-result.failure {
  border-color: rgba(255, 114, 118, 0.34);
  background: rgba(255, 114, 118, 0.08);
  color: #ffd0d1;
}

.connector-action-result pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.connector-runbook-list {
  display: grid;
  gap: 8px;
}

.connector-runbook-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.connector-runbook-list.warning .connector-runbook-item {
  border-color: rgba(255, 216, 133, 0.24);
  background: rgba(255, 216, 133, 0.08);
  color: #ffe0a0;
}

.connector-form {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.connector-group {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.connector-group-title {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.connector-tip {
  padding: 9px 11px;
  border: 1px solid rgba(255, 216, 133, 0.2);
  border-radius: 13px;
  color: #ffe0a0;
  background: rgba(255, 216, 133, 0.075);
  font-size: 12px;
  line-height: 1.5;
}

.connector-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.connector-field-grid input,
.connector-field-grid select,
.connector-field-grid textarea,
.connector-form textarea {
  width: 100%;
}

.connector-field-grid textarea,
.connector-form textarea {
  grid-column: span 2;
}

.connector-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.connector-form-actions button {
  flex: 1;
}

.status-window-overlay {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 18, 0.6);
  backdrop-filter: blur(16px);
}

.status-window-modal {
  width: min(860px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.98);
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.status-window-header,
.status-window-actions,
.status-request-top,
.status-alert-top,
.status-diagnostic-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.status-window-actions {
  flex-wrap: wrap;
}

.status-window-actions button {
  flex: 1;
}

.status-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-window-title {
  font-size: 18px;
  font-weight: 800;
}

.status-window-subtitle,
.status-summary-label,
.status-summary-note,
.status-section-label,
.status-request-meta,
.status-request-note,
.status-alert-source,
.status-diagnostic-method,
.status-diagnostic-detail,
.status-diagnostic-data {
  color: var(--muted);
}

.status-window-subtitle,
.status-summary-note,
.status-request-meta,
.status-request-note,
.status-alert-source,
.status-diagnostic-detail,
.status-diagnostic-data {
  font-size: 12px;
  line-height: 1.45;
}

.status-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-summary-card,
.status-section,
.status-request-card,
.status-alert-card,
.status-diagnostic-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.status-summary-card,
.status-section {
  padding: 14px;
}

.status-summary-label,
.status-section-label,
.status-diagnostic-method {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-summary-label,
.status-section-label {
  font-size: 11px;
}

.status-summary-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-summary-note {
  margin-top: 8px;
}

.status-copy {
  margin-top: 10px;
  white-space: pre-wrap;
  line-height: 1.5;
  word-break: break-word;
}

.status-inline-form {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.status-inline-form button {
  width: 100%;
}

.status-request-list,
.status-alert-list,
.status-diagnostic-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.status-request-card,
.status-alert-card,
.status-diagnostic-card {
  padding: 12px 14px;
}

.status-request-card.pending {
  border-color: rgba(134, 167, 255, 0.28);
  background: rgba(134, 167, 255, 0.08);
}

.status-request-top,
.status-alert-top,
.status-diagnostic-top {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-request-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
}

.status-request-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 16, 31, 0.36);
}

.status-request-copy,
.status-alert-message,
.status-diagnostic-message {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.45;
  word-break: break-word;
}

.status-request-detail,
.status-diagnostic-data {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
}

.status-request-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-request-actions button {
  flex: 1;
  min-width: 120px;
}

.status-request-note {
  margin-top: 8px;
}

.status-alert-card.error,
.status-diagnostic-card.error {
  border-color: rgba(255, 131, 148, 0.3);
  background: rgba(255, 131, 148, 0.08);
}

.status-alert-card.warning,
.status-diagnostic-card.warning {
  border-color: rgba(255, 216, 133, 0.22);
  background: rgba(255, 216, 133, 0.08);
}

.approval-popup {
  position: fixed;
  right: 22px;
  top: 22px;
  bottom: auto;
  z-index: 9995;
  width: min(460px, calc(100vw - 32px));
  max-height: min(68dvh, 560px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 216, 133, 0.42);
  border-radius: 8px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 216, 133, 0.18), transparent 34%),
    rgba(12, 18, 33, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.approval-popup.hidden {
  display: none;
}

.approval-popup-eyebrow {
  color: var(--warning);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.approval-popup-title {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 900;
}

.approval-popup-message,
.approval-popup-detail {
  margin-top: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-popup-message {
  color: var(--text);
}

.approval-popup-detail {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.approval-popup-disclosure > summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.approval-popup-code {
  max-height: 240px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.approval-popup-actions {
  position: sticky;
  bottom: -16px;
  margin-top: 14px;
  padding: 12px 0 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(12, 18, 33, 0.98);
}

.approval-popup-actions button {
  flex: 1;
  min-width: 110px;
}

.approval-popup-actions .user-input-request-form {
  flex: 1 1 100%;
}

.user-input-request-form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.user-input-request-form.compact {
  gap: 10px;
}

.user-input-request-error {
  padding: 9px 11px;
  border: 1px solid rgba(255, 92, 122, 0.28);
  border-radius: 12px;
  background: rgba(255, 92, 122, 0.1);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.user-input-question {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.user-input-question legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.user-input-question-prompt {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.user-input-option-list {
  display: grid;
  gap: 8px;
}

.user-input-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.user-input-option:has(input:checked) {
  border-color: rgba(65, 105, 225, 0.5);
  background: rgba(65, 105, 225, 0.12);
}

.user-input-option input[type="radio"] {
  margin-top: 2px;
}

.user-input-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-input-option-copy strong {
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}

.user-input-option-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.user-input-other-input {
  width: 100%;
  min-width: 0;
  margin-top: 3px;
}

.user-input-request-actions {
  display: flex;
  gap: 8px;
}

.user-input-request-actions button {
  width: 100%;
}

.directory-picker-modal {
  width: min(760px, 100%);
  max-height: min(84vh, 920px);
  overflow: auto;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.96);
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

.picker-header,
.picker-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.picker-actions button {
  flex: 1;
}

.picker-title {
  font-size: 15px;
  font-weight: 800;
}

.picker-status,
.picker-current-path,
.picker-section-label {
  color: var(--muted);
  font-size: 12px;
}

.picker-current-path {
  word-break: break-all;
  line-height: 1.4;
}

.picker-chip-row,
.picker-entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.picker-entry-list {
  flex-direction: column;
}

.picker-chip,
.picker-entry {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.picker-chip {
  padding: 8px 12px;
}

.picker-chip.active {
  border-color: rgba(125, 231, 203, 0.42);
  background: rgba(125, 231, 203, 0.12);
}

.picker-entry {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
}

.picker-entry:hover,
.picker-chip:hover {
  border-color: rgba(134, 167, 255, 0.34);
}

.picker-entry .name {
  font-weight: 700;
}

.picker-entry .path {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--panel-2);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.markdown-plain-fallback {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: #08101f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.secondary-button[aria-pressed="true"] {
  color: #06101c;
  background: linear-gradient(135deg, rgba(130, 247, 208, 0.98), rgba(143, 177, 255, 0.98));
  border-color: rgba(130, 247, 208, 0.42);
}

.danger-button {
  color: #ffdfe4;
  background: rgba(255, 131, 148, 0.12);
  border: 1px solid rgba(255, 131, 148, 0.22);
}

.list {
  display: grid;
  gap: 10px;
}

.compact-list {
  margin-top: 6px;
}

.compact-list,
.conversation-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding-right: 4px;
}

.conversation-list {
  min-height: 260px;
}

.host-card,
.conversation-card,
.row,
.detail-card,
.dismissed-list {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.host-card,
.conversation-card {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
}

.host-card.active,
.conversation-card.active {
  outline: 1px solid rgba(125, 231, 203, 0.32);
}

.host-card-top,
.conversation-card-top,
.host-actions {
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.host-card-top > div {
  min-width: 0;
  max-width: 100%;
}

.host-card .title,
.conversation-card .title {
  font-weight: 700;
}

.host-card .title,
.host-card .sub {
  overflow-wrap: anywhere;
}

.conversation-card-top {
  align-items: center;
}

.host-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.host-actions .action-button {
  flex: 1 1 120px;
  min-width: 0;
}

.host-codex-status {
  margin-top: 4px;
  max-width: min(100%, 720px);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.host-codex-status.completed,
.host-codex-status.updated {
  color: var(--accent);
}

.host-codex-status.failed,
.host-codex-status.update_failed,
.host-codex-status.completed_with_resume_failures {
  color: var(--danger);
}

.host-codex-status.interrupted,
.host-codex-status.installing,
.host-codex-status.verifying,
.host-codex-status.resuming,
.host-codex-status.stopping_sessions {
  color: var(--warning);
}

.host-recovery-status {
  margin-top: 5px;
  max-width: min(100%, 720px);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.host-recovery-status.working,
.host-recovery-status.recovering,
.host-recovery-status.stopping,
.host-recovery-status.ownership_pending {
  color: var(--warning);
}

.host-recovery-status.completed {
  color: var(--accent);
}

.host-recovery-status.failed {
  color: var(--danger);
}

.action-button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.conversation-card .path {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conversation-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.conversation-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.conversation-time-grid span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(150, 177, 218, 0.14);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time-grid strong {
  display: block;
  color: rgba(235, 241, 255, 0.86);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-profile-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(150, 177, 218, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--text);
  background: rgba(148, 184, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-profile-chip.fallback {
  color: var(--muted);
  background: rgba(148, 184, 255, 0.06);
}

.conversation-card .preview {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conversation-stats {
  text-align: right;
  min-width: 82px;
}

.conversation-stats .count {
  font-size: 18px;
  font-weight: 800;
}

.conversation-stats .label {
  color: var(--muted);
  font-size: 12px;
}

.conversation-summary {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.conversation-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.conversation-card-actions select,
.collection-remove-button {
  min-height: 36px;
  padding-block: 8px;
}

.variant-strip,
.variant-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.variant-row {
  margin-top: 8px;
}

.variant-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.variant-chip.active {
  background: linear-gradient(135deg, rgba(125, 231, 203, 0.18), rgba(134, 167, 255, 0.18));
  border-color: rgba(125, 231, 203, 0.4);
}

.variant-chip.live {
  color: #d7fff3;
}

.variant-chip.history {
  color: var(--muted);
}

.variant-chip:disabled {
  opacity: 0.6;
  cursor: default;
}

.variant-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.dismissed-hosts {
  margin-top: 12px;
}

.dismissed-list {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}

.main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  align-self: start;
}

.detail-panel,
.runtime-panel,
.transcript-panel {
  min-height: 0;
}

.compact-detail-panel {
  cursor: pointer;
}

.unified-session-panel {
  display: grid;
  gap: 0;
  padding: 10px 12px;
}

.unified-session-panel > .compact-detail-main {
  display: none !important;
}

.unified-session-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
}

.unified-session-copy,
.unified-runtime-copy {
  min-width: 0;
}

.runtime-detail-section {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.compact-detail-title {
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
}

.compact-detail-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.compact-detail-status {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.session-details-modal {
  width: min(1040px, 100%);
}

.session-status-panel-slot {
  display: grid;
  gap: 14px;
}

.session-status-panel-slot .status-window-modal {
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.session-status-panel-slot .status-window-header {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-thinking-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.export-thinking-toggle input {
  width: auto;
  margin: 0;
}

.export-thinking-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.58;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  padding: 14px;
}

.runtime-panel {
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.runtime-panel-header,
.runtime-panel-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.runtime-panel-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.runtime-panel-actions button {
  min-width: 128px;
}

.runtime-details-overlay {
  position: fixed;
  inset: 0;
  z-index: 64;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 8, 16, 0.66);
  backdrop-filter: blur(16px);
}

.runtime-details-modal {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(125, 231, 203, 0.1), transparent 28%),
    rgba(10, 18, 34, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.runtime-details-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.runtime-panel-title {
  font-size: 18px;
  font-weight: 800;
}

.runtime-panel-subtitle,
.runtime-command-note,
.thinking-note,
.thinking-subhead {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.runtime-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.runtime-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.runtime-chip strong {
  margin-right: 6px;
}

.runtime-chip.info {
  border-color: rgba(134, 167, 255, 0.22);
  background: rgba(134, 167, 255, 0.09);
}

.runtime-chip.active {
  border-color: rgba(125, 231, 203, 0.3);
  background: rgba(125, 231, 203, 0.1);
}

.runtime-chip.warning {
  border-color: rgba(255, 216, 133, 0.24);
  background: rgba(255, 216, 133, 0.08);
}

.runtime-chip.error {
  border-color: rgba(255, 131, 148, 0.28);
  background: rgba(255, 131, 148, 0.1);
}

.runtime-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.runtime-command-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.runtime-command-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thinking-file-change-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.thinking-file-change-card {
  border: 1px solid rgba(134, 167, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 16, 31, 0.42);
}

.thinking-file-change-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
}

.thinking-file-path {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.diff-stat {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.diff-stat.added {
  color: #8df3b3;
  background: rgba(70, 220, 122, 0.13);
}

.diff-stat.removed {
  color: #ff9aa8;
  background: rgba(255, 111, 129, 0.13);
}

.diff-stat.status {
  color: rgba(134, 167, 255, 0.92);
  background: rgba(134, 167, 255, 0.14);
}

.thinking-diff-block {
  max-height: 420px;
  overflow: auto;
  padding: 10px 0;
  border-top: 1px solid rgba(134, 167, 255, 0.14);
  background: rgba(1, 7, 17, 0.58);
}

.diff-line {
  padding: 1px 12px;
  white-space: pre;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(226, 235, 255, 0.76);
}

.thinking-diff-full {
  margin: 0;
  padding: 0 12px;
  color: rgba(226, 235, 255, 0.76);
  background: transparent;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.diff-line.added {
  color: #9af6ba;
  background: rgba(70, 220, 122, 0.09);
}

.diff-line.removed {
  color: #ff9aa8;
  background: rgba(255, 111, 129, 0.09);
}

.diff-line.hunk {
  color: #a8c4ff;
  background: rgba(134, 167, 255, 0.08);
}

.composer-turn-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 216, 133, 0.24);
  border-radius: 16px;
  background: rgba(255, 216, 133, 0.08);
  color: var(--text);
}

.composer-turn-notice strong {
  display: block;
  margin-bottom: 4px;
}

.composer-turn-notice div div {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.composer-turn-notice button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.steer-queue-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.steer-queue-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(134, 167, 255, 0.22);
  border-radius: 14px;
  background: rgba(8, 16, 31, 0.34);
}

.steer-queue-item-header,
.steer-queue-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.steer-queue-item-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.steer-queue-item-meta,
.steer-queue-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.steer-queue-error {
  color: var(--danger);
}

.steer-queue-text {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

.steer-queue-actions {
  justify-content: flex-end;
}

.steer-queue-actions button {
  min-width: 128px;
}

.warning-card {
  border-color: rgba(255, 131, 148, 0.22);
  background: rgba(255, 131, 148, 0.08);
}

.alerts-fab {
  position: fixed;
  left: 22px;
  right: auto;
  bottom: 22px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.alerts-fab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(8, 16, 31, 0.34);
  color: var(--text);
}

.alerts-window {
  position: fixed;
  left: 22px;
  right: auto;
  bottom: 22px;
  z-index: 44;
  width: min(420px, calc(100vw - 44px));
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 131, 148, 0.24);
  background: rgba(10, 18, 34, 0.96);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 12px;
}

.choice-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 145, 64, 0.18), transparent 30%),
    rgba(4, 9, 18, 0.64);
  backdrop-filter: blur(18px);
}

.choice-dialog-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(134, 167, 255, 0.24);
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

#session-action-dialog .choice-dialog-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#session-action-dialog .choice-session-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#session-action-dialog .choice-dialog-actions {
  flex: 0 0 auto;
}

.export-dialog-modal {
  width: min(920px, 100%);
}

.api-profile-backup-actions {
  justify-content: flex-start;
}

.api-profile-backup-modal {
  width: min(720px, 100%);
}

.api-profile-backup-file-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.api-profile-backup-preview,
.api-profile-backup-conflicts {
  display: grid;
  gap: 8px;
  padding-block: 4px;
}

.api-profile-backup-preview-summary {
  color: var(--text);
  font-weight: 800;
}

.api-profile-backup-preview-list {
  display: grid;
  gap: 6px;
}

.api-profile-backup-preview-row,
.api-profile-backup-conflict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  padding-block: 8px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.api-profile-backup-preview-row strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.api-profile-backup-conflict-row span {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 680px) {
  .api-profile-backup-preview-row,
  .api-profile-backup-conflict-row {
    grid-template-columns: 1fr;
  }

  .api-profile-backup-preview-row strong {
    text-align: left;
  }
}

.session-id-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.session-id-copy-button:hover {
  color: var(--text);
  border-color: rgba(134, 167, 255, 0.38);
}

.history-import-dialog-modal {
  width: min(860px, 100%);
}

.history-import-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(140px, auto) auto;
  gap: 10px;
  align-items: start;
}

.history-import-collection-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-import-collection-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-import-collection-choice input {
  width: auto;
  margin: 0;
}

.history-import-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-session-copy .history-import-meta span {
  width: auto;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  white-space: normal;
}

.choice-dialog-header,
.choice-dialog-actions,
.choice-section-heading,
.choice-select-all {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.choice-dialog-header h2,
.choice-dialog-header p {
  margin: 0;
}

.choice-dialog-header p,
.choice-summary {
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.choice-dialog-header > div,
.choice-session-list {
  min-width: 0;
  max-width: 100%;
}

.choice-select-all {
  justify-content: flex-start;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 145, 64, 0.22);
  border-radius: 16px;
  background: rgba(255, 145, 64, 0.08);
  color: #ffbd7a;
  font-weight: 800;
}

.choice-session-list,
.choice-file-list {
  display: grid;
  gap: 10px;
}

.choice-host-group {
  display: grid;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
}

.choice-host-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.choice-host-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
}

.choice-host-heading label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.choice-host-heading span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-host-heading small {
  flex: 0 0 auto;
}

#session-action-dialog .choice-host-heading input,
#session-action-dialog .choice-select-all input,
#session-action-dialog .choice-session-row > input {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
}

.choice-session-result {
  font-size: 12px;
  white-space: normal !important;
}

.choice-session-row[data-result-status="success"] {
  border-color: rgba(45, 185, 125, 0.42);
}

.choice-session-row[data-result-status="failure"],
.choice-session-row[data-result-status="conflict"] {
  border-color: rgba(232, 91, 91, 0.52);
}

.choice-session-row[data-result-status="ready"] {
  border-color: rgba(50, 145, 220, 0.42);
}

.choice-session-row,
.choice-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.choice-session-copy,
.choice-file-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.choice-session-copy strong,
.choice-file-copy strong {
  color: var(--text);
}

.choice-session-copy span,
.choice-file-copy span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#session-action-dialog .choice-session-copy strong,
#session-action-dialog .choice-session-copy span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-import-session-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.history-import-main-toggle {
  display: grid;
  place-items: start center;
  padding-top: 2px;
}

.history-import-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.history-import-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-import-options input,
.history-import-main-toggle input {
  width: auto;
  margin: 0;
}

.choice-dialog-actions {
  justify-content: flex-end;
  align-items: center;
}

.choice-section-heading {
  align-items: center;
  margin-bottom: 8px;
}

.choice-section-heading .choice-section-title {
  margin-bottom: 0;
}

.choice-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.choice-section-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.export-option-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(2, minmax(130px, 0.6fr));
  gap: 12px;
}

.export-option-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.export-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.export-timeline-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.export-time-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.export-timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.export-day-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 118px;
  overflow: auto;
}

.export-day-chip {
  display: inline-grid;
  gap: 2px;
  min-width: 92px;
  padding: 7px 9px;
  border: 1px solid rgba(134, 167, 255, 0.26);
  border-radius: 8px;
  background: rgba(134, 167, 255, 0.12);
  color: var(--text);
  text-align: left;
}

.export-day-chip strong {
  color: #9fb4ff;
  font-size: 11px;
}

.export-day-chip.selected {
  border-color: rgba(255, 145, 64, 0.46);
  background: rgba(255, 145, 64, 0.14);
}

.export-day-chip.selected strong {
  color: #ffbd7a;
}

.export-day-chip.empty {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

.export-day-chip.empty strong {
  color: var(--muted);
}

.export-day-note {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.export-checkbox-grid label,
.choice-chip-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.export-extension-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.choice-chip label {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.choice-chip-remove {
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.choice-section-title {
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 900;
}

.choice-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alerts-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.alerts-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.alerts-actions button {
  min-height: 36px;
  padding: 8px 12px;
}

.alerts-title {
  font-size: 15px;
  font-weight: 800;
}

.alerts-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.alert-item.error {
  border-color: rgba(255, 131, 148, 0.28);
  background: rgba(255, 131, 148, 0.08);
}

.alert-item.warning {
  border-color: rgba(255, 216, 133, 0.2);
  background: rgba(255, 216, 133, 0.08);
}

.alert-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-severity {
  color: var(--danger);
  font-weight: 800;
}

.alert-item.warning .alert-severity {
  color: #ffd87d;
}

.alert-message {
  margin-top: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert-source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.detail-card-wide {
  grid-column: span 2;
}

.detail-path,
.detail-value {
  font-weight: 700;
}

.detail-path,
.detail-copy {
  word-break: break-word;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scroll-padding-bottom: 88px;
  padding-right: 4px;
}

.transcript-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: visible;
  min-height: 68vh;
}

.message {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(82%, 720px);
  gap: 6px;
}

.message.agent {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message.search-focused-message .bubble {
  border-color: rgba(255, 213, 105, 0.74);
  box-shadow: 0 0 0 3px rgba(255, 213, 105, 0.16), var(--shadow);
}

.message.search-match-message:not(.search-focused-message) .bubble {
  border-color: rgba(255, 213, 105, 0.28);
}

.message.system {
  align-self: center;
  max-width: 100%;
}

.message-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.message:hover .message-toolbar,
.message:focus-within .message-toolbar {
  opacity: 1;
  transform: translateY(0);
}

.message-meta {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-copy-button,
.markdown-copy-code {
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 11px;
}

.bubble {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.markdown-body {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 10px;
}

.markdown-body p {
  white-space: pre-wrap;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
  margin: 4px 0 10px;
  line-height: 1.25;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body blockquote {
  padding-left: 12px;
  border-left: 3px solid rgba(134, 167, 255, 0.35);
  color: rgba(226, 235, 255, 0.76);
}

.markdown-table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(134, 167, 255, 0.18);
  border-radius: 14px;
}

.markdown-table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.markdown-body table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
}

.markdown-body th,
.markdown-body td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(134, 167, 255, 0.14);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.markdown-body th {
  color: var(--text);
  background: rgba(134, 167, 255, 0.09);
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-math-inline,
.markdown-math-block {
  color: #111827;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
}

.markdown-math-inline mjx-container,
.markdown-math-block mjx-container,
.markdown-math-inline .MathJax,
.markdown-math-block .MathJax {
  color: #111827 !important;
}

.markdown-math-block {
  display: block;
  margin: 12px 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid rgba(125, 231, 203, 0.18);
  border-radius: 14px;
  background: rgba(125, 231, 203, 0.055);
  text-align: center;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(8, 16, 31, 0.42);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.markdown-code-card {
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid rgba(134, 167, 255, 0.22);
  border-radius: 14px;
  background: rgba(1, 7, 17, 0.52);
}

.markdown-code-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(134, 167, 255, 0.14);
  color: var(--muted);
  font-size: 12px;
}

.markdown-code-card pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre;
}

.markdown-code-card code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.message.agent .bubble {
  background: rgba(125, 231, 203, 0.08);
  border-color: rgba(125, 231, 203, 0.2);
}

.message.user .bubble {
  background: rgba(134, 167, 255, 0.14);
  border-color: rgba(134, 167, 255, 0.26);
}

.transcript-history-gate {
  display: flex;
  justify-content: center;
  padding: 6px 0 12px;
}

.transcript-load-older-button {
  min-height: 34px;
  padding-inline: 14px;
  font-size: 13px;
}

.message-file-list {
  display: grid;
  gap: 8px;
}

.message-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(134, 167, 255, 0.2);
  border-radius: 16px;
  padding: 10px;
  background: rgba(134, 167, 255, 0.08);
}

.message-file-card.image {
  grid-template-columns: minmax(82px, 132px) minmax(0, 1fr);
  align-items: stretch;
}

button.message-file-preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
}

.message-file-preview {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(8, 16, 31, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-file-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.message-file-name {
  font-weight: 800;
  word-break: break-word;
}

.message-file-path,
.message-file-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.message-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-file-actions a {
  text-decoration: none;
  text-align: center;
}

.message.system .bubble {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: center;
}

.message.thinking {
  align-self: flex-start;
  max-width: min(74%, 640px);
  overflow-anchor: none;
}

.message.thinking .message-meta {
  color: rgba(125, 231, 203, 0.82);
}

.thinking-card {
  position: relative;
  border: 1px solid rgba(125, 231, 203, 0.22);
  border-radius: 18px;
  background: rgba(125, 231, 203, 0.08);
  overflow: hidden;
  overflow-anchor: none;
}

.thinking-card[open] {
  background: rgba(125, 231, 203, 0.1);
}

.thinking-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.thinking-card[open] .thinking-summary {
  padding-right: 48px;
}

.thinking-summary::-webkit-details-marker {
  display: none;
}

.thinking-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.thinking-title {
  font-size: 13px;
  font-weight: 800;
}

.thinking-phase {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thinking-preview {
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.thinking-content {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
  overflow-anchor: none;
}

.thinking-card[open] .thinking-content {
  max-height: min(56vh, 680px);
  overflow: auto;
  padding-right: 86px;
  scrollbar-width: thin;
}

.thinking-scroll-actions {
  display: flex;
  gap: 6px;
}

.thinking-scroll-button {
  min-height: 28px;
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.thinking-scroll-actions.rail {
  display: none;
  position: absolute;
  top: 46px;
  right: 38px;
  bottom: 8px;
  width: 42px;
  padding: 6px 4px;
  border-left: 1px solid rgba(125, 231, 203, 0.12);
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 16, 31, 0.08), rgba(8, 16, 31, 0.18));
  pointer-events: none;
  z-index: 2;
}

.thinking-card[open] .thinking-scroll-actions.rail {
  display: flex;
}

.thinking-scroll-actions.rail .thinking-scroll-button {
  min-width: 0;
  width: 34px;
  padding: 5px 4px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  pointer-events: auto;
}

.thinking-scroll-button.has-new {
  color: #fff;
  border-color: rgba(239, 68, 68, 0.65);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(249, 115, 22, 0.92));
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.18);
}

.thinking-bottom-anchor {
  width: 1px;
  height: 1px;
}

.thinking-collapse-rail {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 34px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(125, 231, 203, 0.16);
  border-radius: 0;
  color: rgba(125, 231, 203, 0.72);
  background: rgba(125, 231, 203, 0.045);
  box-shadow: none;
  cursor: pointer;
  z-index: 2;
}

.thinking-card[open] .thinking-collapse-rail {
  display: block;
}

.thinking-collapse-rail::before {
  content: "<";
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 18px;
  font-weight: 900;
  opacity: 0.65;
}

.thinking-collapse-rail:hover:not(:disabled) {
  transform: none;
  border-color: rgba(125, 231, 203, 0.36);
  background: rgba(125, 231, 203, 0.12);
  box-shadow: none;
}

.thinking-block {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(8, 16, 31, 0.24);
}

.thinking-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thinking-text {
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.thinking-history-list {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.thinking-history-item {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.thinking-operation {
  padding: 0;
  overflow: hidden;
}

.thinking-operation-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.thinking-operation-summary::-webkit-details-marker {
  display: none;
}

.thinking-operation-summary::before {
  content: ">";
  grid-column: 1;
  grid-row: 1;
  width: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transform-origin: center;
  transition: transform 120ms ease;
}

.thinking-operation[open] > .thinking-operation-summary::before {
  transform: rotate(90deg);
}

.thinking-operation-identity {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-left: 18px;
}

.thinking-operation-kind {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.thinking-operation-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thinking-operation-status {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.thinking-operation-status.running {
  color: #f8c15c;
  border-color: rgba(248, 193, 92, 0.34);
  background: rgba(248, 193, 92, 0.08);
}

.thinking-operation-status.completed {
  color: #67d8b4;
  border-color: rgba(103, 216, 180, 0.32);
  background: rgba(103, 216, 180, 0.08);
}

.thinking-operation-status.failed {
  color: #ff8d9b;
  border-color: rgba(255, 141, 155, 0.34);
  background: rgba(255, 141, 155, 0.08);
}

.thinking-operation-body {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.thinking-operation-meta {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.thinking-operation-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.thinking-operation-field-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.thinking-operation-value,
.thinking-operation-code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.thinking-operation-code {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: #d9e4f2;
  background: rgba(2, 7, 16, 0.42);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.thinking-expandable-content:not(.is-expanded) {
  max-height: 9.2em;
  overflow: hidden;
}

.thinking-operation-code.thinking-expandable-content:not(.is-expanded) {
  max-height: 168px;
  overflow: hidden;
}

.thinking-expandable-content.is-expanded,
.thinking-operation-code.thinking-expandable-content.is-expanded {
  max-height: none;
  overflow: auto;
}

.thinking-expand-toggle {
  justify-self: start;
  min-height: 28px;
  max-width: 100%;
  margin-top: 2px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
}

.thinking-narrative > .thinking-expand-toggle {
  margin-top: 8px;
}

.thinking-diff-expand-toggle {
  margin: 8px 10px 10px;
}

.thinking-source-truncation-note {
  color: var(--warning);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.thinking-diff-truncation-note {
  padding: 0 10px 10px;
}

.thinking-operation-field.failed .thinking-operation-code {
  color: #ffc0c8;
  border-color: rgba(255, 141, 155, 0.2);
}

.thinking-history-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thinking-history-kind {
  color: var(--accent);
  font-weight: 700;
}

.thinking-history-text {
  min-width: 0;
  max-width: 100%;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .thinking-operation-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .thinking-operation-status {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-left: 18px;
  }
}

.row {
  padding: 12px 14px;
}

.row .kind {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.row.stderr .kind {
  color: var(--danger);
}

.row .text {
  white-space: pre-wrap;
  margin-top: 6px;
  line-height: 1.45;
}

.composer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 14px;
  position: relative;
  z-index: 5;
  overflow: visible;
  backdrop-filter: blur(20px);
  box-shadow: 0 -12px 28px rgba(2, 6, 18, 0.35);
}

.composer.disabled {
  opacity: 0.65;
}

.composer.drag-active {
  border-color: rgba(125, 231, 203, 0.72);
  background:
    linear-gradient(135deg, rgba(125, 231, 203, 0.12), rgba(134, 167, 255, 0.1)),
    var(--panel);
  box-shadow:
    0 -12px 28px rgba(2, 6, 18, 0.35),
    0 0 0 3px rgba(125, 231, 203, 0.12) inset;
}

.composer-control-grid,
.composer-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: center;
}

.composer-control-grid > *,
.composer-attachment-grid > * {
  min-width: 0;
}

.session-api-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  width: 100%;
}

.session-api-context > div {
  min-width: 0;
}

.session-api-context span,
.session-api-context strong {
  display: block;
  overflow-wrap: anywhere;
}

.session-api-context span {
  color: var(--muted);
  font-size: 12px;
}

.session-api-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.session-rebind-settings-summary {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.session-api-action-field {
  flex: 1 1 220px;
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.session-api-action-field select {
  width: 100%;
}

.session-control-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.session-control-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.settings-control-grid #codex-model-select {
  grid-column: auto;
  min-width: 0;
}

.composer-attachment-grid {
  grid-template-columns: auto auto auto auto;
  justify-content: start;
  position: relative;
  z-index: 1;
  align-items: stretch;
}

#codex-local-image-path {
  min-height: 42px;
  overflow: hidden;
  border-color: var(--border);
}

.attachment-icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.attachment-import-button {
  min-width: 74px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 850;
}

.file-picker-input {
  display: none;
}

input[type="hidden"] {
  display: none;
}

#codex-model-select {
  min-width: 0;
  width: 100%;
}

.composer-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  position: relative;
  z-index: 3;
}

.composer-input-wrap {
  position: relative;
  display: grid;
  min-width: 0;
  z-index: 4;
}

.composer-session-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, auto);
  gap: 7px 12px;
  align-items: end;
  min-width: 0;
  padding: 8px 4px 0;
}

.composer-session-selection-status {
  align-self: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.composer-session-selection-status.success {
  color: var(--accent);
}

.composer-session-selection-status.warning {
  color: #f2c46d;
}

.composer-session-selection-status.error {
  color: var(--danger);
}

.composer-session-control-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.35fr) minmax(120px, 0.8fr);
  gap: 8px;
  align-items: end;
  justify-self: end;
  width: min(100%, 690px);
  min-width: 0;
}

.composer-session-control {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.composer-session-control > span {
  white-space: nowrap;
}

.composer-session-control select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
  text-overflow: ellipsis;
}

.composer-session-select-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  min-width: 0;
}

.composer-control-icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.composer-manual-effort-controls {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

.composer-manual-effort-controls input:not(.hidden) {
  flex: 1 1 180px;
  min-height: 36px;
}

.composer-manual-effort-controls .settings-checkbox.compact:not(.hidden) {
  min-height: 36px;
}

.composer-main-row textarea {
  min-height: 96px;
}

.slash-command-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 10030;
  display: grid;
  gap: 6px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(125, 231, 203, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(8, 16, 31, 0.96), rgba(14, 26, 48, 0.96)),
    var(--panel);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(22px);
}

.slash-command-menu.hidden {
  display: none;
}

.slash-command-item {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.slash-command-item.active,
.slash-command-item:hover {
  border-color: rgba(125, 231, 203, 0.26);
  background: rgba(125, 231, 203, 0.1);
}

.slash-command-icon {
  padding: 6px 8px;
  border: 1px solid rgba(134, 167, 255, 0.22);
  border-radius: 999px;
  color: #c9d7ff;
  background: rgba(134, 167, 255, 0.1);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.slash-command-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.slash-command-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.slash-command-title {
  font-weight: 800;
}

.slash-command-category {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slash-command-description,
.slash-command-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.slash-command-empty {
  padding: 14px;
  text-align: center;
}

.slash-command-note {
  border-top: 1px solid rgba(134, 167, 255, 0.12);
  text-align: left;
}

.composer-action-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 8px;
}

.composer-action-stack button {
  min-width: 92px;
}

.attachment-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 0;
  margin-top: -2px;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible;
}

.attachment-chip-list.hidden,
.attachment-chip-list:empty {
  display: none;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(125, 231, 203, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(125, 231, 203, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.attachment-chip.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
}

.attachment-chip.file {
  border-color: rgba(134, 167, 255, 0.22);
  background: rgba(134, 167, 255, 0.09);
}

.attachment-chip.image {
  padding: 4px 8px 4px 4px;
  border-radius: 16px;
}

button.attachment-chip-preview {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: min(360px, 70vw);
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: zoom-in;
  box-shadow: none;
}

.attachment-chip-thumbnail {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(8, 16, 31, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 16, 31, 0.42);
  font-size: 13px;
  line-height: 1;
}

.attachment-chip-remove:hover {
  color: #08101f;
  background: var(--accent);
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(18px);
}

.image-preview-overlay.hidden {
  display: none;
}

.image-preview-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  width: min(1100px, calc(100vw - 44px));
  max-height: min(88vh, 900px);
  padding: 16px;
  border: 1px solid rgba(125, 231, 203, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(125, 231, 203, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(8, 16, 31, 0.96), rgba(14, 26, 48, 0.96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.image-preview-header,
.image-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-preview-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  word-break: break-word;
}

.image-preview-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.image-preview-canvas {
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    rgba(2, 8, 18, 0.42);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-preview-canvas img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
}

.image-preview-actions {
  justify-content: flex-end;
}

.image-preview-actions a {
  text-decoration: none;
}

.empty-state {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  text-align: center;
}

@media (max-width: 980px) {
  .shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .shell.navigator-collapsed {
    grid-template-columns: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(92vw, 390px);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.48);
  }

  .shell.navigator-collapsed .sidebar {
    height: 100dvh;
    max-height: 100dvh;
    padding: 18px;
    border-right-color: transparent;
    transform: translateX(-105%);
  }

  .sidebar-close-button {
    display: inline-flex;
    min-width: 82px;
    justify-content: center;
  }

  .selected-host-section {
    overflow: visible;
  }

  select,
  input,
  button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .mobile-replaced-select {
    display: none;
  }

  .mobile-select-button {
    display: flex;
  }

  .mobile-select-menu:not(.hidden) {
    display: grid;
    gap: 3px;
  }

  .selected-host-section .conversation-list {
    max-height: none;
  }

  .main {
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 12px;
  }

  .detail-header,
  .detail-header > div,
  .panel,
  .composer,
  .transcript-panel,
  .log {
    min-width: 0;
    max-width: 100%;
  }

  .session-meta-path {
    max-width: calc(100vw - 32px);
  }

  .log {
    max-height: none;
    min-height: 50vh;
  }

  .transcript-panel {
    min-height: 52vh;
  }
}

@media (max-width: 720px) {
  .settings-update-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .session-api-context {
    grid-template-columns: 1fr;
  }

  .session-api-actions {
    grid-column: 1;
  }

  .detail-grid,
  .mini-stats,
  .status-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .status-control-grid {
    grid-template-columns: 1fr;
  }

  .runtime-inline-grid {
    grid-template-columns: 1fr;
  }

  .session-search-form {
    grid-template-columns: 1fr;
  }

  .session-search-form input,
  .session-search-form select,
  .session-search-form button {
    grid-column: span 1;
  }

  .session-sort-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .conversation-time-grid {
    grid-template-columns: 1fr;
  }

  .conversation-card-actions {
    grid-template-columns: 1fr;
  }

  .collection-create-row,
  .collection-manager-row,
  .collection-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .connector-manager-grid,
  .connector-field-grid,
  .settings-field-grid,
  .settings-profile-toolbar,
  .settings-host-api-row {
    grid-template-columns: 1fr;
  }

  .connector-field-grid textarea,
  .connector-form textarea {
    grid-column: span 1;
  }

  .detail-card-wide {
    grid-column: span 2;
  }

  .import-form,
  .composer {
    grid-template-columns: 1fr;
  }

  .composer-control-grid,
  .composer-main-row {
    grid-template-columns: 1fr;
  }

  .composer-session-toolbar {
    grid-template-columns: 1fr;
  }

  .composer-session-control-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
  }

  .composer-api-control {
    grid-column: 1 / -1;
  }

  .composer-manual-effort-controls {
    grid-column: 1;
  }

  .composer-attachment-grid {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  #codex-model-input,
  #codex-model-select {
    grid-column: span 1;
    min-width: 0;
  }

  .composer-action-stack {
    grid-template-columns: 1fr 1fr;
  }

  .message-toolbar {
    opacity: 1;
    transform: none;
  }

  .message-file-card.image {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    justify-content: stretch;
    width: 100%;
  }

  .detail-actions button {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .settings-header,
  .settings-section,
  .settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-inline-actions {
    justify-content: stretch;
  }

  .settings-inline-actions button {
    width: 100%;
  }

  .runtime-panel-header,
  .runtime-panel-actions,
  .runtime-details-header,
  .compact-detail-status {
    flex-direction: column;
    align-items: stretch;
  }

  .unified-session-main {
    grid-template-columns: 1fr;
  }

  .runtime-panel-actions button,
  .compact-detail-status button {
    width: 100%;
  }

  .runtime-details-overlay {
    padding: 12px;
    align-items: end;
  }

  .runtime-details-modal {
    width: 100%;
    max-height: 88vh;
    padding: 14px;
    border-radius: 20px 20px 0 0;
  }

  .runtime-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .runtime-chip {
    flex: 0 0 auto;
  }

  .composer-turn-notice {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .composer-turn-notice > button,
  .steer-queue-actions button {
    width: 100%;
  }

  .steer-queue-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .directory-picker-overlay {
    padding: 14px;
  }

  .directory-picker-modal {
    max-height: 88vh;
    padding: 14px;
    border-radius: 20px;
  }

  .alerts-window {
    left: 14px;
    right: auto;
    bottom: 14px;
    width: min(420px, calc(100vw - 28px));
  }

  .alerts-fab {
    left: 14px;
    right: auto;
    bottom: 14px;
  }

  .status-window-overlay {
    padding: 14px;
  }

  .status-window-modal {
    max-height: 90vh;
    padding: 14px;
    border-radius: 20px;
  }

  .image-preview-overlay {
    padding: 14px;
  }

  .image-preview-modal {
    width: calc(100vw - 28px);
    max-height: 90vh;
    padding: 14px;
    border-radius: 20px;
  }

  .image-preview-header,
  .image-preview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .approval-popup {
    right: 12px;
    left: 12px;
    top: 12px;
    bottom: auto;
    width: auto;
    max-height: min(78dvh, 560px);
    border-radius: 8px;
  }

  .approval-popup-actions {
    display: grid;
  }

  .approval-popup-actions button,
  .user-input-request-actions button {
    min-height: 44px;
  }

  .user-input-question {
    padding: 10px;
  }

  .user-input-option {
    padding: 10px 9px;
  }

  .connector-manager-overlay {
    padding: 14px;
  }

  .connector-manager-modal {
    max-height: 90vh;
    padding: 14px;
    border-radius: 20px;
  }

  .connector-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .connector-form-actions {
    flex-direction: column;
  }

  .connector-runbook-header {
    flex-direction: column;
  }

  .connector-runbook-actions,
  .connector-runbook-actions button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .detail-grid,
  .mini-stats,
  .status-summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-card-wide {
    grid-column: span 1;
  }

  .host-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .host-actions .action-button {
    flex: 0 0 auto;
    width: 100%;
  }

  .message {
    max-width: 100%;
  }

  .message.thinking {
    max-width: 100%;
  }

  .choice-dialog-overlay {
    align-items: end;
    padding: 8px;
  }

  .choice-dialog-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 14px;
    overflow-x: hidden;
    border-radius: 16px;
  }

  .settings-modal {
    max-width: calc(100vw - 16px);
  }

  .choice-dialog-header,
  .choice-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .choice-dialog-header > div,
  .choice-dialog-header h2,
  .choice-dialog-header p {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .choice-dialog-header > button,
  .choice-dialog-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* 2.2 UI facelift: chat-first control deck */
:root {
  --bg: #050915;
  --panel: rgba(12, 20, 37, 0.74);
  --panel-2: rgba(19, 32, 57, 0.82);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --text: #edf4ff;
  --muted: #8fa3c8;
  --accent: #82f7d0;
  --accent-2: #8fb1ff;
  --danger: #ff8193;
  --warning: #ffd77a;
  --border: rgba(169, 191, 235, 0.14);
  --border-strong: rgba(169, 191, 235, 0.24);
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 12px 34px rgba(0, 0, 0, 0.22);
}

html,
body {
  background:
    radial-gradient(circle at 12% -8%, rgba(130, 247, 208, 0.18), transparent 34%),
    radial-gradient(circle at 88% 4%, rgba(143, 177, 255, 0.18), transparent 36%),
    radial-gradient(circle at 54% 110%, rgba(81, 126, 255, 0.1), transparent 34%),
    linear-gradient(180deg, #050915 0%, #081226 54%, #050915 100%);
  font-family: "Aptos", "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(143, 177, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 177, 255, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 82%);
}

button,
input,
select,
textarea {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

input,
select,
textarea {
  background: rgba(13, 25, 48, 0.78);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(130, 247, 208, 0.46);
  box-shadow:
    0 0 0 3px rgba(130, 247, 208, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  outline: 0;
}

button {
  background:
    linear-gradient(135deg, rgba(130, 247, 208, 0.98), rgba(143, 177, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.secondary-button {
  color: rgba(237, 244, 255, 0.92);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(143, 177, 255, 0.32);
  background: rgba(143, 177, 255, 0.1);
}

.danger-button {
  color: #ffe4e8;
  background: rgba(255, 129, 147, 0.12);
  border: 1px solid rgba(255, 129, 147, 0.28);
}

.shell {
  grid-template-columns: 348px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  height: calc(100vh - 28px);
  margin: 14px 0 14px 14px;
  padding: 16px;
  border: 1px solid rgba(169, 191, 235, 0.16);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(11, 19, 36, 0.86), rgba(8, 14, 27, 0.78)),
    rgba(8, 14, 27, 0.82);
  box-shadow: var(--shadow-soft);
}

.shell.navigator-collapsed .sidebar {
  margin-left: 0;
  transform: translateX(-24px) scale(0.985);
}

.brand {
  padding: 6px 6px 2px;
}

.brand h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.eyebrow {
  color: rgba(143, 177, 255, 0.78);
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 800;
}

.nav-section,
.panel,
.composer {
  border-color: rgba(169, 191, 235, 0.14);
  background:
    linear-gradient(180deg, rgba(16, 28, 51, 0.76), rgba(10, 18, 34, 0.72)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.nav-section {
  border-radius: 26px;
}

.selected-host-section {
  gap: 12px;
}

.selected-host-heading h2 {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.host-switcher-row,
.collection-toolbar,
.session-search-form,
.session-sort-form {
  padding: 8px;
  border: 1px solid rgba(169, 191, 235, 0.1);
  border-radius: 18px;
  background: rgba(3, 8, 18, 0.22);
}

.collection-toolbar,
.session-sort-form {
  margin-bottom: 6px;
}

.session-search-summary {
  margin: 0 4px 6px;
}

.conversation-list {
  padding-right: 6px;
}

.conversation-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border-color: rgba(169, 191, 235, 0.12);
  background:
    linear-gradient(180deg, rgba(22, 36, 65, 0.62), rgba(12, 22, 41, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.conversation-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
}

.conversation-card:hover {
  border-color: rgba(143, 177, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(27, 45, 80, 0.72), rgba(14, 25, 48, 0.72));
}

.conversation-card.live {
  border-color: rgba(169, 191, 235, 0.16);
}

.conversation-live-dot {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14), 0 0 16px rgba(34, 197, 94, 0.42);
  animation: live-session-pulse 1.9s ease-in-out infinite;
  pointer-events: none;
}

.conversation-card.message-unread::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 28px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 0 16px rgba(239, 68, 68, 0.32);
}

@keyframes live-session-pulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

.conversation-card.active {
  outline: 0;
  border-color: rgba(130, 247, 208, 0.38);
  background:
    radial-gradient(circle at 0% 0%, rgba(130, 247, 208, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(25, 44, 75, 0.84), rgba(13, 26, 48, 0.82));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.conversation-card.active::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.conversation-card .title {
  letter-spacing: -0.02em;
}

.conversation-time-grid {
  grid-template-columns: 1fr;
  gap: 4px;
}

.conversation-time-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-color: rgba(169, 191, 235, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.conversation-time-grid strong {
  display: inline;
}

.conversation-card-actions select,
.collection-remove-button {
  border-radius: 13px;
}

.main {
  position: relative;
  padding: 14px 18px 14px 14px;
  gap: 12px;
}

.detail-header {
  position: sticky;
  top: 14px;
  z-index: 22;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(169, 191, 235, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(12, 22, 42, 0.9), rgba(8, 15, 30, 0.76)),
    rgba(8, 15, 30, 0.84);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
}

.detail-header h2 {
  font-size: clamp(21px, 2.2vw, 32px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.detail-actions {
  gap: 8px;
}

.detail-actions button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
}

.navigator-toggle-button {
  min-width: 92px;
}

.unified-session-panel {
  padding: 12px 14px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(130, 247, 208, 0.065), rgba(143, 177, 255, 0.045)),
    rgba(11, 19, 36, 0.58);
}

.runtime-chip-row {
  gap: 8px;
}

.runtime-chip {
  border-color: rgba(169, 191, 235, 0.16);
  background: rgba(3, 8, 18, 0.28);
  color: rgba(237, 244, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.runtime-chip.active,
.runtime-chip.info {
  background: rgba(130, 247, 208, 0.09);
}

.transcript-panel {
  gap: 10px;
  min-height: 0;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 0%, rgba(130, 247, 208, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(9, 17, 33, 0.68), rgba(6, 12, 24, 0.62));
}

.log {
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(169, 191, 235, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(2, 7, 17, 0.18), rgba(2, 7, 17, 0.36));
}

.message {
  max-width: min(78%, 820px);
}

.message.user {
  max-width: min(64%, 680px);
}

.message-toolbar {
  min-height: 22px;
  padding: 0 4px;
  opacity: 0.42;
}

.message-meta {
  color: rgba(143, 177, 255, 0.7);
  font-size: 10px;
}

.bubble {
  border-radius: 22px;
  padding: 15px 17px;
  border-color: rgba(169, 191, 235, 0.13);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.message.agent .bubble {
  background:
    linear-gradient(180deg, rgba(18, 35, 54, 0.84), rgba(13, 27, 43, 0.82));
  border-color: rgba(130, 247, 208, 0.16);
  border-top-left-radius: 10px;
}

.message.user .bubble {
  background:
    linear-gradient(135deg, rgba(77, 114, 220, 0.34), rgba(48, 89, 172, 0.26));
  border-color: rgba(143, 177, 255, 0.32);
  border-top-right-radius: 10px;
}

.markdown-code-card,
.markdown-table-wrap,
.markdown-math-block {
  border-color: rgba(143, 177, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.markdown-code-card {
  background: rgba(2, 8, 18, 0.72);
}

.message-file-card {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(143, 177, 255, 0.1), rgba(130, 247, 208, 0.045));
}

.message.thinking {
  max-width: min(76%, 760px);
}

.thinking-card {
  border-color: rgba(130, 247, 208, 0.2);
  background:
    linear-gradient(180deg, rgba(14, 42, 51, 0.5), rgba(10, 22, 34, 0.54));
  box-shadow: var(--shadow-card);
}

.thinking-summary {
  padding: 13px 15px;
}

.thinking-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(130, 247, 208, 0.72);
  vertical-align: 1px;
}

.thinking-file-change-card {
  border-color: rgba(143, 177, 255, 0.16);
  background: rgba(2, 8, 18, 0.54);
}

.composer {
  border-radius: 26px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(17, 30, 55, 0.9), rgba(9, 17, 33, 0.86));
  box-shadow:
    0 -18px 54px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.composer-attachment-grid {
  display: flex;
  gap: 8px;
}

.attachment-icon-button {
  width: 42px;
  min-width: 42px;
  border-radius: 15px;
}

.attachment-chip {
  border-radius: 13px;
  background: rgba(130, 247, 208, 0.075);
}

.composer-main-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.composer-main-row textarea {
  min-height: 104px;
  border-radius: 20px;
  resize: vertical;
}

.composer-action-stack {
  align-content: stretch;
}

.composer-action-stack button {
  border-radius: 16px;
  min-height: 48px;
}

#codex-send-button {
  color: #06101c;
  font-weight: 850;
}

.slash-command-menu,
.mobile-select-menu,
.collection-popover,
.settings-modal,
.runtime-details-modal,
.status-window-modal,
.alerts-window {
  border-color: rgba(169, 191, 235, 0.18);
  background:
    radial-gradient(circle at top left, rgba(130, 247, 208, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(12, 22, 42, 0.98), rgba(8, 15, 30, 0.98));
  box-shadow: 0 26px 84px rgba(0, 0, 0, 0.44);
}

.alerts-window {
  border-radius: 24px;
}

@media (max-width: 980px) {
  body::before {
    background-size: 42px 42px;
  }

  .sidebar {
    width: min(90vw, 390px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 10px 0 10px 10px;
    border-radius: 26px;
  }

  .shell.navigator-collapsed .sidebar {
    margin-left: 10px;
    transform: translateX(calc(-100% - 16px));
  }

  .main {
    padding: 10px;
    gap: 10px;
  }

  .detail-header {
    top: 10px;
    padding: 12px;
    border-radius: 22px;
  }

  .detail-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .detail-actions button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .transcript-panel {
    border-radius: 24px;
  }

  .log {
    min-height: 54vh;
    padding: 12px;
    border-radius: 20px;
  }

  .composer {
    position: sticky;
    bottom: 8px;
    border-radius: 22px;
  }

  .mobile-select-menu:not(.hidden) {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 86px;
    z-index: 140;
    max-height: min(52dvh, 420px);
  }
}

@media (max-width: 720px) {
  .brand h1 {
    font-size: 34px;
  }

  .detail-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-header h2 {
    font-size: 22px;
  }

  .session-meta-path {
    max-width: 100%;
  }

  .conversation-time-grid span {
    white-space: normal;
  }

  .message,
  .message.user,
  .message.thinking {
    max-width: 100%;
  }

  .message.user {
    align-self: stretch;
  }

  .message.user .bubble {
    margin-left: 28px;
  }

  .composer-main-row {
    grid-template-columns: 1fr;
  }

  .composer-action-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .composer-action-stack button {
    min-width: 0;
    min-height: 44px;
    padding: 9px 8px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .sidebar {
    width: min(94vw, 370px);
    padding: 14px;
  }

  .nav-section {
    border-radius: 22px;
    padding: 12px;
  }

  .host-switcher-row,
  .collection-toolbar,
  .session-search-form,
  .session-sort-form {
    padding: 7px;
    border-radius: 16px;
  }

  .conversation-card {
    border-radius: 18px;
  }

  .detail-actions button {
    min-height: 36px;
    padding: 8px 11px;
  }

  .unified-session-panel {
    padding: 10px;
  }

  .runtime-chip-row {
    gap: 6px;
  }

  .runtime-chip {
    padding: 7px 10px;
    font-size: 11px;
  }

  .bubble {
    padding: 13px 14px;
  }

  .message.user .bubble {
    margin-left: 18px;
  }

  .composer {
    padding: 10px;
  }
}

/* 2.2 polish pass: tactile details and calmer hierarchy */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 177, 255, 0.32) rgba(255, 255, 255, 0.035);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(143, 177, 255, 0.32);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(130, 247, 208, 0.38);
  background-clip: padding-box;
}

#fork-session-button,
#codex-send-button {
  background:
    linear-gradient(135deg, rgba(130, 247, 208, 1), rgba(121, 171, 255, 1));
}

#resume-session-button,
#join-session-button {
  border-color: rgba(130, 247, 208, 0.22);
  background: rgba(130, 247, 208, 0.08);
}

#toggle-alerts-button:not(.hidden) {
  border-color: rgba(255, 145, 64, 0.42);
  background: rgba(255, 145, 64, 0.14);
  color: #ff9f43;
}

.message-notification-anchor {
  position: relative;
  display: inline-flex;
}

.message-notification-button {
  position: relative;
  min-width: 42px;
  justify-content: center;
}

.message-notification-icon {
  display: inline-block;
  line-height: 1;
}

.message-notification-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  border: 2px solid rgba(8, 15, 30, 0.98);
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.message-notification-button.has-unread {
  color: #1f2937;
  border-color: rgba(245, 158, 11, 0.54);
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.message-notification-button.has-unread .message-notification-icon {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}

.message-notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 76;
  width: min(390px, calc(100vw - 28px));
  max-height: min(62vh, 520px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(169, 191, 235, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(12, 22, 42, 0.98), rgba(8, 15, 30, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

@media (max-width: 980px), (pointer: coarse), (hover: none) {
  .message-notification-panel:not(.hidden) {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    z-index: 3000;
    width: auto;
    max-height: min(72dvh, 520px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

.message-notification-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.message-notification-heading {
  font-weight: 800;
}

.message-notification-list {
  display: grid;
  gap: 8px;
}

.message-notification-item {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(169, 191, 235, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.message-notification-title {
  font-weight: 800;
}

.message-notification-meta,
.message-notification-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.message-notification-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card .path,
.conversation-card .preview,
.conversation-summary,
.conversation-stats .label {
  color: rgba(196, 210, 239, 0.68);
}

.runtime-chip.warning {
  color: #ffae5f;
}

.runtime-chip.error {
  color: #ffd8df;
}

.log:empty::before {
  content: "Select a conversation or start a new session.";
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(169, 191, 235, 0.14);
  border-radius: 22px;
  color: rgba(196, 210, 239, 0.58);
}

.thinking-card[open] {
  border-color: rgba(130, 247, 208, 0.28);
}

.composer {
  position: relative;
  z-index: 80;
  overflow: visible;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(130, 247, 208, 0.16), transparent 28%, rgba(143, 177, 255, 0.12));
  opacity: 0.32;
  mask-image: linear-gradient(#000, transparent 52%);
}

.composer > * {
  position: relative;
  z-index: 1;
}

.settings-section {
  border-color: rgba(169, 191, 235, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
}

.settings-section-title {
  letter-spacing: -0.01em;
}

.status-request-card,
.status-alert-card,
.status-diagnostic-card {
  border-radius: 18px;
}

.alerts-fab {
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

@media (max-width: 980px) {
  .detail-actions {
    scrollbar-width: none;
  }

  .detail-actions::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 560px) {
  .log {
    padding: 10px;
  }

  .composer-main-row textarea {
    min-height: 92px;
  }

  .composer-action-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composer-session-control-fields {
    grid-template-columns: 1fr;
  }

  .composer-api-control {
    grid-column: 1;
  }
}

.settings-compact-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  width: min(360px, 100%);
}

.settings-compact-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

html[data-theme="minimal-light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-2: rgba(248, 250, 255, 0.94);
  --surface: rgba(11, 23, 44, 0.045);
  --surface-strong: rgba(11, 23, 44, 0.075);
  --text: #111827;
  --muted: #667085;
  --accent: #0f9f83;
  --accent-2: #4169e1;
  --danger: #c8324f;
  --warning: #9a6500;
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.18);
  --shadow-soft: 0 20px 70px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 12px 34px rgba(15, 23, 42, 0.08);
}

html[data-theme="minimal-light"] body {
  background:
    radial-gradient(circle at 15% -10%, rgba(15, 159, 131, 0.1), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(65, 105, 225, 0.1), transparent 36%),
    linear-gradient(180deg, #fbfcff 0%, #f4f6fb 48%, #ffffff 100%);
  color: var(--text);
}

html[data-theme="minimal-light"] body::before {
  background:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  opacity: 0.48;
}

html[data-theme="minimal-light"] input,
html[data-theme="minimal-light"] select,
html[data-theme="minimal-light"] textarea {
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="minimal-light"] input::placeholder,
html[data-theme="minimal-light"] textarea::placeholder {
  color: rgba(102, 112, 133, 0.72);
}

html[data-theme="minimal-light"] button {
  color: #ffffff;
  background: linear-gradient(135deg, #0f9f83, #4169e1);
}

html[data-theme="minimal-light"] button.attachment-chip-preview,
html[data-theme="minimal-light"] button.message-file-preview-button {
  color: inherit;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="minimal-light"] .secondary-button {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="minimal-light"] .secondary-button[aria-pressed="true"] {
  color: #ffffff;
  background: linear-gradient(135deg, #0f9f83, #4169e1);
  border-color: rgba(65, 105, 225, 0.24);
}

html[data-theme="minimal-light"] .danger-button {
  color: #9f1239;
  background: rgba(255, 241, 243, 0.92);
  border-color: rgba(200, 50, 79, 0.18);
}

html[data-theme="minimal-light"] .approval-popup {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(154, 101, 0, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.98);
  border-color: rgba(154, 101, 0, 0.28);
  box-shadow: 0 22px 64px rgba(15, 23, 42, 0.2);
}

html[data-theme="minimal-light"] .approval-popup-detail {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.045);
}

html[data-theme="minimal-light"] .approval-popup-actions {
  background: rgba(255, 255, 255, 0.98);
}

html[data-theme="minimal-light"] .sidebar,
html[data-theme="minimal-light"] .detail-header,
html[data-theme="minimal-light"] .nav-section,
html[data-theme="minimal-light"] .panel,
html[data-theme="minimal-light"] .composer,
html[data-theme="minimal-light"] .auth-card,
html[data-theme="minimal-light"] .settings-modal,
html[data-theme="minimal-light"] .runtime-details-modal,
html[data-theme="minimal-light"] .status-window-modal,
html[data-theme="minimal-light"] .alerts-window,
html[data-theme="minimal-light"] .collection-popover,
html[data-theme="minimal-light"] .mobile-select-menu,
html[data-theme="minimal-light"] .slash-command-menu {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 255, 0.78));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow:
    0 20px 70px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px);
}

html[data-theme="minimal-light"] .transcript-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(15, 159, 131, 0.065), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 255, 0.82));
}

html[data-theme="minimal-light"] .log {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(15, 23, 42, 0.075);
}

html[data-theme="minimal-light"] .conversation-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.09);
}

html[data-theme="minimal-light"] .conversation-card.live {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.09);
}

html[data-theme="minimal-light"] .conversation-card:hover,
html[data-theme="minimal-light"] .conversation-card.active {
  background: #ffffff;
  border-color: rgba(15, 159, 131, 0.32);
}

html[data-theme="minimal-light"] .conversation-card.live,
html[data-theme="minimal-light"] .conversation-card.live.active,
html[data-theme="minimal-light"] .conversation-card.live:hover {
  background: #ffffff;
}

html[data-theme="minimal-light"] .message-notification-count {
  border-color: #ffffff;
}

html[data-theme="minimal-light"] .message-notification-panel {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.92));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}

html[data-theme="minimal-light"] .message-notification-item {
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .host-switcher-row,
html[data-theme="minimal-light"] .collection-toolbar,
html[data-theme="minimal-light"] .session-search-form,
html[data-theme="minimal-light"] .session-sort-form,
html[data-theme="minimal-light"] .conversation-time-grid span,
html[data-theme="minimal-light"] .runtime-chip,
html[data-theme="minimal-light"] .thinking-block,
html[data-theme="minimal-light"] .thinking-history-item,
html[data-theme="minimal-light"] .settings-section {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="minimal-light"] .bubble {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

html[data-theme="minimal-light"] .message.agent .bubble {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="minimal-light"] .message.user .bubble {
  color: #ffffff;
  background: linear-gradient(135deg, #4169e1, #0f9f83);
  border-color: transparent;
}

html[data-theme="minimal-light"] .message-meta,
html[data-theme="minimal-light"] .meta,
html[data-theme="minimal-light"] .muted,
html[data-theme="minimal-light"] .sub,
html[data-theme="minimal-light"] .detail-copy,
html[data-theme="minimal-light"] .conversation-card .path,
html[data-theme="minimal-light"] .conversation-card .preview,
html[data-theme="minimal-light"] .conversation-summary,
html[data-theme="minimal-light"] .conversation-stats .label {
  color: var(--muted);
}

html[data-theme="minimal-light"] .runtime-chip.active,
html[data-theme="minimal-light"] .runtime-chip.info,
html[data-theme="minimal-light"] .thinking-card {
  background: rgba(15, 159, 131, 0.07);
  border-color: rgba(15, 159, 131, 0.18);
}

html[data-theme="minimal-light"] .thinking-operation-body {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="minimal-light"] .thinking-operation-code {
  color: #1e293b;
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(241, 245, 249, 0.9);
}

html[data-theme="minimal-light"] .thinking-operation-field.failed .thinking-operation-code {
  color: #9f1239;
  border-color: rgba(190, 24, 93, 0.18);
}

html[data-theme="minimal-light"] .markdown-code-card,
html[data-theme="minimal-light"] .thinking-file-change-card,
html[data-theme="minimal-light"] .thinking-diff-block {
  background: #f6f8fb;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .markdown-code-card code,
html[data-theme="minimal-light"] .diff-line,
html[data-theme="minimal-light"] .thinking-diff-full {
  color: #111827;
}

html[data-theme="minimal-light"] .api-profile-chip,
html[data-theme="minimal-light"] .variant-chip {
  color: #344054;
  background: rgba(65, 105, 225, 0.07);
  border-color: rgba(65, 105, 225, 0.14);
}

html[data-theme="minimal-light"] .slash-command-item {
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="minimal-light"] .slash-command-item.active,
html[data-theme="minimal-light"] .slash-command-item:hover {
  color: #101828;
  background: rgba(15, 159, 131, 0.08);
  border-color: rgba(15, 159, 131, 0.2);
}

html[data-theme="minimal-light"] .slash-command-icon {
  color: #0f766e;
  background: rgba(15, 159, 131, 0.08);
  border-color: rgba(15, 159, 131, 0.2);
}

html[data-theme="minimal-light"] .slash-command-title {
  color: #101828;
}

html[data-theme="minimal-light"] .slash-command-category {
  color: #0f9f83;
}

html[data-theme="minimal-light"] .slash-command-description,
html[data-theme="minimal-light"] .slash-command-empty {
  color: #667085;
}

html[data-theme="minimal-light"] .slash-command-note {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="minimal-light"] #fork-session-button,
html[data-theme="minimal-light"] #codex-send-button {
  color: #ffffff;
  background: linear-gradient(135deg, #0f9f83, #4169e1);
}

html[data-theme="minimal-light"] #resume-session-button,
html[data-theme="minimal-light"] #join-session-button {
  color: #0f766e;
  background: rgba(15, 159, 131, 0.08);
  border-color: rgba(15, 159, 131, 0.18);
}

html[data-theme="minimal-light"] .empty-state {
  color: var(--muted);
  border-color: rgba(15, 23, 42, 0.12);
}

@media (max-width: 720px) {
  .settings-compact-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .skills-manager-grid {
    grid-template-columns: 1fr;
  }

  .skills-manager-overlay {
    padding: 8px;
  }

  .skills-manager-modal {
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .skills-inventory-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  #skills-inventory-summary {
    text-align: left;
  }

  .skills-deployment-options,
  .skills-deployment-actions {
    align-items: stretch;
  }

  .skills-scope-segment,
  #skills-project-cwd-select,
  .skills-project-confirmation {
    width: 100%;
  }

  .skills-deployment-actions button {
    flex: 1 1 140px;
  }

  .skills-deployment-progress-row {
    grid-template-columns: 1fr;
  }

  .skills-deployment-progress-results {
    justify-content: flex-start;
  }

  .skills-inventory-matrix {
    max-height: 50vh;
  }

  .skills-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .skills-row-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    width: 100%;
  }

  .skills-daily-digest,
  .skills-source-editor,
  .skills-github-import-editor,
  .skills-library-lifecycle-toolbar,
  .skills-source-row {
    grid-template-columns: 1fr;
  }

  .skills-source-automation {
    grid-template-columns: 1fr;
  }

  .skills-audit-item-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .skills-source-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Light theme repair pass: complete the non-chat surfaces. */
html[data-theme="minimal-light"] .selected-host-section {
  overflow: hidden;
}

html[data-theme="minimal-light"] .conversation-list {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 4px 8px 8px 2px;
}

html[data-theme="minimal-light"] .conversation-card {
  display: block;
  min-height: 132px;
  padding: 12px;
  overflow: visible;
  color: var(--text);
  border-radius: 18px;
}

html[data-theme="minimal-light"] .conversation-card .title {
  color: #101828;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="minimal-light"] .conversation-card-top {
  min-width: 0;
}

html[data-theme="minimal-light"] .conversation-card-top > div:first-child {
  min-width: 0;
}

html[data-theme="minimal-light"] .conversation-time-grid {
  grid-template-columns: 1fr;
}

html[data-theme="minimal-light"] .conversation-time-grid span {
  color: #475467;
}

html[data-theme="minimal-light"] .conversation-time-grid strong {
  color: #667085;
}

html[data-theme="minimal-light"] .conversation-card-actions {
  grid-template-columns: 1fr;
}

html[data-theme="minimal-light"] .collection-popover {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  color: var(--text);
}

html[data-theme="minimal-light"] .collection-popover-header,
html[data-theme="minimal-light"] .collection-create-row,
html[data-theme="minimal-light"] .collection-manager-row,
html[data-theme="minimal-light"] .collection-manager-actions {
  min-width: 0;
}

html[data-theme="minimal-light"] .collection-popover-header,
html[data-theme="minimal-light"] .collection-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

html[data-theme="minimal-light"] .collection-manager-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .collection-manager-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

html[data-theme="minimal-light"] .collection-manager-actions button {
  width: 100%;
  min-width: 0;
}

html[data-theme="minimal-light"] .collection-manager-copy strong {
  color: #101828;
}

html[data-theme="minimal-light"] .directory-picker-overlay,
html[data-theme="minimal-light"] .connector-manager-overlay,
html[data-theme="minimal-light"] .runtime-details-overlay,
html[data-theme="minimal-light"] .status-window-overlay,
html[data-theme="minimal-light"] .choice-dialog-overlay,
html[data-theme="minimal-light"] .image-preview-overlay {
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(18px);
}

html[data-theme="minimal-light"] .directory-picker-modal,
html[data-theme="minimal-light"] .connector-manager-modal,
html[data-theme="minimal-light"] .choice-dialog-modal,
html[data-theme="minimal-light"] .image-preview-modal {
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 159, 131, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 24px 90px rgba(15, 23, 42, 0.18);
}

html[data-theme="minimal-light"] .choice-select-all {
  color: #0f766e;
  background: rgba(15, 159, 131, 0.08);
  border-color: rgba(15, 159, 131, 0.18);
}

html[data-theme="minimal-light"] .choice-session-row,
html[data-theme="minimal-light"] .choice-file-row,
html[data-theme="minimal-light"] .export-timeline-panel,
html[data-theme="minimal-light"] .export-checkbox-grid label,
html[data-theme="minimal-light"] .choice-chip-list label {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .export-day-chip {
  border-color: rgba(15, 159, 131, 0.28);
  background: rgba(15, 159, 131, 0.1);
}

html[data-theme="minimal-light"] .export-day-chip strong {
  color: #0f766e;
}

html[data-theme="minimal-light"] .export-day-chip.selected {
  border-color: rgba(217, 119, 6, 0.36);
  background: rgba(245, 158, 11, 0.13);
}

html[data-theme="minimal-light"] .export-day-chip.selected strong {
  color: #b45309;
}

html[data-theme="minimal-light"] .export-day-chip.empty {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.8);
}

html[data-theme="minimal-light"] .picker-entry,
html[data-theme="minimal-light"] .picker-chip {
  color: #101828;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="minimal-light"] .picker-entry:hover,
html[data-theme="minimal-light"] .picker-chip:hover,
html[data-theme="minimal-light"] .picker-chip.active {
  border-color: rgba(15, 159, 131, 0.32);
  background: rgba(15, 159, 131, 0.08);
}

html[data-theme="minimal-light"] .picker-current-path,
html[data-theme="minimal-light"] .picker-status,
html[data-theme="minimal-light"] .picker-section-label,
html[data-theme="minimal-light"] .picker-entry .path,
html[data-theme="minimal-light"] .image-preview-subtitle {
  color: #667085;
}

html[data-theme="minimal-light"] .connector-manager-note,
html[data-theme="minimal-light"] .connector-editor-subtitle,
html[data-theme="minimal-light"] .connector-plan,
html[data-theme="minimal-light"] .connector-meta,
html[data-theme="minimal-light"] .connector-command-preview,
html[data-theme="minimal-light"] .connector-runbook-item {
  color: #667085;
}

html[data-theme="minimal-light"] .connector-library,
html[data-theme="minimal-light"] .connector-editor-panel,
html[data-theme="minimal-light"] .connector-runbook,
html[data-theme="minimal-light"] .connector-card,
html[data-theme="minimal-light"] .connector-group,
html[data-theme="minimal-light"] .connector-action-result {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .connector-command-preview,
html[data-theme="minimal-light"] .connector-action-result pre {
  color: #344054;
  background: #f8fafc;
}

html[data-theme="minimal-light"] .connector-badge {
  color: #0f766e;
  background: rgba(15, 159, 131, 0.09);
  border-color: rgba(15, 159, 131, 0.2);
}

html[data-theme="minimal-light"] .runtime-chip {
  color: #344054;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .runtime-chip.active,
html[data-theme="minimal-light"] .runtime-chip.info {
  color: #0f766e;
  background: rgba(15, 159, 131, 0.08);
  border-color: rgba(15, 159, 131, 0.22);
}

html[data-theme="minimal-light"] .runtime-chip.warning {
  color: #9a6500;
  background: rgba(255, 215, 122, 0.16);
  border-color: rgba(154, 101, 0, 0.16);
}

html[data-theme="minimal-light"] .runtime-chip.error {
  color: #b42318;
  background: rgba(254, 243, 242, 0.92);
  border-color: rgba(180, 35, 24, 0.16);
}

html[data-theme="minimal-light"] .unified-session-panel,
html[data-theme="minimal-light"] .runtime-detail-section,
html[data-theme="minimal-light"] .status-summary-card,
html[data-theme="minimal-light"] .status-section,
html[data-theme="minimal-light"] .status-request-card,
html[data-theme="minimal-light"] .status-alert-card,
html[data-theme="minimal-light"] .status-diagnostic-card {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .status-alert-card.error,
html[data-theme="minimal-light"] .status-diagnostic-card.error {
  background: rgba(254, 243, 242, 0.92);
  border-color: rgba(180, 35, 24, 0.16);
}

html[data-theme="minimal-light"] .status-alert-card.warning,
html[data-theme="minimal-light"] .status-diagnostic-card.warning {
  background: rgba(255, 250, 235, 0.92);
  border-color: rgba(154, 101, 0, 0.16);
}

@media (max-width: 980px) {
  html[data-theme="minimal-light"] .conversation-card {
    min-height: 118px;
  }
}

/* Navigation repair: keep session cards compact and dropdowns above the rail. */
.shell:not(.navigator-collapsed) .sidebar {
  transform: none;
}

.selected-host-section {
  overflow: visible;
}

.selected-host-section .conversation-list {
  overflow: auto;
}

.collection-toolbar,
.mobile-select-anchor,
.collection-select-anchor {
  z-index: 30;
}

.mobile-select-menu:not(.hidden) {
  z-index: 220;
}

html[data-theme="minimal-light"] .selected-host-section {
  overflow: visible;
}

html[data-theme="minimal-light"] .conversation-list {
  grid-auto-rows: auto;
  gap: 8px;
  overflow-x: hidden;
}

html[data-theme="minimal-light"] .conversation-card {
  display: grid;
  gap: 6px;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 12px;
  overflow: hidden;
}

html[data-theme="minimal-light"] .conversation-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

html[data-theme="minimal-light"] .conversation-stats {
  min-width: 34px;
}

html[data-theme="minimal-light"] .conversation-stats .count {
  font-size: 14px;
}

html[data-theme="minimal-light"] .conversation-stats .label {
  display: none;
}

html[data-theme="minimal-light"] .conversation-card .sub,
html[data-theme="minimal-light"] .conversation-card .path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

html[data-theme="minimal-light"] .conversation-card .path {
  margin-top: 0;
  font-size: 12px;
}

html[data-theme="minimal-light"] .conversation-tag-row {
  margin-top: 0;
}

html[data-theme="minimal-light"] .conversation-time-grid {
  display: flex;
  gap: 5px;
  margin-top: 0;
  min-width: 0;
}

html[data-theme="minimal-light"] .conversation-time-grid span {
  min-width: 0;
  flex: 1 1 0;
  display: block;
  padding: 4px 6px;
  font-size: 10px;
  text-align: center;
}

html[data-theme="minimal-light"] .conversation-time-grid strong {
  display: none;
}

html[data-theme="minimal-light"] .conversation-summary,
html[data-theme="minimal-light"] .conversation-card .preview,
html[data-theme="minimal-light"] .conversation-card .variant-row,
html[data-theme="minimal-light"] .conversation-card-actions {
  display: none;
}

html[data-theme="minimal-light"] .markdown-body blockquote {
  color: #344054;
  background: #f8fafc;
  border-left-color: rgba(65, 105, 225, 0.62);
  border-radius: 0 12px 12px 0;
  padding: 9px 12px;
}

/* Mobile navigation and transcript ergonomics. */
.transcript-panel {
  position: relative;
}

.transcript-scroll-controls {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 18;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

body.modal-open .transcript-scroll-controls {
  display: none !important;
}

.transcript-search-navigator {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 19;
  display: grid;
  grid-template-columns: auto minmax(80px, 220px) auto auto auto;
  align-items: center;
  gap: 7px;
  max-width: min(560px, calc(100% - 180px));
  padding: 7px;
  border: 1px solid rgba(255, 213, 105, 0.28);
  border-radius: 999px;
  background: rgba(10, 18, 34, 0.86);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.transcript-search-label,
.transcript-search-query {
  min-width: 0;
  font-size: 12px;
  line-height: 1.1;
}

.transcript-search-label {
  color: rgba(255, 213, 105, 0.92);
  font-weight: 800;
  white-space: nowrap;
}

.transcript-search-query {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript-search-nav-button,
.transcript-search-close-button {
  min-width: 0;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.transcript-search-close-button {
  width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.scroll-jump-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  pointer-events: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

html[data-theme="minimal-light"] .scroll-jump-button {
  color: #172033;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="minimal-light"] .transcript-search-navigator {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(217, 119, 6, 0.24);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

html[data-theme="minimal-light"] .transcript-search-label {
  color: #9a6700;
}

.scroll-jump-button.has-new,
html[data-theme="minimal-light"] .scroll-jump-button.has-new {
  color: #fff;
  border-color: rgba(239, 68, 68, 0.62);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.96), rgba(249, 115, 22, 0.92));
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.2);
}

html[data-theme="minimal-light"] .conversation-card {
  contain: layout paint;
}

html[data-theme="minimal-light"] .conversation-card .title,
html[data-theme="minimal-light"] .conversation-card .sub,
html[data-theme="minimal-light"] .conversation-card .path {
  min-width: 0;
}

@media (max-width: 980px) {
  .selected-host-section {
    flex: 0 0 auto;
    overflow: visible;
  }

  .selected-host-section .conversation-list {
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  html[data-theme="minimal-light"] .conversation-list {
    display: grid;
    gap: 8px;
  }

  html[data-theme="minimal-light"] .conversation-card {
    min-height: 0;
    padding: 10px 11px;
  }

  html[data-theme="minimal-light"] .conversation-time-grid {
    display: none;
  }

  .mobile-select-menu:not(.hidden) {
    z-index: 3000;
  }

  .transcript-scroll-controls {
    top: 10px;
    right: 12px;
  }

  .scroll-jump-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .transcript-search-navigator {
    position: sticky;
    top: 8px;
    left: auto;
    transform: none;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    max-width: 100%;
    margin: 0 6px -2px;
  }
}

/* Conversation card repair: keep cards readable and restore collection actions. */
html[data-theme="minimal-light"] .conversation-list {
  align-items: stretch;
  grid-auto-rows: minmax(132px, auto);
}

html[data-theme="minimal-light"] .conversation-card {
  contain: none;
  min-height: 132px;
  overflow: visible;
  align-content: start;
}

html[data-theme="minimal-light"] .conversation-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 2px;
}

html[data-theme="minimal-light"] .conversation-card-actions .mobile-select-anchor,
html[data-theme="minimal-light"] .collection-move-anchor {
  width: 100%;
  min-width: 0;
}

html[data-theme="minimal-light"] .conversation-card-actions select,
html[data-theme="minimal-light"] .conversation-card-actions button,
html[data-theme="minimal-light"] .collection-remove-button {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 12px;
  font-size: 11px;
}

html[data-theme="minimal-light"] .conversation-card .variant-row {
  display: none;
}

@media (max-width: 980px) {
  html[data-theme="minimal-light"] .conversation-list {
    grid-auto-rows: minmax(118px, auto);
  }

  html[data-theme="minimal-light"] .conversation-card {
    min-height: 118px;
  }

  html[data-theme="minimal-light"] .conversation-card-actions {
    display: grid;
  }

  html[data-theme="minimal-light"] .conversation-card-actions select {
    display: none;
  }

  html[data-theme="minimal-light"] .conversation-card-actions .mobile-select-button {
    display: flex;
  }
}

/* Final nav/action polish: desktop stays compact; phone keeps direct controls. */
@media (hover: hover) and (pointer: fine) {
  html[data-theme="minimal-light"] .conversation-list {
    grid-auto-rows: minmax(94px, auto);
  }

  html[data-theme="minimal-light"] .conversation-card {
    min-height: 94px;
  }

  html[data-theme="minimal-light"] .conversation-card-actions {
    display: none;
  }

  html[data-theme="minimal-light"] .conversation-card:hover .conversation-card-actions,
  html[data-theme="minimal-light"] .conversation-card.active .conversation-card-actions {
    display: grid;
  }
}

@media (max-width: 980px) {
  .transcript-scroll-controls {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
    z-index: 85;
    flex-direction: column;
    gap: 7px;
  }

  .scroll-jump-button {
    min-width: 56px;
    box-shadow:
      0 12px 32px rgba(15, 23, 42, 0.18),
      0 0 0 1px rgba(255, 255, 255, 0.72) inset;
  }
}

/* Keep per-session collection menus inside their conversation card. */
.conversation-card.collection-menu-open {
  overflow: visible;
}

.conversation-card.collection-menu-open .conversation-card-actions {
  display: grid;
}

.conversation-card .collection-move-anchor {
  display: grid;
  gap: 6px;
  overflow: visible;
}

.conversation-card .collection-move-menu:not(.hidden) {
  position: static;
  inset: auto;
  width: 100%;
  max-height: 180px;
  margin-top: 2px;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: none;
}

html[data-theme="minimal-light"] .conversation-card .collection-move-menu:not(.hidden) {
  color: #172033;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

html[data-theme="minimal-light"] .conversation-card .collection-move-menu .mobile-select-option {
  color: #172033;
}

/* Stable session rail: no fixed-height cards, no overlaying rows. */
.selected-host-section .conversation-list,
html[data-theme="minimal-light"] .selected-host-section .conversation-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  grid-auto-rows: unset;
  overflow-y: auto;
  overflow-x: hidden;
}

.conversation-card,
html[data-theme="minimal-light"] .conversation-card {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  contain: none;
  overflow: hidden;
}

.conversation-card.collection-menu-open,
html[data-theme="minimal-light"] .conversation-card.collection-menu-open {
  overflow: visible;
}

html[data-theme="minimal-light"] .conversation-card-actions {
  display: none;
}

.conversation-card.collection-menu-open .conversation-card-actions,
html[data-theme="minimal-light"] .conversation-card.collection-menu-open .conversation-card-actions,
html[data-theme="minimal-light"] .conversation-card.active .conversation-card-actions {
  display: grid;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="minimal-light"] .conversation-card:hover .conversation-card-actions {
    display: grid;
  }
}

@media (max-width: 980px), (pointer: coarse), (hover: none) {
  /* Native selects are the most reliable picker on mobile browsers. */
  .mobile-replaced-select,
  .conversation-card-actions select.mobile-replaced-select,
  html[data-theme="minimal-light"] .conversation-card-actions select.mobile-replaced-select {
    display: block !important;
  }

  .mobile-select-button,
  .mobile-select-menu {
    display: none !important;
  }

  .conversation-card-actions,
  html[data-theme="minimal-light"] .conversation-card-actions {
    display: grid;
  }

  .conversation-card,
  html[data-theme="minimal-light"] .conversation-card {
    min-height: 0;
    overflow: hidden;
  }

  body > .transcript-scroll-controls,
  .transcript-scroll-controls {
    position: fixed !important;
    top: 50vh !important;
    top: 50dvh !important;
    right: 12px !important;
    right: calc(env(safe-area-inset-right, 0px) + 12px) !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 9990 !important;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .transcript-scroll-controls #scroll-transcript-bottom-button,
  .transcript-scroll-controls #scroll-transcript-top-button {
    position: static;
    pointer-events: auto;
  }

  .scroll-jump-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.94);
    touch-action: manipulation;
  }

  .transcript-search-navigator {
    position: sticky !important;
    top: 8px !important;
    z-index: 70;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    max-width: 100%;
    margin: 0 0 -2px;
  }

  .slash-command-menu {
    max-height: min(58dvh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .slash-command-item {
    touch-action: manipulation;
  }
}
/* Mobile transcript page-flow repair */
@media (max-width: 980px), (pointer: coarse), (hover: none) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: clip;
    overflow-y: visible;
  }

  .shell {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .main {
    height: auto;
    min-height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }

  .detail-header {
    position: relative;
    top: auto;
  }

  .transcript-panel {
    min-height: 0;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .log {
    overflow: visible;
    min-height: 0;
    max-height: none;
  }

  .composer {
    position: relative;
    bottom: auto;
  }
}

@media (max-width: 560px) {
  .message.thinking {
    max-width: calc(100% - 4px);
  }

  .thinking-card[open] .thinking-summary,
  .thinking-card[open] .thinking-content {
    padding-right: 52px;
  }

  .thinking-scroll-actions.rail {
    top: 48px;
    right: 0;
    bottom: 0;
    width: 44px;
    padding: 0;
  }

  .thinking-scroll-actions.rail .thinking-scroll-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
  }

  .thinking-collapse-rail {
    bottom: auto;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

/* Phone focus mode: keep the daily remote-control path calm and thumb-friendly. */
@media (max-width: 720px) {
  body {
    background: #f4f7fb;
  }

  body::before,
  body::after {
    display: none;
  }

  .main {
    gap: 6px;
    padding: 0;
    background: #f4f7fb;
  }

  .detail-header {
    position: sticky;
    top: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(16px);
  }

  .detail-header > div:first-child {
    min-width: 0;
    align-self: center;
  }

  .detail-header .eyebrow,
  #session-meta {
    display: none !important;
  }

  .detail-header h2 {
    overflow: hidden;
    margin: 0;
    color: #172033;
    font-size: 17px;
    font-weight: 760;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .detail-actions {
    display: flex;
    width: auto;
    gap: 6px;
    overflow: visible;
    padding: 0;
  }

  .detail-actions > * {
    display: none !important;
  }

  .detail-actions > #toggle-navigator-button,
  .detail-actions > #open-settings-button,
  .detail-actions > #resume-session-button:not(.hidden) {
    display: inline-flex !important;
    min-width: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border-color: rgba(15, 23, 42, 0.1);
    border-radius: 13px;
    background: #f7f9fc;
    color: #263249;
    box-shadow: none;
    font-size: 13px;
  }

  .detail-actions > #resume-session-button:not(.hidden) {
    border-color: rgba(214, 69, 69, 0.18);
    background: #fff2f2;
    color: #b52f38;
  }

  #toggle-navigator-button,
  #open-settings-button {
    width: 42px;
    padding-inline: 0 !important;
    overflow: hidden;
    font-size: 0 !important;
  }

  #toggle-navigator-button::after {
    content: "☰";
    font-size: 19px;
    line-height: 1;
  }

  #open-settings-button::after {
    content: "⚙";
    font-size: 18px;
    line-height: 1;
  }

  .unified-session-panel {
    min-height: 0;
    padding: 4px 12px 2px;
    border: 0;
    border-radius: 0;
    background: #f4f7fb;
    box-shadow: none;
  }

  #runtime-chip-row {
    display: flex;
    gap: 6px;
    overflow: hidden;
    flex-wrap: nowrap;
  }

  #runtime-chip-row .runtime-chip {
    display: none;
    flex: 0 0 auto;
    min-height: 26px;
    padding: 4px 9px;
    border: 0;
    border-radius: 999px;
    background: #e8eef8;
    color: #526079;
    font-size: 10px;
    box-shadow: none;
  }

  #runtime-chip-row .runtime-chip:nth-child(-n + 2) {
    display: inline-flex;
  }

  .transcript-panel {
    min-height: calc(100dvh - 76px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #f4f7fb;
    box-shadow: none;
  }

  body > .transcript-scroll-controls,
  .transcript-panel > .transcript-scroll-controls,
  .transcript-scroll-controls {
    display: none !important;
  }

  .log {
    min-height: 54dvh;
    padding: 10px 12px 128px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .message,
  .message.user,
  .message.thinking {
    max-width: 92%;
  }

  .message.user {
    align-self: flex-end;
  }

  .message.user .bubble {
    margin-left: 0;
    border-radius: 18px 18px 5px 18px;
  }

  .message.agent .bubble,
  .message:not(.user) .bubble {
    border-radius: 18px 18px 18px 5px;
  }

  .message-toolbar {
    opacity: 0.55;
  }

  .composer {
    position: sticky;
    bottom: 0;
    z-index: 80;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    margin: 0;
    padding: 9px 10px calc(env(safe-area-inset-bottom, 0px) + 9px);
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
  }

  .composer-session-toolbar,
  #import-current-history-button,
  #import-other-history-button,
  #codex-plan-button,
  #codex-goal-button,
  #codex-review-button,
  #codex-clear-attachments-button:not(.has-attachments) {
    display: none !important;
  }

  .composer-main-row {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
  }

  .composer-input-wrap textarea,
  .composer-main-row textarea {
    min-height: 50px;
    max-height: 34dvh;
    padding: 13px 14px;
    border-color: rgba(15, 23, 42, 0.1);
    border-radius: 17px;
    background: #f5f7fb;
    color: #172033;
    resize: none;
    box-shadow: none;
  }

  .composer-action-stack {
    display: flex;
    gap: 6px;
    align-items: stretch;
  }

  .composer-action-stack button {
    min-width: 54px;
    min-height: 50px;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
  }

  #codex-interrupt-button:not(.hidden) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #codex-send-button {
    min-width: 66px;
  }

  .composer-attachment-grid {
    display: flex;
    grid-column: 1;
    gap: 6px;
  }

  .composer > :not(.composer-attachment-grid):not(.composer-main-row) {
    grid-column: 1 / -1;
  }

  .composer-attachment-grid .attachment-icon-button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 12px;
  }

  .alerts-fab {
    right: 12px;
    bottom: 92px;
  }

  .sidebar {
    z-index: 220;
    width: min(88vw, 348px);
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
    border: 0;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0 22px 22px 0;
    background: #fff;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.16);
  }

  .shell.navigator-collapsed .sidebar {
    margin-left: 0;
    transform: translateX(calc(-100% - 4px));
  }

  .sidebar .brand p,
  .sidebar .collection-toolbar,
  .sidebar .session-search-form,
  .sidebar .session-sort-form,
  .sidebar .session-search-summary,
  .conversation-card-actions {
    display: none !important;
  }

  .sidebar .brand h1 {
    font-size: 24px;
  }

  .nav-section {
    padding: 10px;
    border-radius: 16px;
    box-shadow: none;
  }

  .conversation-card {
    padding: 11px;
    border-radius: 14px;
  }
}

/* Phone focus v2 final overrides. Keep this block after the upstream mobile rules. */
@media (max-width: 720px) {
  .log {
    gap: 12px;
    padding: 10px 10px 92px;
  }

  .message:has(.message-file-list),
  .message.thinking {
    width: 100%;
    max-width: 100%;
  }

  .message-file-list {
    gap: 6px;
  }

  .message-file-card,
  .message-file-card.image {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    min-height: 98px;
    padding: 8px;
    border: 1px solid #e3e8f1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  }

  button.message-file-preview-button {
    height: 82px;
    overflow: hidden;
    border-radius: 10px;
  }

  .message-file-preview {
    width: 100%;
    height: 82px;
    max-height: 82px;
    border: 0;
    border-radius: 10px;
    object-fit: cover;
    background: #eef2f7;
  }

  .message-file-body {
    align-content: center;
    gap: 5px;
  }

  .message-file-name {
    display: -webkit-box;
    overflow: hidden;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .message-file-path {
    display: none;
  }

  .message-file-meta {
    overflow: hidden;
    color: #8a94a6;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .message-file-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .message-file-actions .secondary-button {
    display: inline-flex;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    background: #f7f9fc;
    color: #344054;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    box-shadow: none;
  }

  .message-file-card.image .message-file-actions a:first-of-type {
    display: none;
  }

  .message.thinking > .message-meta {
    display: none;
  }

  .thinking-card,
  html[data-theme="minimal-light"] .thinking-card {
    border: 1px solid #dfe7e5;
    border-radius: 13px;
    background: #f8fbfa;
    box-shadow: none;
  }

  .thinking-summary,
  .thinking-card[open] .thinking-summary {
    min-height: 44px;
    align-content: center;
    gap: 0;
    padding: 9px 12px;
  }

  .thinking-title-row {
    gap: 8px;
  }

  .thinking-title {
    color: #344054;
    font-size: 0;
  }

  .thinking-title::before {
    width: 6px;
    height: 6px;
    margin-right: 7px;
    box-shadow: none;
  }

  .thinking-title::after {
    content: "思考过程";
    font-size: 12px;
    font-weight: 700;
  }

  .thinking-phase {
    color: #7b8794;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .thinking-preview,
  .thinking-note {
    display: none;
  }

  .thinking-card[open] .thinking-content {
    max-height: 52dvh;
    padding: 0 48px 10px 10px;
  }

  .composer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 68px;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .composer-input-wrap textarea,
  .composer-main-row textarea {
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 120px;
    padding: 12px 13px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.35;
  }

  .composer-action-stack button {
    min-height: 48px;
    border-radius: 15px;
  }

  #codex-send-button {
    min-width: 62px;
  }
}
