/* Theme: dark (default), light, or system (prefers-color-scheme). data-theme set in <head> + theme.js */
html,
html[data-theme="dark"] {
  --bg: #0f1218;
  --card: #171b24;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --accent: #5cc8ff;
  --good: #7cd992;
  --bad: #ff7b7b;
  --line: #2a3140;
  --input-bg: #101420;
  --gradient-spot: #1a2040;
  --btn-inline-bg: #252b38;
  --callout-sub: #c8d0df;
  --row-rec: #1c2434;
  --row-rec-2: #182030;
  --pick-pill-fg: #0a1018;
  --pick-subtle-text: #d6ecff;
  --pick-subtle-bg: #2a3f55;
  --pick-subtle-border: #3d5a78;
  --table-th-bg: #131722;
  --placeholder: #5a6478;
  --primary-btn-mix: #2a3b55;
  --badge-bg: #2a303c;
  --alert-error-bg: #3a1f1f;
  --alert-error-text: #ffc9c9;
  --alert-error-border: #662020;
  --alert-good-bg: #1f2e22;
  --alert-good-text: #c0f0cc;
  --alert-good-border: #2d5a2f;
  --alert-warn-bg: #2e2a1f;
  --alert-warn-text: #ffe8a8;
  --alert-warn-border: #5a4a2d;
  --code-bg: #131722;
  --tier-mobile-bg: #131722;
  --footer-meta: #8b95a8;
  --card-shadow: rgba(0, 0, 0, 0.25);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[data-theme="light"] {
  --bg: #f1f4fa;
  --card: #ffffff;
  --text: #121820;
  --muted: #5a6478;
  --accent: #007cbd;
  --good: #0d7d45;
  --bad: #c53030;
  --line: #cfd6e2;
  --input-bg: #ffffff;
  --gradient-spot: #cfe8fb;
  --btn-inline-bg: #e8ecf4;
  --callout-sub: #3d4d5f;
  --row-rec: #e4f1fb;
  --row-rec-2: #d9ebf8;
  --pick-pill-fg: #0a1a28;
  --pick-subtle-text: #164a70;
  --pick-subtle-bg: #b8dcf4;
  --pick-subtle-border: #4a9ecc;
  --table-th-bg: #eef2f8;
  --placeholder: #8a96a8;
  --primary-btn-mix: #b8d9f0;
  --badge-bg: #e2e8f0;
  --alert-error-bg: #fce8e8;
  --alert-error-text: #8b1d1d;
  --alert-error-border: #e8a4a4;
  --alert-good-bg: #e6f5ea;
  --alert-good-text: #1a5c2e;
  --alert-good-border: #9cd4a8;
  --alert-warn-bg: #fdf8e4;
  --alert-warn-text: #7a5f12;
  --alert-warn-border: #e8d48c;
  --code-bg: #eef2f8;
  --tier-mobile-bg: #eef2f8;
  --footer-meta: #6b7380;
  --card-shadow: rgba(20, 35, 60, 0.09);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f1f4fa;
    --card: #ffffff;
    --text: #121820;
    --muted: #5a6478;
    --accent: #007cbd;
    --good: #0d7d45;
    --bad: #c53030;
    --line: #cfd6e2;
    --input-bg: #ffffff;
    --gradient-spot: #cfe8fb;
    --btn-inline-bg: #e8ecf4;
    --callout-sub: #3d4d5f;
    --row-rec: #e4f1fb;
    --row-rec-2: #d9ebf8;
    --pick-pill-fg: #0a1a28;
    --pick-subtle-text: #164a70;
    --pick-subtle-bg: #b8dcf4;
    --pick-subtle-border: #4a9ecc;
    --table-th-bg: #eef2f8;
    --placeholder: #8a96a8;
    --primary-btn-mix: #b8d9f0;
    --badge-bg: #e2e8f0;
    --alert-error-bg: #fce8e8;
    --alert-error-text: #8b1d1d;
    --alert-error-border: #e8a4a4;
    --alert-good-bg: #e6f5ea;
    --alert-good-text: #1a5c2e;
    --alert-good-border: #9cd4a8;
    --alert-warn-bg: #fdf8e4;
    --alert-warn-text: #7a5f12;
    --alert-warn-border: #e8d48c;
    --code-bg: #eef2f8;
    --tier-mobile-bg: #eef2f8;
    --footer-meta: #6b7380;
    --card-shadow: rgba(20, 35, 60, 0.09);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1000px 600px at 20% 0%, var(--gradient-spot), var(--bg));
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

p.lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 68ch;
}

p.lead--tight {
  margin-top: -0.75rem;
}

