/* ============================================================
   Freehold
   Visual language: certificates of ownership and machine plates.
   Engraved display serif, official-document sans, machine mono.
   The em dash in the EXPIRES row is the motif of the whole site.
   ============================================================ */

:root {
  --ink:        #122E2B;
  --ink-soft:   #4A6764;
  --paper:      #E6E7E1;
  --card:       #F3F3EF;
  --vault:      #0D211F;
  --brass:      #9C7A33;
  --verdigris:  #2F7A6B;
  --rust:       #9A4A2F;

  --line:       rgba(18, 46, 43, 0.16);
  --line-firm:  rgba(18, 46, 43, 0.32);

  --display: 'Fraunces', Georgia, serif;
  --body:    'Public Sans', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --gut: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

a { color: inherit; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

/* --- top bar --------------------------------------------------------- */

.topbar {
  border-bottom: 1px solid var(--line-firm);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}

.topbar__inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0.75rem var(--gut);
  display: flex; align-items: center; gap: 1.5rem;
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--brass); }

.topbar nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.topbar nav a:hover { border-bottom-color: var(--brass); }
.topbar nav a[aria-current] { border-bottom-color: var(--ink); }

/* --- buttons --------------------------------------------------------- */

.btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--vault); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--brass { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn--brass:hover { background: #866629; border-color: #866629; }

.btn--yes { background: var(--verdigris); border-color: var(--verdigris); color: #fff; }
.btn--yes:hover { background: #246457; border-color: #246457; }

.btn--no { background: transparent; border-color: var(--rust); color: var(--rust); }
.btn--no:hover { background: var(--rust); color: #fff; }

.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.6875rem; }

/* --- the plate: signature element ------------------------------------ */
/* An engraved certificate of ownership. Used at three sizes: the hero,
   each catalogue card, and the listing detail header. */

.plate {
  background: var(--card);
  border: 1px solid var(--line-firm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 1px 0 rgba(18,46,43,0.06);
  padding: 1.25rem 1.35rem 1.1rem;
  position: relative;
}

.plate::before {
  content: '';
  position: absolute; inset: 5px;
  border: 1px solid var(--brass);
  opacity: 0.35;
  pointer-events: none;
}

.plate__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.plate__rows { margin: 0; font-family: var(--mono); font-size: 0.75rem; }

.plate__row {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.28rem 0;
}
.plate__row dt {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  white-space: nowrap;
}
.plate__row .leader {
  flex: 1;
  border-bottom: 1px dotted var(--line-firm);
  transform: translateY(-3px);
  min-width: 1rem;
}
.plate__row dd { margin: 0; font-weight: 500; text-align: right; }

/* The whole product, in one character. */
.forever {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--brass);
  letter-spacing: 0;
}

.serial {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-top: 0.85rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
}

/* --- hero ------------------------------------------------------------ */

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--line-firm);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: normal;
  font-variation-settings: 'opsz' 144, 'WONK' 1, 'SOFT' 100;
  color: var(--brass);
}

.hero__lede {
  font-size: 1.0625rem;
  max-width: 42ch;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
}

.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero__plate { max-width: 380px; margin-left: auto; width: 100%; }

/* The struck-out subscription row: the thing this site exists to refuse. */
.struck { position: relative; color: var(--rust); }
.struck dd, .struck dt { color: var(--rust); }
.struck::after {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 0; height: 1.5px;
  background: var(--rust);
  animation: strike 0.5s 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes strike { to { width: 100%; } }

.reveal { opacity: 0; animation: reveal 0.5s 1.7s ease forwards; }
@keyframes reveal { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .struck::after { animation: none; width: 100%; }
  .reveal { animation: none; opacity: 1; }
  .btn:hover { transform: none; }
}

/* --- section headers ------------------------------------------------- */

.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-firm);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}
.section__head h1,
.section__head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* --- filters --------------------------------------------------------- */

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

.chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-firm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.search {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-firm);
  background: var(--card);
  color: var(--ink);
  min-width: 200px;
}

/* --- catalogue ------------------------------------------------------- */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.title-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.title-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 -2px rgba(18,46,43,0.12);
}

.title-card h3 { font-size: 1.375rem; margin-bottom: 0.35rem; }
.title-card p {
  font-size: 0.875rem; color: var(--ink-soft);
  margin: 0 0 0.9rem; flex: 1;
}

.price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.price small {
  display: block; font-weight: 400; font-size: 0.5625rem;
  letter-spacing: 0.16em; color: var(--ink-soft); text-align: right;
}

/* --- badges ---------------------------------------------------------- */

