:root {
  color-scheme: light;
  --ink: #10201e;
  --muted: #58706b;
  --line: #d8e4e1;
  --panel: #ffffff;
  --wash: #eff8f6;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #b45309;
  --red: #b91c1c;
  --blue: #1d4ed8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #e8f5f2 0, #f8fbfa 360px);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 28px clamp(16px, 5vw, 56px) 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 13px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: 0; }
h2 { font-size: 22px; margin-bottom: 0; }
h3 { font-size: 18px; line-height: 1.45; }

.status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-strip span, .pill, .question-meta span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 80px;
}

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

.dashboard article, .panel, .question-card, .lab-card, .coverage-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(16, 32, 30, .06);
}

.dashboard article { padding: 16px; }
.metric-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.dashboard strong { font-size: 26px; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

button {
  border: 0;
  background: var(--teal);
  color: white;
  border-radius: 7px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--teal-dark); }
.tab, .mode, .ghost { background: #dcebe8; color: var(--ink); }
.tab.active, .mode.active { background: var(--teal); color: white; }
.ghost:hover, .tab:hover, .mode:hover { background: #c7ddd8; }

.panel {
  display: none;
  padding: clamp(16px, 3vw, 28px);
}
.panel.active { display: block; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

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

.note-grid { margin-top: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.plan-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  background: #fbfdfc;
}

.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f7fbfa;
}
.note b { display: block; margin-bottom: 8px; color: var(--teal-dark); }
.note p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }

.plan-item input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--teal); }
.plan-item strong { display: block; margin-bottom: 5px; }
.plan-item span { color: var(--muted); line-height: 1.55; font-size: 14px; }

.segmented {
  display: flex;
  background: #eef5f3;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.question-card { padding: 20px; }
.question-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.choices { display: grid; gap: 8px; margin: 18px 0; }
.choice { text-align: left; background: #f2f7f5; color: var(--ink); border: 1px solid var(--line); justify-content: flex-start; }
.choice.correct { background: #dcfce7; color: #14532d; border-color: #86efac; }
.choice.wrong { background: #fee2e2; color: var(--red); border-color: #fecaca; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.explain { color: var(--muted); line-height: 1.65; margin: 14px 0 0; }

.lab-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 14px; }
.coverage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.coverage-grid article { padding: 18px; }
.lab-card { padding: 18px; }
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #0b1715;
  color: #d5f5ef;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.55;
}
.compact { padding-left: 18px; line-height: 1.8; color: var(--muted); }
.wrong-list { display: grid; gap: 10px; }
.wrong-item { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fbfdfc; }
.sync-box { max-width: 820px; line-height: 1.65; color: var(--muted); }
label { display: grid; gap: 6px; font-weight: 700; color: var(--ink); }
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  font: inherit;
}
.small { font-size: 13px; }
.install-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .28);
}

@media (max-width: 820px) {
  .app-header { display: block; }
  .status-strip { margin-top: 16px; }
  .dashboard, .plan-list, .note-grid, .lab-grid, .coverage-grid { grid-template-columns: 1fr; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
}
