:root {
  color-scheme: dark;
  --bg: #111111;
  --ink: #f4f1ea;
  --ink-soft: #f1efe9;
  --muted: #a8a29a;
  --muted-2: #8c939b;
  --muted-3: #5e6570;
  --line: #3a3835;
  --line-cool: #2b3542;
  --panel: #181818;
  --panel-2: #20201f;
  --card: #161d26;
  --well: #10161e;
  --field: #111111;
  --button: #f4f1ea;
  --button-ink: #111111;
  --amber: #d89b31;
  --amber-bg: #2a2115;
  --red: #ff6b5f;
  --red-bg: #2d1715;
  --green: #7ccf93;
  --green-bg: #142418;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 14px calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 2px 12px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.subsection-title {
  margin: 18px 0 4px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.status-pill,
.time-chip {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.notice {
  border-left: 5px solid var(--amber);
  border-radius: 0;
  margin: 4px 0 14px;
  padding: 12px;
  background: var(--amber-bg);
  color: var(--ink);
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ask-layout {
  display: grid;
  gap: 16px;
}

.intake-card {
  min-width: 0;
}

.learning-rail {
  min-width: 0;
}

.intake-card .grid.two {
  grid-template-columns: 1fr;
}

.calibration-note {
  margin-top: 14px;
}

.auto-pill {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-cool);
  background: transparent;
  color: var(--muted-2);
  text-align: left;
  font-size: 0.84rem;
}

.auto-pill.active {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
  color: var(--well);
}

.chip-section {
  margin-top: 16px;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  min-height: 34px;
  border: 1px solid var(--line-cool);
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 740;
}

.choice-chip.selected {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
  color: var(--well);
}

.profile-card {
  margin: 10px 0 18px;
  padding: 14px;
  border: 1px solid var(--line-cool);
  background: var(--panel);
}

.profile-card h3 {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-chip {
  min-height: 34px;
  border: 1px solid var(--line-cool);
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 740;
}

.profile-chip.selected {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
  color: var(--well);
}

.profile-list {
  min-height: 64px;
  background: var(--field);
}

.detected-chip {
  margin-top: 12px;
  border-left: 3px solid var(--amber);
  padding: 9px 10px;
  background: var(--amber-bg);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.initial-composer {
  display: grid;
  gap: 10px;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  background: var(--field);
  color: var(--ink);
}

textarea::placeholder,
input::placeholder {
  color: var(--muted-3);
}

textarea {
  resize: vertical;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 0;
  min-height: 46px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 760;
}

.primary {
  background: var(--button);
  color: var(--button-ink);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 0;
  padding: 11px 14px;
  text-decoration: none;
  font-weight: 760;
}

.primary:active {
  background: #d9d4ca;
}

.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

button.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.full {
  width: 100%;
  margin-top: 12px;
}

.link-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px;
  background: var(--panel-2);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-cool) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-cool);
}

.empty,
.helper {
  color: var(--muted);
}

.prompt-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.answer-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.answer-box {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.56;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.verdict-banner {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid var(--line-cool);
  border-left: 4px solid var(--ink-soft);
  background: var(--card);
  color: var(--ink-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.04rem, 1.1vw, 1.18rem);
  font-weight: 850;
  line-height: 1.34;
  letter-spacing: 0;
}

.verdict-banner.verdict-red {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(255, 107, 95, 0.18), rgba(22, 29, 38, 0.72));
  color: #ff958c;
}

.verdict-banner.verdict-amber {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(216, 155, 49, 0.2), rgba(22, 29, 38, 0.72));
  color: #f2c15f;
}

.verdict-banner.verdict-green {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(124, 207, 147, 0.17), rgba(22, 29, 38, 0.72));
  color: #9be4ad;
}

