/* Shared style for every screen. Dark theme, gold accents (decision 0005).
   Type scale: 14 small, 16 body, 20 lead, 28 heading. Light weight, never italic.
   Text on photos is never below 14px. */
:root {
  --bg: #0b0b0c;
  --surface: #17171b;
  --line: #3a3326;
  --gold: #d4a64a;
  --gold-strong: #f0c35f;
  --text: #f5f1e8;
  --muted: #d3ccbc;
  --alert: #e5484d;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: 20px;
  --fs-head: 28px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: #050506; color: var(--text);
  font: 300 var(--fs-body)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-style: normal;
}
a { color: var(--gold-strong); }
h1 { font-size: var(--fs-head); font-weight: 600; line-height: 1.15; margin: 12px 0 4px; }
h2 { font-size: var(--fs-lead); font-weight: 600; margin: 0 0 8px; }
h3 { font-size: var(--fs-body); font-weight: 600; margin: 16px 0 4px; color: var(--gold); }
small { font-size: var(--fs-small); }

/* Reviewer chrome around the screens (not part of the product) */
.topbar { display: flex; gap: 16px; padding: 10px 16px; background: #111; font-size: var(--fs-small); border-bottom: 1px solid #222; }
.topbar span { color: var(--muted); }
.states { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; font-size: var(--fs-small); background: #0d0d0f; }
.states span { color: var(--muted); margin-right: 4px; }
.states a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; }
.states a.on { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.stage { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; align-items: flex-start; padding: 24px 16px 48px; }
.notes { flex: 1 1 320px; max-width: 520px; font-size: var(--fs-small); color: var(--muted); }
.notes table { border-collapse: collapse; width: 100%; }
.notes th, .notes td { border: 1px solid #2a2a2a; padding: 6px 8px; text-align: left; vertical-align: top; }
.notes code { color: var(--text); }

/* Client view (WB-13): states.js puts class "client" on <html> when the browser flag is set.
   It hides the three reviewer parts, so the client sees only the product. */
html.client .topbar, html.client .states, html.client .notes, html.client .index .intro, html.client .index .task, html.client .index .readme, html.client .index .viewswitch .to-client { display: none !important; }
html:not(.client) .index .viewswitch .to-notes { display: none; }

/* State switching: an element with data-s shows only in the listed states */
body[data-state="normal"] [data-s]:not([data-s~="normal"]),
body[data-state="loading"] [data-s]:not([data-s~="loading"]),
body[data-state="failure"] [data-s]:not([data-s~="failure"]),
body[data-state="empty"] [data-s]:not([data-s~="empty"]) { display: none; }

/* Phone frame */
.phone { width: 390px; height: 844px; border: 10px solid #26262b; border-radius: 44px; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; flex: none; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.statusbar { display: flex; justify-content: space-between; padding: 12px 24px 4px; font-size: var(--fs-small); font-weight: 600; }
.scroll { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.bottomnav { overflow-x: auto; scrollbar-width: none; display: flex; border-top: 1px solid var(--line); background: #0f0f11; padding: 6px 4px 14px; }
.bottomnav a { flex: 1 0 min-content; padding: 0 4px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--fs-small); color: var(--muted); text-decoration: none; text-align: center; }
.bottomnav a.on { color: var(--gold-strong); }
.bottomnav .ic { width: 24px; height: 24px; }

/* Desktop frame */
.desktop { width: 1180px; max-width: 100%; height: 720px; border: 10px solid #26262b; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.chrome { display: flex; gap: 6px; align-items: center; padding: 8px 12px; background: #1d1d21; font-size: var(--fs-small); color: var(--muted); }
.chrome i { width: 10px; height: 10px; border-radius: 50%; background: #444; }
.chrome span { margin-left: 12px; }
.adminbody { flex: 1; display: flex; min-height: 0; }
.sidenav { width: 220px; background: #0f0f11; border-right: 1px solid var(--line); padding: 16px 0; display: flex; flex-direction: column; }
.sidenav a { padding: 12px 20px; color: var(--text); text-decoration: none; font-size: var(--fs-body); border-left: 3px solid transparent; }
.sidenav a.on { color: var(--gold-strong); border-left-color: var(--gold); background: #17171b; }
.sidenav .who { margin-top: auto; padding: 12px 20px; font-size: var(--fs-small); color: var(--muted); }
.logo.small { padding: 0 20px 16px; font-size: var(--fs-lead); }
.content { flex: 1; padding: 24px 32px; overflow: auto; }
.stage:has(.desktop) { flex-direction: column; align-items: center; }
.stage:has(.desktop) .notes { max-width: 1180px; }

/* Brand */
.brand { text-align: center; padding: 12px 0 4px; }
.logo { font-size: 30px; font-weight: 700; letter-spacing: .5px; color: var(--text); font-style: normal; }
.slogan { font-size: var(--fs-small); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.tag { margin: 0 0 12px; color: var(--muted); }

/* Shop details strip */
.strip { display: grid; gap: 2px; padding: 8px 12px; margin: 8px 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.strip .row { display: flex; gap: 8px; align-items: center; font-size: var(--fs-small); color: var(--text); text-decoration: none; min-height: 32px; }
.strip a.row span { text-decoration: underline; text-decoration-color: var(--gold); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.go { width: 28px; height: 28px; color: var(--gold); }
.ic.big { width: 36px; height: 36px; color: var(--gold); }

/* Main action */
.cta { display: block; text-align: center; padding: 18px; font-size: var(--fs-lead); font-weight: 600; color: #1a1405; background: linear-gradient(#f0c35f, #c8962f); border-radius: 14px; text-decoration: none; margin: 4px 0 14px; min-height: 56px; }

/* Tiles */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: block; aspect-ratio: 3 / 2.3; border: 1px solid var(--gold); border-radius: 14px; overflow: hidden; color: var(--text); text-decoration: none; background: var(--surface); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 10%, rgba(0,0,0,.15) 70%); }
.tilebody { position: absolute; left: 10px; right: 40px; bottom: 8px; display: block; }
.tilebody b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: 1.15; }
.tilebody small { display: block; margin-top: 2px; font-weight: 300; color: var(--text); }
.tile .go { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; }
.tile.skel { background: linear-gradient(90deg, #17171b, #26262b, #17171b); background-size: 200% 100%; animation: sh 1.4s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .tile.skel { animation: none; } }

/* Mission banner */
.mission { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.mission span { flex: 1; }
.mission b { display: block; color: var(--gold-strong); font-size: var(--fs-body); }
.mission small { color: var(--text); }

/* Misc */
.bellrow { display: flex; justify-content: flex-end; padding-top: 4px; }
.bell { position: relative; display: inline-flex; padding: 10px; color: var(--text); }
.bellic { width: 28px; height: 28px; }
.count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--alert); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.banner { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--alert); border-radius: 10px; background: #2a1213; font-size: var(--fs-small); }
/* Links inside a banner are controls: 44px tall, on every screen (WB-12) */
.banner a { display: inline-flex; align-items: center; min-height: 44px; }
.loadingbar { color: var(--muted); }
.back { display: inline-flex; align-items: center; min-height: 44px; padding: 0; text-decoration: none; }
.body { color: var(--text); }
.foot { text-align: center; font-size: var(--fs-small); }
.ph { margin-top: 16px; padding: 16px; border: 2px dashed var(--gold); border-radius: 12px; color: var(--muted); }
.ph b { color: var(--gold-strong); }

/* Index */
.index { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.index ul { padding-left: 20px; }
.index li { margin: 6px 0; }
.index .task { color: var(--muted); font-size: var(--fs-small); }
.index .viewswitch { font-size: var(--fs-small); color: var(--muted); }

@media (max-width: 480px) {
  /* On a phone the two reviewer bars take 91px; the screen fills the rest, so the bottom navigation is on screen without scrolling. */
  /* Both bars have a fixed height (41 + 50 = 91px) so the phone's height below is exact (WB-12). */
  .topbar { height: 41px; white-space: nowrap; overflow: hidden; }
  .topbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .states { height: 50px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .states a { flex: none; white-space: nowrap; }
  .stage { padding: 0 0 24px; }
  .phone { width: 100%; height: calc(100vh - 91px); height: calc(100dvh - 91px); border: 0; border-radius: 0; }
  .notes { padding: 0 16px; }
  /* Client view: both bars are hidden, so the phone takes the whole height */
  html.client .phone { height: 100vh; height: 100dvh; }
}
