/* Colours follow the device's light/dark setting unless the theme button is used. */
:root,
:root[data-theme="dark"] {
  --bg: #0e0f14;
  --surface: #161821;
  --surface-2: #1e212c;
  --surface-3: #272b38;
  --border: #2b2f3d;
  --text: #ebe9e4;
  --text-2: #b9b8b3;
  --muted: #8b8d98;
  --accent: #7b8bff;
  --accent-strong: #94a1ff;
  --accent-ink: #0e0f14;
  --accent-soft: rgba(123, 139, 255, 0.14);
  --good: #3ecf8e;
  --good-soft: rgba(62, 207, 142, 0.14);
  --bad: #ff6369;
  --bad-soft: rgba(255, 99, 105, 0.14);
  --warn: #f5b84a;
  --warn-soft: rgba(245, 184, 74, 0.14);
  --side-2: #f5b84a; /* second series (right side) in charts */
  --unsaved: #f5b84a; /* dot on the Save button */
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f2ea;
    --surface: #fffdf8;
    --surface-2: #f0ebdf;
    --surface-3: #e6dfd0;
    --border: #ddd5c4;
    --text: #1f1d1a;
    --text-2: #45413b;
    --muted: #6e695f;
    --accent: #3e52c9;
    --accent-strong: #3245b3;
    --accent-ink: #ffffff;
    --accent-soft: rgba(62, 82, 201, 0.1);
    --good: #13834f;
    --good-soft: rgba(19, 131, 79, 0.1);
    --bad: #c9323a;
    --bad-soft: rgba(201, 50, 58, 0.09);
    --warn: #a86a00;
    --warn-soft: rgba(168, 106, 0, 0.1);
    --side-2: #e8590c;
    --unsaved: #ffffff;
    --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 24px rgba(60, 45, 20, 0.07);
    color-scheme: light;
  }
}

/* The theme button sets data-theme for this tab only (nothing is saved). */
:root[data-theme="light"] {
  --bg: #f5f2ea;
  --surface: #fffdf8;
  --surface-2: #f0ebdf;
  --surface-3: #e6dfd0;
  --border: #ddd5c4;
  --text: #1f1d1a;
  --text-2: #45413b;
  --muted: #6e695f;
  --accent: #3e52c9;
  --accent-strong: #3245b3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(62, 82, 201, 0.1);
  --good: #13834f;
  --good-soft: rgba(19, 131, 79, 0.1);
  --bad: #c9323a;
  --bad-soft: rgba(201, 50, 58, 0.09);
  --warn: #a86a00;
  --warn-soft: rgba(168, 106, 0, 0.1);
  --side-2: #e8590c;
  --unsaved: #ffffff;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 24px rgba(60, 45, 20, 0.07);
  color-scheme: light;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1rem;
}


.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


main {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.section {
  margin-top: 2rem;
}

.section > h2 {
  margin-bottom: 0.85rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: var(--bad);
}

.btn-lg {
  min-height: 50px;
  padding: 0 1.6rem;
  font-size: 1.02rem;
}

.btn-sm {
  min-height: 32px;
  padding: 0 0.7rem;
  font-size: 0.85rem;
  border-radius: 8px;
}


.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented button {
  min-height: 36px;
  padding: 0 0.9rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(0, 0, 0, 0.15);
}


.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  margin-left: 0.3rem;
  vertical-align: middle;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tabs a {
  padding: 0.65rem 1rem;
  color: var(--text-2);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--text);
}

.tabs a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}


.search {
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
}

.search:focus,
.select:focus {
  border-color: var(--accent);
}

.select {
  height: 42px;
  padding: 0 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface);
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: var(--surface-2);
}

td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

th.num {
  text-align: right;
}


.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.tile {
  padding: 1rem 1.1rem;
}

.tile small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.tile strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  margin-top: 0.15rem;
}

.tile span {
  font-size: 0.78rem;
  color: var(--muted);
}

.chart-card {
  padding: 1.1rem 1.25rem 0.75rem;
  position: relative;
}

.chart-card h2 {
  font-size: 1rem;
}

