:root {
  --bg: #f5f3ee;
  --paper: #fffef9;
  --ink: #121211;
  --muted: #62615b;
  --line: rgba(18, 18, 17, 0.18);
  --soft-line: rgba(18, 18, 17, 0.09);
  --tile: #e8e7e1;
  --tile-hover: #deddd5;
  --tile-active: #d8d9d3;
  --tile-all: #d9d9d3;
  --dark: #151512;
  --dark-2: #20201c;
  --light-on-dark: #fffdf7;
  --muted-on-dark: rgba(255, 253, 247, 0.64);
  --accent: #d8d8d0;
  --accent-ink: #30312e;
  --cyan: #5b9898;
  --coral: #c98268;
  --violet: #8680bd;
  --radius: 8px;
  --shadow: 0 22px 60px rgba(18, 18, 17, 0.14);
  --topbar: 68px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 254, 249, 0.96) 0%, rgba(246, 243, 236, 0.94) 44%, rgba(235, 231, 221, 0.98) 100%),
    linear-gradient(128deg, rgba(18, 18, 17, 0.035) 0%, rgba(255, 253, 247, 0) 36%, rgba(255, 253, 247, 0.34) 72%, rgba(18, 18, 17, 0.025) 100%),
    var(--bg);
  background-attachment: fixed;
  font-family: Inter, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid rgba(255, 253, 247, 0.18);
  background: rgba(21, 21, 18, 0.94);
  color: var(--light-on-dark);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.32);
  border-radius: var(--radius);
  color: var(--accent);
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-title {
  display: block;
  font-size: 14px;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted-on-dark);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions,
.language-switch,
.route-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switch {
  padding: 3px;
  border: 1px solid rgba(255, 253, 247, 0.24);
  border-radius: var(--radius);
}

.language-switch button,
.icon-button,
.ghost-button,
.primary-button,
.secondary-button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 860;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.language-switch button {
  min-width: 38px;
  border: 0;
  background: transparent;
  color: var(--muted-on-dark);
}

.language-switch button.active,
.language-switch button:hover {
  background: var(--accent);
  color: var(--ink);
}

.icon-button,
.ghost-button {
  border-color: rgba(255, 253, 247, 0.24);
  background: transparent;
  color: var(--light-on-dark);
}

