:root {
  color-scheme: light;
  --page: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --raised: #ffffff;
  --text: #111214;
  --text-2: #4b4f58;
  --muted: #868b95;
  --border: rgba(17, 18, 20, 0.08);
  --border-strong: rgba(17, 18, 20, 0.16);
  --accent: #2a78d6;
  --accent-soft: rgba(42, 120, 214, 0.12);
  --error: #d03b3b;
  --hover: rgba(17, 18, 20, 0.05);
  --scrim: rgba(17, 18, 20, 0.28);
  --shadow-sm: 0 1px 2px rgba(17, 18, 20, 0.04), 0 1px 3px rgba(17, 18, 20, 0.04);
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 8px 24px rgba(17, 18, 20, 0.06);
  --shadow-pop: 0 12px 32px rgba(17, 18, 20, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --page: #0e0f11;
    --surface: #17181b;
    --surface-2: #1d1f23;
    --raised: #30333a;
    --text: #f3f4f6;
    --text-2: #b9bdc6;
    --muted: #7f848e;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #4d95ea;
    --accent-soft: rgba(77, 149, 234, 0.16);
    --error: #ef7272;
    --hover: rgba(255, 255, 255, 0.06);
    --scrim: rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0e0f11;
  --surface: #17181b;
  --surface-2: #1d1f23;
  --raised: #30333a;
  --text: #f3f4f6;
  --text-2: #b9bdc6;
  --muted: #7f848e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #4d95ea;
  --accent-soft: rgba(77, 149, 234, 0.16);
  --error: #ef7272;
  --hover: rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Top bar: brand, search, settings ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--page) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 24px;
  height: 24px;
}

/* Sun setting over the sea; the same drawing as favicon.svg. */
.brand-mark .sun {
  fill: #f08a3c;
  stroke: none;
}

.brand-mark .rays {
  stroke: #f08a3c;
}