.thread {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.chat-stream {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.chat-pair {
  display: grid;
  gap: 10px;
}

.message {
  max-width: 92%;
  border: 1px solid var(--line);
  padding: 12px;
  overflow-wrap: anywhere;
}

.user-message {
  justify-self: end;
  background: var(--field);
}

.assistant-message {
  justify-self: start;
  background: transparent;
}

.message-label,
.turn-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.routed-chip {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--line-cool);
  padding: 4px 7px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.decision-snapshot {
  margin-top: 12px;
  border: 1px solid var(--line-cool);
  padding: 14px;
  background: var(--card);
  color: var(--ink-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.decision-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.decision-snapshot-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.decision-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  margin-top: 13px;
}

.decision-snapshot-item {
  min-width: 0;
}

.decision-snapshot-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.decision-snapshot-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

.answer-card-actions,
.post-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.post-action-groups {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.post-action-group {
  border: 1px solid var(--line);
  padding: 10px 12px 12px;
  background: rgba(18, 22, 27, 0.7);
}

.post-action-label {
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-action-group .post-answer-actions {
  margin-top: 7px;
}

.tiny-action,
.post-answer-actions .secondary {
  min-height: 32px;
  border: 1px solid var(--line-cool);
  padding: 6px 9px;
  background: transparent;
  color: var(--muted-2);
  font-size: 0.75rem;
  font-weight: 740;
}

.answer-sources {
  margin-top: 10px;
  border-left: 2px solid var(--line-cool);
  padding: 9px 11px;
  background: var(--field);
  color: var(--muted);
}

.answer-sources > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.answer-sources .answer-text {
  margin: 0;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
}

.thinking {
  border-left: 3px solid var(--amber);
  padding-left: 10px;
}

.continue-box {
  margin: 18px -2px -2px;
  border: 1px solid var(--line-cool);
  padding: 12px;
  background: var(--card);
}

.continue-box textarea {
  background: var(--card);
  border-color: var(--line-cool);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
}

.continue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.continue-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
}

.continue-box .helper {
  margin: 0;
  color: var(--muted-3);
  font-size: 0.72rem;
}

.continue-box .primary {
  flex: none;
  min-width: 132px;
  border: 1px solid var(--line-cool);
  background: transparent;
  color: var(--ink-soft);
}

.continue-box .secondary {
  min-width: 132px;
}

.feedback-box {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--line-cool);
  border-radius: 10px;
  padding: 16px;
  background: var(--card);
}

.learning-box > strong {
  color: #b3bac1;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.learning-box > .helper {
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.learning-box textarea,
.learning-box select,
.learning-box input {
  border-color: var(--line-cool);
  border-radius: 8px;
  background: var(--well);
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.verdict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.verdict-chip {
  min-height: 0;
  border: 1px solid var(--line-cool);
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.verdict-chip.selected {
  border-color: var(--ink-soft);
  color: var(--ink-soft);
}

.learning-actions {
  grid-template-columns: 1fr;
  margin-top: 6px;
}

.learning-actions .secondary {
  min-height: 38px;
  border-color: var(--line-cool);
  color: #b3bac1;
  font-size: 0.82rem;
  font-weight: 700;
}

.learning-actions .primary {
  min-height: 42px;
  background: var(--ink-soft);
  color: var(--well);
  font-size: 0.86rem;
}

#answer-save-status {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.75rem;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.setting-row input {
  width: auto;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.message-body {
  margin-top: 6px;
}

@media (max-width: 700px) {
  .decision-snapshot-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.risk {
  border-radius: 0;
  padding: 12px;
  margin-bottom: 12px;
  font-weight: 780;
}

.risk.red {
  background: var(--red-bg);
  color: var(--red);
}

.risk.amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.risk.green {
  background: var(--green-bg);
  color: var(--green);
}

.check-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.92rem;
}

.check-table th,
.check-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 6px;
  text-align: left;
  vertical-align: top;
}

.answer-table-wrap {
  overflow-x: auto;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
}

.answer-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.answer-table th,
.answer-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.answer-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.journal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.journal-entry {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  background: var(--panel-2);
}

.journal-entry time {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.learning-state {
  display: inline-block;
  margin: 0 0 8px;
  border: 1px solid var(--amber);
  padding: 3px 7px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.journal-entry div {
  white-space: pre-wrap;
}

.source-list {
  padding-left: 20px;
}

.source-list li {
  margin-bottom: 10px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: min(760px, 100%);
  padding: 0 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(16, 22, 30, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.28);
}

.tab {
  min-height: 52px;
  border-top: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  border-top-color: var(--ink-soft);
  background: transparent;
  color: var(--ink-soft);
}

.tab:disabled,
.tab.tab-locked {
  cursor: not-allowed;
  border-top-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  opacity: 0.65;
}

@media (max-width: 460px) {
  .grid.two,
  .button-row,
  .actions {
    grid-template-columns: 1fr;
  }

  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }

  .topbar {
    align-items: flex-start;
  }

  .answer-table-wrap {
    border: 0;
    overflow-x: visible;
  }

  .answer-table,
  .answer-table thead,
  .answer-table tbody,
  .answer-table tr,
  .answer-table th,
  .answer-table td {
    display: block;
    width: 100%;
  }

  .answer-table thead {
    display: none;
  }

  .answer-table tr {
    border: 1px solid var(--line);
    margin-bottom: 10px;
    padding: 8px;
  }

  .answer-table td {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  .answer-table td:last-child {
    border-bottom: 0;
  }

  .answer-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 760;
    text-transform: uppercase;
    margin-bottom: 3px;
  }
}

@media (min-width: 900px) {
  html,
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: min(1680px, 100%);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-width: 1680px;
    margin: 0;
    padding-left: 24px;
    padding-right: 24px;
    overflow: hidden;
    transform: translateX(-50%);
  }

  .topbar,
  .notice {
    flex: none;
  }

  main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .panel {
    padding: 20px;
  }

  .panel.active {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }

  #ask-panel.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #ask-panel .section-title {
    flex: none;
  }

  .ask-layout {
    flex: 1;
    height: 100%;
    grid-template-columns: minmax(220px, 0.42fr) minmax(560px, 1.58fr);
    grid-template-rows: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
  }

  .intake-card {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }

  .learning-rail {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }

  .learning-rail .feedback-box {
    margin-top: 0;
  }

  .result {
    display: flex;
    flex-direction: column;
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    height: 100%;
    min-height: 360px;
    max-height: none;
    overflow: hidden;
  }

  .result > .initial-composer {
    margin-top: auto;
    border: 1px solid var(--line-cool);
    padding: 14px;
    background: var(--card);
  }

  .result > .conversation-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding-right: 4px;
  }

  .result > .continue-box {
    flex: none;
    margin: 12px 0 0;
  }

  .tabbar {
    width: min(1180px, calc(100% - 48px));
  }
}

@media (min-width: 1280px) {
  body {
    font-size: 17px;
  }

  .app-shell {
    width: min(1680px, calc(100% - 32px));
    max-width: 1680px;
  }

  .ask-layout {
    grid-template-columns: minmax(250px, 0.75fr) minmax(680px, 2fr) minmax(320px, 0.95fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .choice-chip,
  .verdict-chip {
    font-size: 0.84rem;
  }

  .message-label,
  .turn-meta,
  .learning-box > .helper {
    font-size: 0.82rem;
  }

  .intake-card {
    grid-column: 1;
    grid-row: 1;
  }

  .result {
    grid-column: 2;
    grid-row: 1;
  }

  .learning-rail {
    grid-column: 3;
    grid-row: 1;
  }

  .tabbar {
    width: min(1540px, calc(100% - 48px));
  }
}

.setup-flow[hidden] {
  display: none;
}

.setup-flow {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: #111111;
}

.setup-card {
  width: min(100%, 440px);
  color: #f4f1ea;
  text-align: center;
}

.practice-framing-card,
.practice-wizard-card {
  max-width: 420px;
}

.setup-accent {
  width: 40px;
  height: 2px;
  margin: 0 auto 20px;
  background: #185fa5;
}

.setup-card h2 {
  margin: 0;
  color: #f4f1ea;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
}

.setup-subhead {
  max-width: 340px;
  margin: 14px auto 20px;
  color: #a8a29a;
  font-size: 13px;
  line-height: 1.6;
}

.practice-framing-card .setup-subhead {
  max-width: 320px;
}

.setup-warning {
  margin: 20px 0;
  padding: 10px 14px;
  border: 1px solid #d89b31;
  border-radius: 6px;
  background: #2a2115;
  color: #fac775;
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.landing-safety-copy p {
  margin: 0;
}

.landing-safety-copy p + p {
  margin-top: 10px;
}

.setup-judgment {
  margin: 18px 0;
  color: #a8a29a;
  font-size: 12px;
  line-height: 1.5;
}

.setup-checkbox {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin: 18px 0 22px;
  color: #d8d4cc;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.setup-checkbox input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #185fa5;
}

.setup-primary,
.setup-secondary,
.setup-text-button,
.practice-option {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.setup-primary {
  border: 1px solid #185fa5;
  background: #185fa5;
  color: #e6f1fb;
  font-weight: 700;
}

.landing-card > .setup-primary {
  width: 100%;
}

.setup-primary:disabled {
  border-color: #3a3835;
  background: #3a3835;
  color: #5e6570;
  cursor: not-allowed;
}

.setup-secondary {
  border: 1px solid #3a3835;
  background: transparent;
  color: #a8a29a;
  font-weight: 700;
}

.setup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.setup-step {
  margin: 0 0 14px;
  color: #8c939b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

.practice-wizard-card h2 {
  font-size: 15px;
  text-align: left;
}

.setup-instruction {
  margin: 8px 0 0;
  color: #8c939b;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.practice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 30px;
}

.practice-option {
  position: relative;
  padding: 10px 14px;
  border: 1px solid #3a3835;
  background: transparent;
  color: #a8a29a;
  font-size: 13px;
  font-weight: 650;
}

.practice-option.selected {
  padding-left: 34px;
  border-color: #185fa5;
  background: #152233;
  color: #e6f1fb;
}

.practice-option.selected.single-choice {
  padding-left: 14px;
}

.rank-badge {
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #5e6570;
  color: #111111;
  font-size: 9px;
  font-weight: 800;
}

.wizard-back-row {
  margin: 0 0 10px;
  text-align: left;
}

.setup-text-button {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e6570;
  font-size: 12px;
  font-weight: 700;
}

.wizard-next {
  width: 100%;
}

.practice-company-indicator {
  display: block;
  max-width: 100%;
  margin: -4px 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a8a29a;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #3a3835;
  text-underline-offset: 3px;
  cursor: pointer;
}

.practice-company-indicator[hidden] {
  display: none;
}

.setup-primary:focus-visible,
.setup-secondary:focus-visible,
.setup-text-button:focus-visible,
.practice-option:focus-visible,
.practice-company-indicator:focus-visible,
.setup-checkbox input:focus-visible {
  outline: 2px solid #e6f1fb;
  outline-offset: 3px;
}

@media (max-width: 460px) {
  .setup-flow {
    place-items: start center;
    padding-right: 16px;
    padding-left: 16px;
  }

  .setup-card {
    margin: auto 0;
  }

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

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

  .wizard-next {
    width: 100%;
  }
}

/* Swiss v5 presentation layer: visual and mobile navigation only. */
.theme-swiss-v5 {
  --bg: #000;
  --ink: #f2f2f0;
  --ink-soft: #f2f2f0;
  --muted: #929397;
  --muted-2: #7c7d82;
  --line: rgba(255, 255, 255, 0.12);
  --line-cool: rgba(255, 255, 255, 0.13);
  --panel: #090909;
  --card: #0b0b0b;
  --well: #050505;
  --field: #050505;
  --button: #f2f2f0;
  --button-ink: #000;
  --swiss-red: #d52b1e;
  --amber: #c9a227;
  --amber-bg: #1d180d;
  background: #000;
  color: var(--ink);
  font-family: "Instrument Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.011em;
}

.theme-swiss-v5 button,
.theme-swiss-v5 input,
.theme-swiss-v5 textarea {
  font-family: inherit;
  letter-spacing: inherit;
}

.theme-swiss-v5 button:focus-visible,
.theme-swiss-v5 input:focus-visible,
.theme-swiss-v5 textarea:focus-visible {
  outline: 1px solid var(--swiss-red);
  outline-offset: 3px;
}

.theme-swiss-v5 .app-shell {
  background: radial-gradient(ellipse 95% 36% at 50% -12%, rgba(213, 43, 30, 0.1), transparent 66%), #000;
}

.theme-swiss-v5 .brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-swiss-v5 .brand-dot {
  color: var(--swiss-red);
}

.theme-swiss-v5 .eyebrow {
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.theme-swiss-v5 h1 {
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.theme-swiss-v5 h2 {
  font-weight: 500;
  letter-spacing: -0.025em;
}

.theme-swiss-v5 .topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-swiss-v5 .tester-button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #000;
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.18s ease;
}

.theme-swiss-v5 .tester-button:active {
  transform: scale(0.96);
}

.theme-swiss-v5 .status-pill,
.theme-swiss-v5 .time-chip,
.theme-swiss-v5 .auto-pill,
.theme-swiss-v5 .choice-chip,
.theme-swiss-v5 .verdict-chip,
.theme-swiss-v5 .primary,
.theme-swiss-v5 .secondary,
.theme-swiss-v5 .link-button {
  border-radius: 999px;
}

.theme-swiss-v5 .notice {
  border-left-color: var(--swiss-red);
  border-left-width: 3px;
  background: rgba(213, 43, 30, 0.12);
}

.theme-swiss-v5 .notice-education {
  display: block;
  margin-top: 6px;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.theme-swiss-v5 .panel,
.theme-swiss-v5 .result,
.theme-swiss-v5 .initial-composer,
.theme-swiss-v5 .continue-box,
.theme-swiss-v5 .feedback-box,
.theme-swiss-v5 .message {
  border-color: var(--line);
  background: rgba(8, 8, 8, 0.9);
}

.theme-swiss-v5 .auto-pill.active,
.theme-swiss-v5 .choice-chip.selected,
.theme-swiss-v5 .verdict-chip.selected,
.theme-swiss-v5 .primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #000;
}

.theme-swiss-v5 textarea,
.theme-swiss-v5 input {
  border-color: var(--line-cool);
  border-radius: 15px;
  background: #050505;
  color: var(--ink);
}

.theme-swiss-v5 .message {
  border-radius: 18px;
}

.theme-swiss-v5 .user-message {
  background: transparent;
}

.theme-swiss-v5 .verdict-banner {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.19), rgba(201, 162, 39, 0.03));
  color: #e6bd55;
}

.theme-swiss-v5 .verdict-banner.verdict-red {
  border-left-color: var(--swiss-red);
  background: linear-gradient(90deg, rgba(213, 43, 30, 0.28), rgba(213, 43, 30, 0.04));
  color: #ff8e84;
}

.theme-swiss-v5 .verdict-banner.verdict-amber {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.19), rgba(201, 162, 39, 0.03));
  color: #e6bd55;
}

.theme-swiss-v5 .verdict-banner.verdict-green {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(124, 207, 147, 0.2), rgba(124, 207, 147, 0.03));
  color: #9fe1b2;
}

.theme-swiss-v5 .tabbar {
  border-top-color: var(--line);
  background: rgba(3, 7, 12, 0.96);
  box-shadow: none;
}

.theme-swiss-v5 .tab {
  font-size: 0.83rem;
  font-weight: 600;
}

.theme-swiss-v5 .tab.active {
  border-top-color: var(--swiss-red);
  color: var(--ink);
}

.mobile-utility,
.mobile-sheet-head,
.mobile-sheet-scrim {
  display: none;
}

.theme-swiss-v5 .setup-flow {
  background: radial-gradient(ellipse 120% 48% at 50% -12%, rgba(213, 43, 30, 0.12), transparent 64%), #000;
}

.theme-swiss-v5 .setup-accent {
  width: min(100%, 260px);
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--swiss-red), transparent);
}

.theme-swiss-v5 .setup-card h2 {
  color: var(--ink);
  font-size: clamp(1.55rem, 7vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.theme-swiss-v5 .setup-card h2 em {
  color: var(--muted);
  font-style: normal;
}

.theme-swiss-v5 .setup-primary,
.theme-swiss-v5 .setup-secondary,
.theme-swiss-v5 .practice-option {
  border-radius: 999px;
}

.theme-swiss-v5 .setup-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #000;
}

.theme-swiss-v5 .setup-warning {
  border-color: rgba(213, 43, 30, 0.9);
  background: rgba(213, 43, 30, 0.14);
  color: #f6d7d3;
}

.theme-swiss-v5 .setup-warning strong {
  color: #fff;
}

.theme-swiss-v5 .setup-checkbox input {
  accent-color: var(--swiss-red);
  border-radius: 4px;
}

.theme-swiss-v5 .setup-checkbox input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

@media (max-width: 899px) {
  html,
  body.theme-swiss-v5 {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .theme-swiss-v5 .app-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    padding: env(safe-area-inset-top) 14px calc(66px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .theme-swiss-v5 .topbar {
    flex: none;
    padding: 13px 4px 9px;
  }

  .theme-swiss-v5 .eyebrow {
    font-size: 0.58rem;
  }

  .theme-swiss-v5 h1 {
    font-size: 1.42rem;
  }

  .theme-swiss-v5 .status-pill {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .theme-swiss-v5 main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .theme-swiss-v5 .notice {
    flex: none;
    margin: 0 0 9px;
    padding: 8px 10px;
    font-size: 0.69rem;
    line-height: 1.42;
  }

  .theme-swiss-v5 .panel {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .theme-swiss-v5 .panel.active {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .theme-swiss-v5 #ask-panel.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .theme-swiss-v5 #ask-panel .section-title {
    flex: none;
    margin: 0 0 8px;
  }

  .theme-swiss-v5 #ask-title {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .theme-swiss-v5 .section-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .theme-swiss-v5 .time-chip {
    display: inline-flex;
    max-width: 58vw;
    min-height: 31px;
    align-items: center;
    padding: 5px 9px;
    overflow: hidden;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-utility {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
  }

  .theme-swiss-v5 .ask-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .theme-swiss-v5 .result {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(6, 6, 6, 0.82);
  }

  .theme-swiss-v5 .result > .conversation-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 13px 6px;
  }

  .theme-swiss-v5 .result > .initial-composer {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
    margin: 0;
    padding: 13px;
    border: 0;
    background: transparent;
  }

  .theme-swiss-v5 #question {
    flex: 0 1 34vh;
    min-height: 128px;
    max-height: 240px;
    padding: 14px;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
  }

  .theme-swiss-v5 .button-row {
    grid-template-columns: 1.5fr 1fr;
    gap: 8px;
  }

  .theme-swiss-v5 .primary,
  .theme-swiss-v5 .secondary {
    min-height: 46px;
  }

  .theme-swiss-v5 .result > .continue-box {
    flex: none;
    margin: 8px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(9, 15, 22, 0.97);
  }

  .theme-swiss-v5 #follow-up {
    min-height: 76px;
    max-height: 132px;
  }

  .theme-swiss-v5 .continue-footer .helper {
    display: none;
  }

  .theme-swiss-v5 .continue-actions {
    width: 100%;
  }

  .theme-swiss-v5 .message {
    max-width: 100%;
    padding: 13px;
  }

  .theme-swiss-v5 .user-message {
    width: fit-content;
    max-width: 88%;
    margin-left: auto;
  }

  .theme-swiss-v5 .answer-box {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .theme-swiss-v5 .post-action-groups {
    display: grid;
    gap: 8px;
  }

  .theme-swiss-v5 .post-action-group {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .theme-swiss-v5 .post-answer-actions {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .theme-swiss-v5 .post-answer-actions .secondary {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .mobile-sheet {
    position: fixed !important;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    display: block !important;
    width: 100%;
    max-height: min(84dvh, 760px);
    overflow-y: auto !important;
    padding: 8px 18px calc(22px + env(safe-area-inset-bottom)) !important;
    border: 1px solid var(--line) !important;
    border-bottom: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    background: #050505 !important;
    box-shadow: 0 -22px 60px rgba(0, 0, 0, 0.62);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .mobile-sheet-head {
    position: sticky;
    top: -8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -4px 14px;
    padding: 10px 4px 9px;
    border-bottom: 1px solid var(--line);
    background: #050505;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .mobile-sheet-head button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 11px;
    color: var(--ink);
  }

  body.mobile-calibration-open #calibration-sheet,
  body.mobile-learning-open #learning-sheet {
    transform: translateY(0);
  }

  .mobile-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.mobile-sheet-open .mobile-sheet-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .theme-swiss-v5 .learning-rail .feedback-box {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .theme-swiss-v5 .tabbar {
    width: 100%;
    padding: 0 8px env(safe-area-inset-bottom);
  }

  .theme-swiss-v5 .tab {
    min-height: 58px;
  }

  .theme-swiss-v5 #journal-panel {
    padding: 14px 4px 24px;
  }
}

@media (min-width: 900px) {
  .theme-swiss-v5 .ask-layout {
    grid-template-columns: minmax(250px, 0.55fr) minmax(0, 1.45fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .theme-swiss-v5 .intake-card {
    grid-column: 1;
    grid-row: 1;
  }

  .theme-swiss-v5 .result {
    grid-column: 2;
    grid-row: 1;
  }

  body.theme-swiss-v5.calibration-collapsed .ask-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.theme-swiss-v5.calibration-collapsed #calibration-sheet {
    display: none;
  }

  body.theme-swiss-v5.calibration-collapsed .result {
    grid-column: 1;
  }

  .theme-swiss-v5 #learning-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: block;
    width: min(440px, 92vw);
    max-height: none;
    overflow-y: auto;
    padding: 18px 22px 30px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: #050505;
    box-shadow: -22px 0 60px rgba(0, 0, 0, 0.62);
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    overscroll-behavior: contain;
  }

  body.mobile-learning-open #learning-sheet {
    transform: translateX(0);
  }

  .theme-swiss-v5 #learning-sheet .mobile-sheet-head {
    position: sticky;
    top: -18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -4px 14px;
    padding: 10px 4px 9px;
    border-bottom: 1px solid var(--line);
    background: #050505;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .theme-swiss-v5 #learning-sheet .mobile-sheet-head button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 11px;
    background: transparent;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
  }

  .theme-swiss-v5 .mobile-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.mobile-sheet-open .mobile-sheet-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .theme-swiss-v5 #learning-sheet .feedback-box {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-swiss-v5 .mobile-sheet,
  .theme-swiss-v5 .mobile-sheet-scrim,
  .theme-swiss-v5 .tester-button {
    transition: none;
  }
}

/* Composer stability contract: the app frame is fixed; only the thread scrolls. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.theme-swiss-v5 .app-shell {
  height: 100dvh;
  min-height: 0;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.theme-swiss-v5 main,
.theme-swiss-v5 #ask-panel.active,
.theme-swiss-v5 .ask-layout,
.theme-swiss-v5 .result {
  min-height: 0;
  overflow: hidden;
}

.theme-swiss-v5 .result {
  display: flex;
  flex-direction: column;
}

.theme-swiss-v5 .result > .conversation-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
}

.theme-swiss-v5 .result > .composer-shell {
  position: static;
  flex: 0 0 auto;
  transform: none;
  overflow: visible;
}

.theme-swiss-v5 .composer-shell textarea,
.theme-swiss-v5 #question,
.theme-swiss-v5 #follow-up {
  box-sizing: border-box;
  height: auto;
  min-height: calc(1.5em + 26px);
  max-height: calc(9em + 26px);
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
}

.theme-swiss-v5 .continue-footer {
  justify-content: flex-end;
}

.theme-swiss-v5 .continue-actions {
  margin-left: auto;
}

/* Codex-style discussion: one readable thread, compact composer, no overlap. */
.theme-swiss-v5 .chat-stream {
  gap: 26px;
  margin: 0;
  padding: 4px 8px 24px;
}

.theme-swiss-v5 .chat-pair {
  gap: 16px;
  scroll-margin-top: 8px;
}

.theme-swiss-v5 .assistant-message {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  padding: 4px 0 10px;
  background: transparent;
}

.theme-swiss-v5 .user-message {
  width: fit-content;
  max-width: min(82%, 760px);
  margin-left: auto;
  padding: 12px 16px;
  background: #171717;
}

.theme-swiss-v5 .result > .continue-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin: 8px;
  padding: 9px;
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.98);
}

.theme-swiss-v5 .discussion-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  margin: 7px 8px 0;
  padding: 2px 0 1px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.theme-swiss-v5 .discussion-actions::-webkit-scrollbar {
  display: none;
}

.theme-swiss-v5 .discussion-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.76rem;
}

.theme-swiss-v5 .result > .continue-box textarea {
  min-height: calc(1.5em + 20px);
  padding: 10px 13px;
}

.theme-swiss-v5 .result > .continue-box .send-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.28rem;
  line-height: 1;
}

.theme-swiss-v5 .empty-thread-welcome {
  display: grid;
  gap: 6px;
  max-width: 700px;
  margin: 0 auto auto;
  padding: 18px 4px 30px;
  color: var(--muted);
  text-align: center;
}

.theme-swiss-v5 .empty-thread-welcome strong {
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  font-weight: 500;
  line-height: 1.2;
}

.theme-swiss-v5 .empty-thread-welcome span {
  font-size: 0.9rem;
  line-height: 1.45;
}

.theme-swiss-v5 .new-question-button {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 899px) {
  .theme-swiss-v5 .app-shell {
    height: 100dvh;
  }

  .theme-swiss-v5 .result > .initial-composer {
    display: grid;
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr) auto auto;
    justify-content: stretch;
    margin-top: 0;
    border-top: 1px solid var(--line);
    background: rgba(9, 15, 22, 0.97);
  }

  .theme-swiss-v5 #question,
  .theme-swiss-v5 #follow-up {
    flex: 0 0 auto;
    min-height: calc(1.5em + 26px);
    max-height: calc(9em + 26px);
  }

  .theme-swiss-v5 .result > .continue-box {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin: 6px;
    padding: 7px;
  }

  .theme-swiss-v5 .result > .continue-box textarea {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .theme-swiss-v5 .result > .continue-box .new-question-button {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
  }

  .theme-swiss-v5 .discussion-actions {
    margin: 5px 6px 0;
  }

  .theme-swiss-v5 .result > .continue-box .send-button {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .theme-swiss-v5 .empty-thread-welcome {
    align-self: center;
    margin: 0 0 12px;
    padding: 8px 2px 12px;
    text-align: left;
  }
}

/* Compact workspace navigation and conversation alignment. */
.theme-swiss-v5 .legacy-tabbar {
  display: none !important;
}

.theme-swiss-v5 .desktop-utility-nav {
  display: flex;
  gap: 7px;
}

.theme-swiss-v5 .desktop-utility-nav button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.theme-swiss-v5 .actionbar {
  position: fixed;
  right: max(24px, calc((100vw - 1680px) / 2 + 24px));
  bottom: 0;
  left: max(24px, calc((100vw - 1680px) / 2 + 24px));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 54px;
  padding: 0 8px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: rgba(3, 7, 12, 0.98);
  backdrop-filter: blur(12px);
}

.theme-swiss-v5 .discussion-toolbar {
  display: flex;
  min-width: 0;
  gap: 7px;
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.theme-swiss-v5 .discussion-toolbar[hidden] {
  display: none;
}

.theme-swiss-v5 .discussion-toolbar::-webkit-scrollbar {
  display: none;
}

.theme-swiss-v5 .discussion-toolbar button,
.theme-swiss-v5 .actionbar-calibrate,
.theme-swiss-v5 .actionbar-mobile-link {
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.theme-swiss-v5 .discussion-toolbar button:disabled {
  opacity: 0.58;
  color: var(--muted);
  cursor: not-allowed;
}

.theme-swiss-v5 .discussion-toolbar button.action-active,
.theme-swiss-v5 #actionbar-copy.action-active {
  border-color: rgba(242, 242, 240, 0.72);
  background: rgba(242, 242, 240, 0.1);
}

.theme-swiss-v5 .actionbar-calibrate,
.theme-swiss-v5 .actionbar-mobile-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.theme-swiss-v5 .actionbar-calibrate {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.theme-swiss-v5 .actionbar-mobile-link:disabled {
  opacity: 1;
  color: var(--text);
  cursor: not-allowed;
}

.theme-swiss-v5 .learning-send-status {
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.theme-swiss-v5 .learning-send-success {
  border: 1px solid rgba(125, 211, 152, 0.55);
  background: rgba(31, 122, 70, 0.2);
  color: #bff2ce !important;
  font-weight: 650;
}

.theme-swiss-v5 .learning-send-error {
  border: 1px solid rgba(255, 82, 72, 0.75);
  background: rgba(213, 43, 30, 0.2);
  color: #ffb4ad !important;
  font-weight: 650;
}

.theme-swiss-v5 #ask-panel {
  padding: 12px;
}

.theme-swiss-v5 #ask-panel .section-title {
  margin-bottom: 6px;
}

.theme-swiss-v5 #ask-panel .section-title-utility-only {
  justify-content: flex-end;
}

.theme-swiss-v5 .practice-company-indicator {
  margin: 0 0 10px;
}

.theme-swiss-v5 .result > .conversation-scroll {
  padding: 9px 10px 4px;
}

.theme-swiss-v5 .chat-stream {
  gap: 18px;
  margin: 0;
  padding: 0 4px 12px;
}

.theme-swiss-v5 .chat-pair {
  gap: 7px;
}

.theme-swiss-v5 .assistant-message {
  padding: 0 0 6px;
}

.theme-swiss-v5 .user-message {
  padding: 10px 14px;
}

.theme-swiss-v5 .assistant-message .message-label,
.theme-swiss-v5 .assistant-message .routed-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  margin-right: 7px;
}

@media (max-width: 899px) {
  .theme-swiss-v5 .app-shell {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .theme-swiss-v5 .desktop-utility-nav {
    display: none;
  }

  .theme-swiss-v5 .actionbar {
    right: 0;
    left: 0;
    justify-content: flex-start;
    min-height: 58px;
    padding: 0 8px;
    overflow-x: auto;
  }

  .theme-swiss-v5 .discussion-toolbar {
    overflow: visible;
  }

  .theme-swiss-v5 #ask-panel {
    padding: 0;
  }

  .theme-swiss-v5 #ask-panel .section-title {
    margin-bottom: 4px;
  }

  .theme-swiss-v5 .result > .conversation-scroll {
    padding: 7px 7px 3px;
  }
}
