:root {
  /* a finance-vault palette: cool document stone, ink-navy, brass. off the
     cream + terracotta default. color is scarce, brass is the only accent. */
  --bg: #e8e9e6;      /* cool stone paper, not warm cream */
  --card: #f2f2ef;
  --ink: #17222e;     /* deep ink-navy, not warm-black */
  --muted: #667079;   /* slate: secondary text + labels */
  --faint: #99a0a6;
  --line: rgba(23, 34, 46, 0.13);   /* navy hairline rule */
  --line-strong: rgba(23, 34, 46, 0.26);

  /* the one accent: brass. money, brass fittings. active states + focus only. */
  --accent: #a97b2e;
  --accent-deep: #855f1e;
  --accent-pale: rgba(169, 123, 46, 0.12);
  --accent-rgb: 169, 123, 46;

  /* data hues: pine for gains, oxblood for losses. as text color on figures. */
  --up: #1f6b54;
  --up-deep: #164f3e;
  --up-rgb: 31, 107, 84;
  --down: #8e2f3a;
  --down-deep: #6d222b;
  --down-rgb: 142, 47, 58;
  --neutral: #5c6b78;
  --neutral-deep: #45525c;
  --neutral-rgb: 92, 107, 120;

  --radius: 4px;
  --radius-sm: 2px;
  --shadow: none;
  --shadow-hover: none;
  --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.1);
  --fog-bg: rgba(242, 242, 239, 0.74);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

:root[data-theme="dark"] {
  --bg: #10161c;      /* deep ink-navy, not pure black */
  --card: #182029;
  --ink: #e8e9e5;     /* bone */
  --muted: #8a929a;
  --faint: #626a72;
  --line: rgba(232, 233, 229, 0.14);
  --line-strong: rgba(232, 233, 229, 0.28);

  --accent: #c79a4a;  /* brass, brighter on navy */
  --accent-deep: #a97b2e;
  --accent-pale: rgba(199, 154, 74, 0.16);
  --accent-rgb: 199, 154, 74;

  --up: #3e9a76;
  --up-deep: #2c7357;
  --up-rgb: 62, 154, 118;
  --down: #c25668;
  --down-deep: #9c3f4f;
  --down-rgb: 194, 86, 104;
  --neutral: #8a97a3;
  --neutral-deep: #6d7a86;
  --neutral-rgb: 138, 151, 163;

  --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  --fog-bg: rgba(24, 32, 41, 0.82);
}

* { box-sizing: border-box; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* top bar */
.topbar {
  max-width: 920px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand h1 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0;
}
.theme-toggle {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }

/* section headings: serif, sentence case, real reading size. no uppercase. */
.section-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 1.4rem;
}
.modal-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 1.2rem;
}

/* cards: paper panels, hairline borders, no shadow. */
.summary,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.25rem;
}
/* the signature reeded-glass ribbon across the top of the hero card */
.summary { position: relative; overflow: hidden; padding-top: 2.6rem; }
.summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0) 2px,
      rgba(0, 0, 0, 0.12) 6px, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0.3) 12px),
    linear-gradient(90deg, #f26b4e, #e77fa3, #8e86d6, #5c6b78);
}

/* small labels: grotesk, lowercase, haze. no caps, no letter-spacing. */
.summary-label,
.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* hero figure: strong sans, huge, tabular. numbers stay legible, not serif. */
.summary-value {
  font-family: var(--sans);
  font-size: clamp(3.4rem, 7.5vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.summary-change {
  font-size: 1rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 500;
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}
/* total gain/loss is a second display figure, strong sans */
.stat-value-lg {
  font-family: var(--sans);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.3rem;
}
.status-line {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}
.status-line.error { color: var(--down); }

/* runtime key entry */
.key-bar { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.key-note { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.key-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* data text colors */
.up { color: var(--up); }
.down { color: var(--down); }

/* buttons: no fill. ink outline that inverts to an ink fill on hover. */
.btn {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-sm:disabled { opacity: 0.45; cursor: default; }

/* inputs: hairline box, focus goes to an ink border, no glow ring. */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.8rem; color: var(--muted); }
.field input[type="text"],
.field input[type="number"],
.key-row input {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease;
}
.key-row input { width: 20rem; max-width: 100%; font-size: 0.9rem; }
.field input:focus,
.key-row input:focus { border-color: var(--accent); }
#add-ticker { text-transform: uppercase; letter-spacing: 0.02em; }
/* drop the default number spinners — you type the value */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* performance */
.perf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.perf-head .section-title { margin: 0; }
.perf-right { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.tf-select { display: flex; gap: 0.9rem; }
.tf-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.1rem 0;
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  transition: color 0.12s ease;
}
.tf-btn:hover { color: var(--ink); }
.tf-btn.is-active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.chart-wrap { width: 100%; }
#perf-chart { width: 100%; height: auto; display: block; }

/* diversity donut, inside holdings */
.diversity-wrap {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.donut-hold { flex: 0 0 auto; }
#diversity-chart { width: 190px; height: 190px; display: block; }
.diversity-legend {
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 12rem;
}
.legend-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.legend-swatch { flex: 0 0 auto; width: 0.75rem; height: 0.75rem; border-radius: 2px; }
.legend-ticker { font-weight: 600; }
.legend-pct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* add control: plain text button */
.add-row { margin-top: 1.75rem; }
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0.2rem 0;
  cursor: pointer;
}
.btn-add:hover { text-decoration: underline; }
.btn-add .plus { font-size: 1.2rem; line-height: 1; }

/* holding cards: hairline, serif ticker, day % in moss/brick text */
.holdings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
}
.hcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-height: 112px;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.hcard:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.hcard-ticker {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--ink);
}
.hcard-day {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: auto;
}
/* a ticker you have written notes about carries the same brass tick that pins
   each entry to its spine in the detail view. */
.hcard-mark {
  position: absolute;
  top: 0.95rem;
  right: 1rem;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent);
}

/* visually hidden, still read out loud */
.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;
}

