/* TroyTally
   Palette follows the original spreadsheet: charcoal headers, per-metal row tints,
   blue text on pale yellow for values you type in, green/red for gain and loss.
   System fonts only (no font downloads, nothing loaded from third parties). */

:root {
  --font-display: 'Iowan Old Style', 'Charter', 'Sitka Text', 'Cambria', Georgia, serif;
  --font-ui: 'Bahnschrift', 'DIN Alternate', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;

  --graphite: #1f2126;
  --graphite-2: #2b2e33;
  --paper: #edeff1;
  --surface: #ffffff;
  --ink: #1f2126;
  --muted: #5f646b;
  --line: #d3d7dc;
  --track: #e5e8eb;
  --head-bg: #2b2e33;
  --head-ink: #ffffff;
  --focus: #9a6700;
  --primary-bg: #1f2126;
  --primary-ink: #ffffff;
  --entry-ink: #1f4e8c;
  --entry-bg: #fff8d9;
  --gain: #1e7b34;
  --gain-bg: #d9f0dd;
  --loss: #b3261e;
  --loss-bg: #fbe0de;
  --warn-bg: #fff1d6;

  /* Row tints by metal (spreadsheet conditional formatting) */
  --tint-gold: #fbf1d2;
  --tint-silver: #eceef0;
  --tint-platinum: #e3eaf0;
  --tint-palladium: #efe7f3;

  /* Chart identity colors, validated for color-vision deficiency on light and dark surfaces */
  --gold: #b98310;
  --silver: #00909e;
  --platinum: #5b63c4;
  --palladium: #c0527a;

  --radius: 6px;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15171a;
    --surface: #1d2024;
    --ink: #eceef0;
    --muted: #a3a9b0;
    --line: #353a40;
    --track: #2a2e34;
    --head-bg: #2b2e33;
    --focus: #f0c24b;
    --primary-bg: #e8c36a;
    --primary-ink: #1f2126;
    --entry-ink: #a9c8ff;
    --entry-bg: #272619;
    --gain: #6fcf8a;
    --gain-bg: #1d3424;
    --loss: #ff8a80;
    --loss-bg: #3d2321;
    --warn-bg: #3a3020;
    --tint-gold: #2f2a1c;
    --tint-silver: #25282c;
    --tint-platinum: #222a33;
    --tint-palladium: #2c2430;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-underline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 8px;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--graphite);
  color: #fff;
  padding: 16px var(--gutter) 0;
  --focus: #f0c24b;
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 22px/1.2 var(--font-display);
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 30px;
  height: 30px;
}

.price-status {
  margin: 0;
  font-size: 13px;
  color: #c3c7cc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a8f96;
  flex: none;
}
.price-status[data-state='live']::before {
  background: #4cc26c;
}
.price-status[data-state='error']::before {
  background: #f08c3c;
}
.price-status a {
  color: #fff;
}

/* Spot prices as struck hallmark plates: atomic number, element symbol, live price */
.hallmarks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1320px;
  margin: 16px auto 0;
}

