:root {
  --bg: #f3f5f1;
  --panel: #ffffff;
  --panel-2: #f6f8f4;
  --ink: #17201b;
  --muted: #5f6b63;
  --line: #dfe5dc;
  --track: #e3e9e0;
  --accent: #2f7d57;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1e8;
  --practice: #b7791f;
  --practice-ink: #ffffff;
  --danger: #c2413f;
  --danger-soft: #fbe9e8;
  --ok: #2e8f55;
  --ok-soft: #e2f3e8;
  --warn: #b7791f;
  --warn-soft: #fbf1dc;
  --shadow: 0 2px 12px rgba(23, 32, 27, 0.06);
  --radius: 16px;
  --radius-sm: 11px;
  --tabbar: 62px;
  --topbar: 52px;
  --font:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Inter,
    Roboto,
    system-ui,
    sans-serif;
  --mono:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html:not([data-effective-theme=light]) {
    --bg: #0f1512;
    --panel: #171f1a;
    --panel-2: #1c2620;
    --ink: #eef2ee;
    --muted: #9aa89e;
    --line: #2a3830;
    --track: #26332b;
    --accent: #5fc48e;
    --accent-ink: #0f1512;
    --accent-soft: #1d3327;
    --practice: #e0a84a;
    --practice-ink: #1a1408;
    --danger: #f07f7c;
    --danger-soft: #3a2422;
    --ok: #5fc48e;
    --ok-soft: #1d3327;
    --warn: #e0a84a;
    --warn-soft: #382d18;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
html[data-effective-theme=dark] {
  --bg: #0f1512;
  --panel: #171f1a;
  --panel-2: #1c2620;
  --ink: #eef2ee;
  --muted: #9aa89e;
  --line: #2a3830;
  --track: #26332b;
  --accent: #5fc48e;
  --accent-ink: #0f1512;
  --accent-soft: #1d3327;
  --practice: #e0a84a;
  --practice-ink: #1a1408;
  --danger: #f07f7c;
  --danger-soft: #3a2422;
  --ok: #5fc48e;
  --ok-soft: #1d3327;
  --warn: #e0a84a;
  --warn-soft: #382d18;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}
p {
  margin: 0 0 10px;
}
code {
  font-family: var(--mono);
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.desktop-only {
  display: none;
}
.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-login {
  justify-content: center;
  margin-bottom: 18px;
}
.brand-small .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  background: var(--panel);
  color: var(--ink);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn.secondary {
  background: var(--panel);
  border-color: var(--line);
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.btn.wide {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.link-btn {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
}
.link-btn.danger {
  color: var(--danger);
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: none;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-size: 24px;
  margin-bottom: 6px;
}
.login-card h2 {
  font-size: 19px;
  margin-bottom: 6px;
}
.auth-form {
  margin-top: 16px;
}
.auth-form label {
  display: block;
  margin-bottom: 12px;
}
.auth-form label span,
.field > span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}
.auth-form .btn {
  margin-top: 6px;
}
.auth-form .link-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.auth-status {
  color: var(--ok);
  font-size: 14px;
  margin: 12px 0 0;
}
.auth-error {
  color: var(--danger);
  font-size: 14px;
  margin: 10px 0 0;
  white-space: pre-line;
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=time],
input[type=date],
input[type=search],
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  resize: vertical;
  line-height: 1.4;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field:last-child {
  margin-bottom: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.inline-form .field {
  flex: 1;
  margin: 0;
}
.stack-form .btn {
  margin-top: 4px;
}
.app-shell {
  min-height: 100vh;
}
.main-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 20px);
}
.top-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar) + env(safe-area-inset-top));
  background: var(--bg);
  margin: 0 -16px 8px;
  padding-left: 16px;
  padding-right: 16px;
}
.page-title {
  font-size: 19px;
  flex: 1;
}
#themeToggle .icon {
  display: none;
}
html[data-theme=light] #themeToggle .icon-theme-light {
  display: block;
}
html[data-theme=dark] #themeToggle .icon-theme-dark {
  display: block;
}
html[data-theme=auto] #themeToggle .icon-theme-auto,
html:not([data-theme]) #themeToggle .icon-theme-auto {
  display: block;
}
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 0;
}
.tab.active {
  color: var(--accent);
}
.tab .icon {
  width: 24px;
  height: 24px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h2.later {
  margin-top: 18px;
}
.panel h3 {
  font-size: 14px;
  margin: 16px 0 6px;
}
.panel h3:first-child {
  margin-top: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h2 {
  margin: 0;
}
.num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.panel .btn + .btn {
  margin-top: 8px;
}
.panel .btn.secondary {
  width: 100%;
}
.panel .inline-form .btn,
.panel .stack-form .btn,
.panel .item .btn,
.panel .user-actions .btn,
.panel .move-row .btn,
.panel .panel-head .btn,
.panel .note-box .btn {
  width: auto;
}
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--warn-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 6px 0 12px;
  font-size: 14px;
}
.notice strong {
  display: block;
}
.notice span {
  color: var(--muted);
  font-size: 13px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
  max-width: calc(100% - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.save-status {
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0 0;
  white-space: pre-line;
}
.save-status.ok {
  color: var(--ok);
}
.save-status.error {
  color: var(--danger);
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.detail-row:last-child {
  border-bottom: 0;
}
.detail-row span {
  color: var(--muted);
  flex: 1;
}
.detail-row strong {
  text-align: right;
  font-weight: 600;
}
.segmented {
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 12px;
}
.segmented button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px;
}
.segmented button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.kpi strong {
  display: block;
  font-size: 21px;
  line-height: 1.2;
}
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.lead {
  font-size: 14px;
  margin: 2px 0 12px;
}
.foot {
  text-align: center;
  margin: 18px 0 8px;
}
.bar {
  flex: 1;
  min-width: 40px;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  display: inline-block;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s;
}
.bar.practice i {
  background: var(--practice);
}
.ring {
  width: 112px;
  height: 112px;
  display: block;
}
.ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 11;
}
.ring-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset .3s;
}
.ring-num {
  fill: var(--ink);
  font: 700 30px var(--font);
  text-anchor: middle;
  dominant-baseline: middle;
}
.ring-unit {
  fill: var(--muted);
  font: 600 12px var(--font);
  text-anchor: middle;
}
.hero {
  display: flex;
  gap: 16px;
  align-items: center;
}
.hero-ring {
  flex: none;
}
.hero-body {
  flex: 1;
  min-width: 0;
}
.hero-body h2 {
  font-size: 19px;
  margin-bottom: 4px;
}
.split {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 8px 0;
}
.split > span:first-child {
  width: 58px;
  flex: none;
  font-weight: 600;
}
.split em,
.area-row em,
.block-meta em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  min-width: 44px;
  text-align: right;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.split.wide {
  margin: 0 0 12px;
}
.split.wide > span:first-child {
  width: auto;
}
.accent-panel {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.area-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  width: 100%;
  text-align: left;
}
.area-row.as-button {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  min-height: 46px;
}
.area-row.as-button:first-of-type {
  border-top: 0;
}
.area-name {
  width: 42%;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.area {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--muted);
  flex: none;
}
.area-M,
.area-C {
  background: #c2413f;
}
.area-A {
  background: #2f6fb5;
}
.area-R {
  background: #5d6b78;
}
.area-H {
  background: #7a4fa3;
}
.area-P {
  background: #b7791f;
}
.area-AB {
  background: #2f8a7e;
}
.area-W {
  background: #a8553a;
}
.area-S {
  background: #4b7a3a;
}
.area-G {
  background: var(--accent);
  color: var(--accent-ink);
}
.next-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--ink);
  min-height: 60px;
}
.next-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.next-card strong {
  display: block;
}
.next-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.next-card .num {
  background: var(--accent);
  color: var(--accent-ink);
}
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
  color: var(--ink);
  min-height: 76px;
}
.tile strong {
  display: block;
  font-size: 15px;
}
.tile span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.block-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.block-card.complete {
  border-color: var(--ok);
}
.block-main {
  flex: 1;
  min-width: 0;
}
.block-main strong {
  display: block;
  font-size: 16px;
}
.block-main small {
  display: block;
  font-size: 13px;
  margin: 2px 0 8px;
}
.block-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.block-meta .bar {
  margin-left: 4px;
}
.num.big {
  width: 38px;
  height: 38px;
  font-size: 16px;
  font-weight: 700;
}
.block-card.complete .num.big {
  background: var(--ok);
  color: #fff;
}
.block-card > .icon,
.next-card > .icon,
.drug-head > .icon {
  color: var(--muted);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 0;
}
.back .icon {
  width: 18px;
  height: 18px;
}
.block-head p {
  margin: 12px 0 0;
}
.new-list,
.plain {
  margin: 4px 0 4px;
  padding-left: 20px;
  font-size: 14px;
}
.new-list li,
.plain li {
  margin-bottom: 4px;
}
.plain.small {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 20px;
}
.pager .btn .icon {
  width: 18px;
  height: 18px;
}
.item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.panel h2 + .item,
.panel > .item:first-child {
  border-top: 0;
  padding-top: 0;
}
.item.flash,
.drug.flash,
.panel.flash,
.term.flash {
  animation: flash 1.8s ease-out;
}
@keyframes flash {
  0%, 40% {
    box-shadow: 0 0 0 3px var(--accent);
  }
  100% {
    box-shadow: 0 0 0 3px transparent;
  }
}
.tick {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: none;
  margin-top: 1px;
}
.tick .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}
.is-done > .tick {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.is-shown > .tick {
  background: var(--practice);
  border-color: var(--practice);
  color: var(--practice-ink);
}
.item-body {
  flex: 1;
  min-width: 0;
}
.item-title {
  font-weight: 600;
  font-size: 15px;
}
.item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.item-sub .area {
  width: 20px;
  height: 20px;
  font-size: 11px;
  border-radius: 6px;
}
.item-text {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 8px;
}
.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  min-height: 30px;
}
.item .btn.small {
  margin: 2px 0 6px;
}
.note-btn {
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.note-btn.has {
  color: var(--accent);
}
.note-box {
  margin-top: 6px;
}
.note-box textarea {
  margin-bottom: 6px;
}
.note-box .btn {
  width: auto;
}
.skill-states,
.drug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
  align-items: center;
}
.state-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.state-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}
.state-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.state-btn.active.shown {
  background: var(--practice);
  border-color: var(--practice);
  color: var(--practice-ink);
}
.links {
  font-size: 13px;
  line-height: 1.9;
  margin: 2px 0;
}
.src {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-right: 4px;
}
.src:hover {
  text-decoration: underline;
}
.icon.ext {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: -1px;
  margin-left: 3px;
}
.links .pill {
  margin-right: 8px;
}
.links small {
  margin-left: 6px;
}
.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.quiz .bar {
  display: block;
  margin-bottom: 16px;
}
.panel h2.quiz-q {
  font-size: 18px;
  line-height: 1.35;
  display: block;
  margin-bottom: 14px;
}
.quiz-options {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.quiz-option {
  text-align: left;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--panel-2);
  font-size: 15px;
  color: var(--ink);
}
.quiz-option.right {
  border-color: var(--ok);
  background: var(--ok-soft);
  font-weight: 600;
  opacity: 1;
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  opacity: 1;
}
.quiz-option.dim {
  opacity: .55;
}
.quiz-explain {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  background: var(--panel-2);
  border-left: 4px solid var(--danger);
}
.quiz-explain.ok {
  border-left-color: var(--ok);
}
.quiz-explain p {
  margin: 4px 0;
}
.quiz-result {
  text-align: center;
}
.quiz-result .hero-ring {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}
.panel.quiz-result h2 {
  display: block;
}
.quiz-score {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0;
}
.filter {
  margin: 12px 0 10px;
}
.drug {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.drug.retired {
  border-style: dashed;
}
.drug.retired .drug-name strong {
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.drug-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 14px;
  color: var(--ink);
  min-height: 60px;
}
.drug-name {
  flex: 1;
  min-width: 0;
}
.drug-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.drug-name strong {
  display: block;
  font-size: 16px;
}
.drug-name small {
  display: block;
  font-size: 12px;
}
.drug.open .drug-head > .icon {
  transform: rotate(90deg);
}
.drug-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
.drug-field {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.drug-field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 3px;
}
.drug-field strong {
  font-weight: 500;
  font-size: 15px;
  display: block;
}
.drug-field em {
  font-size: 13px;
}
.drug-body > p {
  margin: 10px 0;
}
.legend-line {
  display: flex;
  gap: 18px;
}
.group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 18px 0 8px;
}
.card-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.card-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 0;
  font-size: 14px;
}
.card-line .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--muted);
}
.card-line.do .icon {
  fill: currentColor;
  stroke: none;
  color: var(--accent);
}
.card-line.do span {
  font-weight: 600;
}
.card-line.text::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  margin: 8px 5px 0 6px;
  flex: none;
}
.card-sec h2 {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}
.card-m h2,
.card-c h2 {
  border-left-color: #c2413f;
}
.card-a h2 {
  border-left-color: #2f6fb5;
}
.card-r h2 {
  border-left-color: #5d6b78;
}
.card-h1 h2,
.card-h2 h2 {
  border-left-color: #7a4fa3;
}
.card-p h2 {
  border-left-color: #b7791f;
}
.card-ab h2 {
  border-left-color: #2f8a7e;
}
.card-w h2 {
  border-left-color: #a8553a;
}
.card-s h2 {
  border-left-color: #4b7a3a;
}
.table-wrap {
  overflow-x: auto;
  margin: 10px -4px 4px;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}