.chart-card .sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.15rem 0 0.5rem;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: inherit;
}

.chart .series {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .area {
  fill: var(--accent);
  opacity: 0.08;
}

.chart .pt {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart .avg-line {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart .crosshair {
  stroke: var(--muted);
  stroke-width: 1;
}

.chart-tip {
  position: absolute;
  pointer-events: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  white-space: nowrap;
  transform: translate(-50%, -110%);
  z-index: 5;
}

.chart-tip strong {
  font-size: 0.95rem;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-state .big {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--border);
}

.acc-bar {
  display: inline-block;
  width: 70px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.acc-bar > i {
  display: block;
  height: 100%;
  background: var(--bad);
  border-radius: 999px;
}

.data-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 50;
}


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


/* ---------- Limb tracker ---------- */
.leg-form-card {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.leg-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.leg-form-head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.leg-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
}

.leg-field .search {
  flex: none;
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.leg-when {
  min-width: 220px;
}

.leg-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.leg-input-wrap {
  position: relative;
}

.leg-input-wrap .search {
  padding-right: 2.1rem;
}

.leg-input-wrap em {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
}

.leg-form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.leg-form-foot .btn-row {
  margin: 0;
}

.leg-tiles {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.tile.trend-up strong,
.trend-up {
  color: var(--bad);
}

.tile.trend-down strong,
.trend-down {
  color: var(--good);
}

.chart .series.base {
  stroke: var(--muted);
  stroke-dasharray: 5 4;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.6rem;
}

.legend .sw {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--accent);
}

.legend .sw.base {
  border-top: 2px dashed var(--muted);
}

.leg-sections {
  padding: 1rem 1.25rem;
}

.leg-sections p {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.leg-seg {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.leg-seg strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.div-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
}

.div-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--muted);
}

.div-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.div-bar i.pos {
  left: 50%;
  background: var(--bad);
}

.div-bar i.neg {
  right: 50%;
  background: var(--good);
}

.leg-table td small {
  display: block;
  font-size: 0.72rem;
}

.leg-table td small:not([class*="trend-up"]):not([class*="trend-down"]) {
  color: var(--muted);
}

.leg-notes {
  min-width: 140px;
  max-width: 260px;
  color: var(--text-2);
  font-size: 0.85rem;
}

.nowrap {
  white-space: nowrap;
}


/* ---------- Limb tracker: app shell ---------- */
.brand-mark svg {
  width: 18px;
  height: 18px;
}

.topbar-right .btn {
  min-height: 36px;
}

.unsaved-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--unsaved);
}

.tabs button {
  padding: 0.65rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tabs .add-limb {
  color: var(--accent);
}

.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 0.9rem;
  color: var(--text-2);
}

.notice strong {
  color: var(--text);
}

.notice svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  color: var(--accent);
}

.setup-card {
  padding: 1.25rem 1.4rem;
}

.setup-card h2 {
  margin-bottom: 0.75rem;
}

.setup-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.setup-fields {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.setup-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.limb-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  font-size: 0.88rem;
}

.open-card {
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.open-card p {
  margin: 0.25rem 0 0;
}

@media (max-width: 720px) {
  .setup-fields {
    grid-template-columns: 1fr 1fr;
  }

  .setup-fields .leg-field:first-child {
    grid-column: 1 / -1;
  }

  .leg-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .leg-tiles .tile strong {
    font-size: 1.35rem;
  }

  .topbar-right .btn span.label {
    display: none;
  }
}

.icon-only {
  display: none;
}

@media (max-width: 720px) {
  .icon-only {
    display: inline;
  }
}

/* ---------- "What that looks like" ---------- */
.compare-card {
  padding: 1.1rem 1.25rem;
}

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

.compare-head h2 {
  font-size: 1rem;
}

.compare-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  min-width: 0;
}

.compare-pick > span {
  white-space: nowrap;
}

.compare-pick .select {
  height: 38px;
  max-width: 100%;
}

.compare-text {
  margin: 0.85rem 0 0.75rem;
  font-size: 1.02rem;
}