.empty { color: var(--muted); font-size: 0.9rem; padding: 1.5rem 0; text-align: center; }

/* modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 18, 14, 0.55);
  animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay[hidden] { display: none; }
/* the card carries no opacity/transform of its own; either promotes it to a
   layer this renderer paints translucent. the dim animates instead. */
.modal-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--modal-shadow);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow: auto;
}
.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s ease;
}
.modal-close:hover { border-color: var(--ink); }

/* add popup */
.add-card { padding: 1.6rem; max-width: 380px; }
#add-form { display: flex; flex-direction: column; gap: 0.9rem; }
#add-form .btn-primary { margin-top: 0.35rem; }
.add-status { font-size: 0.82rem; color: var(--muted); margin-top: 0.7rem; min-height: 1em; }
.add-status.error { color: var(--down); }
.add-recent { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.recent-chip {
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* holding detail modal — the fluted-glass banner is the signature. a touch wider
   than the add popup so the notes ledger gets a readable measure. */
.holding-card { max-width: 460px; }
.hmodal-banner {
  position: relative;
  overflow: hidden;
  height: 134px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-end;
  padding: 1.2rem 1.45rem;
}
.hmodal-banner.banner-pixel { image-rendering: pixelated; }
/* grain over the soft-gradient banners, so they read as distorted glass */
.hmodal-banner.banner-soft::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: soft-light;
}
.hmodal-ticker {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.hmodal-body { padding: 1.45rem; display: flex; flex-direction: column; gap: 1.2rem; }
.hmodal-edit { display: flex; gap: 0.75rem; align-items: flex-end; }
.hmodal-edit .field { flex: 1 1 auto; }
.hmodal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.hmodal-stats > div { display: flex; flex-direction: column; gap: 0.25rem; }
.hstat { font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.ask-news-btn {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.ask-news-btn:hover { background: var(--ink); color: var(--bg); }
.hmodal-news:empty { display: none; }
.hm-ai {
  background: var(--accent-pale);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.blurb-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.2rem;
}
.blurb-text { color: var(--ink); }
.hm-news-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.hm-news-list li { padding: 0.5rem 0; font-size: 0.86rem; border-top: 1px solid var(--line); }
.hm-news-list li:first-child { border-top: none; }
.hm-news-list a { color: var(--ink); text-decoration: none; }
.hm-news-list a:hover { text-decoration: underline; }
.hm-news-list .src { color: var(--faint); font-size: 0.76rem; }
.hm-news-loading, .hm-news-empty { color: var(--muted); font-size: 0.85rem; font-style: italic; margin: 0.5rem 0 0; }
.hmodal-delete {
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  padding: 0.2rem 0;
}
.hmodal-delete:hover { color: var(--down); text-decoration: underline; }

/* ---- notes: a ledger of timestamped entries, one per holding --------------
   entries hang off a hairline spine, each pinned with a brass tick. the column
   runs oldest first, because the order is the point: "why i bought" written in
   march sitting above "sell trigger" written in april is the story of the
   position. brass is the app's only accent, so notes borrow it rather than
   introduce a hue. the filled accent-pale block stays reserved for the ai read. */
.hnotes { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.hnotes-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.hnotes-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}
.hnotes-count {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.hnote-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0 1.1rem;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.hnote { position: relative; }
.hnote::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.45rem;
  margin-left: -3px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent);
}
.hnote-label {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.hnote-body {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hnote-meta {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.hnote-acts {
  margin-left: auto;
  display: flex;
  gap: 0.7rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.hnote:hover .hnote-acts,
.hnote:focus-within .hnote-acts { opacity: 1; }
.hnote-act {
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.hnote-act:hover { color: var(--ink); text-decoration: underline; }
.hnote-act[data-note-action="remove"]:hover { color: var(--down); }
.hnote-act.is-armed { color: var(--down); text-decoration: underline; }

/* inline editor: the entry body swapped for a field, brass edge while it is live */
.hnote-edit-area {
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: transparent;
  outline: none;
  resize: none;
  overflow: hidden;
}

/* composer */
.hnote-composer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.hnote-label-input,
.hnote-input {
  font-family: var(--sans);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}
.hnote-label-input { font-size: 0.9rem; padding: 0.45rem 0.6rem; }
.hnote-input {
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 0.55rem 0.6rem;
  min-height: 4.6rem;
  resize: none;
  overflow: hidden;
}
.hnote-label-input:focus,
.hnote-input:focus { border-color: var(--accent); }
.hnote-label-input::placeholder,
.hnote-input::placeholder { color: var(--faint); }
.hnote-foot { display: flex; align-items: center; gap: 0.75rem; }
.hnote-foot .btn { margin-left: auto; }
/* the write is invisible and this modal closes on a backdrop click. the line is
   how you know what you just typed is safe. it says its piece and fades. */
.hnote-saved {
  font-size: 0.76rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hnote-saved.is-on { opacity: 1; }
.hnote-saved.is-warn { color: var(--down); }

/* empty ledger: an invitation and three ways in */
.hnote-empty { padding-top: 0.1rem; }
.hnote-empty p {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}
.hnote-starts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hnote-start {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.62rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hnote-start:hover { border-color: var(--accent); color: var(--accent-deep); }

.hnote-act:focus-visible,
.hnote-start:focus-visible,
.hnote-composer .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .hnote-acts { opacity: 1; transition: none; }
  .hnote-saved { transition: none; }
}

/* worth a look — a fog you clear with your cursor to reveal a grid of headlines */
.wal-stage { position: relative; padding: 0.5rem 0 0.25rem; }
.wal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.6rem;
}
.wal-tile {
  position: relative;
  text-align: left;
  font-family: var(--sans);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  min-height: 96px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.wal-tile-head { font-size: 0.92rem; line-height: 1.28; }
.wal-tile.up .wal-tile-head { color: var(--up); }
.wal-tile.down .wal-tile-head { color: var(--down); }
.wal-tile-detail { display: none; margin-top: 0.75rem; }
.wal-tile-detail p { margin: 0 0 0.6rem; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.wal-tile-meta { display: flex; align-items: baseline; gap: 0.85rem; font-size: 0.78rem; }
.wal-tile-meta .src { color: var(--faint); }
.wal-tile-meta a { color: var(--accent); text-decoration: none; margin-left: auto; font-weight: 500; }
.wal-tile-meta a:hover { text-decoration: underline; }

/* the fog: blur + dim over the grid, cleared in a feathered circle at the cursor */
.wal-fog {
  position: absolute;
  inset: -1px;
  z-index: 3;
  pointer-events: none;
  background: var(--fog-bg);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  -webkit-mask: radial-gradient(circle 130px at var(--mx, -999px) var(--my, -999px), transparent 0, transparent 40%, #000 100%);
  mask: radial-gradient(circle 130px at var(--mx, -999px) var(--my, -999px), transparent 0, transparent 40%, #000 100%);
}
/* an opened card rises above the fog and is fully legible */
.wal-tile.is-open {
  z-index: 5;
  background: var(--card);
  border-color: var(--line-strong);
  box-shadow: var(--modal-shadow);
}
.wal-tile.is-open .wal-tile-detail { display: block; }
.wal-hint { margin: 0.9rem 0 0; font-size: 0.78rem; color: var(--faint); }

/* ask box */
.ask-box { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.ask-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.9rem; }
.ask-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; }
.ask-sub { font-size: 0.8rem; color: var(--muted); }
.ask-log { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 0.9rem; }
.ask-log:empty { display: none; }
.ask-q { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.ask-a { font-size: 0.9rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.55; }
.ask-a.note { color: var(--ink); }
.ask-src { font-size: 0.74rem; color: var(--faint); margin-top: 0.3rem; }
#ask-form { display: flex; gap: 0.75rem; align-items: baseline; }
#ask-form input {
  flex: 1 1 auto;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.5rem 0.1rem;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}
#ask-form input:focus { border-bottom-color: var(--accent); }

/* footer */
.site-footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  color: var(--faint);
  font-size: 0.82rem;
}
.site-footer p { margin: 0; }

/* responsive */
@media (max-width: 640px) {
  .topbar { padding-top: 2.5rem; }
  .summary, .panel { padding: 1.6rem; }
  .summary-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .diversity-wrap { gap: 1.5rem; justify-content: center; }
  .holdings-cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
