/* Page chrome follows the Morges.info "Gazette" system: a local newspaper on
   warm paper, serif masthead, ink rules, one red accent. Light only, by design.
   The illustrated market keeps its own Daytime / Evening palette below. */
:root {
  --bg: #f3eee4;          /* newsprint */
  --surface: #fbf8f2;
  --stone: #e9e2d5;
  --line: #d6cdbd;
  --stone-3: #bdb3a2;
  --ink: #1c1b19;
  --muted: #57524a;
  --accent: #b3121a;      /* editorial red */
  --accent-soft: #f2e3d8;
  --lake: #2f5d6e;        /* interactive accent */
  --cat-home: #4f6b45;
  --cat-micro: #7a2a3a;
  --chip-ink: #fbf8f2;
  --focus: #2f5d6e;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --display: 'Young Serif', 'Iowan Old Style', Georgia, serif; /* painted signs in the illustration */
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --street-h: clamp(420px, calc(100vh - 380px), 820px);
  color-scheme: light;
}

/* ---------- scene lighting: chosen with the Daytime / Evening switch,
   independent of the page's light or dark theme ---------- */
.market {
  /* Daytime: clear California sky, warm afternoon sun */
  --sky-1: #2f86d4;
  --sky-2: #6fb3e6;
  --sky-3: #bfe0f2;
  --sky-4: #e8eedf;
  --mtn-far: #9fb3c4;
  --mtn: #8aa0ae;
  --hill-back: #c2b46e;
  --hill: #a8a356;
  --vine: #66803a;
  --oak: #5d7236;
  --oak-near: #4f652f;
  --cloud: rgba(255, 255, 255, 0.85);
  --sun-o: 1;
  --star-o: 0;
  --street: #c6b9a3;
  --promenade: #d2c6af;
  --glass: #4f7380;
  --banner: #2c5f8d;
  --banner-mark: #f4f1e8;
  --road-line: #e2b33c;
  --haze: #cfe3ee;
  --medal-ink: #f3ead8;
  --tint: rgba(16, 22, 52, 0);
  --lights-o: 0;
  --stall-filter: saturate(1.06);
  --crowd-filter: none;
  --fg-filter: none;
}
.market[data-scene="evening"] {
  --sky-1: #2a3d74;
  --sky-2: #6c6493;
  --sky-3: #d99068;
  --sky-4: #e8a774;
  --mtn-far: #6c6f8e;
  --mtn: #575d7a;
  --hill-back: #77704e;
  --hill: #686442;
  --vine: #464c2c;
  --oak: #444a2c;
  --oak-near: #3b4027;
  --cloud: rgba(220, 200, 230, 0.28);
  --sun-o: 0;
  --star-o: 0.9;
  --street: #a99c8b;
  --promenade: #b2a693;
  --glass: #3d3f45;
  --banner: #2c5f8d;
  --banner-mark: #f4f1e8;
  --road-line: #c9a24a;
  --haze: #8a88a8;
  --medal-ink: #ffd98c;
  --tint: rgba(14, 18, 48, 0.5);
  --lights-o: 1;
  --stall-filter: brightness(.82) saturate(.9);
  --crowd-filter: brightness(.8) saturate(.9);
  --fg-filter: brightness(.62) saturate(.85);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 8px 14px; background: var(--lake); color: #fff; text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* ---------- newspaper masthead ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: 'date date date' 'brand brand brand' '. nav note';
  gap: 0 16px;
  padding: 14px max(20px, calc((100% - 1120px) / 2)) 0;
  border-bottom: 3px double var(--ink);
  position: relative;
}
.site-header::before { content: ''; grid-row: 3; grid-column: 1 / -1; border-top: 1px solid var(--ink); }
.masthead-dateline {
  grid-area: date;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.masthead-founded { justify-self: end; }
.masthead-emblem {
  grid-row: 2; grid-column: 3; justify-self: center; align-self: start;
  margin-top: clamp(34px, calc(14px + 3vw), 50px);
}
.masthead-emblem svg { display: block; width: clamp(44px, 5vw, 64px); height: clamp(44px, 5vw, 64px); }
.brand {
  grid-area: brand; justify-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px 0 10px; text-align: center; color: inherit; text-decoration: none;
}
.brand-mark { width: clamp(28px, 3.4vw, 40px); height: clamp(28px, 3.4vw, 40px); }
.brand-name {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 4.1rem);
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.035em; line-height: .95;
}
.brand-dot { color: var(--accent); font-style: italic; font-weight: 400; }
.brand-place { margin-top: 4px; font-size: .74rem; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; color: var(--accent); }
.brand-motto {
  margin-top: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .24em;
  text-transform: uppercase; color: var(--muted);
}
.site-nav { grid-area: nav; padding: 4px 0; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a, .site-nav .soon {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px;
  font-weight: 600; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .soon { color: var(--stone-3); cursor: default; }
.masthead-note {
  grid-area: note; justify-self: end; align-self: center;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* ---------- front-page lead ---------- */
.intro {
  padding-block: clamp(16px, 2.2vw, 22px) clamp(14px, 1.8vw, 18px);
  display: grid; gap: 4px 40px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end;
}
.kicker { grid-column: 1 / -1; margin: 0 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.intro h1 { font-size: clamp(1.7rem, 2.8vw, 2.3rem); font-variation-settings: 'opsz' 96; line-height: 1.08; max-width: 22ch; }
.lead { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; color: #34312c; max-width: 60ch; }
.lead::first-letter { float: left; padding: 4px 8px 0 0; font-size: 3.2em; font-weight: 600; line-height: .85; color: var(--accent); }

/* ---------- the street ---------- */
.market { position: relative; }
.street {
  position: relative;
  height: var(--street-h);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
  cursor: grab;
  border-block: 1px solid var(--ink);
  -webkit-overflow-scrolling: touch;
}
.street:focus-visible { outline-offset: -4px; }
.street.dragging { cursor: grabbing; user-select: none; }
.street.dragging .stall { pointer-events: none; }
.track {
  position: relative;
  height: 100%;
  width: calc(var(--street-h) * 7140 / 820);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 32%, var(--sky-3) 50%, var(--sky-4) 62%, var(--sky-4) 100%);
}
.layer { position: absolute; inset: 0; }
.layer > svg { display: block; width: 100%; height: 100%; }
.layer-parallax { will-change: transform; }
.tint { background: var(--tint); pointer-events: none; }
.lights { opacity: var(--lights-o); pointer-events: none; transition: opacity .6s; }
.stalls { pointer-events: none; }
.foreground { pointer-events: none; filter: var(--fg-filter); }
.grain { pointer-events: none; opacity: .5; mix-blend-mode: multiply; background-size: 180px 180px; }

/* street illustration classes */
.mtn-far { fill: var(--mtn-far); } .mtn { fill: var(--mtn); }
.hill-back { fill: var(--hill-back); } .hill { fill: var(--hill); }
.vine-row { fill: var(--vine); }
.oak { fill: var(--oak); } .oak-near { fill: var(--oak-near); }
.cloud { fill: var(--cloud); }
.star { fill: #fff; opacity: var(--star-o); }
.road, .street-p { fill: var(--street); }
.promenade { fill: var(--promenade); }
.glass { fill: var(--glass); }
.shine { fill: #fff; opacity: .13; }
.lit { fill: #f2b85e; opacity: .5; }
.lamp-glass { fill: #ece2c6; }
.bulb { fill: #f4ecd2; }
.sign-paint { font-family: var(--display); }
.sign-small { font-family: var(--body); font-weight: 700; }
.arch-letters { font-family: var(--display); fill: var(--arch-letter); }
.arch-sky { fill: var(--sky-2); }
.medal-letters { font-family: var(--display); fill: var(--medal-ink); }
.medal-stroke { stroke: var(--medal-ink); }
.medal-fill { fill: var(--medal-ink); }
.globe { fill: #f8f5ea; stroke: #d6cfbc; stroke-width: 1; }
.banner { fill: var(--banner); }
.banner-mark { stroke: var(--banner-mark); }
.road-line { fill: var(--road-line); opacity: .8; }
.haze-far { fill: var(--haze); opacity: .55; }
.sun { opacity: var(--sun-o); }
.sun-disc { fill: #fff8e2; }

/* ---------- stall component ---------- */
.stall {
  position: absolute;
  padding: 0; margin: 0; border: 0; background: none;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform .25s ease;
  filter: var(--stall-filter);
  -webkit-tap-highlight-color: transparent;
}
.stall svg { display: block; width: 100%; height: 100%; overflow: visible; }
.stall:hover { transform: translateY(-1.2%) scale(1.015); }
.stall:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.stall--open { opacity: .92; }
.stall-name { font-family: var(--display); fill: #3b2f25; }
.stall-small { font-family: var(--body); font-weight: 700; }
.chalk { font-family: var(--body); font-weight: 600; fill: #f1ede2; }
.flame { fill: #f2a33a; }
.demo-chip { fill: #24221d; }
.demo-chip-text { fill: #f4e6c6; }
.stall-lantern { fill: #f1ddb0; }
.mini-bulb { fill: #fff3cf; stroke: rgba(60,50,40,.35); stroke-width: .6; }
.lantern-glow { fill: url(#halo); opacity: var(--lights-o); }

/* ---------- crowd and ad carriers ---------- */
.crowd { pointer-events: none; }
.walker { position: absolute; left: 0; display: block; will-change: transform; filter: var(--crowd-filter); }
.walker svg { display: block; width: 100%; height: 100%; overflow: visible; }
.walker--left svg { transform: scaleX(-1); }
.walker--left .unflip { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.walker .lg1, .walker .lg2, .walker .ar1, .walker .ar2 { transform-box: fill-box; transform-origin: 50% 0; }
.walking .lg1, .walking .ar2 { animation: swing .9s ease-in-out infinite alternate; }
.walking .lg2, .walking .ar1 { animation: swing .9s ease-in-out infinite alternate-reverse; }
.walking .figure { animation: bob .45s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
.walker--ad { pointer-events: auto; cursor: pointer; }
.walker--ad:hover { filter: drop-shadow(0 0 6px rgba(255, 244, 214, .9)); }
.walker--ad:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.ad-label { font-family: var(--serif); font-weight: 700; }
.ad-tag { font-family: var(--body); font-weight: 800; fill: #fff; letter-spacing: .08em; }
.ad-sign { transform-box: view-box; transform-origin: 22px -140px; animation: sign-trick 6.5s ease-in-out infinite; }
@keyframes sign-trick {
  0%, 100% { transform: translateY(0) rotate(-4deg) scaleX(1); }
  22% { transform: translateY(0) rotate(4deg) scaleX(1); }
  44% { transform: translateY(0) rotate(-3deg) scaleX(1); }
  54% { transform: translateY(-30px) rotate(0deg) scaleX(1); }
  59% { transform: translateY(-62px) rotate(0deg) scaleX(.05); }
  64% { transform: translateY(-78px) rotate(0deg) scaleX(-1); }
  69% { transform: translateY(-62px) rotate(0deg) scaleX(.05); }
  74% { transform: translateY(-30px) rotate(0deg) scaleX(1); }
  80% { transform: translateY(0) rotate(0deg) scaleX(1); }
  90% { transform: translateY(0) rotate(-4deg) scaleX(1); }
}
.ad-balls circle { transform-box: view-box; animation: juggle 1.2s linear infinite; }
.ad-balls .b2 { animation-delay: -.4s; }
.ad-balls .b3 { animation-delay: -.8s; }
@keyframes juggle {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-8px, -30px); }
  50% { transform: translate(-16px, 0); }
  75% { transform: translate(-8px, 10px); }
  100% { transform: translate(0, 0); }
}
.ad-balloon { transform-box: view-box; transform-origin: 18px -96px; animation: bob-balloon 3.2s ease-in-out infinite alternate; }
@keyframes bob-balloon { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-8px); } }
.post-sign { position: absolute; display: block; pointer-events: auto; z-index: 1; filter: var(--crowd-filter); }
.post-sign svg { display: block; width: 100%; height: 100%; overflow: visible; }
.post-board { transform-box: view-box; transform-origin: 110px 11px; animation: post-sway 5s ease-in-out infinite alternate; }
@keyframes post-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.post-sign:hover .post-board { animation-duration: 1.2s; }
.post-sign:hover .post-url { fill: #b3121a; }
.post-sign:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.post-title { font-family: var(--serif); font-style: italic; font-weight: 600; }
.post-small { font-family: var(--body); font-weight: 700; }
.post-url { font-family: var(--serif); font-weight: 700; }
.sponsor-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .86rem; flex: 1 1 100%; }
.sponsor-line a { color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.sponsor-line a:hover { color: var(--accent); }
.sponsor-tagline { color: var(--muted); }
.chip.chip--sponsor { background: var(--accent); }

/* "walk in" hint over the gateway */
.enter-hint {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 0px));
  top: calc(var(--street-h) - 64px);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 18px;
  border: 0; border-radius: 4px;
  background: var(--ink); color: #fff;
  font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transition: opacity .3s, transform .3s, background .2s;
}
.enter-hint:hover { background: var(--accent); }
.enter-hint span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
body.past-gate .enter-hint { opacity: 0; transform: translateY(8px); pointer-events: none; }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* ---------- controls ---------- */
.controls { display: grid; grid-template-columns: auto minmax(0, 15rem) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding-block: 14px 6px; }
.step {
  width: 44px; height: 44px; border-radius: 4px;
  border: 1px solid var(--ink); background: transparent;
  font-size: 1.15rem; cursor: pointer;
}
.step:hover { background: var(--ink); color: #fff; }
.now { display: grid; min-width: 0; }
.now-label { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#now-name { font-family: var(--serif); font-weight: 500; font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map {
  position: relative; height: 26px; cursor: pointer;
  background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 2px no-repeat;
}
.map-window { position: absolute; top: 0; bottom: 0; border: 2px solid var(--ink); border-radius: 2px; background: rgba(127, 127, 110, .08); }
.map-dot { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--muted); }
.map-dot--home { background: var(--cat-home); }
.map-dot--micro { background: var(--cat-micro); }
.map-dot--open { background: transparent; border: 1.5px dashed var(--muted); }
.map-arch { position: absolute; top: 50%; width: 16px; height: 12px; margin: -9px 0 0 -8px; border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0; }
.help-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 0 8px; }
.help { margin: 0; font-size: .85rem; color: var(--muted); min-width: 0; flex: 1 1 22rem; }
.scene-switch { display: inline-flex; border: 1px solid var(--ink); border-radius: 4px; padding: 2px; gap: 2px; }
.scene-switch button {
  border: 0; background: none; border-radius: 2px; padding: 6px 14px; cursor: pointer;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.scene-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- numbered rubrics (I., II.) ---------- */
.rubrics { counter-reset: rubric; padding-block: 28px 8px; display: grid; gap: 34px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  margin-bottom: 14px; padding: 10px 0 8px;
  border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink);
  counter-increment: rubric;
}
.section-head h2 { font-size: 1.7rem; }
.section-head h2::before { content: counter(rubric, upper-roman) ".\00a0"; content: counter(rubric, upper-roman) ".\00a0" / ""; font-style: italic; color: var(--accent); }
.section-text { margin: 0 0 14px; color: var(--muted); max-width: 68ch; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.stall-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0 24px; }
.list-item {
  width: 100%; text-align: left; display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr);
  padding: 12px 0; border: 0; border-top: 1px solid var(--stone-3); background: none; cursor: pointer;
}
.list-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.list-item:hover .list-name { color: var(--accent); }
.list-type { font-size: .86rem; color: var(--muted); }

.chip {
  display: inline-block; justify-self: start; align-self: center;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 2px; color: var(--chip-ink); background: var(--muted); white-space: nowrap;
}
.chip--home { background: var(--cat-home); }
.chip--micro { background: var(--cat-micro); }
.chip--open { background: var(--accent); }

/* ---------- notes as newspaper cards ---------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px 24px; }
.note-grid article { min-width: 0; border-top: 1px solid var(--stone-3); padding-top: 12px; }
.card-kicker { margin: 0 0 4px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.note-grid h3 { font-size: 1.3rem; margin-bottom: 6px; }
.note-grid p { margin: 0; color: var(--muted); font-size: .93rem; max-width: 60ch; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); margin-top: 40px; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px;
  max-width: 1120px; margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) 36px max(20px, env(safe-area-inset-left, 0px));
  font-size: .88rem; color: #c9c3b8;
}
.footer-brand { min-width: 0; max-width: 46ch; }
.footer-brand p { margin: 0 0 4px; }
.footer-name { font-family: var(--serif); font-weight: 600; color: #fff; font-size: 1.6rem; letter-spacing: -0.03em; }
.footer-name .brand-dot { color: #f0a39b; }
.footer-note { font-size: .8rem; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(120px, auto)); gap: 4px 28px; margin: 0; padding: 0; list-style: none; }
.footer-links a, .footer-links span { display: inline-block; padding: 3px 0; color: #fff; text-decoration: none; }
.footer-links span { color: #8f897e; }
.footer-links a:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: #fff; }

/* ---------- profile dialog ---------- */
.profile {
  width: min(720px, calc(100% - 32px));
  max-height: min(88vh, 900px);
  padding: 0; border: 0; border-top: 3px double var(--ink); border-radius: 4px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.profile::backdrop { background: rgba(18, 14, 8, .55); }
.dialog-inner { max-height: min(88vh, 900px); overflow-y: auto; padding: 22px clamp(18px, 4vw, 34px) 22px; display: grid; gap: 14px; }
#profile-body { display: grid; gap: 14px; }
#profile-body > p { margin: 0; max-width: 62ch; }
.profile-close {
  justify-self: end; border: 1px solid var(--ink); background: var(--surface); border-radius: 4px;
  padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .86rem;
  position: sticky; top: 0; z-index: 1;
}
.demo-banner { font-size: .82rem; font-weight: 600; padding: 8px 12px; border-radius: 2px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); }
.profile-head { display: grid; gap: 6px; }
.profile-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.08; font-variation-settings: 'opsz' 96; }
.profile-type { margin: 0; color: var(--muted); }
.profile-summary { font-family: var(--serif); font-size: 1.15rem; line-height: 1.55; }
.photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 8px; }
.photo { position: relative; margin: 0; border-radius: 2px; overflow: hidden; border: 2px dashed var(--line); min-width: 0; }
.photo svg { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; opacity: .55; filter: grayscale(.35); }
.photo--0 { grid-row: span 2; }
.photo--0 svg { aspect-ratio: auto; min-height: 220px; }
.photo figcaption {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  font-size: .75rem; font-weight: 600; background: var(--surface); color: var(--ink); padding: 4px 8px; border-radius: 4px; width: fit-content; max-width: calc(100% - 16px);
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px 20px; margin: 0; }
.facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-pill {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 16px; border-radius: 0;
  background: var(--ink); color: #fff; font-weight: 600; font-size: .86rem;
}
.link-pill small { font-weight: 500; opacity: .7; font-size: .72rem; }
.profile-note { font-size: .85rem; color: var(--muted); }
.cats { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.cats li { display: grid; gap: 6px; }
.profile-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--ink); padding-top: 14px; }
.profile-nav button { border: 1px solid var(--ink); background: transparent; border-radius: 4px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
#profile-pos { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  :root { --street-h: clamp(380px, 64vh, 600px); }
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .site-header { padding: 14px 16px 0; grid-template-areas: 'date date date' 'brand brand brand' 'nav nav nav'; }
  .masthead-dateline { font-size: .64rem; grid-template-columns: 1fr; }
  .masthead-place, .masthead-founded, .masthead-note { display: none; }
  .masthead-emblem { grid-row: 1; grid-column: 3; justify-self: end; align-self: center; margin-top: 0; }
  .masthead-emblem svg { width: 36px; height: 36px; }
  .brand-motto { font-size: .58rem; letter-spacing: .14em; }
  .site-nav ul { flex-wrap: nowrap; justify-content: space-between; }
  .site-nav a, .site-nav .soon { padding: 6px 4px; letter-spacing: .04em; font-size: .64rem; }
  .intro { grid-template-columns: 1fr; }
  .controls { grid-template-columns: auto minmax(0, 1fr) auto; }
  .map { grid-column: 1 / -1; grid-row: 2; }
  .profile { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 0; max-height: 92vh; }
  .dialog-inner { max-height: 92vh; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .photos { grid-template-columns: 1fr 1fr; }
  .photo--0 { grid-column: 1 / -1; grid-row: auto; }
  .photo--0 svg { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  .stall, .enter-hint, .lights { transition: none; }
  .enter-hint span { animation: none; }
  .stall:hover { transform: none; }
  .ad-sign, .ad-balls circle, .ad-balloon, .post-board { animation: none; }
}

/* =====================================================================
   PHASE 2 — pages, directory, forms, admin
   ===================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
a { color: var(--lake); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px;
  border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: #fff;
  font: 600 .9rem/1.2 var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { color: #fff; }
.link-button { border: 0; background: none; padding: 0; color: var(--lake); text-decoration: underline; cursor: pointer; font: inherit; }
.danger { color: var(--accent); }
.danger-btn { background: var(--accent); border-color: var(--accent); }
.section-link, .card-link { color: var(--ink); font-family: var(--serif); font-style: italic; font-weight: 500; text-decoration: none; }
.section-link:hover, .card-link:hover { color: var(--accent); text-decoration: underline; }
.hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.empty-state { color: var(--muted); padding: 18px 0; list-style: none; }
.form-error { color: var(--accent); font-weight: 600; }

/* demo mode bar */
.demo-mode-bar {
  margin: 0; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--accent-soft); color: var(--ink); font-size: .82rem; text-align: center; border-bottom: 1px solid var(--line);
}

/* header nav on small screens wraps neatly */
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- directory ---------- */
.biz-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px 24px; }
.biz-grid > li { min-width: 0; }
.biz-card { border-top: 1px solid var(--stone-3); padding: 12px 0 6px; display: grid; gap: 10px; min-width: 0; }
.biz-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: var(--stone); }
.biz-body { display: grid; gap: 3px; min-width: 0; }
.biz-name { margin: 0; font-size: 1.28rem; }
.biz-open { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.biz-open:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.biz-type { margin: 0; color: var(--muted); font-size: .88rem; }
.biz-summary { margin: 4px 0 0; font-size: .93rem; }
.biz-badges { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.biz-badges:empty { display: none; }
.badge-new, .badge-street, .badge-demo {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px;
}
.badge-new { background: var(--accent); color: #fff; }
.badge-street { background: var(--lake); color: #fff; }
.badge-demo { background: var(--ink); color: #f4e6c6; }
.card-kicker { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.filters { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; margin-bottom: 14px; }
.result-count { margin: 0 0 10px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.seg legend { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-block; padding: 9px 12px; border: 1px solid var(--ink); font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.seg label + label span { margin-left: -1px; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--ink); }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; min-width: 0; margin: 0 0 14px; }
.field label, .sub > legend { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--stone-3); border-radius: 2px;
  background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--body);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 16px; align-items: start; }
.field-row--end { align-items: end; }
.field-row--end .btn { margin-bottom: 14px; }
.field-error { margin: 2px 0 0; color: var(--accent); font-size: .86rem; font-weight: 600; }
.counter { justify-self: end; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.req { color: var(--accent); }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.apply-form, .story-form { max-width: 820px; }
.form-sec { border: 0; border-top: 3px solid var(--ink); padding: 14px 0 6px; margin: 0 0 18px; min-width: 0; }
.form-sec > legend { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; padding: 0 10px 0 0; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .85rem/1 var(--body); vertical-align: 3px; }
.sub { border: 0; padding: 0; margin: 6px 0 14px; }
.sub > legend { margin-bottom: 8px; padding: 0; }
.choices { display: grid; gap: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.choice input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; top: 16px; left: 14px; width: 18px; height: 18px; accent-color: var(--ink); }
.choice-card > span { display: grid; gap: 4px; padding: 14px 14px 14px 42px; border: 1px solid var(--line); background: var(--surface); height: 100%; }
.choice-card strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.choice-card small { color: var(--muted); font-size: .88rem; }
.choice-card input:checked + span { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
.guidance { border-left: 3px solid var(--lake); background: #e6eef1; padding: 10px 14px; margin: 0 0 14px; font-size: .93rem; }
.guidance p { margin: 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-previews { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.photo-previews li { display: grid; gap: 4px; width: 110px; }
.photo-previews img { width: 110px; height: 82px; object-fit: cover; border-radius: 2px; }
.photo-previews button { border: 0; background: none; color: var(--accent); font-size: .8rem; text-decoration: underline; cursor: pointer; justify-self: start; padding: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 8px; }
.form-status { margin: 0; font-size: .92rem; }
.apply-done { max-width: 720px; padding: 18px 0; display: grid; gap: 10px; }
.apply-done h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.demo-note { background: var(--accent-soft); padding: 10px 14px; border-left: 3px solid var(--accent); }

.cat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px 24px; margin-bottom: 12px; }
.cat-card { border-top: 4px solid var(--cat-home); padding-top: 10px; }
.cat-card--micro { border-top-color: var(--cat-micro); }
.cat-card h3 { font-size: 1.4rem; margin-bottom: 4px; }
.cat-card p { margin: 0; }

.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 24px; background: var(--ink); color: #f3eee4; }
.cta-band h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); color: #fff; }
.cta-band p { margin: 4px 0 0; color: #d8d2c6; }
.cta-band .kicker { color: #f0a39b; margin: 0 0 4px; }
.cta-band .btn { background: #fff; color: var(--ink); border-color: #fff; }
.cta-band .btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- articles: Startup Corner, privacy, terms ---------- */
.article-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; padding-block: 20px 20px; align-items: start; }
.toc { position: sticky; top: 16px; border-top: 3px solid var(--ink); padding-top: 10px; }
.col-title { margin: 0 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: .9rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.article { min-width: 0; max-width: 72ch; }
.disclaimer { border: 1px solid var(--ink); background: var(--surface); padding: 12px 16px; margin-bottom: 18px; font-size: .92rem; }
.disclaimer p { margin: 0; }
.topic { border-top: 3px solid var(--ink); padding: 12px 0 18px; scroll-margin-top: 16px; }
.topic h2 { font-size: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.topic h3 { font-size: 1.15rem; margin: 16px 0 4px; }
.topic p, .topic li { font-family: var(--serif); font-size: 1.03rem; line-height: 1.65; }
.topic ul, .topic ol { padding-left: 22px; }
.topic li + li { margin-top: 4px; }
.sources { list-style: none; padding: 10px 14px !important; border-left: 3px solid var(--lake); background: #edf2f3; }
.sources li { font-family: var(--body) !important; font-size: .9rem !important; line-height: 1.45 !important; }
.lvl { display: inline-block; font: 800 .62rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; padding: 5px 7px; border-radius: 2px; color: #fff; vertical-align: middle; }
.lvl-city { background: var(--lake); }
.lvl-county { background: #7a5a2e; }
.lvl-state { background: var(--cat-micro); }
.levels { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.levels .lvl { margin-right: 8px; }
.prose-page { max-width: 760px; padding-block: 26px 10px; }
.prose-page h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 10px; }
.prose-page h2 { font-size: 1.35rem; margin: 22px 0 6px; padding-top: 10px; border-top: 1px solid var(--ink); }
.prose-page p, .prose-page li { font-family: var(--serif); font-size: 1.04rem; line-height: 1.65; }
.terms li + li { margin-top: 10px; }

/* ---------- business page ---------- */
.business-page { max-width: 820px; padding-block: 26px 10px; display: grid; gap: 14px; }
.business-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.05; }
.business-page > p { margin: 0; }
.profile-description p { margin: 0 0 10px; max-width: 65ch; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.photo--0 img { aspect-ratio: auto; min-height: 220px; }
.photos--1 { grid-template-columns: 1fr; }
.photos--1 .photo--0 img { aspect-ratio: 16 / 10; min-height: 0; }
.photos--2 { grid-template-columns: 1fr 1fr; }
.photos--2 .photo--0 { grid-row: auto; }
.photos--2 .photo--0 img { aspect-ratio: 4 / 3; min-height: 0; }
.photo:not(.photo--placeholder) { border: 0; }
.link-pill:is(a):hover { background: var(--accent); }
.back-links { padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- community ---------- */
.stories { display: grid; gap: 24px; }
.story { max-width: 70ch; border-top: 1px solid var(--stone-3); padding-top: 12px; }
.story h3 { font-size: 1.5rem; margin: 2px 0 8px; }
.story-body p { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; margin: 0 0 10px; }
.story-by { color: var(--muted); font-size: .88rem; }
.ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px 28px; }
.idea { border-top: 1px solid var(--stone-3); padding-top: 12px; }
.idea h3 { font-size: 1.25rem; margin-bottom: 6px; }
.idea p { margin: 0; font-family: var(--serif); line-height: 1.6; }

/* ---------- admin ---------- */
.admin { padding-block: 20px 60px; }
.admin-login { max-width: 420px; margin: 30px auto; display: grid; gap: 12px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-head h1 { font-size: 2rem; }
.admin-head-actions { display: flex; align-items: center; gap: 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; border-bottom: 3px double var(--ink); margin-bottom: 16px; }
.admin-tabs button { border: 0; background: none; padding: 10px 14px; font: 700 .78rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.admin-tabs button[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.admin-sub { font-size: 1.3rem; margin: 24px 0 8px; }
.status-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.status-filters button { border: 1px solid var(--line); background: var(--surface); padding: 6px 10px; border-radius: 2px; font: 600 .8rem/1.2 var(--body); cursor: pointer; }
.status-filters button span { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.status-filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.status-filters button[aria-pressed="true"] span { color: #d8d2c6; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.admin-split:has(.detail:not([hidden])) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
.admin-split:has(.detail:not([hidden])) .admin-table :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(6)) { display: none; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table thead th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.admin-table tr[aria-current="true"] td { background: var(--accent-soft); }
.row-open { border: 0; background: none; padding: 0; font: 600 .95rem/1.3 var(--body); color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row-sub { display: block; color: var(--muted); font-size: .8rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lic-unsure, .lic-not_started, .lic-started { color: #8a5a00; font-weight: 600; }
.status-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 7px; border-radius: 2px; background: var(--stone); white-space: nowrap; }
.st-approved.status-pill { background: var(--cat-home); color: #fff; }
.st-new.status-pill, .st-ready.status-pill { background: var(--lake); color: #fff; }
.st-assistance.status-pill, .st-clarifying.status-pill { background: #e9cf8e; }
.st-declined.status-pill, .st-not_eligible.status-pill { background: var(--stone-3); }
.detail { border-top: 3px solid var(--ink); padding-top: 12px; outline: none; min-width: 0; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.detail-head h2 { font-size: 1.7rem; }
.detail-head p { margin: 2px 0 0; }
.detail-sec { border-top: 1px solid var(--ink); padding: 12px 0 4px; margin-top: 12px; }
.detail-sec h3 { font-size: 1.15rem; margin-bottom: 8px; }
.private-box { border: 1px dashed var(--stone-3); padding: 10px 12px; background: var(--surface); }
.private-tag { margin: 0 0 6px; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.kv { margin: 0 0 10px; display: grid; gap: 4px; }
.kv div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.stall-editor { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.stall-preview { background: linear-gradient(#cfe3ee, #e8eedf 70%, #c6b9a3 70%); border-radius: 2px; padding: 8px; aspect-ratio: 240 / 330; }
.stall-preview svg { display: block; width: 100%; height: 100%; }
.palette { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.palette legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span:first-of-type { display: block; width: 42px; height: 26px; border-radius: 2px; border: 2px solid transparent; outline: 1px solid var(--line); }
.swatch input:checked + span { border-color: var(--ink); outline-color: var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); }
.admin-photos { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.admin-photos li { display: grid; gap: 4px; }
.admin-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 2px; }
.pin-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: .9rem; }
.history { margin: 0; padding-left: 18px; font-size: .86rem; display: grid; gap: 3px; }
.detail-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; margin-top: 12px; background: var(--bg); border-top: 1px solid var(--ink); }
.detail-actions .spacer { flex: 1; }
.confirm { border: 2px solid var(--accent); padding: 12px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.confirm p { margin: 0; flex: 1 1 100%; }
.rotation-form { max-width: 520px; }
.rotation-form input[type="range"] { min-height: 0; padding: 0; accent-color: var(--ink); }
.feat { display: inline-block; font-size: .78rem; padding: 3px 7px; margin: 2px 2px 2px 0; border-radius: 2px; background: var(--stone); }
.feat-pinned { background: var(--accent); color: #fff; }
.feat-new { background: #e9cf8e; }
.story-admin { border-top: 1px solid var(--stone-3); padding: 12px 0; }
.story-admin h3 { font-size: 1.2rem; }
.story-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; margin: 0; padding: 10px 16px; background: var(--ink); color: #fff; font-size: .9rem; border-radius: 2px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.admin-toast--error { background: var(--accent); }

@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field--search, .filters .seg { grid-column: 1 / -1; }
  .article-layout { grid-template-columns: 1fr; gap: 10px; }
  .toc { position: static; }
  .admin-split:has(.detail:not([hidden])) { grid-template-columns: 1fr; }
  .stall-editor { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
  .kv div { grid-template-columns: 1fr; gap: 0; }
  .stall-editor { grid-template-columns: 1fr; }
  .stall-preview { max-width: 180px; }
  .cta-band { padding: 18px; }
}