.hallmark {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'num  price'
    'sym  price'
    'name price';
  align-items: end;
  column-gap: 16px;
  padding: 10px 16px 12px 14px;
  border-radius: var(--radius);
  color: #1f2126;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.hallmark.metal-gold {
  background: linear-gradient(135deg, #f6e7bb 0%, #e2c171 55%, #d0a548 100%);
}
.hallmark.metal-silver {
  background: linear-gradient(135deg, #f4f5f7 0%, #d8dce0 55%, #c3c8ce 100%);
}
.hallmark.metal-platinum {
  background: linear-gradient(135deg, #eef2f5 0%, #ccd6de 55%, #b5c2cd 100%);
}
.hallmark.metal-palladium {
  background: linear-gradient(135deg, #f3eff4 0%, #d9d0dc 55%, #c5b8c9 100%);
}
.hm-num {
  grid-area: num;
  font-size: 11px;
  line-height: 1;
  opacity: 0.75;
}
.hm-sym {
  grid-area: sym;
  font: 600 34px/1 var(--font-display);
  letter-spacing: -0.01em;
}
.hm-name {
  grid-area: name;
  font-size: 12px;
  line-height: 1.3;
}
.hm-price {
  grid-area: price;
  justify-self: end;
  align-self: end;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1;
  font-stretch: 87.5%;
  border-radius: 3px;
}
.hm-price.tick-up {
  animation: tick-up 1.6s ease-out;
}
.hm-price.tick-down {
  animation: tick-down 1.6s ease-out;
}
@keyframes tick-up {
  from {
    background: rgba(30, 123, 52, 0.28);
  }
}
@keyframes tick-down {
  from {
    background: rgba(179, 38, 30, 0.24);
  }
}

.tabs {
  display: flex;
  gap: 4px;
  max-width: 1320px;
  margin: 12px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  flex: none;
  padding: 12px 14px 11px;
  color: #c3c7cc;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 3px solid transparent;
}
.tabs a:hover {
  color: #fff;
}
.tabs a[aria-current='page'] {
  color: #fff;
  border-bottom-color: #d9b45a;
}

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

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
}
main:focus {
  outline: none;
}

.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font: 600 34px/1.15 var(--font-display);
}
.lede {
  margin: 6px 0 0;
  max-width: 72ch;
  color: var(--muted);
}

h2 {
  margin: 0 0 12px;
  font: 600 19px/1.3 var(--font-display);
}

.muted {
  color: var(--muted);
}
.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 72ch;
}
.hint.error {
  color: var(--loss);
}
.footnote {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 80ch;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.grid-2 > .panel {
  margin-top: 0;
}

.panel {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

/* Totals: one ruled band rather than a row of cards */
.totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  background: var(--graphite-2);
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.total {
  padding: 16px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.total:first-child {
  border-left: 0;
}
.total dt {
  font-size: 13px;
  color: #b9bdc3;
}
.total dd {
  margin: 4px 0 0;
  font-size: clamp(20px, 2.1vw, 27px);
  font-weight: 600;
  line-height: 1.15;
}
.total dd.gain {
  color: #7fdc97;
}
.total dd.loss {
  color: #ff9c92;
}
.total dd.total-note {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #b9bdc3;
}

.coverage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 16px;
  background: var(--warn-bg);
}
.coverage p {
  margin: 0;
  max-width: 78ch;
}
.notice-title {
  font-weight: 600;
  margin-bottom: 2px !important;
}

sup.mark {
  margin-left: 1px;
  color: var(--muted);
  cursor: help;
}

.missing {
  color: var(--entry-ink);
  font-style: italic;
  font-weight: 500;
}

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  background: var(--tint-gold);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.callout h2 {
  margin-bottom: 4px;
}
.callout p {
  margin: 0;
  max-width: 64ch;
}

.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.notice-warn {
  background: var(--warn-bg);
  margin-bottom: 16px;
}

/* ---------- Tables ---------- */

.table-wrap {
  min-width: 0;
  overflow-x: auto;
}
.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 140px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.data th,
.data td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--head-bg);
  color: var(--head-ink);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 0;
}
.data .num {
  text-align: right;
}
.data tbody tr:hover > * {
  filter: brightness(0.97);
}
.data tbody th {
  font-weight: 500;
}
.data td.notes {
  white-space: normal;
  min-width: 180px;
  max-width: 320px;
  color: var(--muted);
}
.data tfoot .total-row > *,
.data .total-row > * {
  font-weight: 700;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  background: var(--surface);
}
.data .gain {
  color: var(--gain);
  background: var(--gain-bg);
}
.data .loss {
  color: var(--loss);
  background: var(--loss-bg);
}
.empty-row {
  text-align: center !important;
  color: var(--muted);
  padding: 24px !important;
}

tr.metal-gold > * {
  background: var(--tint-gold);
}
tr.metal-silver > * {
  background: var(--tint-silver);
}
tr.metal-platinum > * {
  background: var(--tint-platinum);
}
tr.metal-palladium > * {
  background: var(--tint-palladium);
}
tr.metal-gold > .gain,
tr.metal-silver > .gain,
tr.metal-platinum > .gain,
tr.metal-palladium > .gain {
  background: var(--gain-bg);
}
tr.metal-gold > .loss,
tr.metal-silver > .loss,
tr.metal-platinum > .loss,
tr.metal-palladium > .loss {
  background: var(--loss-bg);
}

/* Holdings: # and product name stay put while scrolling sideways (spreadsheet freeze panes) */
.holdings .idx {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 44px;
  min-width: 44px;
  text-align: right;
  color: var(--muted);
}
.holdings .name {
  position: sticky;
  left: 44px;
  z-index: 1;
  min-width: 260px;
  max-width: 360px;
  white-space: normal;
  box-shadow: 1px 0 0 var(--line);
}
.holdings thead .idx,
.holdings thead .name {
  z-index: 3;
}
.holdings tbody tr {
  cursor: pointer;
}
.products .name {
  white-space: normal;
  min-width: 260px;
}
.products tbody tr {
  cursor: pointer;
}

button.sort {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
button.sort:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
th[aria-sort] button.sort::after {
  content: '▲';
  font-size: 9px;
}
th[aria-sort='descending'] button.sort::after {
  content: '▼';
}

button.link {
  all: unset;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
button.link:hover {
  text-decoration-color: currentColor;
}
button.link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Controls ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input[type='search'] {
  width: 240px;
}
.spacer {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  font: 500 15px/1.2 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--muted);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: var(--primary-bg);
}
.btn-primary:hover {
  border-color: var(--primary-bg);
  filter: brightness(1.15);
}
.btn-danger {
  background: var(--loss);
  border-color: var(--loss);
  color: #fff;
}
.btn-danger-quiet {
  color: var(--loss);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--track);
}

.input {
  min-height: 40px;
  padding: 8px 10px;
  font: 15px/1.3 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
textarea.input {
  resize: vertical;
}
.input:hover {
  border-color: var(--muted);
}
/* Typed-in assumptions use the spreadsheet's input-cell look */
.input-entry {
  color: var(--entry-ink);
  background: var(--entry-bg);
  font-weight: 600;
}
.input-num {
  width: 120px;
  text-align: right;
}
.input-suffix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.input-group {
  display: flex;
  gap: 6px;
}
.input-group .input:first-child {
  flex: 1;
}
.input.unit {
  width: 96px;
}

.switch-row {
  margin-bottom: 4px;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.switch input {
  appearance: none;
  position: relative;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch input:checked {
  background: var(--gain);
}
.switch input:checked::after {
  transform: translateX(18px);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-good {
  color: var(--gain);
  background: var(--gain-bg);
}
.badge-bad {
  color: var(--loss);
  background: var(--loss-bg);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.row-actions .hint {
  margin: 0;
}

.button-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.link-list {
  margin: 12px 0 0;
  padding-left: 18px;
}
.link-list li + li {
  margin-top: 6px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 12px;
  background: var(--track);
  border-radius: 999px;
}
.chip .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form .input {
  flex: 1;
  max-width: 280px;
}

.premiums td:last-child .input {
  width: 100%;
  min-width: 220px;
}

/* ---------- Dialogs ---------- */

.dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}
.dialog-wide {
  width: min(680px, calc(100vw - 32px));
}
.dialog::backdrop {
  background: rgba(15, 17, 20, 0.55);
}
.dialog[open] {
  display: flex;
  flex-direction: column;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin: 0;
  font-size: 22px;
}
.dialog-body {
  padding: 16px 20px;
  overflow-y: auto;
}
.dialog-body p {
  margin: 0;
}
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.form {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}
.field label {
  font-size: 13px;
  font-weight: 600;
}
.field .hint {
  margin: 0;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form > .hint {
  margin-top: -8px;
}
.custom-fields {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.custom-fields[hidden] {
  display: none;
}
.custom-fields legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 13px;
}

.preview {
  padding: 12px 14px;
  background: var(--paper);
  border-radius: var(--radius);
}
.preview .muted {
  margin: 0;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.preview-grid dt {
  font-size: 12px;
  color: var(--muted);
}
.preview-grid dd {
  margin: 0;
  font-weight: 600;
}
.preview-grid dd.gain {
  color: var(--gain);
}
.preview-grid dd.loss {
  color: var(--loss);
}

/* ---------- Charts ---------- */

.chart {
  position: relative;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-tip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  pointer-events: none;
  white-space: nowrap;
}
.chart-tip[hidden] {
  display: none;
}
.axis-label {
  font: 13px var(--font-ui);
  fill: var(--muted);
}
.value-label {
  font: 600 13px var(--font-ui);
  fill: var(--ink);
}
.grid {
  stroke: var(--line);
  stroke-width: 1;
}
.crosshair {
  stroke: var(--muted);
  stroke-width: 1;
}
.donut {
  max-width: 240px;
  margin: 0 auto;
}
.donut-seg {
  cursor: default;
}
.donut-seg:hover {
  opacity: 0.85;
}
.donut-center {
  font: 600 19px var(--font-ui);
  fill: var(--ink);
}
.donut-sub {
  font: 13px var(--font-ui);
  fill: var(--muted);
}

.alloc {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  gap: 24px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.legend-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--ink);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-name {
  flex: 1;
}
.legend-val {
  font-weight: 600;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}
.swatch-bar {
  width: 18px;
  height: 10px;
  background: linear-gradient(90deg, var(--gold) 0 25%, var(--silver) 25% 50%, var(--platinum) 50% 75%, var(--palladium) 75%);
}
.swatch-tick {
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--ink);
}
.swatch-line {
  width: 18px;
  height: 2px;
  background: var(--ink);
}
.swatch-dash {
  width: 18px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 5px, transparent 5px 9px);
}

/* ---------- Prose (about page) ---------- */

.prose {
  max-width: 72ch;
}
.prose h2 {
  margin-top: 28px;
}
.prose p {
  margin: 0 0 12px;
}

/* ---------- Footer & toasts ---------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.site-foot p {
  margin: 0;
}

#toast-region {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 16px;
  color: #fff;
  background: var(--graphite);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast[data-tone='error'] {
  background: #8f1d16;
}

.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 28px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.empty p {
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1000px) {
  .totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .total:nth-child(4) {
    border-left: 0;
  }
  .total:nth-child(n + 4) {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 700px) {
  .hallmarks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hm-sym {
    font-size: 26px;
  }
  .totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .total {
    padding: 12px 14px;
  }
  .total:nth-child(n) {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .total:nth-child(-n + 2) {
    border-top: 0;
  }
  .total:nth-child(even) {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }
  .page-head h1 {
    font-size: 28px;
  }
  .panel {
    padding: 16px;
  }
  .alloc {
    grid-template-columns: minmax(0, 1fr);
  }
  .field-row,
  .preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar input[type='search'] {
    flex: 1;
    width: auto;
  }
  .holdings .name {
    min-width: 180px;
  }
  .price-status {
    font-size: 12px;
  }
}

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

@media print {
  .masthead .tabs,
  .toolbar,
  .site-foot,
  .skip-link {
    display: none;
  }
  .masthead {
    background: none;
    color: #000;
  }
  .table-scroll {
    max-height: none;
    overflow: visible;
  }
}

/* ---------- Launch additions ---------- */

.welcome-points {
  margin: 8px 0 0;
  padding-left: 18px;
  max-width: 68ch;
}
.welcome-points li + li {
  margin-top: 4px;
}

.shop-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.shop-label {
  color: var(--muted);
}
td.shop {
  font-size: 13px;
}
td.shop .shop-links {
  flex-wrap: nowrap;
}
.shop-line {
  display: grid;
  gap: 4px;
  margin: 12px 0 0 !important;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.shop-line .hint {
  margin: 0;
  font-size: 12px;
}

.masthead-spacer {
  height: 16px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.prose h3 {
  margin: 18px 0 6px;
  font: 600 16px/1.4 var(--font-ui);
}
.prose ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.prose li + li {
  margin-top: 6px;
}

/* ---------- Guide pages (guides/*) ---------- */

.calc-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
  margin: 18px 0 0;
}
.calc-result dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.calc-result dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
}
.calc-big {
  font: 600 30px/1.2 var(--font-display);
}
.field-narrow {
  max-width: 16rem;
}
.crumbs {
  margin: 0 0 8px;
}