.obj-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.25rem;
  align-items: flex-end;
  padding: 0.25rem 0 0.4rem;
}

.obj-icon {
  width: 54px;
  height: 86px;
  display: block;
}

.obj-outline,
.obj-outline * {
  fill: none;
  stroke: var(--text-2);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.obj-part {
  position: relative;
  display: block;
}

.obj-part small {
  position: absolute;
  left: 50%;
  bottom: -1.1rem;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.obj-part + .obj-note,
.obj-row:has(.obj-part) {
  margin-bottom: 0.9rem;
}

.obj-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .obj-icon {
    width: 42px;
    height: 67px;
  }
}

/* ---------- Save dialog ---------- */
.save-dialog {
  width: min(460px, calc(100vw - 2rem));
  padding: 1.25rem 1.4rem;
  color: var(--text);
}

.save-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.save-dialog h2 {
  margin-bottom: 1rem;
}

.save-preview {
  margin: 0.75rem 0 1.1rem;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.save-preview strong {
  color: var(--text-2);
  font-weight: 600;
}

.save-dialog .btn-row {
  justify-content: flex-end;
}

/* ---------- Left vs right ---------- */
.chart .series.alt {
  stroke: var(--side-2);
}

.chart .pt.alt {
  fill: var(--side-2);
}

.legend .sw.alt {
  border-top-color: var(--side-2);
}

/* ---------- Paste several ---------- */
.form-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.paste-dialog {
  width: min(820px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.25rem 1.4rem;
  color: var(--text);
}

.paste-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.paste-dialog h2 {
  margin-bottom: 0.5rem;
}

.paste-help {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}

.paste-text {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  padding: 0.7rem 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.paste-error {
  margin: 0.75rem 0 0;
  color: var(--bad);
  font-size: 0.9rem;
}

.paste-fill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.9rem 0 0.6rem;
  font-size: 0.85rem;
}

.paste-fill .search {
  flex: none;
  min-width: 0;
  height: 36px;
  width: auto;
}

.paste-fill .fill-days {
  width: 70px;
}

.paste-table {
  border: 1px solid var(--border);
  border-radius: 10px;
}

.paste-table table {
  font-size: 0.85rem;
}

.paste-table th,
.paste-table td {
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
}

.paste-date {
  min-width: 0;
  width: 112px;
  height: 34px;
  padding: 0 0.4rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text);
}

.paste-note {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}

.paste-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ---------- Theme button ---------- */
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

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

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

.paste-date.invalid {
  border-color: var(--bad);
}

.paste-fill #fill-first {
  width: 112px;
}

.paste-warning {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.88rem;
}

/* ---------- Total volume entry ---------- */
.entry-mode button {
  min-height: 30px;
  padding: 0 0.7rem;
  font-size: 0.85rem;
}

.volume-row {
  display: flex;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.compare-to-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-to-wrap .volume-wrap {
  width: 220px;
}

#compare-to-ml.invalid {
  border-color: var(--bad);
}

.quick-compare {
  margin-bottom: 0.9rem;
}

.quick-compare tr.qc-target td {
  background: var(--accent-soft);
}

.volume-wrap {
  max-width: 220px;
}

.volume-wrap .search {
  font-size: 1.1rem;
  font-weight: 600;
  padding-right: 2.6rem;
}

.volume-help {
  margin: 0.6rem 0 0.2rem;
  font-size: 0.83rem;
  max-width: 720px;
}

.quick-compare table {
  width: auto;
  min-width: min(100%, 460px);
  margin-top: 0.8rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.quick-compare td {
  padding: 0.5rem 0.8rem;
}

.quick-compare tr:last-child td {
  border-bottom: none;
}

.tag.tag-volume {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.quick-compare td.num {
  white-space: nowrap;
}

.compare-to-card {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.5rem;
}

.compare-to-status {
  flex: 1 1 280px;
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.compare-to-status.active {
  color: var(--text-2);
}

.compare-to-status.active strong {
  color: var(--accent-strong);
}

.quick-compare:empty {
  margin-bottom: 0;
}
