:root {
  --ink: #18212d;
  --muted: #687386;
  --line: #d8dee8;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --blue: #1c4f82;
  --blue-dark: #12395e;
  --red: #bd1f2d;
  --green: #257455;
  --amber: #946200;
  --shadow: 0 16px 36px rgba(24, 33, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f8;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #f8fafc;
  background: linear-gradient(180deg, #0d2d4a 0%, #122f4d 52%, #1d2734 100%);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #8198b4;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand h1,
.topbar h2 {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 30px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #d9e6f2;
  text-align: left;
  background: transparent;
  border-radius: 7px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.prep-window {
  position: absolute;
  right: 18px;
  bottom: 22px;
  left: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.prep-window span,
.prep-window small {
  display: block;
  color: #b7c8db;
  font-size: 12px;
}

.prep-window strong {
  display: block;
  margin: 3px 0 8px;
  font-size: 20px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.top-actions,
.question-actions,
.mode-row,
.panel-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h3,
.panel h3,
.scenario-grid h4 {
  margin: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.question-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 108px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
  line-height: 1.1;
}

.split,
.practice-layout,
.story-layout,
.scenario-grid,
.mock-layout {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.split {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.practice-layout,
.mock-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.story-layout,
.scenario-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
}

.panel {
  padding: 18px;
}

.daily-plan {
  display: grid;
  gap: 10px;
}

.daily-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid #e1e7ef;
  border-radius: 7px;
}

.daily-item strong {
  color: var(--blue);
}

.focus-list {
  margin: 0;
  padding-left: 18px;
}

.focus-list li {
  margin-bottom: 10px;
  color: #344154;
  line-height: 1.45;
}

.primary,
.ghost,
.mode-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  font-weight: 700;
}

.primary {
  color: #ffffff;
  background: var(--blue);
}

.primary:hover {
  background: var(--blue-dark);
}

.ghost,
.mode-chip {
  color: var(--blue);
  background: #eef4fa;
  border: 1px solid #d5e3f0;
}

.ghost:hover,
.mode-chip.active {
  color: #ffffff;
  background: var(--blue);
}

.danger {
  color: var(--red);
  background: #fff1f2;
  border-color: #f4c4ca;
}

.danger:hover {
  color: #ffffff;
  background: var(--red);
}

.practice-panel {
  min-height: 690px;
}

.mode-row {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.question-card {
  padding: 18px;
  box-shadow: none;
}

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

.question-card h3,
#mockQuestion {
  min-height: 74px;
  margin: 14px 0 16px;
  font-size: 24px;
  line-height: 1.22;
}

.sarr-box {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.sarr-box.active {
  display: grid;
}

.sarr-box div {
  min-height: 84px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dfe7f0;
  border-radius: 7px;
}

.sarr-box strong,
.sarr-box span {
  display: block;
}

.sarr-box span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.answer,
textarea,
input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

.answer,
textarea {
  min-height: 260px;
  padding: 14px;
  line-height: 1.5;
  resize: vertical;
}

.answer.compact {
  min-height: 180px;
  margin-top: 12px;
}

input,
select {
  min-height: 40px;
  padding: 0 10px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #344154;
  font-size: 13px;
  font-weight: 700;
}

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

.feedback-empty,
.feedback-card,
.story-card,
.history-card,
.scenario-step {
  padding: 14px;
  background: var(--soft);
  border: 1px solid #dfe7f0;
  border-radius: 7px;
}

.feedback-card {
  display: grid;
  gap: 12px;
}

.score-grid {
  display: grid;
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar {
  height: 8px;
  overflow: hidden;
  background: #dce4ed;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.feedback-card h4,
.story-card h4 {
  margin: 0;
}

.feedback-card p,
.story-card p,
.history-card p {
  margin: 0;
  color: #39475a;
  line-height: 1.45;
}

.story-list,
.history-list {
  display: grid;
  gap: 10px;
}

.story-card {
  display: grid;
  gap: 9px;
}

.story-tags {
  color: var(--muted);
  font-size: 12px;
}

.story-actions {
  display: flex;
  gap: 8px;
}

.scenario-step {
  min-height: 170px;
  margin: 12px 0;
  font-size: 19px;
  line-height: 1.35;
}

.full {
  width: 100%;
  margin-top: 10px;
}

.mock-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.slider-list {
  display: grid;
  gap: 16px;
}

.slider-row {
  display: grid;
  gap: 7px;
}

.slider-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.slider-row input {
  min-height: 24px;
}

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

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .prep-window {
    position: static;
    margin-top: 18px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split,
  .practice-layout,
  .story-layout,
  .scenario-grid,
  .mock-layout,
  .sarr-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .panel-head,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .question-card h3,
  #mockQuestion {
    font-size: 20px;
  }
}