thead th {
  background: var(--panel-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
tbody th {
  background: var(--panel-2);
}
.term {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.term:first-child {
  border-top: 0;
  padding-top: 0;
}
.term strong {
  font-size: 15px;
}
.term em {
  font-style: normal;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.term span {
  color: var(--muted);
}
.hit {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: var(--ink);
  min-height: 46px;
}
.panel.hits h2 + .hit {
  border-top: 0;
  padding-top: 0;
}
.hit strong {
  display: block;
  font-size: 15px;
}
.hit small {
  display: block;
  font-size: 13px;
}
.later-gap {
  margin-top: 14px;
}
.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.board-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.board-row.me {
  background: var(--accent-soft);
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 10px;
  border-top-color: transparent;
}
.rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.rank.top1 {
  background: #d9a520;
  border-color: #d9a520;
  color: #fff;
}
.rank.top2 {
  background: #9aa3ad;
  border-color: #9aa3ad;
  color: #fff;
}
.rank.top3 {
  background: #b8793f;
  border-color: #b8793f;
  color: #fff;
}
.board-name {
  flex: 1;
  min-width: 0;
}
.board-name strong {
  font-size: 15px;
}
.board-name .bar {
  display: block;
  margin-top: 5px;
}
.board-pts {
  text-align: right;
  flex: none;
}
.board-pts strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.board-pts small {
  color: var(--muted);
  font-size: 11px;
}
.menu-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.menu-item:first-child {
  border-top: 0;
}
.menu-item .icon {
  color: var(--accent);
}
.login-foot {
  text-align: center;
  margin: 18px 0 0;
}
.move-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.move-row select {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}
select {
  background-image:
    linear-gradient(
      45deg,
      transparent 50%,
      var(--muted) 50%),
    linear-gradient(
      135deg,
      var(--muted) 50%,
      transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 6px 0 12px;
}
.settings-row strong {
  word-break: break-all;
  text-align: right;
}
.mfa-setup {
  margin-top: 12px;
}
.mfa-qr svg {
  width: 176px;
  height: 176px;
  display: block;
  margin: 8px 0;
}
.mfa-secret {
  display: block;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 10px;
  color: var(--muted);
}
.danger-zone {
  border-color: var(--danger);
}
.app-meta {
  text-align: center;
  margin: 20px 0 8px;
}
.search-field {
  position: relative;
  display: block;
  margin: 4px 0 12px;
}
.search-field .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  margin-top: -11px;
  color: var(--muted);
}
.search-field input {
  padding-left: 42px;
}
.hb-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.hb-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.hb-section h2 {
  font-size: 17px;
  margin-bottom: 8px;
}
.hb-section h3 {
  font-size: 14px;
  margin: 12px 0 4px;
}
.hb-section p,
.hb-section li {
  font-size: 14px;
}
.hb-section ol,
.hb-section ul {
  padding-left: 20px;
  margin: 4px 0 10px;
}
.hb-note {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  margin: 6px 0 10px;
}
.hb-warn {
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  margin: 6px 0 10px;
}
.hb-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
}
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
}
.activity-day {
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.activity-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.activity-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
  margin-top: 3px;
}
.user-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child {
  border-bottom: 0;
}
.user-row .who {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.user-row .who strong {
  word-break: break-all;
}
.user-row .who small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.user-meta {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0;
}
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.ok {
  color: var(--ok);
}
.pill.wait {
  color: var(--warn);
}
.pill.error {
  color: var(--danger);
}
.pill.admin {
  color: var(--accent);
}
.mail-events .detail-row {
  font-size: 13px;
}
.sidebar {
  flex-direction: column;
  gap: 16px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  text-align: left;
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-bottom {
  margin-top: auto;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.profile-card strong {
  display: block;
  font-size: 14px;
}
.profile-card small {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: none;
}
@media (min-width: 900px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: flex;
  }
  .app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
  }
  .main-area {
    padding: 0 32px 40px;
    max-width: 800px;
  }
  .top-bar {
    margin: 0 -32px 12px;
    padding-left: 32px;
    padding-right: 32px;
  }
  .page-title {
    font-size: 24px;
  }
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .area-name {
    width: 36%;
  }
  .toast {
    bottom: 24px;
  }
}
@media (max-width: 420px) {
  .hero {
    gap: 12px;
  }
  .hero .ring {
    width: 92px;
    height: 92px;
  }
}
.link-btn.inline {
  padding: 0;
  font-size: inherit;
  min-height: 0;
}
.bar.track i {
  background: var(--ink);
  opacity: .55;
}
.track {
  margin-bottom: 22px;
}
.track-head {
  margin: 4px 2px 12px;
}
.track-head h2 {
  font-size: 20px;
  margin: 0 0 2px;
  letter-spacing: -.01em;
}
.track-head h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}
.track-head p {
  margin: 0 0 8px;
}
.pill.track-pill {
  color: var(--accent);
  margin-right: 2px;
}
.panel h3.group-title {
  margin: 14px 0 6px;
}
.panel h3.group-title:first-of-type {
  margin-top: 4px;
}
.method-group:not(:has(.card-sec:not(.hidden))) {
  display: none;
}
.card-sec h2 .area {
  margin-right: 8px;
}


/* ---- generated: flexbox gap fallback for Safari < 14.1 ----
   Written by scripts/build-frontend.py. Do not edit; edit styles.css.
   Active only when the boot script finds no real flex gap support. */
.no-flex-gap .brand > * + * { margin-left: 10px; }

.no-flex-gap .btn > * + * { margin-left: 8px; }

.no-flex-gap .check > * + * { margin-left: 10px; }

.no-flex-gap .inline-form > * + * { margin-left: 8px; }

.no-flex-gap .top-bar > * + * { margin-left: 12px; }

.no-flex-gap .tab > * + * { margin-top: 3px; }

.no-flex-gap .panel h2 > * + * { margin-left: 10px; }

.no-flex-gap .panel-head > * + * { margin-left: 10px; }

.no-flex-gap .notice > * + * { margin-left: 12px; }

.no-flex-gap .chip-list > * + * { margin-left: 8px; }
.no-flex-gap .chip-list > * { margin-bottom: 8px; }

.no-flex-gap .detail-row > * + * { margin-left: 14px; }

.no-flex-gap .hero > * + * { margin-left: 16px; }

.no-flex-gap .split > * + * { margin-left: 10px; }

.no-flex-gap .area-row > * + * { margin-left: 10px; }

.no-flex-gap .next-card > * + * { margin-left: 12px; }

.no-flex-gap .block-card > * + * { margin-left: 12px; }

.no-flex-gap .block-meta > * + * { margin-left: 6px; }

.no-flex-gap .back > * + * { margin-left: 4px; }

.no-flex-gap .pager > * + * { margin-left: 10px; }

.no-flex-gap .item > * + * { margin-left: 12px; }

.no-flex-gap .item-sub > * + * { margin-left: 6px; }

.no-flex-gap .item-foot > * + * { margin-left: 10px; }

.no-flex-gap .skill-states, .no-flex-gap .drug-actions > * + * { margin-left: 8px; }
.no-flex-gap .skill-states, .no-flex-gap .drug-actions > * { margin-bottom: 8px; }

.no-flex-gap .state-btn > * + * { margin-left: 6px; }

.no-flex-gap .quiz-top > * + * { margin-left: 10px; }

.no-flex-gap .drug-head > * + * { margin-left: 8px; }

.no-flex-gap .drug-pills > * + * { margin-left: 6px; }
.no-flex-gap .drug-pills > * { margin-bottom: 6px; }

.no-flex-gap .legend-line > * + * { margin-left: 18px; }

.no-flex-gap .card-line > * + * { margin-left: 8px; }

.no-flex-gap .board-row > * + * { margin-left: 12px; }

.no-flex-gap .menu-item > * + * { margin-left: 12px; }

.no-flex-gap .move-row > * + * { margin-left: 6px; }

.no-flex-gap .settings-row > * + * { margin-left: 12px; }

.no-flex-gap .hb-toc > * + * { margin-left: 8px; }
.no-flex-gap .hb-toc > * { margin-bottom: 8px; }

.no-flex-gap .activity-chart > * + * { margin-left: 3px; }

.no-flex-gap .user-row .who > * + * { margin-left: 10px; }

.no-flex-gap .user-actions > * + * { margin-left: 6px; }
.no-flex-gap .user-actions > * { margin-bottom: 6px; }

.no-flex-gap .side-nav > * + * { margin-top: 4px; }

.no-flex-gap .nav-item > * + * { margin-left: 10px; }

.no-flex-gap .profile-card > * + * { margin-left: 10px; }


/* Auto margins restated: the reserves above are more specific than the
   rules that set them, and would otherwise cancel every push-to-the-end. */
.no-flex-gap .main-area { margin-left: auto; margin-right: auto; }