.brand-mark .waves {
  stroke: #2f8fc4;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Search ---------- */

.searches {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.compare {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  flex-shrink: 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.pill-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.pill-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
}

.icon-btn-sm svg {
  width: 18px;
  height: 18px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search input[type='search'] {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: border-color 150ms, box-shadow 150ms;
}

.search input[type='search']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search input[type='search']::placeholder {
  color: var(--muted);
}

.search [role='listbox'] {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  max-height: min(440px, 70vh);
  overflow-y: auto;
}

.search [role='listbox'] li {
  display: grid;
  grid-template-columns: 2em 1fr auto;
  gap: 0 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search [role='listbox'] li[aria-selected='true'],
.search [role='listbox'] li:hover {
  background: var(--hover);
}

.search [role='listbox'] .flag {
  grid-row: span 2;
  justify-self: center;
}

.search [role='listbox'] .name {
  font-weight: 600;
}

.search [role='listbox'] .sub {
  grid-column: 2 / 4;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.search [role='listbox'] .pop {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.search [role='listbox'] .more {
  display: block;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.875rem;
  color: var(--accent);
  text-align: center;
}

.search [role='listbox'] .none {
  display: block;
  color: var(--muted);
  cursor: default;
}

/* Flags: small rounded images with a hairline so white flags stay visible. */
.flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
  vertical-align: -2px;
  flex-shrink: 0;
}

.flag-none {
  background: var(--surface-2);
}

/* ---------- Page ---------- */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px 24px;
  /* Legend edge labels may poke past the last chip on a wrapped row. */
  overflow-x: clip;
}

.status {
  margin: 10px 2px 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.status:empty {
  display: none;
}

.status.is-error {
  color: var(--error);
}

.status.is-loading::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 8px;
  vertical-align: -0.1em;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  padding: 15vh 0 0;
  text-align: center;
  color: var(--text-2);
}

.empty p {
  margin: 0 0 16px;
}

.example-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.example-list button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.example-list button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ---------- Chart ---------- */

.chart {
  padding-top: 14px;
}

/* Comparison: the charts stack, separated by a hairline. */
.chart:not([hidden]) ~ .chart:not([hidden]) {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
}

.key::before {
  content: '';
  width: 26px;
  height: 10px;
  border-radius: 3px;
}

.key.warm::before {
  background: linear-gradient(90deg, #f5df72, #ec9037, #c43b2b, #8c1f1d);
}

.key.cold::before {
  background: linear-gradient(90deg, #bfe1a1, #4fab89, #2f69b0, #22438c);
}

.key.dirtier::before {
  background: linear-gradient(90deg, #f6dca0, #e68c4c, #a8445e, #6e2f6b);
}

.key.cleaner::before {
  background: linear-gradient(90deg, #d3ecc4, #74c08a, #2d8282, #1f5e6e);
}

.key.wetter::before {
  background: linear-gradient(90deg, #cfe3ef, #74a9d6, #2f63a6, #1d3b78);
}

.key.drier::before {
  background: linear-gradient(90deg, #f1e4bf, #d6ae66, #9d6a2f, #704a20);
}

.chart-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.chart-head h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.plot-wrap {
  margin-top: 8px;
  width: 100%;
}

.plot-wrap canvas {
  display: block;
  touch-action: pan-y;
}

/* Band legend: coloured chips with the edge temperatures between them. */
.bands {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 4px;
  font-size: 0.8125rem;
}

.bands li {
  position: relative;
  display: flex;
  cursor: default;
  border-radius: 8px;
}

.bands .chip {
  display: block;
  padding: 3px 10px;
  border-radius: 8px;
  min-width: 28px;
  min-height: 1.75em;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 120ms;
}

.bands li:hover .chip {
  transform: translateY(-1px);
}

.bands.is-steps .chip {
  min-width: 34px;
}

.bands .edge {
  position: absolute;
  top: calc(100% + 3px);
  right: -2px;
  transform: translateX(50%);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.footnote {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Settings drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
  animation: fade 150ms ease-out;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(340px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 0s linear 200ms;
}

.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 200ms ease;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.0625rem;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row.is-inactive {
  opacity: 0.45;
}

.field > label,
.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.unit-sym {
  text-transform: none;
}

input[type='number'],
select {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 40px;
  padding: 0 12px;
  width: 100%;
  transition: border-color 150ms, box-shadow 150ms;
}

input[type='number']:hover,
select:hover {
  border-color: var(--border-strong);
}

input[type='number']:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
  position: relative;
}

.select select {
  appearance: none;
  padding-right: 36px;
  text-overflow: ellipsis;
}

.select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.segmented {
  display: flex;
  height: 40px;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segmented label {
  flex: 1;
  display: flex;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.9375rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.segmented input:checked + span {
  background: var(--raised);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
}

.hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.error {
  margin: -8px 0 0;
  color: var(--error);
  font-size: 0.875rem;
}

/* Toggle switch */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch .track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 150ms;
}

.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 150ms;
}

.switch input:checked + .track {
  background: var(--accent);
}

.switch input:checked + .track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Tooltip ---------- */

.tooltip {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  padding: 10px 12px;
  font-size: 0.8125rem;
  min-width: 160px;
  max-width: calc(100vw - 16px);
}

.tt-when {
  color: var(--text-2);
}

.tt-value {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 2px 0 4px;
}

.tt-bin {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text-2);
}

.tt-extra {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
}

/* ---------- View tabs ---------- */

.views {
  display: flex;
  gap: 4px;
  margin: 10px 0 0;
  border-bottom: 1px solid var(--border);
}

.view-tab {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text-2);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 6px 10px 8px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.view-tab:hover {
  color: var(--text);
}

.view-tab[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px 6px 0 0;
}

/* ---------- Planner ---------- */

:root {
  --plan-good: #4c9f5b;
  --plan-wet: #8d8fc2;
  --plan-hot: #e08a4f;
  --plan-cool: #a9c7e3;
  --plan-now: #d03b3b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --plan-good: #4fa862;
    --plan-wet: #7376b0;
    --plan-hot: #c97540;
    --plan-cool: #4f6f91;
  }
}
:root[data-theme='dark'] {
  --plan-good: #4fa862;
  --plan-wet: #7376b0;
  --plan-hot: #c97540;
  --plan-cool: #4f6f91;
}

.planner {
  padding-top: 14px;
}

.criteria {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 10px 0 4px;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.criteria-lead {
  font-weight: 600;
  color: var(--text);
}

.crit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.crit input[type='number'] {
  width: 4.5em;
  height: 34px;
  padding: 0 8px;
  text-align: right;
}

.crit .select select {
  height: 34px;
  width: auto;
}

.plan-empty {
  margin: 24px 0 8px;
  color: var(--text-2);
}

.plan-empty p {
  margin: 0 0 12px;
  max-width: 60ch;
}

.plan-scroll {
  margin-top: 10px;
  overflow-x: auto;
}

.plan-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.plan-table th,
.plan-table td {
  padding: 0;
}

.plan-table .place-col {
  width: 190px;
  text-align: left;
  font-weight: inherit;
  padding: 4px 10px 4px 0;
  vertical-align: middle;
  /* Stays put while the weeks scroll sideways on small screens. */
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--page);
}

.plan-table thead th {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
  padding-bottom: 4px;
}

.plan-table thead .month {
  text-align: left;
  border-left: 1px solid var(--border-strong);
}

.plan-table thead .month button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.plan-table thead .month button:hover,
.plan-table thead .month[aria-sort] button {
  color: var(--text);
  background: var(--hover);
}

.plan-unsort {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.plan-table tbody tr {
  border-top: 1px solid var(--border);
}

.plan-table tbody .plan-group th {
  padding: 14px 0 4px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-table tbody tr.plan-group:first-child th {
  padding-top: 4px;
}

.plan-table tbody td.wk {
  height: 40px;
  border-left: 1px solid transparent;
  background-clip: padding-box;
}

.plan-table tbody td.m-start {
  border-left-color: var(--border-strong);
}

.plan-table tbody td.now {
  box-shadow: inset 2px 0 0 var(--plan-now);
}

.plan-place {
  display: flex;
  align-items: center;
  gap: 2px;
}

.plan-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.plan-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-open:hover span {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plan-open .flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  flex-shrink: 0;
}

.plan-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms;
}

.plan-remove svg {
  width: 14px;
  height: 14px;
}

tr:hover .plan-remove,
.plan-remove:focus-visible {
  opacity: 1;
}

.plan-remove:hover {
  color: var(--text);
  background: var(--hover);
}

.plan-best {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-msg {
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 8px !important;
}

.plan-msg.is-error {
  color: var(--error);
}

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

.plan-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.plan-key li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.plan-key .sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.plan-key .sw-now {
  width: 2px;
  border-radius: 0;
  background: var(--plan-now);
}

@media (hover: none) {
  .plan-remove {
    opacity: 1;
  }
}

/* ---------- Share panel and notices ---------- */

.share-panel {
  position: fixed;
  z-index: 45;
  top: 62px;
  right: max(16px, calc((100vw - 1280px) / 2 + 16px));
  width: min(440px, calc(100vw - 32px));
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}

.share-panel h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.share-panel .hint {
  margin: 0 0 12px;
}

.share-row {
  display: flex;
  gap: 8px;
}

.share-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.share-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.share-copy {
  height: 40px;
}

.share-panel .link-btn {
  margin-top: 10px;
  font-size: 0.875rem;
}

.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  animation: fade 150ms ease-out;
}

.toast .link-btn {
  flex-shrink: 0;
  font-weight: 600;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 640px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  /* The searches take their own row below the brand and settings. The
     Compare button stays beside the first search; the second search, once
     open, gets a row of its own. */
  .searches {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .searches .search {
    flex: 1 1 0;
  }
  .compare {
    flex-basis: 100%;
  }
  #compareOpen {
    padding: 0 12px;
  }
  .brand {
    margin-right: auto;
  }
  /* Suggestions: wider (see position() in search.js) and compact, one line
     for the name and one for the region, so more fit above the keyboard. */
  .search [role='listbox'] {
    padding: 4px;
  }
  .search [role='listbox'] li {
    grid-template-columns: 1.5em 1fr auto;
    gap: 0 8px;
    padding: 6px 8px;
    line-height: 1.3;
  }
  .search [role='listbox'] .name {
    font-size: 0.9375rem;
  }
  .search [role='listbox'] .name,
  .search [role='listbox'] .sub {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .search [role='listbox'] .sub {
    font-size: 0.75rem;
  }
  .search [role='listbox'] .pop {
    font-size: 0.6875rem;
  }
  .search [role='listbox'] .flag {
    width: 18px;
    height: 13.5px;
  }
  .pill-btn {
    height: 36px;
  }
  .share-panel {
    top: 56px;
    right: 16px;
  }
  .page {
    padding: 0 10px 20px;
  }
  .chart-head h2 {
    font-size: 1.0625rem;
  }
  .plan-table .place-col {
    width: 130px;
  }
  .bands {
    gap: 22px 3px;
  }
  .bands .chip {
    padding: 3px 7px;
  }
}