header.page-header--tagline-only {
  margin-bottom: 0.35rem;
  padding-bottom: 0.2rem;
}

header.page-header--tagline-only p.lead--tight {
  margin-bottom: 0.55rem;
}

.lead-label {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-inline {
  background: var(--btn-inline-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-inline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fieldset-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 66ch;
  flex: 1 1 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
a:hover {
  border-bottom-color: var(--accent);
}

form.row-count {
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

form.row-count label {
  color: var(--muted);
  font-size: 0.95rem;
}

form.row-count select {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.15rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 32px var(--card-shadow);
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
  color: var(--accent);
}

/* Recommended choice callout + row highlight */
.callout-pick {
  background: color-mix(in srgb, var(--accent) 12%, var(--card) 88%);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line) 55%);
  border-radius: 10px;
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1rem;
}
.callout-pick__headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.4rem;
}
.callout-pick__sub {
  color: var(--callout-sub);
  font-size: 0.9rem;
  margin: 0;
  max-width: 70ch;
}

tr.row-recommended > td,
tr.row-recommended-marginal > td {
  background: var(--row-rec);
  box-shadow: inset 3px 0 0 0 var(--accent);
}
tr.row-recommended-marginal > td {
  background: var(--row-rec-2);
  box-shadow: inset 3px 0 0 0 color-mix(in srgb, var(--accent) 60%, #555 40%);
}
.pick-pill {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pick-pill-fg);
  background: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  font-weight: 600;
  vertical-align: 0.15em;
}
.pick-pill--subtle {
  color: var(--pick-subtle-text);
  background: var(--pick-subtle-bg);
  border: 1px solid var(--pick-subtle-border);
  font-size: 0.58rem;
  font-weight: 500;
}

.grid-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  padding: 0 0.1rem;
}

.grid-head--rect,
.tier-row--rect {
  grid-template-columns: 1.15fr 0.95fr 0.95fr 1fr;
}

.grid-head.grid-head--abuse:not(.grid-head--rect),
.tier-row.tier-row--abuse:not(.tier-row--rect) {
  grid-template-columns: 1.25fr 1fr 1fr 0.95fr 0.85fr;
}

.grid-head.grid-head--rect.grid-head--abuse,
.tier-row.tier-row--rect.tier-row--abuse {
  grid-template-columns: 1fr 0.85fr 0.85fr 0.95fr 0.8fr 0.75fr;
}

.grid-head--mass,
.tier-row--mass {
  grid-template-columns: 1.35fr 1fr 1fr;
}

/* Attribute tab: 4 cols (name, amount, unit volume + unit selector, price). */
.grid-head--attr,
.tier-row--attr {
  grid-template-columns: 1.3fr 1fr 1.1fr 1fr;
}

.tier-field--volume .volume-pair {
  display: flex;
  gap: 0.35rem;
  align-items: stretch;
  width: 100%;
}

.tier-field--volume .volume-pair input {
  flex: 1 1 auto;
  min-width: 0;
}

.tier-field--volume .volume-pair select {
  flex: 0 0 auto;
  min-width: 3.5rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.4rem;
  font-size: 0.95rem;
}

.tier-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tier-field {
  display: contents;
}

.tier-field__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tier-row input {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  font-size: 0.95rem;
}

.tier-row input::placeholder {
  color: var(--placeholder);
}

.fieldset-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin: 0.9rem 0 1.1rem;
  padding: 0.75rem 0;
  border: none;
  border-top: 1px solid var(--line);
}

.fieldset-inline legend {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0.2rem 0.5rem 0;
  width: 100%;
}

.fieldset-inline label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.fieldset-inline input[type="radio"] {
  accent-color: var(--accent);
}

.currency {
  max-width: 5rem;
}

label.currency-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.25rem;
}
label.currency-label ~ input {
  max-width: 4.5rem;
  margin-left: 0.35rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.4rem;
}

button[type="submit"].primary {
  background: color-mix(in srgb, var(--accent) 20%, var(--primary-btn-mix));
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
}
button[type="submit"].primary:hover {
  background: color-mix(in srgb, var(--accent) 32%, var(--primary-btn-mix));
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--muted);
  margin-left: 0.4rem;
}

