/* Vyrnfall account page: the login screen, the player's character journal and the staff tools.
   Colours, type, buttons, panels and fields come from assets/vyrnfall-ui.css; this file is layout. */

html, body, #app { min-height: 100%; }
html { height: 100%; }
body { min-height: 100vh; }
h1 { font-size: clamp(24px, 3vw, 34px); }
h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--violet-hi); letter-spacing: 0.03em; }
h2 .vf-icon { color: var(--violet); }
.small { font-size: 15px; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 20px; align-content: start; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.head h1 { color: #fff; }
.empty { color: var(--muted); padding: 14px 0 6px; }
.narrow { max-width: 560px; }
.facts { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 14px; background: var(--violet); color: var(--gold-ink); font-weight: 700; border-radius: var(--radius-sm); }
.skip:focus { top: 12px; color: var(--gold-ink); }
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* A message in place of content: something could not load, or there is nothing here. */
.state { display: grid; justify-items: center; gap: 12px; padding: 34px 20px; text-align: center; }
.state img { width: 96px; height: 96px; filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.7)); }
.state h2 { font-size: 24px; color: #fff; }
.state p { max-width: 52ch; color: var(--muted); }
.state__actions { justify-content: center; margin-top: 6px; }

/* ---- login: the gate of the fortress ---- */
.gate {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100dvh;
  display: grid; justify-items: center; align-content: center; gap: 18px;
  padding: 32px 20px 40px;
  background: var(--bg);
}
.gate::before { content: ""; position: fixed; inset: 0; z-index: -2; background: url("assets/brand/fortress.webp") 50% 40% / cover no-repeat; }
.gate::after { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(70% 70% at 50% 50%, rgb(11 8 15 / 0.7), rgb(11 8 15 / 0.35) 70%, rgb(11 8 15 / 0.15)), linear-gradient(180deg, rgb(11 8 15 / 0.4), transparent 30%, rgb(11 8 15 / 0.7)); }
.gate__mark { display: block; filter: drop-shadow(0 12px 26px rgb(0 0 0 / 0.8)); }
.gate__mark img { width: min(78vw, 420px); height: auto; }
.gate__panel { width: min(100%, 440px); padding: 30px; display: grid; gap: 16px; background: rgb(17 12 23 / 0.94); }
.gate__panel h1 { font-size: 28px; color: #fff; text-align: center; }
.gate__lead { color: var(--muted); text-align: center; }
.gate__links { margin: 0; padding: 16px 0 0; list-style: none; display: grid; gap: 8px; border-top: 1px solid var(--line-hi); color: var(--muted); }
.gate__links a { font-weight: 600; }
.linklike { padding: 0; border: 0; background: none; color: var(--violet); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linklike:hover { color: var(--violet-hi); }
.fold { padding-top: 14px; border-top: 1px solid var(--line-hi); }
.fold summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.fold[open] summary { margin-bottom: 10px; }
.fold[open] { display: grid; gap: 10px; }
.gate__back a { color: var(--ink); font-weight: 600; text-shadow: 0 1px 6px #000; }
.gate__back a:hover { color: var(--violet-hi); }
.gate .vf-btn--gold { width: 100%; min-height: 54px; font: 700 18px/1 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; }
.gate .vf-btn--gold[disabled] { opacity: 0.7; }
.gate .row { justify-content: stretch; }
.reveal-wrap { position: relative; }
.reveal-wrap .vf-input { padding-right: 52px; }
.reveal { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 46px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); }
.reveal:hover { color: var(--violet-hi); }
@media (max-width: 560px), (max-height: 700px) {
  /* A phone, or a short window with the keyboard open: the form starts near the top and scrolls with the page. */
  .gate { align-content: start; padding-top: 22px; gap: 14px; }
  .gate::before { background-image: url("assets/brand/fortress-tall.webp"); }
  .gate__mark img { width: min(66vw, 260px); }
  .gate__panel { padding: 22px 18px; }
}

/* ---- shell: a navigation rail and the page ---- */
.shell { position: relative; isolation: isolate; min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.shell::before { content: ""; position: absolute; inset: 0 0 auto 248px; height: 300px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgb(11 8 15 / 0.45), var(--bg)), url("assets/brand/fortress-band.webp") 50% 30% / cover no-repeat; }
.rail {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px;
  background: linear-gradient(180deg, rgb(201 35 69 / 0.1), transparent 220px), var(--bg) var(--grain);
  border-right: 1px solid var(--line-hi);
  box-shadow: 1px 0 0 #000, inset -1px 0 0 rgb(255 255 255 / 0.03);
}
.rail__brand { padding: 4px 8px 18px; display: grid; justify-items: center; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.vf-brand .vf-brand__mark { width: 180px; height: 60px; }
.rail__crest { display: none; }
.rail__nav { display: grid; gap: 3px; }
.rail__nav--staff { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail__label { padding: 0 12px 4px; font: 700 12px/1.4 var(--font-title); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.nav {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 9px 12px;
  font: 600 16px/1.2 var(--font-text); text-align: left; color: var(--muted); cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: color var(--fast), background-color var(--fast);
}
.nav:hover { color: var(--ink); background: var(--surface-2); }
/* The selected destination: lit amethyst, with a bar on its leading edge. */
.nav.active { color: #fff; background: linear-gradient(90deg, rgb(131 61 206 / 0.42), rgb(131 61 206 / 0.08)); border-color: var(--amethyst); box-shadow: inset 3px 0 0 var(--violet); }
.nav.active .vf-icon { color: var(--violet-hi); }
.rail__foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; }
.rail__play { margin-bottom: 8px; min-height: 50px; font: 700 15px/1 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; }
.rail__link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; font: 600 15px/1.2 var(--font-text); color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; border-radius: var(--radius-sm); text-align: left; }
.rail__link:hover { color: var(--ink); background: var(--surface-2); }
.rail__who { padding: 10px 12px 0; border-top: 1px solid var(--line); margin-top: 6px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.rail__who strong { color: var(--ink); }
.main { padding: 28px clamp(18px, 3vw, 40px) 56px; min-width: 0; display: grid; gap: 20px; align-content: start; max-width: 1240px; }
.main:focus { outline: none; }
.main > .vf-loading { padding: 60px 0; justify-self: center; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell::before { left: 0; height: 220px; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--line-hi); box-shadow: 0 1px 0 #000; background: rgb(11 8 15 / 0.94); }
  .rail__brand { padding: 0; margin: 0; border: 0; display: flex; align-items: center; gap: 8px; }
  .rail__crest { display: block; order: -1; }
  .vf-brand .vf-brand__mark { width: 132px; height: 44px; }
  .rail__nav, .rail__link, .rail__who { display: none; }
  /* Staff pages keep their own links in reach: a row under the top bar while one of them is open. */
  .rail { flex-wrap: wrap; }
  .rail__nav--staff.open { display: flex; flex-wrap: wrap; order: 3; width: 100%; margin: 8px 0 0; padding-top: 8px; gap: 4px; }
  .rail__nav--staff.open .rail__label { display: none; }
  .rail__nav--staff.open .nav { width: auto; }
  .rail__foot { margin: 0 0 0 auto; padding: 0; }
  .rail__play { margin: 0; padding-inline: 14px; min-height: 44px; }
  .main { padding: 18px 14px 100px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgb(11 8 15 / 0.97); border-top: 1px solid var(--line-hi);
  }
  .tabbar .nav { flex-direction: column; gap: 3px; min-height: 56px; padding: 6px 2px; font-size: 13px; text-align: center; justify-content: center; }
  .tabbar .nav.active { background: linear-gradient(180deg, rgb(131 61 206 / 0.42), rgb(131 61 206 / 0.05)); box-shadow: inset 0 3px 0 var(--violet); }
}
@media (max-width: 400px) { .rail__crest { display: none; } }

/* ---- the character plate ---- */
.plate { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 22px 26px; }
.plate::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(21 16 28 / 0.72), rgb(21 16 28 / 0.9)), url("assets/brand/fortress-band.webp") 50% 55% / cover no-repeat; }
.plate__emblem { width: 112px; height: 112px; filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.75)); }
.plate__who { display: grid; gap: 12px; min-width: 0; }
.plate__who h1 { overflow-wrap: anywhere; color: #fff; font-size: clamp(28px, 3.6vw, 42px); text-shadow: 0 2px 12px #000; }
.plate .vf-tag .vf-sprite { margin-right: 2px; }
.plate__levels { display: flex; gap: 12px; margin: 0; }
.plate__levels > div { display: grid; justify-items: center; min-width: 108px; padding: 12px 14px; background: rgb(11 8 15 / 0.72); border: 1px solid var(--line-hi); border-radius: var(--radius-sm); }
.plate__levels dt { font: 600 13px/1.3 var(--font-text); color: var(--muted); }
.plate__levels dd { margin: 0; font: 700 36px/1.05 var(--font-title); color: #fff; }
@media (max-width: 760px) {
  .plate { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 14px; }
  .plate__emblem { width: 72px; height: 72px; }
  .plate__levels { grid-column: 1 / -1; }
  .plate__levels > div { flex: 1; min-width: 0; }
  .plate__levels dd { font-size: 30px; }
}

/* ---- headline values ---- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--edge); }
.stat__icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; color: var(--violet-hi); background: linear-gradient(180deg, #3a2060, var(--amethyst-deep)); border: 1px solid var(--amethyst); border-radius: var(--radius-sm); }
.stat--coins .stat__icon { color: var(--ember); background: linear-gradient(180deg, #4a3413, #241806); border-color: #8a6a2a; }
.stat__icon .vf-icon { width: 24px; height: 24px; }
.stat__value { font: 700 28px/1.15 var(--font-text); color: #fff; overflow-wrap: anywhere; }
.stat__label { font: 600 14px/1.3 var(--font-text); color: var(--muted); }
.stat__full { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Two panels side by side on a wide screen: the quest board and membership. */
.pair { display: grid; gap: 20px; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: start; }
@media (max-width: 1080px) { .pair { grid-template-columns: 1fr; } }

/* ---- membership ---- */
.member { display: grid; gap: 12px; background: radial-gradient(120% 60% at 100% 0%, rgb(201 35 69 / 0.16), transparent 60%), var(--surface); }
.member--on { border-color: var(--amethyst); background: radial-gradient(120% 60% at 100% 0%, rgb(131 61 206 / 0.3), transparent 60%), var(--surface); }
.member__head { display: flex; align-items: center; gap: 8px; }
.member__big { font: 700 26px/1.15 var(--font-title); color: #fff; }
.member__big span { font: 600 16px/1.2 var(--font-text); color: var(--muted); }
.member a { font-weight: 600; }

/* ---- the daily quest board ---- */
.board { display: grid; gap: 14px; }
.board__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.board h2 { font-size: 22px; color: #fff; }
.board__member { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--amethyst); border-radius: var(--radius-sm); background: var(--amethyst-deep); color: var(--violet-hi); font-size: 15px; font-weight: 600; }
.board__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.task__icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--violet-hi); border: 1px solid var(--line-hi); border-radius: var(--radius-sm); background: var(--bg); }
.task__icon .vf-icon { width: 24px; height: 24px; }
.task__body { display: grid; gap: 7px; min-width: 0; }
.task__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; font-size: 17px; }
.task__top strong { font-weight: 700; color: var(--ink); }
.task__top span { color: var(--muted); }
.task__reward { font-size: 15px; color: var(--muted); }
.task--done { border-color: #2f6b47; }
.task--done .task__top span { color: var(--good); font-weight: 700; }
.board__bonus { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px dashed var(--line-hi); border-radius: var(--radius-sm); color: var(--ink); }
.board__bonus .vf-icon { color: var(--violet); }
.board__bonus--paid { border-style: solid; border-color: #2f6b47; }
.board__bonus--paid .vf-icon { color: var(--good); }
.board__foot { font-size: 15px; }

/* ---- the skill book ---- */
.skills { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.skill { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.skill__icon { width: 40px; height: 40px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-hi); border-radius: var(--radius-sm); }
.skill__body { display: grid; gap: 5px; min-width: 0; }
.skill__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.skill__name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.skill__level { font: 700 21px/1 var(--font-text); color: #fff; }
.skill--max .skill__level { color: var(--ember); }
.skill__xp { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.skill .vf-bar { height: 5px; }
@media (max-width: 560px) {
  .skills { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .skill { grid-template-columns: 30px minmax(0, 1fr); padding: 8px; gap: 8px; }
  .skill__icon { width: 30px; height: 30px; }
  .skill__icon .vf-sprite { width: 16px; height: 16px; }
}

.record { margin: 12px 0 10px; display: grid; gap: 4px 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.record > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.record dt { color: var(--muted); }
.record dd { margin: 0; text-align: right; }

/* ---- starter path: a quest journal ---- */
.path { display: grid; gap: 14px; }
.path__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.path__now { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid var(--crimson); border-radius: var(--radius-sm); background: radial-gradient(120% 90% at 0% 0%, rgb(201 35 69 / 0.2), transparent 60%), var(--bg-2); }
.path__kicker { font: 700 12px/1 var(--font-title); letter-spacing: 0.2em; text-transform: uppercase; color: var(--crimson-hi); }
.path__now h3 { font-size: 22px; color: #fff; }
.path__progress { margin-left: 12px; padding: 2px 10px; border: 1px solid var(--line-hi); border-radius: 999px; background: var(--bg); font: 700 15px/1.5 var(--font-text); color: var(--ink); white-space: nowrap; }
.path__now .path__reward { color: var(--ember); font-weight: 600; font-size: 16px; }
.path__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 8px 20px; }
.path__step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; color: var(--muted); }
.path__step strong { color: var(--muted); font-weight: 600; }
.path__mark { width: 28px; height: 28px; border: 1px solid var(--line-hi); border-radius: var(--radius-sm); display: grid; place-items: center; margin-top: 1px; font: 700 14px/1 var(--font-text); color: var(--muted); background: var(--bg); }
.path__mark .vf-icon { width: 16px; height: 16px; }
.path__step--done .path__mark { border-color: #2f6b47; color: var(--good); }
.path__step--done strong { color: var(--muted); }
.path__step--now strong { color: #fff; }
.path__step--now .path__mark { border-color: var(--crimson-hi); color: #fff; background: var(--crimson-deep); }
.path__step--now .path__reward { color: var(--crimson-hi); font-weight: 700; }
.path__step--bonus .path__mark { border-color: var(--amethyst); color: var(--violet-hi); background: var(--amethyst-deep); }
.path__step--bonus strong { color: var(--violet-hi); }
.path__reward { font-size: 14px; margin-top: 2px; }

/* ---- items ---- */
.itembar { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.itemdetail { grid-column: 1 / -1; margin: 0; padding: 11px 14px; background: var(--bg); border: 1px solid var(--line-hi); border-left: 3px solid var(--violet); border-radius: var(--radius-sm); color: var(--muted); min-height: 48px; overflow-wrap: anywhere; }
.itemdetail strong { color: #fff; }
.segs { display: inline-flex; border: 1px solid var(--line-hi); border-radius: var(--radius-sm); overflow: hidden; }
.seg { min-height: 48px; padding: 8px 16px; font: 600 15px/1.2 var(--font-text); color: var(--muted); background: var(--bg-2); border: 0; cursor: pointer; }
.seg + .seg { border-left: 1px solid var(--line-hi); }
.seg:hover { color: var(--ink); }
.seg.active { color: #fff; background: linear-gradient(180deg, #4a2a7a, var(--amethyst-deep)); box-shadow: inset 0 -2px 0 var(--violet); }
/* The backpack and what is worn sit side by side, as in the game; the bank runs the full width under them. */
.items-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: start; }
.items--bank { grid-column: 1 / -1; }
.items h2 { margin-bottom: 14px; }
.slots { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.slots--inventory { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Worn equipment laid out as the game's equipment tab: head on top, weapon and shield at the sides, feet below. */
.slots--worn { grid-template-columns: repeat(3, minmax(0, 104px)); justify-content: center;
  grid-template-areas: ". head ." "cape neck ammunition" "weapon body shield" ". legs ." "hands feet ring"; }
.slot--head { grid-area: head; } .slot--cape { grid-area: cape; } .slot--neck { grid-area: neck; } .slot--ammunition { grid-area: ammunition; }
.slot--weapon { grid-area: weapon; } .slot--body { grid-area: body; } .slot--shield { grid-area: shield; } .slot--legs { grid-area: legs; }
.slot--hands { grid-area: hands; } .slot--feet { grid-area: feet; } .slot--ring { grid-area: ring; }
.slot { aspect-ratio: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.6); }
.slot > button { position: relative; width: 100%; height: 100%; display: grid; align-content: center; justify-items: center; gap: 2px; padding: 16px 5px 5px; font: 600 13px/1.2 var(--font-text); color: var(--ink); background: linear-gradient(180deg, rgb(131 61 206 / 0.12), transparent 70%); border: 0; cursor: pointer; border-radius: inherit; }
.slot > button:hover { background: var(--surface-2); }
.slot--picked { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--amethyst), var(--glow-violet); }
.slot__qty { position: absolute; left: 6px; top: 4px; font: 700 13px/1 var(--font-text); color: var(--ember); }
.slot__name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: center; overflow-wrap: anywhere; }
.slot__where { font: 600 11px/1.2 var(--font-text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.slot--empty { display: grid; place-items: center; opacity: 0.7; }
/* Each container has its own ground, so a glance tells them apart. */
.items--worn .slot { border-color: var(--line-hi); }
.items--bank .slot { border-style: dashed; }
.rows { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.rows > li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.rows > li span:last-child { color: var(--ember); white-space: nowrap; }
@media (max-width: 1080px) { .items-grid { grid-template-columns: 1fr; } .slots--inventory { max-width: 440px; } }
@media (max-width: 640px) {
  .itembar { grid-template-columns: 1fr; }
  .slots--inventory { max-width: none; }
  .slots--bank { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .slots--worn { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot > button { font-size: 12px; padding-inline: 3px; }
}

/* ---- messages ---- */
.inbox { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.mail { padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line-hi); border-left: 3px solid var(--violet); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.mail--personal { border-left-color: var(--crimson-hi); }
.mail p { color: var(--ink); white-space: pre-wrap; max-width: 80ch; }
.mail__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-bottom: 8px; }
.mail__head strong { display: inline-flex; align-items: center; gap: 7px; color: var(--violet-hi); }
.mail__head time { color: var(--muted); font-size: 15px; }
.inbox .vf-notice { list-style: none; }
.standing { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.standing--good { color: var(--good); border-color: #2f6b47; }
.standing--bad { color: #ffb3a3; border-color: #7d4034; }
.vf-panel > .vf-notice, .vf-panel > .small { margin-top: 12px; }

/* ---- staff tools: plain panels, tables and forms ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; min-width: 0; align-content: start; box-shadow: var(--edge); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.stat-card .value { font: 700 26px/1.2 var(--font-text); overflow-wrap: anywhere; }
.stat-card .label { color: var(--muted); font-size: 14px; }
.inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline > .vf-field { flex: 1; min-width: 140px; }
.check { min-height: 46px; color: var(--muted); font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font: 600 12.5px/1.3 var(--font-text); text-transform: uppercase; letter-spacing: 0.07em; }
tbody tr:hover { background: var(--surface-2); }
td.wrap { white-space: normal; overflow-wrap: anywhere; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.itemlist { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-height: 320px; overflow-y: auto; }
.item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; background: var(--bg); border-radius: 3px; font-size: 14.5px; }
.item span:last-child { color: var(--muted); }
.results { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }
.results button { text-align: left; border: 0; background: var(--bg); color: var(--ink); border-radius: 3px; padding: 8px 10px; font: 400 15px/1.3 var(--font-text); cursor: pointer; }
.results button:hover { background: var(--surface-2); color: var(--violet-hi); }
.note { background: var(--bg); border-radius: var(--radius-sm); padding: 9px 11px; overflow-wrap: anywhere; }

/* A member's page: sections as tabs, each a two-column layout whose columns stack their own cards. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-hi); }
.tab { min-height: 44px; padding: 10px 16px; font: 600 16px/1.2 var(--font-text); color: var(--muted); background: none; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: #fff; background: var(--surface); border-color: var(--line-hi); border-bottom: 1px solid var(--surface); box-shadow: inset 0 2px 0 var(--violet); }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.card--danger { border-color: #7d4034; }
.rule { height: 1px; background: var(--line); }
.grow { flex: 1; min-width: 0; }
.standing .muted { margin-top: 2px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pager .vf-btn { min-height: 40px; padding: 7px 14px; }

#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--good); border-left-width: 3px; border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }
#toast.bad { border-color: var(--bad); }
@media (max-width: 900px) { #toast { bottom: 88px; right: 12px; } }
@media (prefers-reduced-motion: reduce) { #toast, .nav { transition: none; } #toast { transform: none; } }

/* Staff news posts */
.news-title { font-weight: 700; color: var(--ink); margin-top: 2px; }
.news-text { white-space: pre-wrap; color: var(--muted); margin-top: 4px; }
.news-picture { display: block; max-width: 100%; max-height: 180px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
textarea.vf-input { resize: vertical; min-height: 150px; font: inherit; line-height: 1.5; }

/* Staff guide */
.guide { display: grid; gap: 14px; scroll-margin-top: 16px; }
.guide + .guide { margin-top: 20px; }
.guide__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.guide p, .guide li { max-width: 78ch; }
.guide__toc { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-block: 16px 20px; }
.guide__list, .guide__steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.guide__note { padding: 12px 14px; border: 1px solid var(--line-hi); border-left: 3px solid var(--violet); border-radius: var(--radius-sm); background: var(--bg); }
.guide__img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-hi); border-radius: var(--radius-sm); }
.guide__table th, .guide__table td { vertical-align: top; text-align: left; }
.guide__table tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.guide__table tbody th { text-transform: none; letter-spacing: 0; font-size: inherit; background: none; }
.guide__table th, .guide__table td { overflow-wrap: normal; word-break: normal; }
.guide__table td:nth-child(2):not(:last-child) { white-space: nowrap; }
.vf-panel > h2 + * { margin-top: 10px; }
.vf-panel > .facts, .vf-panel > form, .vf-panel > .row { margin-top: 14px; }

/* ---- second pass ---- */
.plate__saved { margin: 0; font-size: 15px; color: var(--muted); }
.plate__saved time { color: var(--ink); font-variant-numeric: tabular-nums; }
.gate__next { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.gate__next h2 { font: 700 15px/1.3 var(--font-text); color: var(--ink); }
.gate__next ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; color: var(--muted); }

/* ---- shop ---- */
.shop { display: grid; gap: 20px; }
.shopbar { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(200px, 320px); align-items: end; }
.shoplist { margin: 10px 0 0; padding: 0; list-style: none; }
.shoprow { display: grid; grid-template-columns: minmax(0, 1fr) auto 92px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shoprow:last-child { border-bottom: 0; }
.shoprow__what { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.shoprow__what strong { color: #fff; font-weight: 600; }
.shoprow__shop { color: var(--muted); font-size: 14px; }
.shoprow__price { color: var(--ember); font-weight: 700; white-space: nowrap; text-align: right; }
.shoprow__unit { color: var(--muted); font-weight: 400; font-size: 14px; }
.shoprow__qty { min-height: 44px; text-align: right; }
.exchange-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.exchange { display: grid; gap: 10px; align-content: start; }
.exchange__worth { margin: 0; color: var(--ember); font: 700 22px/1.2 var(--font-text); }
@media (max-width: 720px) {
  .shopbar { grid-template-columns: 1fr; }
  .shoprow { grid-template-columns: minmax(0, 1fr) 84px auto; }
  .shoprow__what { grid-column: 1 / -1; }
  .shoprow__price { text-align: left; }
}
