:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15191e;
  --muted: #5d6673;
  --line: #e3e6ea;
  --accent: #2456d6;
  --accent-soft: #e8eefc;
  --low: #1a7f4b;
  --low-soft: #e5f4ec;
  --mid: #a35a00;
  --mid-soft: #fbf0df;
  --high: #c0262d;
  --high-soft: #fbe7e7;
  --pending: #5d6673;
  --pending-soft: #eef0f3;
  --info: var(--accent);
  --info-soft: var(--accent-soft);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e24;
    --text: #e8eaed;
    --muted: #9aa3ae;
    --line: #2b313a;
    --accent: #7ea2ff;
    --accent-soft: #1f2a44;
    --low: #4cc488;
    --low-soft: #15291f;
    --mid: #f0a540;
    --mid-soft: #2e2414;
    --high: #ff6b6b;
    --high-soft: #331a1c;
    --pending: #9aa3ae;
    --pending-soft: #22272e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* Elements with their own display value must still honour the attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

/* Header + tabs */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 0;
}
.brand {
  flex: 1;
  color: var(--muted);
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 6px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 10px;
  flex-wrap: wrap;
}
.tabs-empty { margin: 0; font-size: 14px; color: var(--muted); }
.tabs-empty-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.tab {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.tab[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .tab[aria-current="page"] { color: #0b1020; }
}
.search-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.search-open:hover, .new-patient:hover { color: var(--text); }
.new-patient {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

/* Layout */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(110px + env(safe-area-inset-bottom));
}
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.head > div { min-width: 0; }
h1 { hyphens: auto; overflow-wrap: break-word; margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.reset {
  flex: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.reset:hover { color: var(--text); }
.head-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.fav-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.fav-btn svg { fill: none; }
.fav-btn:hover { color: var(--text); }
.fav-btn[aria-pressed="true"] { color: var(--mid); border-color: var(--mid); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

/* When to use */
.usage {
  margin: 0 0 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 15px;
}
.usage summary {
  padding: 10px 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style-position: inside;
}
.usage-body { padding: 0 14px 12px; }
.usage-body p { margin: 0; hyphens: auto; overflow-wrap: break-word; }
.usage-body p + p { margin-top: 8px; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form-heading {
  margin: 10px 2px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-heading:first-child { margin-top: 0; }

.hint { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* Larger text: scales the whole layout, including the fixed result bar. */
html.large-text body { zoom: 1.18; }

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

/* Review page */
.review-page main { padding-bottom: 40px; }
.review-panel {
  margin: 16px 0 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.review-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.review-field input, .review-check textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}
.review-progress { margin: 12px 0 0; font-weight: 600; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 8px; }
.review-filter { font-size: 14px; color: var(--muted); }
.review-group {
  margin: 24px 2px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.review-card {
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--mid);
  border-radius: var(--radius);
}
.review-card[data-checked="true"] { border-left-color: var(--low); }
.review-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.review-title { font-weight: 600; }
.review-status { flex: none; font-size: 13.5px; color: var(--muted); }
.review-body { padding: 0 14px 14px; }
.review-body h3 { margin: 16px 0 6px; font-size: 15px; }
.review-body p { margin: 0 0 6px; }
.review-criteria { margin: 0; padding-left: 18px; }
.review-criteria li { margin: 4px 0; }
.review-criteria ul { margin: 2px 0; padding-left: 18px; font-size: 14.5px; }
.review-crit-heading { list-style: none; margin-left: -18px !important; font-weight: 600; color: var(--muted); }
.review-examples { display: grid; gap: 8px; }
.review-example {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--low-soft);
}
.review-example[data-ok="false"] { background: var(--high-soft); }
.review-example h4 { margin: 0 0 4px; font-size: 14px; }
.review-inputs {
  margin: 0 0 6px;
  font: 13.5px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-result { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; }
.review-ok { font-weight: 700; }
.review-source { display: block; margin: 4px 0; color: var(--accent); font-size: 14px; overflow-wrap: anywhere; }
.review-check { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.review-check label { font-weight: 600; }

/* Start page */
.home-title { font-size: 28px; }
.home-intro { margin: 6px 0 16px; color: var(--muted); }
.home-search {
  position: relative;
  display: flex;
  align-items: center;
}
.home-search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
#home-search {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px 10px 42px;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#home-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.home-group h2 {
  margin: 22px 2px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.home-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 600px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
}
.home-card {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.12s;
}
.home-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.home-link {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 10px 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
}
.home-name { display: block; font-weight: 600; }
.home-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  hyphens: auto;
}
.home-tip { margin: 22px 2px 0; font-size: 14px; color: var(--muted); }
.home-link:focus-visible, .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Yes/no rows */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background-color 0.12s;
}
.row-text { flex: 1; min-width: 0; }
.row-label { font-weight: 500; }
.row .pts {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted);
}
.switch {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.row[aria-pressed="true"] .switch { background: var(--accent); }
.row[aria-pressed="true"] .switch::after { transform: translateX(18px); }
.row[aria-pressed="true"] .pts { color: var(--accent); font-weight: 600; }

/* Multiple-choice items */
.choice {
  margin: 0;
  padding: 12px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.choice.missing { border-color: var(--mid); }
.choice { scroll-margin-top: calc(var(--header-h, 100px) + 12px); }
.choice-label { float: left; width: 100%; padding: 0; font-weight: 600; }
.choice-label + * { clear: both; }
.choice > .hint { margin: 0 0 2px; }
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background-color 0.12s;
}
.opt-pts {
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
}
.opt-text { min-width: 0; padding-top: 2px; }
.row-label, .opt-label, .hint { hyphens: auto; overflow-wrap: break-word; }
.opt-label { font-size: 15px; }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option[aria-checked="true"] .opt-pts { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .option[aria-checked="true"] .opt-pts { color: #0b1020; }
}

/* Number inputs */
.num-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.num-input {
  width: 9em;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.num-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.choice.invalid .num-input { border-color: var(--high); }
.unit-label { color: var(--muted); }
.units { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.unit {
  min-height: 42px;
  padding: 0 12px;
  border: none;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.unit + .unit { border-left: 1px solid var(--line); }
.unit[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.num-error { margin: 6px 0 0; font-size: 13.5px; color: var(--high); }
.num-error:empty { display: none; }
.num-shared { display: none; margin: 6px 0 0; font-size: 13.5px; color: var(--accent); }
.choice.prefilled .num-shared { display: block; }
.choice.prefilled .num-input { border-style: dashed; border-color: var(--accent); }

@media (hover: hover) {
  .row:hover, .option:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
}
.row:focus-visible, .option:focus-visible, .tab:focus-visible, .reset:focus-visible, .bar-jump:focus-visible,
.unit:focus-visible, .fav-btn:focus-visible, .search-open:focus-visible, .copy:focus-visible, .star:focus-visible, .search-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Interpretation card */
.detail {
  --c: var(--pending);
  --c-soft: var(--pending-soft);
  margin-top: 20px;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--c);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-kicker { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-label { margin: 2px 0 6px; font-size: 21px; color: var(--c); }
.detail-text { margin: 0; }
.detail-warn {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mid-soft);
  font-size: 14px;
}
.indices { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.index-row {
  --c: var(--pending);
  --c-soft: var(--pending-soft);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--c-soft);
  border-left: 4px solid var(--c);
}
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.index-name { font-weight: 600; }
.index-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c); white-space: nowrap; }
.index-note { display: block; font-size: 14px; color: var(--muted); hyphens: auto; overflow-wrap: break-word; }
.copy {
  margin-top: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.related { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.related h3, .sources h3 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.related-link {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.related-link:hover { border-color: var(--accent); }
.related-name { font-weight: 600; color: var(--accent); }
.related-name::after { content: " →"; }
.review { margin: 10px 0 0; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; }
.review[data-state="open"] { background: var(--mid-soft); }
.review[data-state="done"] { background: var(--low-soft); }
.review a { color: var(--accent); }
.footer { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.footer a { color: var(--accent); }
.notes { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.notes li + li { margin-top: 4px; }
.sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sources h3 { margin-bottom: 6px; }
.sources a {
  display: block;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sources a + a { margin-top: 6px; }
.sources a:hover { text-decoration: underline; }

.disclaimer { margin: 20px 2px 0; font-size: 13px; color: var(--muted); }

/* Sticky result bar */
.bar {
  --c: var(--pending);
  --c-soft: var(--pending-soft);
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(688px, calc(100% - 24px));
  display: flex;
  /* A label that does not fit next to the number moves to its own line. */
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--c);
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.16);
  z-index: 20;
}
.bar-name { min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--muted); align-self: center; hyphens: auto; }
.bar-total {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--c);
}
.bar-max { white-space: nowrap; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-label {
  margin-left: auto;
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--c-soft);
  color: var(--c);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: right;
  flex: 0 1 auto;
  min-width: 4.5em;
  /* Long labels wrap between words (or hyphenate) instead of being cut off. */
  hyphens: auto;
  border-radius: 12px;
}
.bar-jump {
  align-self: center;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .bar-jump { color: #0b1020; }
}

:is(.bar, .detail, .index-row)[data-level="low"] { --c: var(--low); --c-soft: var(--low-soft); }
:is(.bar, .detail, .index-row)[data-level="mid"] { --c: var(--mid); --c-soft: var(--mid-soft); }
:is(.bar, .detail, .index-row)[data-level="high"] { --c: var(--high); --c-soft: var(--high-soft); }
:is(.bar, .detail, .index-row)[data-level="info"] { --c: var(--info); --c-soft: var(--info-soft); }

/* Toast above the result bar */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.25);
  z-index: 30;
}
.toast[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .toast-action { color: #0b1020; }
}
.toast-action {
  flex: none;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Search dialog */
.search {
  width: min(640px, calc(100% - 24px));
  max-height: min(80vh, 720px);
  margin: max(env(safe-area-inset-top), 6vh) auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.25);
}
.search::backdrop { background: rgba(10, 14, 20, 0.45); }
.search-inner { display: flex; flex-direction: column; max-height: inherit; }
.search-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.search-head form { display: contents; }
#search-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
#search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-close {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
}
.search-list { overflow-y: auto; padding: 4px 12px 12px; }
.search-group h2 {
  margin: 12px 4px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-item { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.search-item:hover { background: var(--bg); }
.search-link {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.search-link[aria-current="page"] .search-name { color: var(--accent); }
.search-name { font-weight: 600; }
.star {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.star::before { content: "☆"; }
.star[aria-pressed="true"] { color: var(--mid); }
.star[aria-pressed="true"]::before { content: "★"; }
.search-empty { margin: 16px 4px; color: var(--muted); }

@media (max-width: 520px) {
  .options { grid-template-columns: 1fr; gap: 6px; }
  .option { min-height: 44px; align-items: center; }
  .opt-text { padding-top: 0; }
}

@media (max-width: 520px) {
  .tabs { gap: 5px; }
  .tab { padding: 5px 11px; font-size: 14px; }
}

@media (max-width: 380px) {
  .bar-name { display: none; }
  h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .top, .bar, .head-actions, .copy, .search, .toast, .related, .footer { display: none; }
  main { padding-bottom: 0; }
}