.badge {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge--pending     { color: var(--brass); }
.badge--approved    { color: var(--verdigris); }
.badge--published   { color: var(--verdigris); }
.badge--rejected    { color: var(--rust); }
.badge--quarantined { color: var(--rust); }
.badge--shadowed    { color: var(--ink-soft); }

/* --- detail view ----------------------------------------------------- */

.detail { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }

.detail__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.detail h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 0.5rem; }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1rem; }

.backlink {
  font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft);
  display: inline-block; margin-bottom: 1.5rem;
}
.backlink:hover { color: var(--ink); }

.shots { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.shots img {
  width: 180px; height: 120px; object-fit: cover;
  border: 1px solid var(--line-firm);
}

/* --- comments -------------------------------------------------------- */

.thread { margin-top: 3rem; border-top: 1px solid var(--line-firm); padding-top: 1.5rem; }

.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.comment__meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.08em; color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.comment p { margin: 0; font-size: 0.9375rem; }

textarea, input[type=text], input[type=email], input[type=url], input[type=number], select {
  width: 100%;
  font-family: var(--body);
  font-size: 0.9375rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-firm);
  background: var(--card);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

label {
  display: block;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.1rem 0 0.35rem;
}

.hint { font-size: 0.75rem; color: var(--ink-soft); margin: 0.35rem 0 0; }

.notice {
  font-family: var(--mono); font-size: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--brass);
  background: var(--card);
  margin: 1rem 0;
}
.notice--bad  { border-left-color: var(--rust); color: var(--rust); }
.notice--good { border-left-color: var(--verdigris); color: var(--verdigris); }

/* --- vault sections (dark) ------------------------------------------- */

.vault {
  background: var(--vault);
  color: var(--paper);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.vault h2 { color: var(--paper); }
.vault .eyebrow { color: var(--brass); }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-top: 2rem; }
.rules h3 { font-size: 1.0625rem; margin-bottom: 0.4rem; color: var(--paper); }
.rules p { font-size: 0.875rem; color: rgba(230,231,225,0.68); margin: 0; }
.rules .n {
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.16em;
  color: var(--brass); display: block; margin-bottom: 0.6rem;
}

/* --- admin ledger ---------------------------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--line-firm);
  border: 1px solid var(--line-firm);
  margin-bottom: 2rem;
}
.stat { background: var(--card); padding: 1rem 1.1rem; }
.stat b {
  display: block; font-family: var(--mono); font-size: 1.75rem;
  font-weight: 700; line-height: 1.1;
}
.stat .eyebrow { display: block; margin-top: 0.25rem; }
.stat--calm b { color: var(--verdigris); }
.stat--warn b { color: var(--brass); }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-firm); margin-bottom: 1.5rem; }
.tab {
  font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.7rem 1.1rem; border: none; background: none;
  color: var(--ink-soft); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }

.row {
  border: 1px solid var(--line-firm);
  background: var(--card);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.row__head {
  display: flex; align-items: flex-start; gap: 1rem;
  justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.row__head h3 { font-size: 1.125rem; }
.row__body { font-size: 0.875rem; color: var(--ink-soft); margin: 0 0 0.85rem; }
.row__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Why the engine flagged something, so a decision takes seconds. */
.why {
  font-family: var(--mono); font-size: 0.6875rem;
  background: rgba(18,46,43,0.045);
  border-left: 2px solid var(--brass);
  padding: 0.6rem 0.8rem; margin: 0 0 0.85rem;
}
.why ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.why li { margin-bottom: 0.15rem; }

.meter {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em;
}
.meter__track { width: 90px; height: 4px; background: var(--line); position: relative; }
.meter__fill { position: absolute; inset: 0 auto 0 0; background: var(--brass); }