.alert {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.alert-error {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border: 1px solid var(--alert-error-border);
}
.alert-good {
  background: var(--alert-good-bg);
  color: var(--alert-good-text);
  border: 1px solid var(--alert-good-border);
}
.alert-warn {
  background: var(--alert-warn-bg);
  color: var(--alert-warn-text);
  border: 1px solid var(--alert-warn-border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.5rem 0 1.25rem;
}
table.data th,
table.data td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
  text-align: left;
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  background: var(--table-th-bg);
}
table.data td {
  color: var(--text);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.5rem 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footnote {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
  max-width: 70ch;
}

.site-footer {
  margin-top: 1.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  max-width: 70ch;
}

.site-footer > p + p {
  margin-top: 0.45rem;
}

.site-footer__rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.55rem 0 0.35rem;
  max-width: 70ch;
}

.site-footer__build {
  margin: 0;
  max-width: 70ch;
  font-size: 0.78rem;
  color: var(--footer-meta);
  line-height: 1.45;
  word-break: break-word;
}

.site-footer__meta {
  max-width: 70ch;
  font-size: 0.78rem;
  color: var(--footer-meta);
  line-height: 1.45;
}

.site-footer__meta p {
  margin: 0.12rem 0 0;
}

.site-footer__meta p:first-child {
  margin-top: 0;
}

/* Single-row deploy: "Deployed {date, time} — release {version}" */
.site-footer__deploy-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35rem;
  row-gap: 0.15rem;
  max-width: 70ch;
}

.site-footer__deploy-prefix {
  flex-shrink: 0;
}

.site-footer__deploy-separator {
  flex-shrink: 0;
  opacity: 0.85;
}

.site-footer__release-lead {
  flex-shrink: 0;
}

.site-footer__release-version {
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.site-footer__deploy-time,
.site-footer__build-line {
  font-variant-numeric: tabular-nums;
}

.releases-main__title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.page-header--releases {
  margin-bottom: 1rem;
  border-bottom: none;
}

.changelog-body {
  max-width: 72ch;
  font-size: 0.95rem;
  line-height: 1.55;
}

.changelog-body h1,
.changelog-body h2,
.changelog-body h3 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.changelog-body h1 {
  font-size: 1.35rem;
}

.changelog-body h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
}

.changelog-body h3 {
  font-size: 1.02rem;
}

.changelog-body p,
.changelog-body ul,
.changelog-body ol {
  margin: 0.5rem 0;
}

.changelog-body ul,
.changelog-body ol {
  padding-left: 1.35rem;
}

.changelog-body code {
  font-size: 0.88em;
}

.changelog-body pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

.changelog-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

.changelog-body th,
.changelog-body td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.changelog-body th {
  background: var(--table-th-bg);
}

.caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  max-width: 66ch;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  max-width: 66ch;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: -0.5rem -1.25rem 1rem;
  padding: 0.5rem 1.25rem 0.65rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--card-shadow);
}

.site-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.site-nav__brand {
  color: var(--text);
  text-decoration: none;
  flex: 0 1 auto;
}

.site-nav__brand:hover {
  color: var(--accent);
}

.site-nav__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

.site-nav__tabs.tabs {
  flex: 1 1 auto;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  border-bottom: none;
  gap: 0.25rem 0.4rem;
}

.site-nav__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  flex: 0 0 auto;
}

.site-nav__controls .theme-field {
  margin: 0;
}

.beta-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.beta-toggle {
  width: 1rem;
  height: 1rem;
}

html[data-beta="0"] .beta-only {
  display: none !important;
}

html[data-beta="1"] .tiers-units-fallback {
  display: none !important;
}

html[data-beta="1"] .beta-hint-when-off {
  display: none !important;
}

.changelog-preamble {
  margin-bottom: 1.25rem;
}

.changelog-details {
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.65rem 0.65rem;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.changelog-summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.35rem 0;
}

.changelog-details__body {
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  border-bottom: none;
}
.tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--card) 80%, transparent);
}
.tab--active {
  color: var(--text);
  background: var(--card);
  border-color: var(--line);
  box-shadow: inset 0 -2px 0 0 var(--accent);
}
.tab--active:hover {
  color: var(--text);
}

.grid-head--ship,
.tier-row--ship {
  grid-template-columns: 1.35fr 1fr 1fr;
}

header.page-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
}

.page-header__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.page-header__top h1 {
  margin: 0;
}