.icon-button:hover,
.ghost-button:hover {
  background: rgba(255, 253, 247, 0.12);
  color: var(--light-on-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.primary-button {
  background: var(--ink);
  color: var(--paper);
}

.primary-button:hover {
  background: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button {
  background: #e4e2da;
  color: var(--ink);
}

.secondary-button:hover {
  background: #d6d4ca;
  transform: translateY(-1px);
}

.route-banner {
  display: none;
  align-items: center;
  min-height: 34px;
  padding: 8px clamp(14px, 3vw, 34px);
  border-bottom: 0;
  background: rgba(245, 243, 238, 0.82);
}

.route-banner strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

.route-banner span {
  color: var(--muted);
  font-size: 13px;
}

.main-view {
  min-height: calc(100vh - var(--topbar));
}

.screen {
  min-height: calc(100vh - var(--topbar));
  padding: clamp(30px, 5vw, 82px) clamp(16px, 5vw, 72px);
}

.screen-inner {
  width: min(1720px, 100%);
  margin: 0 auto;
}

.onboarding {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.68fr);
  gap: clamp(22px, 5vw, 80px);
  align-items: stretch;
  min-height: 100vh;
}

.intro-panel {
  display: grid;
  align-content: space-between;
  gap: 44px;
  padding: clamp(24px, 5vw, 60px);
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.intro-copy {
  max-width: 790px;
}

.kicker {
  margin: 0 0 12px;
  color: #373630;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: 0;
  font-weight: 950;
  max-width: 980px;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(32px, 4.4vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 950;
  overflow-wrap: anywhere;
}

h3 {
  font-size: 18px;
  line-height: 1.16;
  font-weight: 890;
  overflow-wrap: anywhere;
}

p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.66;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 820px;
  margin-top: 22px;
  color: #30302c;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.62;
}

.signal-rail {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  border: 0;
  background: transparent;
}

.signal-step {
  min-height: 180px;
  display: grid;
  align-content: space-between;
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(rgba(18, 18, 17, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 18, 17, 0.045) 1px, transparent 1px),
    #e7e5de;
  background-size: 22px 22px;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.signal-step span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.signal-step strong {
  font-size: clamp(17px, 2vw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(18px, 4vw, 42px);
  background: var(--dark);
  color: var(--light-on-dark);
  min-width: 0;
  max-width: 100vw;
}

.login-panel h2 {
  font-size: clamp(34px, 6vw, 68px);
}

.login-panel p {
  color: var(--muted-on-dark);
}

.form-grid {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.text-input,
.select-input,
.text-area {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #ebe9e2;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--soft-line);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.text-input:hover,
.select-input:hover,
.text-area:hover,
.text-input:focus,
.select-input:focus,
.text-area:focus {
  background: var(--paper);
  box-shadow: inset 0 0 0 2px rgba(18, 18, 17, 0.18);
}

.login-panel .text-input,
.login-panel .select-input {
  border-color: rgba(255, 253, 247, 0.22);
  background: #24241f;
  color: var(--light-on-dark);
}

.text-area {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-panel .field-hint {
  color: var(--muted-on-dark);
}

.model-picker {
  position: relative;
  display: grid;
  gap: 7px;
}

.model-picker-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #24241f;
  color: var(--light-on-dark);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 253, 247, 0.18);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.model-picker-button:hover,
.model-picker.open .model-picker-button {
  background: #2e2e28;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 247, 0.3), 0 14px 30px rgba(0, 0, 0, 0.2);
}

.model-picker-button strong,
.model-option strong {
  display: block;
  font-size: 13px;
  line-height: 1.15;
}

.model-picker-button small,
.model-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted-on-dark);
  font-size: 11px;
  line-height: 1.25;
}

.model-picker-chevron {
  font-size: 18px;
  opacity: 0.7;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.model-picker.open .model-picker-chevron {
  transform: rotate(180deg);
}

.model-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 6px;
  max-height: 310px;
  overflow: auto;
  border-radius: calc(var(--radius) + 2px);
  padding: 8px;
  background: rgba(21, 21, 18, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 253, 247, 0.12);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.model-picker.open .model-menu {
  opacity: 1;
  transform: translateY(8px) scale(1);
  pointer-events: auto;
}

.model-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px;
  background: transparent;
  color: var(--light-on-dark);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.model-option:hover,
.model-option.active {
  background: rgba(255, 253, 247, 0.1);
  transform: translateY(-1px);
}

.model-option code {
  flex: 0 0 auto;
  color: rgba(255, 253, 247, 0.62);
  font-size: 11px;
}

.notice {
  border: 1px solid rgba(255, 253, 247, 0.2);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 247, 0.06);
}

.notice strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.status-line {
  min-height: 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.topic-card {
  min-height: 320px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  border: 0;
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 34px);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--soft-line);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.topic-card.stub {
  cursor: default;
  color: #64635d;
  background: #e6e2d8;
  box-shadow: none;
}

.topic-card h3 {
  font-size: clamp(34px, 4vw, 60px);
  line-height: 0.98;
}

.topic-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.workspace-flow {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  margin-top: 38px;
}

.control-stack,
.result-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.control-stack .panel,
.result-stack .panel {
  width: 100%;
}

.panel {
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.82);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(18, 18, 17, 0.08);
  transition: box-shadow 180ms ease, background 180ms ease;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(18, 18, 17, 0.08);
}

.panel-head strong {
  font-size: 13px;
  text-transform: uppercase;
}

.panel-body {
  padding: 16px;
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 12px;
}

.selector-tile {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 14px;
  background: var(--tile);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(18, 18, 17, 0.04);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.selector-tile:hover {
  background: var(--tile-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(18, 18, 17, 0.08);
}

.selector-tile strong {
  font-size: 15px;
  line-height: 1.05;
}

.selector-tile small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.selector-tile.active {
  background: var(--tile-active);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 2px rgba(18, 18, 17, 0.13);
}

.selector-tile.all {
  background: var(--tile-all);
  color: var(--ink);
}

.selector-tile.all.active {
  background: #d0d1ca;
  color: var(--accent-ink);
}

.selector-tile.active small,
.selector-tile.all small {
  color: rgba(48, 64, 45, 0.68);
}

.selector-tile.all small {
  color: var(--muted);
}

.industry-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e8e7e1;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.chip.active,
.chip:hover {
  background: #32332f;
  color: var(--paper);
  transform: translateY(-1px);
}

.histogram {
  min-height: 180px;
  padding: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #e5e2d8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.bar-value {
  text-align: right;
  font-size: 12px;
  font-weight: 900;
}

.inline-direction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.mini-direction-card {
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px;
  background: #ebe9e2;
  box-shadow: inset 0 0 0 1px var(--soft-line);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mini-direction-card:hover {
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(18, 18, 17, 0.1);
}

.mini-direction-card.selected {
  background: #dddeda;
  box-shadow: inset 0 0 0 2px rgba(18, 18, 17, 0.16);
}

.mini-direction-card > button:first-child {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mini-direction-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-direction-card strong {
  font-size: 17px;
  line-height: 1.15;
}

.mini-direction-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.generation-progress {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(18, 18, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 18, 17, 0.035) 1px, transparent 1px),
    #fbfaf4;
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.generation-progress span {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(18, 18, 17, 0.18);
  border-top-color: #777a70;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.generation-progress strong {
  font-size: 13px;
  text-transform: uppercase;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-pill {
  border: 0;
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 253, 247, 0.62);
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.score-pill span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-pill strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.reference-list,
.evidence-list,
.chat-messages {
  display: grid;
  gap: 8px;
}

.reference-link {
  display: grid;
  gap: 4px;
  border: 0;
  border-radius: var(--radius);
  padding: 9px;
  text-decoration: none;
  background: #ebe9e2;
  box-shadow: inset 0 0 0 1px var(--soft-line);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.reference-link:hover {
  background: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(18, 18, 17, 0.08);
}

.reference-link strong {
  font-size: 12px;
  line-height: 1.25;
}

.reference-link span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.research-block {
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  background: #ebe9e2;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.research-block h3 {
  margin-bottom: 10px;
}

.research-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.drawer {
  position: fixed;
  top: var(--topbar);
  right: 0;
  z-index: 40;
  width: min(520px, 100vw);
  height: calc(100vh - var(--topbar));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 0;
  background: var(--paper);
  box-shadow: -18px 0 50px rgba(18, 18, 17, 0.16);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--soft-line);
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.studio-grid {
  display: grid;
  gap: 14px;
}

.memory-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
  font-size: 13px;
}

.chat-drawer {
  width: min(560px, 100vw);
}

.chat-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.chat-messages {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.chat-message {
  max-width: 86%;
  border: 0;
  border-radius: var(--radius);
  padding: 10px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--soft-line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.user {
  justify-self: end;
  background: var(--accent);
}

.chat-message.assistant {
  justify-self: start;
}

.chat-form {
  display: grid;
  gap: 8px;
}

.chat-form textarea {
  min-height: 92px;
}

.empty-state {
  border: 0;
  border-radius: var(--radius);
  padding: 18px;
  background: #ebe9e2;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 70;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

button:active,
.selector-tile:active,
.chip:active,
.topic-card:active,
.mini-direction-card:active,
.reference-link:active {
  transform: translateY(0) scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .onboarding,
  .workspace-flow,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .onboarding {
    display: flex;
    flex-direction: column;
  }

  .login-panel {
    order: -1;
    min-height: 100vh;
  }

  .login-panel h2 {
    font-size: clamp(30px, 8vw, 44px);
  }

  .login-panel > * {
    width: min(100%, 350px);
  }

  .login-panel .language-switch {
    width: fit-content;
  }

  .intro-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar: 98px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
  }

  .screen {
    padding: 22px 12px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 64px);
  }

  .signal-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selector-grid {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .route-banner {
    display: none;
  }

  .route-actions {
    flex-wrap: wrap;
  }
}