.empty {
  text-align: center; padding: 3.5rem 1rem;
  border: 1px dashed var(--line-firm);
  color: var(--ink-soft);
}
.empty .forever { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

/* --- footer ---------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line-firm);
  padding: 2rem 0 3rem;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.08em; color: var(--ink-soft);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.demo-flag {
  background: var(--brass); color: #fff;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.1em; text-align: center; padding: 0.4rem;
}
.demo-flag button {
  background: none; border: 1px solid rgba(255,255,255,0.5);
  color: #fff; font: inherit; padding: 0.1rem 0.5rem;
  margin-left: 0.5rem; cursor: pointer;
}

/* --- splash / sign in ------------------------------------------------- */
/* The dark counterpart to the catalogue: one plate, centred, nothing else
   competing with it. The rotating line sits where a deed's inscription would. */

.splash {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--vault);
  color: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.splash a { color: var(--paper); }

.splash__bar {
  padding: 1.5rem var(--gut);
  display: flex; align-items: center; gap: 1rem;
}
.splash__bar .wordmark { color: var(--paper); }

.splash__main {
  display: grid;
  place-items: center;
  padding: 2rem var(--gut) 3rem;
}

.splash__inner {
  width: 100%; max-width: 460px;
  text-align: center;
}

/* Rotating taglines. Every line is in the DOM at once and rotated by
   visibility, so a crawler reads all of them and the page still says
   something with JavaScript switched off. */
.taglines {
  position: relative;
  min-height: 5.5rem;
  margin-bottom: 2rem;
  display: grid;
}

.tagline {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  font-weight: 600;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.tagline[data-on] { opacity: 1; transform: none; }
.tagline em { font-style: normal; color: var(--brass); }

/* No JS: show the first line rather than an empty box. */
.no-js .tagline:first-child { opacity: 1; transform: none; }

.splash .plate {
  background: rgba(230, 231, 225, 0.04);
  border-color: rgba(230, 231, 225, 0.22);
  box-shadow: none;
  text-align: left;
}
.splash .plate::before { border-color: var(--brass); opacity: 0.45; }
.splash .plate__head { border-bottom-color: rgba(230, 231, 225, 0.18); }
.splash .plate__row dt { color: rgba(230, 231, 225, 0.55); }
.splash .plate__row .leader { border-bottom-color: rgba(230, 231, 225, 0.28); }
.splash .serial {
  border-top-color: rgba(230, 231, 225, 0.18);
  color: rgba(230, 231, 225, 0.5);
}

.splash .btn--ghost { color: var(--paper); border-color: rgba(230, 231, 225, 0.4); }
.splash .btn--ghost:hover { background: var(--paper); color: var(--vault); }

.splash__actions { display: grid; gap: 0.6rem; margin-top: 1.5rem; }

.splash__dots {
  display: flex; gap: 0.4rem; justify-content: center;
  margin-top: 1.25rem;
}
.splash__dot {
  width: 20px; height: 2px; padding: 0; border: none;
  background: rgba(230, 231, 225, 0.25);
  cursor: pointer; transition: background 0.3s;
}
.splash__dot[aria-current="true"] { background: var(--brass); }

.splash__foot {
  padding: 1.5rem var(--gut) 2rem;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: rgba(230, 231, 225, 0.45);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.splash__foot a { color: inherit; }
.splash__foot a:hover { color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  .tagline { transition: none; }
}

/* --- app shell -------------------------------------------------------- */
/* Bottom tab bar on phones, a centred segmented control from tablet up.
   The bar is a column grid with no fixed count, so two tabs and three tabs
   both lay out correctly without a modifier class. */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--vault);
  color: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.shell a { color: inherit; }

.shell__head {
  padding: 1rem var(--gut) 0.85rem;
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid rgba(230, 231, 225, 0.12);
  position: sticky; top: 0; z-index: 20;
  background: var(--vault);
}
.shell__head .wordmark { color: var(--paper); }
.shell__head .eyebrow { margin-left: auto; color: rgba(230, 231, 225, 0.5); }

.shell__main { padding: 1.5rem var(--gut) 2rem; }
.shell__main > .wrap { padding: 0; }

/* Boot gate, matching the pattern of loading the account before painting. */
.boot {
  min-height: 60vh;
  display: grid; place-items: center; text-align: center;
  gap: 0.75rem;
}
.boot__spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(230, 231, 225, 0.2);
  border-top-color: var(--brass);
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot__spinner { animation-duration: 3s; } }

.gate { max-width: 460px; margin: 3rem auto; text-align: center; }
.gate h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin-bottom: 0.75rem; }
.gate h1 em { font-style: normal; color: var(--brass); }
.gate p { color: rgba(230, 231, 225, 0.65); margin: 0 0 1.75rem; }

/* --- tab bar ---------------------------------------------------------- */