.theme-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-field label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.theme-select {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

@media (max-width: 640px) {
  .grid-head,
  .tier-row {
    grid-template-columns: 1fr;
  }
  .grid-head {
    display: none;
  }
  .tier-row {
    background: var(--tier-mobile-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem;
  }

  .tier-row--rect {
    grid-template-columns: 1fr 1fr;
    column-gap: 0.6rem;
    row-gap: 0.45rem;
  }

  .tier-row--rect .tier-field--name {
    grid-column: 1 / -1;
  }

  .tier-row--rect .tier-field--rect-len {
    grid-column: 1;
  }

  .tier-row--rect .tier-field--rect-wid {
    grid-column: 2;
  }

  .tier-row--rect .tier-field--price {
    grid-column: 1 / -1;
  }

  .tier-row--rect.tier-row--abuse .tier-field--abuse {
    grid-column: 1 / -1;
  }

  .tier-row--rect .tier-field {
    margin-bottom: 0;
  }

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

  .tier-row--ship .tier-field--name {
    grid-column: 1;
  }

  .tier-row--ship .tier-field--ship-days,
  .tier-row--ship .tier-field--price {
    grid-column: 1;
  }

  /* Attribute tab stacks every field full-width on mobile; the inline g/oz
     selector inside .volume-pair stays a flex row beside its number input. */
  .tier-row--attr {
    grid-template-columns: 1fr;
  }
  .tier-row--attr .tier-field {
    grid-column: 1;
  }

  .tier-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
  }

  .tier-field:last-child {
    margin-bottom: 0;
  }

  .tier-field__label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }

  /* Larger tap targets and 16px font on form controls to prevent iOS zoom-on-focus. */
  .tier-row input,
  form.row-count select,
  form.row-count input,
  form.notify-form input[type="email"],
  .fieldset-inline input[type="text"],
  .theme-select {
    min-height: 44px;
    font-size: 16px;
  }

  /* Notify form: stack vertically with comfortable spacing. */
  form.notify-form {
    gap: 0.85rem;
  }
  form.notify-form .cf-turnstile {
    margin: 0.25rem 0;
  }

  /* Stack the "Number of options" row so each control is full-width and easy to tap. */
  form.row-count {
    gap: 0.5rem;
  }
  form.row-count label {
    flex: 1 1 100%;
    margin-bottom: -0.25rem;
  }
  form.row-count select {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Primary action button: full-width, comfortable height. */
  button[type="submit"].primary {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  /* Horizontally scroll the nav tabs instead of wrapping; keeps a single tidy row. */
  .site-nav__inner {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }
  .site-nav__tabs.tabs {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    gap: 0.25rem;
  }
  .site-nav__tabs.tabs::-webkit-scrollbar {
    display: none;
  }
  .site-nav__tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 0.4rem 0.7rem;
  }
  .site-nav__controls {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
  }

  /* Slightly tighter card padding on phones. */
  .card {
    padding: 1rem 0.95rem 1.15rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 1rem 0.85rem 2.25rem;
  }
  .card {
    padding: 0.9rem 0.85rem 1.05rem;
  }
  .site-nav {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  h1 {
    font-size: 1.3rem;
  }
  .site-nav__title {
    font-size: 1.05rem;
  }
}

/* /notify: bulleted summary under the lead. Tight, muted, reasonable indent. */
.notify-bullets {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.5;
}
.notify-bullets li + li {
  margin-top: 0.2rem;
}

/* Anchor that wants to look/behave like a primary button (notify result CTA). */
a.button-link {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border-radius: 6px;
  text-decoration: none;
}
a.button-link.primary {
  color: #fff;
  background: var(--accent, #2b6cb0);
}
a.button-link.primary:hover,
a.button-link.primary:focus-visible {
  filter: brightness(1.08);
}

/* Focused alert banner gets a visible ring; tabindex=-1 means click-focus only. */
.alert[tabindex]:focus-visible {
  outline: 2px solid var(--accent, #2b6cb0);
  outline-offset: 2px;
}

/* Share-analysis (1.4.0). Calculate + Share sit in the same action row; the
   share button is secondary so it visually steps back from Calculate. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
}
button.share-button {
  appearance: none;
  background: transparent;
  border: 1px solid var(--accent, #2b6cb0);
  color: var(--accent, #2b6cb0);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
button.share-button:hover,
button.share-button:focus-visible {
  background: rgba(43, 108, 176, 0.08);
}
button.share-button:focus-visible {
  outline: 2px solid var(--accent, #2b6cb0);
  outline-offset: 2px;
}

/* "Shared analysis from YYYY-MM-DD" badge: muted, low-key, no panel chrome. */
.shared-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  margin: 0.25rem 0 0.7rem;
  font-size: 0.85rem;
  border-radius: 999px;
  background: rgba(43, 108, 176, 0.10);
  color: var(--muted-fg, #555);
  border: 1px dashed rgba(43, 108, 176, 0.35);
}

/* Bottom-center toast for clipboard/share feedback. Auto-fades; not aria-live
   because share.js uses role="status" which already announces it once. */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 999px;
  font-size: 0.92rem;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.share-toast--err {
  background: rgba(160, 30, 30, 0.92);
}
.share-toast--fade {
  opacity: 0;
}

@media (max-width: 640px) {
  button.share-button {
    width: 100%;
    min-height: 48px;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