.tabbar {
  position: sticky; bottom: 0; z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(13, 33, 31, 0.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(230, 231, 225, 0.14);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tabbar__btn {
  appearance: none; border: none; background: none;
  color: rgba(230, 231, 225, 0.55);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 0.35rem 0.75rem;
  display: grid; justify-items: center; gap: 0.3rem;
  cursor: pointer;
  border-top: 2px solid transparent;
  margin-top: -1px;
  transition: color 0.15s;
}
.tabbar__btn svg { width: 20px; height: 20px; fill: none;
  stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar__btn:hover { color: rgba(230, 231, 225, 0.85); }
.tabbar__btn[aria-selected="true"] { color: var(--paper); border-top-color: var(--brass); }

.tabbar__badge {
  position: absolute; transform: translate(14px, -6px);
  background: var(--brass); color: #fff;
  font-size: 0.5rem; line-height: 1;
  padding: 0.15rem 0.28rem;
}

@media (min-width: 720px) {
  /* Above phone width the bar leaves the bottom edge and becomes a segmented
     control under the header, which reads as navigation rather than chrome. */
  .shell { grid-template-rows: auto auto 1fr; }
  .tabbar {
    position: static;
    order: -1;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: center;
    gap: 0.25rem;
    background: none;
    backdrop-filter: none;
    border-top: none;
    border-bottom: 1px solid rgba(230, 231, 225, 0.12);
    padding: 0.5rem var(--gut);
  }
  .tabbar__btn {
    grid-auto-flow: column;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-top: none;
    border-bottom: 2px solid transparent;
    margin: 0 0 -0.5rem;
  }
  .tabbar__btn[aria-selected="true"] { border-top-color: transparent; border-bottom-color: var(--brass); }
  .shell__main { padding-top: 2rem; }
}

/* --- metrics ---------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: rgba(230, 231, 225, 0.14);
  border: 1px solid rgba(230, 231, 225, 0.14);
  margin-bottom: 1.5rem;
}
.metric { background: var(--vault); padding: 1rem 1.1rem; }
.metric b {
  display: block; font-family: var(--mono);
  font-size: 1.5rem; font-weight: 700; line-height: 1.15;
}
.metric .eyebrow { display: block; margin-top: 0.3rem; color: rgba(230, 231, 225, 0.5); }
.metric--headline { grid-column: 1 / -1; }
.metric--headline b { font-size: clamp(2rem, 8vw, 2.75rem); color: var(--brass); }

/* --- account rows ----------------------------------------------------- */

.panel {
  border: 1px solid rgba(230, 231, 225, 0.14);
  margin-bottom: 1.25rem;
}
.panel > h2 {
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(230, 231, 225, 0.5);
  padding: 0.8rem 1.1rem;
  margin: 0;
  border-bottom: 1px solid rgba(230, 231, 225, 0.14);
  font-weight: 400;
}

.krow {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  font-family: var(--mono); font-size: 0.75rem;
  border-bottom: 1px solid rgba(230, 231, 225, 0.08);
}
.krow:last-child { border-bottom: none; }
.krow dt, .krow > span:first-child {
  color: rgba(230, 231, 225, 0.5);
  letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 0.6875rem; white-space: nowrap;
}
.krow .leader { flex: 1; border-bottom: 1px dotted rgba(230, 231, 225, 0.2); transform: translateY(-3px); }
.krow dd, .krow > span:last-child { margin: 0; text-align: right; }

.actions { display: grid; gap: 0.5rem; padding: 1.1rem; }
.actions .btn { text-align: center; }

.identity {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem;
}
.identity__mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--brass);
  font-family: var(--display); font-size: 1.25rem; color: var(--brass);
}
.identity strong { display: block; font-size: 1rem; }
.identity span { font-family: var(--mono); font-size: 0.6875rem; color: rgba(230, 231, 225, 0.5); }

/* --- library ---------------------------------------------------------- */

.lib { display: grid; gap: 0.75rem; }
.lib__item {
  border: 1px solid rgba(230, 231, 225, 0.14);
  padding: 0.9rem 1.1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.lib__item h3 { font-size: 1.0625rem; }
.lib__item .eyebrow { color: rgba(230, 231, 225, 0.5); }
.lib__item .btn { margin-left: auto; }

.shell .empty { border-color: rgba(230, 231, 225, 0.2); color: rgba(230, 231, 225, 0.55); }
.shell .notice { background: rgba(230, 231, 225, 0.05); }
.shell label { color: rgba(230, 231, 225, 0.55); }
.shell textarea, .shell input, .shell select {
  background: rgba(230, 231, 225, 0.05);
  border-color: rgba(230, 231, 225, 0.2);
  color: var(--paper);
}
.shell .hint { color: rgba(230, 231, 225, 0.45); }
.shell h1, .shell h2, .shell h3 { color: var(--paper); }

/* --- responsive ------------------------------------------------------ */

@media (max-width: 900px) {
  .hero__grid, .detail__grid { grid-template-columns: 1fr; }
  .hero__plate { margin: 0; max-width: 420px; }
}

@media (max-width: 560px) {
  .topbar__inner { gap: 0.75rem; }
  .topbar nav { gap: 0.85rem; font-size: 0.6875rem; }
  .shelf { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.5rem; }
}
