/* CitiesIsle — The Living Atlas design system.
   Layers: reset → tokens → base → components → cinematic → utilities.
   The cinematic layer only adds motion and depth; removing it never breaks a page. */
@layer reset, tokens, base, components, cinematic, utilities;

/* ---------------------------------------------------------------- reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
  ol, ul { padding: 0; list-style: none; }
  img, svg, canvas { display: block; max-width: 100%; }
  input, button, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
}

/* --------------------------------------------------------------- tokens */
@layer tokens {
  :root {
    --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Charter, "Bitstream Charter", Georgia, serif;
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --paper: #f4efe4; --paper-2: #ebe3d1; --card: #fbf8f1; --card-2: #f1ebdd;
    --ink: #172231; --ink-2: #4b5768; --ink-3: #7a8494;
    --line: rgba(23, 34, 49, .13); --line-2: rgba(23, 34, 49, .24);
    --teal: #0d6f68; --teal-2: #14998c; --teal-soft: rgba(13, 111, 104, .1);
    --amber: #b8730f; --verified: #2c7f4a; --rose: #a8435a;
    --glow: rgba(20, 153, 140, .45);
    --shadow: 0 1px 2px rgba(23, 34, 49, .06), 0 10px 30px -12px rgba(23, 34, 49, .22);
    --shadow-lift: 0 2px 4px rgba(23, 34, 49, .08), 0 24px 48px -18px rgba(23, 34, 49, .35);
    --scrim: linear-gradient(90deg, var(--paper) 30%, color-mix(in srgb, var(--paper) 55%, transparent) 62%, transparent);
    --contour: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' fill='none' stroke='%23172231' stroke-opacity='.07'%3E%3Cpath d='M-20 80c60-40 120 30 190-10s110-50 210 0M-20 130c70-30 110 40 190 0s120-40 210 10M-20 185c50-20 130 35 200 5s110-45 200-5M-20 240c80-35 120 25 200 0s100-30 200 15M-20 300c60-25 140 30 210 0s100-20 190 10'/%3E%3Cellipse cx='250' cy='150' rx='46' ry='30'/%3E%3Cellipse cx='250' cy='150' rx='24' ry='14'/%3E%3C/svg%3E");

    /* Plate sky defaults (the local-sky script refines these). */
    --sky-a: #fbf7ee; --sky-b: #efe7d6; --sky-c: #e2d8c3;
    --plate-line: rgba(23, 34, 49, .16); --plate-text: #4b5768; --pin: #0d6f68; --pt: #172231;

    --ease-descend: cubic-bezier(.2, .7, .1, 1);
    --ease-settle: cubic-bezier(.3, 1.3, .5, 1);
    --t-quick: 160ms; --t-base: 320ms; --t-slow: 600ms;

    --radius: 14px; --radius-lg: 22px;
    --gutter: clamp(16px, 4vw, 40px);
    --max: 1240px;
    color-scheme: light;
  }
  :root[data-theme="dark"] {
    --paper: #0a1322; --paper-2: #0f1b2f; --card: #121f36; --card-2: #172742;
    --ink: #e8eef7; --ink-2: #a3b3c9; --ink-3: #75879f;
    --line: rgba(190, 210, 240, .12); --line-2: rgba(190, 210, 240, .22);
    --teal: #4fd1c1; --teal-2: #7fe6d8; --teal-soft: rgba(79, 209, 193, .12);
    --amber: #f2b24a; --verified: #66cf8c; --rose: #f08aa0;
    --glow: rgba(79, 209, 193, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -20px rgba(0, 0, 0, .75);
    --contour: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' fill='none' stroke='%23bcd4f5' stroke-opacity='.06'%3E%3Cpath d='M-20 80c60-40 120 30 190-10s110-50 210 0M-20 130c70-30 110 40 190 0s120-40 210 10M-20 185c50-20 130 35 200 5s110-45 200-5M-20 240c80-35 120 25 200 0s100-30 200 15M-20 300c60-25 140 30 210 0s100-20 190 10'/%3E%3Cellipse cx='250' cy='150' rx='46' ry='30'/%3E%3Cellipse cx='250' cy='150' rx='24' ry='14'/%3E%3C/svg%3E");
    --sky-a: #1b2c4a; --sky-b: #111f37; --sky-c: #0b1628;
    --plate-line: rgba(190, 215, 250, .14); --plate-text: #a3b3c9; --pin: #4fd1c1; --pt: #dce8f7;
    color-scheme: dark;
  }
  @media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
      --paper: #0a1322; --paper-2: #0f1b2f; --card: #121f36; --card-2: #172742;
      --ink: #e8eef7; --ink-2: #a3b3c9; --ink-3: #75879f;
      --line: rgba(190, 210, 240, .12); --line-2: rgba(190, 210, 240, .22);
      --teal: #4fd1c1; --teal-2: #7fe6d8; --teal-soft: rgba(79, 209, 193, .12);
      --amber: #f2b24a; --verified: #66cf8c; --rose: #f08aa0;
      --glow: rgba(79, 209, 193, .55);
      --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
      --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -20px rgba(0, 0, 0, .75);
      --contour: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' fill='none' stroke='%23bcd4f5' stroke-opacity='.06'%3E%3Cpath d='M-20 80c60-40 120 30 190-10s110-50 210 0M-20 130c70-30 110 40 190 0s120-40 210 10M-20 185c50-20 130 35 200 5s110-45 200-5M-20 240c80-35 120 25 200 0s100-30 200 15M-20 300c60-25 140 30 210 0s100-20 190 10'/%3E%3Cellipse cx='250' cy='150' rx='46' ry='30'/%3E%3Cellipse cx='250' cy='150' rx='24' ry='14'/%3E%3C/svg%3E");
      --sky-a: #1b2c4a; --sky-b: #111f37; --sky-c: #0b1628;
      --plate-line: rgba(190, 215, 250, .14); --plate-text: #a3b3c9; --pin: #4fd1c1; --pt: #dce8f7;
      color-scheme: dark;
    }
  }
}

/* ----------------------------------------------------------------- base */
@layer base {
  html { background: var(--paper); }
  body {
    min-height: 100vh; display: flex; flex-direction: column;
    background: var(--paper) var(--contour); background-attachment: fixed;
    color: var(--ink); font: 16px/1.6 var(--font-ui);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
  }
  main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 64px; }
  a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { color: var(--teal-2); }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; }
  h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
  small { color: var(--ink-3); }
  :focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
  ::selection { background: var(--teal-soft); }
}

/* ----------------------------------------------------------- components */
@layer components {
  .skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: 10px; }
  .skip:focus { top: 12px; }

  /* Header */
  .site-header {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 18px;
    padding: 12px var(--gutter);
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
  .brand-mark { width: 34px; height: 34px; fill: none; }
  .bm-ring { stroke: var(--ink); stroke-width: 1.6; }
  .bm-ring2 { stroke: var(--teal); stroke-width: 1.2; stroke-dasharray: 3 3; }
  .bm-tick { stroke: var(--ink); stroke-width: 1.6; }
  .bm-core { fill: var(--teal); }
  .brand-word { font: 600 1.28rem/1 var(--font-display); letter-spacing: -.01em; }
  .brand-word em { font-style: italic; color: var(--teal); }
  .site-nav { display: flex; gap: 4px; margin-left: 12px; }
  .site-nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: .94rem; }
  .site-nav a:hover { color: var(--ink); background: var(--teal-soft); }
  .header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .search-trigger {
    display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px 6px 12px;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--card);
    color: var(--ink-3); text-decoration: none; font-size: .92rem;
  }
  .search-trigger:hover { color: var(--ink); border-color: var(--teal); }
  .search-trigger svg, .palette-form svg, .hero-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
  kbd { font: 600 .72rem/1 var(--font-ui); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--paper); }
  /* Slot for the SpiderTaz launcher; it brings its own scoped styles. Width is
     reserved so the header does not shift when the script arrives. */
  .ci-network-nav { display: inline-flex; align-items: center; min-width: 76px; min-height: 34px; margin-left: 2px; }
  .theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); }
  .theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
  .theme-toggle .moon { display: none; }
  :root[data-theme="dark"] .theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .rays { display: none; }
  :root[data-theme="dark"] .theme-toggle .moon { display: block; }
  @media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .theme-toggle .sun, :root[data-theme="auto"] .theme-toggle .rays { display: none; }
    :root[data-theme="auto"] .theme-toggle .moon { display: block; }
  }

  /* Breadcrumbs */
  .crumbs { max-width: var(--max); margin: 0 auto; width: 100%; padding: 18px var(--gutter) 0; font-size: .9rem; }
  .crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .crumbs li { display: flex; align-items: center; gap: 6px; }
  .crumbs a { color: var(--ink-2); text-decoration: none; }
  .crumbs a:hover { color: var(--teal); }
  .crumbs [aria-current] { color: var(--ink); font-weight: 600; }
  .crumb-link { width: 28px; height: 8px; overflow: visible; }
  .crumb-link path { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
  .crumb-link circle { fill: var(--teal); }

  /* Shared text */
  .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); font-size: .92rem; }
  .eyebrow a { color: inherit; }
  .type-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    background: var(--teal-soft); color: var(--teal); font: 700 .7rem/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase;
  }
  .type-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .place-title { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.4rem); line-height: 1.02; margin: 10px 0 8px; text-wrap: balance; }
  .place-suffix { color: var(--ink-3); font-weight: 400; }
  .zip-title { font-family: var(--font-ui); font-weight: 700; letter-spacing: .02em; }
  .display { font-size: clamp(2.6rem, 1.5rem + 4.4vw, 5rem); line-height: 1; margin: 12px 0 14px; text-wrap: balance; }
  .display span { color: var(--teal); font-style: italic; font-weight: 400; }
  .lede { max-width: 60ch; color: var(--ink-2); font-size: 1.08rem; }
  .quiet { color: var(--ink-3); }
  .empty { padding: 28px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); text-align: center; }
  .text-link { font-weight: 600; text-decoration: none; }
  .coords { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font: 600 .86rem/1.4 var(--font-ui); letter-spacing: .04em; color: var(--ink-2); }
  .coords span { padding-left: 14px; position: relative; }
  .coords span::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border: 1.5px solid var(--teal); border-radius: 50%; }
  .sky-line { margin-top: 6px; color: var(--ink-3); font-size: .9rem; }
  .sky-line b { color: var(--ink-2); font-weight: 600; }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px;
    border-radius: 999px; border: 1px solid var(--teal); background: var(--teal); color: var(--paper);
    font-weight: 600; text-decoration: none;
  }
  .btn:hover { background: var(--teal-2); border-color: var(--teal-2); color: var(--paper); }
  .btn.ghost { background: transparent; color: var(--teal); }
  .btn.ghost:hover { background: var(--teal-soft); }
  .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

  /* Place hero */
  .place-hero {
    position: relative; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 4vw, 56px); align-items: center;
    padding: clamp(24px, 4vw, 48px) 0 clamp(28px, 4vw, 44px);
  }
  .hero-photo {
    position: absolute; z-index: -2; inset: 0 calc(var(--gutter) * -1) 0 30%; width: calc(70% + var(--gutter)); height: 100%;
    object-fit: cover; border-radius: 0 0 0 var(--radius-lg); opacity: .5;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%), linear-gradient(#000 70%, transparent);
    -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 45%), linear-gradient(#000 70%, transparent); mask-composite: intersect;
  }
  .hero-field { position: absolute; z-index: -1; inset: 0 calc(var(--gutter) * -1); background: radial-gradient(60% 80% at 80% 40%, var(--teal-soft), transparent 70%); pointer-events: none; }
  .facts { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
  .facts > div { flex: 1 1 150px; padding: 12px 14px; background: color-mix(in srgb, var(--card) 92%, transparent); }
  .facts dt { font: 700 .68rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
  .facts dd { margin-top: 2px; font-weight: 600; font-size: 1.02rem; }
  .facts dd a { color: var(--ink); text-decoration: none; }
  .facts dd a:hover { color: var(--teal); }
  .facts dd small { font-weight: 500; }
  .identity-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
  .identity-card {
    display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow);
  }
  .identity-card img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; background: var(--paper-2); }
  .identity-card span { display: flex; flex-direction: column; line-height: 1.25; }
  .identity-card small { font: 700 .62rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; }
  .identity-card.large img { width: 54px; height: 54px; }
  .identity-card:hover { border-color: var(--teal); }

  /* Plate */
  .plate { position: relative; margin: 0; max-width: 560px; justify-self: center; width: 100%; }
  .plate figcaption, .constellation figcaption { margin-top: 10px; color: var(--ink-3); font-size: .85rem; text-align: center; }
  .plate-svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 30px 40px rgba(10, 20, 35, .18)); }
  .plate-svg .sky-a { stop-color: var(--sky-a); }
  .plate-svg .sky-b { stop-color: var(--sky-b); }
  .plate-svg .sky-c { stop-color: var(--sky-c); }
  .plate-rim { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
  .graticule line { stroke: var(--plate-line); stroke-width: 1; }
  .grat-label { fill: var(--plate-text); font: 500 10px var(--font-ui); opacity: .75; }
  .ring { fill: none; stroke: var(--teal); stroke-opacity: .5; stroke-width: 1.2; stroke-dasharray: 1.2 1.6; }
  .ring-label { fill: var(--teal); font: 700 10.5px var(--font-ui); letter-spacing: .06em; paint-order: stroke; stroke: var(--sky-b); stroke-width: 4px; }
  .compass line { stroke: var(--plate-text); stroke-width: 1.4; }
  .compass text { fill: var(--plate-text); font: 700 11px var(--font-ui); }
  .compass .north { fill: var(--teal); }
  .pt { fill: var(--pt); stroke: var(--sky-a); stroke-width: 1.5; }
  .points a:hover .pt, .points a:focus .pt { fill: var(--teal); }
  .pt-label { fill: var(--ink); font: 600 12px var(--font-ui); paint-order: stroke; stroke: var(--sky-a); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
  .pin-halo { opacity: .9; }
  .glow-a { stop-color: var(--pin); stop-opacity: .45; }
  .glow-b { stop-color: var(--pin); stop-opacity: 0; }
  .pin-core { fill: var(--pin); stroke: var(--sky-a); stroke-width: 2.5; }
  .pin-pulse { fill: none; stroke: var(--pin); stroke-width: 1.5; opacity: 0; transform-origin: center; transform-box: fill-box; }
  .pin-label { fill: var(--ink); font: 700 14px var(--font-display); paint-order: stroke; stroke: var(--sky-a); stroke-width: 5px; stroke-linejoin: round; }
  .plate[data-sky="night"] { --sky-a: #1d3156; --sky-b: #13233f; --sky-c: #0a1427; --plate-line: rgba(190, 215, 250, .14); --plate-text: #a9bbd6; --pt: #f3d58b; --pin: #7fe6d8; --ink: #eef3fa; }
  .plate[data-sky="twilight"] { --sky-a: #5a5a8c; --sky-b: #36406b; --sky-c: #1f2747; --plate-line: rgba(230, 220, 255, .16); --plate-text: #d3cdea; --pt: #ffe2a8; --pin: #9ff0e4; --ink: #f6f2ff; }
  .plate[data-sky="golden"] { --sky-a: #fde6bc; --sky-b: #f3c891; --sky-c: #df9f6a; --plate-line: rgba(80, 40, 10, .16); --plate-text: #6b4626; --pt: #3a2614; --pin: #0d6f68; --ink: #2b1a0c; }
  .plate[data-sky="day"] { --sky-a: #f6fbff; --sky-b: #dcecf8; --sky-c: #bfd9ee; --plate-line: rgba(20, 50, 80, .13); --plate-text: #3d5872; --pt: #172231; --pin: #0d6f68; --ink: #122033; }

  /* Constellations (canvas) */
  .constellation { margin: 0; position: relative; }
  .constellation canvas, .atlas canvas { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
  .constellation canvas { background: radial-gradient(120% 120% at 50% 0%, var(--card), var(--paper-2)); border: 1px solid var(--line); }
  .hero-constellation canvas { aspect-ratio: 1 / 1; box-shadow: var(--shadow-lift); }
  .tab-panel .constellation { max-width: 820px; }
  .constellation-tip, .atlas-tip {
    position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 10px; font-size: .84rem; font-weight: 600;
    background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
  }
  .constellation-tip small, .atlas-tip small { display: block; font-weight: 500; }

  /* Tabs */
  .tabs { margin-top: 8px; }
  .tab-list {
    position: sticky; top: 65px; z-index: 30; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 86%, transparent);
    border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    width: max-content; max-width: 100%;
  }
  .tab-list::-webkit-scrollbar { display: none; }
  .tab-list a {
    position: relative; z-index: 1; flex: none; padding: 9px 16px; border-radius: 999px; color: var(--ink-2);
    text-decoration: none; font-weight: 600; font-size: .94rem; white-space: nowrap;
  }
  .tab-list a small { margin-left: 4px; font-weight: 600; }
  .tab-list a[aria-selected="true"] { color: var(--paper); }
  .tab-list a[aria-selected="true"] small { color: inherit; opacity: .75; }
  .tab-indicator { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; border-radius: 999px; background: var(--teal); box-shadow: 0 6px 18px -6px var(--glow); }
  .tab-panel { padding-top: 28px; scroll-margin-top: 130px; }
  .tab-panel + .tab-panel { margin-top: 24px; }
  .js .tabs.is-ready .tab-panel + .tab-panel { margin-top: 0; }
  .panel-title { margin-bottom: 16px; }
  .panel-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
  .band { padding-top: clamp(32px, 5vw, 56px); }
  .band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 18px; }

  /* Distance list */
  .distance-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
  .distance-list a {
    display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  }
  .distance-list a:hover { border-color: var(--teal); box-shadow: var(--shadow); }
  .dl-bearing { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); }
  .dl-bearing svg { width: 18px; height: 18px; fill: var(--teal); transform: rotate(var(--brg)); }
  .dl-name { display: flex; flex-direction: column; min-width: 0; }
  .dl-name strong, .dl-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dl-dist { font-weight: 700; text-align: right; }
  .dl-dist small { display: block; font-weight: 600; }

  /* Cards */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
  .place-card {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 84px; padding: 14px 16px;
    border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden;
  }
  .place-card strong { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.2; }
  .place-card:hover { border-color: var(--teal); }
  .place-card.has-photo { min-height: 180px; color: #fff; border-color: transparent; }
  .place-card.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
  .place-card.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(8, 14, 26, .82)); z-index: 0; }
  .place-card.has-photo strong, .place-card.has-photo small { position: relative; z-index: 1; color: #fff; }
  .place-card.has-photo small { opacity: .85; }
  .chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip-cloud a {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; min-height: 40px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .94rem;
  }
  .chip-cloud a:hover { border-color: var(--teal); color: var(--teal); }
  .chip-cloud small { font-weight: 600; }
  .pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; color: var(--ink-3); }

  /* Sparkbars */
  .sparkbars { width: 100%; height: auto; overflow: visible; }
  .sb-label { fill: var(--ink); font: 600 13px var(--font-ui); }
  .sb-value { fill: var(--ink-2); font: 700 13px var(--font-ui); }
  .sb-track { fill: var(--line); }
  .sb-bar { fill: var(--teal); }
  .sparkbars a:hover .sb-bar { fill: var(--teal-2); }
  .sparkbars a:hover .sb-label { fill: var(--teal); }

  /* Home atlas */
  .atlas-hero { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(16px, 3vw, 40px); align-items: center; padding: clamp(28px, 5vw, 64px) 0 12px; }
  .atlas { order: 2; margin: 0; position: relative; }
  .atlas canvas { aspect-ratio: 1000 / 620; }
  .atlas-intro { order: 1; }
  .hero-search {
    display: flex; align-items: center; gap: 10px; margin-top: 24px; max-width: 520px; padding: 6px 6px 6px 18px;
    border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  }
  .hero-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft), var(--shadow); }
  .hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 10px 0; }
  .hero-search button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--teal); color: var(--paper); font-weight: 700; }
  .ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin-top: 28px; max-width: 520px; }
  .ledger div { border-top: 1px solid var(--line-2); padding-top: 10px; }
  .ledger dt { font: 700 .68rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
  .ledger dd { font: 600 clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem)/1.1 var(--font-display); }
  .state-index { columns: 4 200px; column-gap: 24px; }
  .state-index li { break-inside: avoid; }
  .state-index a { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
  .state-index a:hover, .state-index a.is-lit { background: var(--teal-soft); }
  .si-code { font: 700 .74rem/1 var(--font-ui); letter-spacing: .06em; color: var(--teal); }
  .si-name { font-weight: 600; }
  .si-count { color: var(--ink-3); font-size: .86rem; }
  .path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
  .path-card {
    display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius-lg);
    background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  }
  .path-card svg { width: 40px; height: 40px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; margin-bottom: 8px; }
  .path-card strong { font: 600 1.3rem/1.2 var(--font-display); }
  .path-card span { color: var(--ink-2); font-size: .95rem; }
  .path-card:hover { border-color: var(--teal); box-shadow: var(--shadow-lift); }

  /* Directory pages */
  .page-head { padding: clamp(24px, 4vw, 44px) 0 8px; }
  .page-head.narrow { max-width: 720px; }
  .search-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
  .search-row input, .search-row select {
    min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); flex: 1 1 200px;
  }
  .search-row select { flex: 0 1 220px; }
  .search-row input:focus, .search-row select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
  .state-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; padding-top: 24px; }
  .state-tile {
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 12px; padding: 14px; height: 100%;
    border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  }
  .state-tile:hover { border-color: var(--teal); box-shadow: var(--shadow-lift); }
  .st-flag img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
  .st-bird img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; background: var(--paper-2); border: 3px solid var(--card); box-shadow: var(--shadow); }
  .st-bird { align-self: end; margin: 0 0 -6px -36px; }
  .st-text { grid-column: 1 / -1; display: flex; flex-direction: column; }
  .st-text strong { font: 600 1.2rem/1.2 var(--font-display); }
  .bird-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; padding-top: 24px; }
  .bird-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; height: 100%; }
  .bird-tile:hover { border-color: var(--teal); box-shadow: var(--shadow-lift); }
  .bt-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--paper-2); margin-bottom: 8px; }
  .bird-tile strong { font: 600 1.15rem/1.2 var(--font-display); }
  .zip-ledger { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
  .zip-ledger a { display: flex; flex-direction: column; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
  .zip-ledger a:hover { border-color: var(--teal); }
  .zip-ledger strong { font-size: 1.2rem; letter-spacing: .04em; }
  .county-index { columns: 2 200px; column-gap: 16px; }
  .county-index a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; break-inside: avoid; }
  .county-index a:hover, .county-index a.is-lit { background: var(--teal-soft); color: var(--teal); }
  .symbol-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(24px, 4vw, 48px) 0; }
  .symbol-frame { margin: 0; padding: 14px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
  .symbol-frame img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 18px; background: var(--paper-2); }
  .flag-frame img { aspect-ratio: 3 / 2; }
  .lost { text-align: left; }
  .lost-mark { width: 96px; height: 96px; margin-bottom: 12px; fill: none; stroke: var(--line-2); stroke-width: 2; }
  .lost-mark .needle { fill: var(--teal); stroke: none; transform-origin: 60px 60px; }

  /* Search palette */
  .palette {
    width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--card) 90%, transparent); color: var(--ink); box-shadow: var(--shadow-lift);
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  }
  .palette::backdrop { background: rgba(8, 14, 26, .45); backdrop-filter: blur(4px) brightness(.8); -webkit-backdrop-filter: blur(4px) brightness(.8); }
  .palette-form { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
  .palette-form input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1.12rem; }
  .palette-results { max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; }
  .palette-results a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; }
  .palette-results a small { grid-column: 2; }
  .palette-results [aria-selected="true"] a, .palette-results a:hover { background: var(--teal-soft); }
  .palette-results .pr-type { grid-row: span 2; min-width: 66px; text-align: center; padding: 4px 8px; border-radius: 8px; background: var(--paper-2); color: var(--teal); font: 700 .66rem/1.3 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
  .palette-results strong { font-weight: 600; }
  .palette-hint { padding: 12px 18px 16px; color: var(--ink-3); font-size: .88rem; }

  /* Footer */
  .site-footer { padding: 40px var(--gutter) 28px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
  .foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 24px 40px; max-width: var(--max); margin: 0 auto; }
  .foot-brand strong { font: 600 1.3rem var(--font-display); }
  .foot-brand p { color: var(--ink-2); max-width: 46ch; margin-top: 6px; }
  .foot-col { display: flex; flex-direction: column; gap: 6px; }
  .foot-col h2 { font: 700 .72rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
  .foot-col a { color: var(--ink-2); text-decoration: none; }
  .foot-col a:hover { color: var(--teal); }
  .foot-search { max-width: var(--max); margin: 28px auto 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .foot-search p { font-weight: 700; }
  .foot-search form { display: flex; gap: 8px; flex: 1 1 320px; max-width: 520px; }
  .foot-search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); }
  .foot-search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
  .foot-bottom { max-width: var(--max); margin: 20px auto 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-3); font-size: .88rem; }
  .cookie-notice {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 760px; margin: 0 auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 20px; border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow-lift);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .cookie-notice > div:first-child { flex: 1 1 320px; }
  .cookie-notice p { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
  .cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .legal { max-width: 780px; }
  .legal .updated { color: var(--ink-3); margin: 6px 0 22px; }
  .legal section { padding: 20px 0; border-top: 1px solid var(--line); }
  .legal h2 { font-size: 1.3rem; margin-bottom: 8px; }
  .legal p + p, .legal p + ul, .legal ul + p { margin-top: 10px; }
  .legal ul { list-style: disc; padding-left: 22px; color: var(--ink-2); }
  .legal li + li { margin-top: 4px; }
  .legal p { color: var(--ink-2); }
  .legal-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
  .legal-toc a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .86rem; font-weight: 600; text-decoration: none; }
  .contact-form { display: grid; gap: 16px; max-width: 640px; padding: 22px; margin-top: 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); }
  @media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

  /* Responsive */
  @media (max-width: 960px) {
    .site-nav { display: none; }
    .place-hero, .atlas-hero, .symbol-hero, .panel-split { grid-template-columns: minmax(0, 1fr); }
    .atlas { order: 1; }
    .atlas-intro { order: 2; }
    .hero-photo { inset: 0 calc(var(--gutter) * -1) auto; width: calc(100% + var(--gutter) * 2); height: 70%; opacity: .32; border-radius: 0; }
    .plate { max-width: 460px; }
  }
  @media (max-width: 560px) {
    .search-trigger span, .search-trigger kbd { display: none; }
    .search-trigger { width: 40px; padding: 0; justify-content: center; }
    .foot-grid { grid-template-columns: 1fr; }
    .tab-list { top: 61px; }
    .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

/* -------------------------------------------- business and service index */
@layer components {
  .biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
  .biz-card {
    display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius-lg);
    background: var(--card); border: 1px solid var(--line); position: relative;
  }
  .biz-card:hover { border-color: var(--teal); box-shadow: var(--shadow-lift); }
  .biz-card h3 { font-size: 1.2rem; }
  .biz-card h3 a { color: var(--ink); text-decoration: none; }
  .biz-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .biz-card h3 a:focus-visible { outline: none; }
  .biz-card:focus-within { outline: 2px solid var(--teal); outline-offset: 3px; }
  .biz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
  .biz-desc { color: var(--ink-2); font-size: .95rem; }
  .biz-card footer { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line-2); color: var(--ink-3); font-size: .86rem; }
  .model-chip, .status-chip {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    font: 700 .7rem/1.4 var(--font-ui); letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper);
  }
  .model-chip { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 35%, transparent); background: var(--teal-soft); }
  .status-chip.verified { color: var(--verified); border-color: color-mix(in srgb, var(--verified) 40%, transparent); }
  .status-chip.verified::before { content: "✓"; margin-right: 4px; }
  .status-chip.unclaimed { color: var(--ink-3); border-style: dashed; }
  .dist { font-weight: 700; font-size: .86rem; color: var(--ink-2); }
  .svc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .svc-chips li { padding: 3px 10px; border-radius: 8px; background: var(--paper-2); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
  .svc-chips .more { background: transparent; border: 1px dashed var(--line-2); }
  .sub-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; font-size: 1.15rem; }
  .sub-title small { font: 600 .85rem var(--font-ui); }
  .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
  .dot-here { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
  .dot-serving { border: 2px dashed var(--teal); }
  .dot-near { border: 2px solid var(--amber); }
  .svc-tally { margin-bottom: 8px; }
  .empty-state {
    display: flex; gap: 22px; align-items: center; padding: 26px; border-radius: var(--radius-lg);
    border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent);
  }
  .empty-state svg { width: 72px; height: 72px; flex: none; fill: none; stroke: var(--teal); stroke-width: 1.6; opacity: .8; }
  .empty-state p + p { margin-top: 6px; }
  .empty-state .btn { margin-right: 10px; }

  .category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
  .category-card { padding: 20px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); }
  .category-card h2 { font-size: 1.25rem; }
  .category-card h2 small { font: 700 .8rem var(--font-ui); color: var(--teal); }
  .category-card > p { font-size: .9rem; margin: 4px 0 10px; }
  .category-card li a { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
  .category-card li a:hover { color: var(--teal); }
  .category-card li a.is-empty { color: var(--ink-2); font-weight: 500; }

  .biz-hero .place-title { font-size: clamp(2.1rem, 1.5rem + 3vw, 3.6rem); }
  .svc-links { margin-top: 14px; }
  .trust-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; color: var(--ink-3); font-size: .88rem; }
  .facts dd small { display: block; font-weight: 500; }
  .hours { width: 100%; border-collapse: collapse; }
  .hours th, .hours td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .hours th { font-weight: 600; width: 40%; }
  .hours tr.is-today th, .hours tr.is-today td { color: var(--teal); font-weight: 700; }
  .avail { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--teal-soft); font-weight: 600; }
  .avail-closed, .avail-temporarily_closed, .avail-holiday { background: color-mix(in srgb, var(--rose) 14%, transparent); }
  .area-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .area-list li { padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--teal); font-weight: 600; font-size: .92rem; }
  .area-list a { text-decoration: none; }
  .report details { border-top: 1px solid var(--line); padding-top: 16px; }
  .report summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
  .report-form { display: grid; gap: 14px; max-width: 560px; margin-top: 14px; }
  .notice { margin-bottom: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--teal-soft); font-weight: 600; }
  .notice-card {
    display: flex; gap: 18px; align-items: flex-start; max-width: 720px; margin: 8px 0 24px; padding: 22px;
    border-radius: var(--radius-lg); background: var(--card); border: 1px solid color-mix(in srgb, var(--verified) 40%, transparent); box-shadow: var(--shadow);
  }
  .notice-card svg { width: 44px; height: 44px; flex: none; fill: none; stroke: var(--verified); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .notice-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
  .form-errors { max-width: 720px; margin-bottom: 18px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--rose); background: color-mix(in srgb, var(--rose) 10%, transparent); color: var(--ink); }

  /* Form */
  .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .biz-form { display: grid; gap: 18px; max-width: 780px; padding-top: 12px; }
  .form-step { margin: 0; padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); display: grid; gap: 14px; min-width: 0; }
  .form-step legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font: 600 1.25rem var(--font-display); }
  .form-step legend small { font: 500 .85rem var(--font-ui); color: var(--ink-3); }
  .step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: var(--paper); font: 700 .9rem var(--font-ui); }
  .field { display: grid; gap: 6px; font-weight: 600; font-size: .94rem; }
  .field small { font-weight: 500; }
  .field-label { font-weight: 600; font-size: .94rem; }
  .field.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .field input, .field textarea, .field select, .hours-row select, .hours-row input {
    width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2);
    background: var(--paper); font-weight: 500; font-size: 1rem;
  }
  .field textarea { min-height: 84px; resize: vertical; }
  .field input:focus, .field textarea:focus, .hours-row select:focus, .hours-row input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
  [aria-invalid="true"] { border-color: var(--rose) !important; }
  .field-error { margin-top: -6px; color: var(--rose); font-weight: 600; font-size: .9rem; }
  .narrow-field { max-width: 240px; }
  .field-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
  .field-row .field { flex: 1 1 260px; }
  .radio, .check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; cursor: pointer; }
  .radio input, .check input, .svc-option input { width: 18px; height: 18px; accent-color: var(--teal); }
  .choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .choice { position: relative; cursor: pointer; }
  .choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
  .choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); font-weight: 600; font-size: .92rem; }
  .choice input:checked + span { background: var(--teal); border-color: var(--teal); color: var(--paper); box-shadow: 0 6px 16px -8px var(--glow); }
  .choice input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 3px; }
  .choice input:disabled + span { opacity: .4; cursor: not-allowed; }
  .svc-picker { max-height: 360px; overflow-y: auto; padding: 4px 12px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
  .svc-group-name { position: sticky; top: 0; padding: 10px 0 6px; background: var(--paper); font: 700 .72rem/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .svc-options { display: flex; flex-wrap: wrap; gap: 6px; }
  .svc-option { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 500; }
  .svc-option:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); font-weight: 700; }
  .hours-grid { display: grid; gap: 8px; }
  .hours-row { display: grid; grid-template-columns: 110px minmax(130px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr); gap: 8px; align-items: center; }
  .hours-day { font-weight: 600; }
  .btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; justify-self: start; }
  .form-submit { display: grid; gap: 10px; justify-items: start; }
  @media (max-width: 560px) {
    .hours-row { grid-template-columns: 1fr 1fr; }
    .hours-day { grid-column: 1 / -1; }
    .empty-state { flex-direction: column; align-items: flex-start; }
  }
}

/* ------------------------------------------------------------ cinematic */
@layer cinematic {
  @view-transition { navigation: auto; }
  .place-title { view-transition-name: place-title; }
  .plate, .hero-constellation { view-transition-name: place-plate; }
  .crumbs { view-transition-name: crumbs; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(place-plate) { animation: 260ms var(--ease-descend) both vt-out; }
  ::view-transition-new(place-plate) { animation: 520ms var(--ease-descend) both vt-in; }
  @keyframes vt-out { to { opacity: 0; transform: scale(1.12); filter: blur(6px); } }
  @keyframes vt-in { from { opacity: 0; transform: scale(.86); filter: blur(6px); } }

  @media (prefers-reduced-motion: no-preference) {
    /* Plate depth: tilt follows the pointer (set by script as --rx/--ry). */
    [data-depth] { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--t-base) var(--ease-descend); transform-style: preserve-3d; }

    /* Rings trace themselves in; points settle after them. */
    .ring { stroke-dasharray: 100; stroke-dashoffset: 100; animation: trace 1.1s var(--ease-descend) forwards; animation-delay: calc(var(--i) * 140ms + 150ms); }
    @keyframes trace { to { stroke-dashoffset: 0; stroke-dasharray: 1.2 1.6; } }
    .pt { opacity: 0; animation: settle 500ms var(--ease-settle) forwards; animation-delay: calc(var(--d) * 35ms + 500ms); transform-origin: center; transform-box: fill-box; }
    @keyframes settle { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
    .pt-label { opacity: 0; animation: fade 600ms ease forwards 1s; }
    @keyframes fade { to { opacity: 1; } }
    .pin-pulse { animation: pulse 2.4s ease-out 3 .6s; }
    @keyframes pulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(4.2); } }
    .points a:hover .pt { filter: drop-shadow(0 0 6px var(--glow)); }

    /* Radar-style mask reveal when a plate first appears. */
    .plate-svg { -webkit-mask-image: radial-gradient(circle, #000 0 45%, transparent 70%); mask-image: radial-gradient(circle, #000 0 45%, transparent 70%); -webkit-mask-size: 30% 30%; mask-size: 30% 30%; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; animation: radar-expand 900ms var(--ease-descend) forwards; }
    @keyframes radar-expand { to { -webkit-mask-size: 260% 260%; mask-size: 260% 260%; } }

    /* Breadcrumb links trace in. */
    .crumb-link path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: crumb 700ms var(--ease-descend) forwards .1s; }
    @keyframes crumb { to { stroke-dashoffset: 0; } }

    /* Tabs: sliding indicator and a soft reveal of the new panel. */
    .tab-indicator { transition: transform var(--t-base) var(--ease-descend), width var(--t-base) var(--ease-descend); }
    .tab-panel.is-entering { animation: panel-in 420ms var(--ease-descend); }
    @keyframes panel-in { from { opacity: 0; transform: translateY(10px); -webkit-mask-image: linear-gradient(#000 0, transparent 30%); mask-image: linear-gradient(#000 0, transparent 30%); } }

    /* Sparkbars grow from the axis. */
    .sb-bar { transform-origin: 190px 0; transform: scaleX(0); animation: grow 800ms var(--ease-descend) forwards; animation-delay: calc(var(--i) * 45ms + 200ms); }
    @keyframes grow { to { transform: scaleX(1); } }

    /* Cards lift with depth on hover. */
    .place-card, .state-tile, .bird-tile, .path-card, .distance-list a, .identity-card { transition: transform var(--t-quick) var(--ease-descend), box-shadow var(--t-quick), border-color var(--t-quick); }
    .place-card:hover, .state-tile:hover, .bird-tile:hover, .path-card:hover { transform: translateY(-3px); }
    .place-card.has-photo img { transition: transform var(--t-slow) var(--ease-descend); }
    .place-card.has-photo:hover img { transform: scale(1.05); }
    .hero-photo { animation: photo-in 1.2s var(--ease-descend) both; }
    @keyframes photo-in { from { opacity: 0; transform: scale(1.04); } }
    .lost-mark .needle { animation: seek 2.8s var(--ease-settle) 1; }
    @keyframes seek { 0% { transform: rotate(-70deg); } 40% { transform: rotate(40deg); } 70% { transform: rotate(-15deg); } 100% { transform: rotate(0); } }
    .palette[open] { animation: palette-in 260ms var(--ease-descend); }
    @keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
  }
  @media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
  }
}

/* ------------------------------------------------------------ utilities */
@layer utilities {
  .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  [hidden] { display: none !important; }
  @media (prefers-reduced-transparency: reduce) {
    .site-header, .tab-list, .palette, .atlas-tip, .constellation-tip { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
  }
  @media (forced-colors: active) {
    .plate-svg { filter: none; }
    .tab-list a[aria-selected="true"] { outline: 2px solid CanvasText; }
    .tab-indicator, .hero-field, .hero-photo { display: none; }
    .type-chip::before { forced-color-adjust: none; background: CanvasText; }
  }
  @media print {
    .site-header, .tab-list, .palette, .site-footer, .crumbs { display: none; }
    .js .tabs .tab-panel[hidden] { display: block !important; }
  }
}

/* ------------------------------------------ news (city and county pages) */
@layer components {
  .news-list { display: grid; gap: 10px; max-width: 920px; }
  .news-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
  .news-item.has-image { grid-template-columns: 132px minmax(0, 1fr); }
  .news-item img { width: 132px; height: 92px; object-fit: cover; border-radius: 10px; background: var(--card-2); }
  .news-why { font: 700 .68rem/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
  .news-title { font-size: 1.12rem; line-height: 1.3; }
  .news-title a { color: var(--ink); text-decoration: none; }
  .news-title a:hover { color: var(--teal); text-decoration: underline; }
  .news-excerpt { margin-top: 6px; color: var(--ink-2); font-size: .94rem; line-height: 1.5; }
  .news-meta { margin-top: 6px; color: var(--ink-3); font-size: .82rem; }
  .news-note { margin-top: 14px; font-size: .86rem; max-width: 70ch; }
  @media (max-width: 640px) {
    .news-item.has-image { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 14px; }
    .news-item img { width: 88px; height: 66px; }
  }
}

/* ------------------------------------ sponsored local spot (city pages) */
@layer components {
  .ad-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 22px; align-items: center; padding: 18px 22px;
    border-radius: var(--radius-lg); border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent);
  }
  .ad-card.is-paid { grid-template-columns: auto minmax(0, 1fr) auto; border-style: solid; background: var(--card); box-shadow: var(--shadow); }
  .ad-card img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius); }
  .ad-label { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font: 700 .66rem/1.5 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
  .ad-title { font-size: 1.2rem; margin-bottom: 4px; }
  .ad-copy p + p { margin-top: 4px; }
  .ad-business { font-weight: 600; color: var(--ink-2); font-size: .92rem; }
  @media (max-width: 640px) {
    .ad-card, .ad-card.is-paid { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .ad-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  }
}

/* ------------------------------------- network links (city pages) */
@layer components {
  .net-link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
  .net-link-list a {
    position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 14px 44px 14px 16px;
    border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  }
  .net-link-list a:hover { border-color: var(--teal); box-shadow: var(--shadow); }
  .net-link-list strong { font: 600 1.05rem/1.25 var(--font-display); }
  .net-link-list span { color: var(--ink-2); font-size: .88rem; }
  .net-link-list svg { position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}
@layer cinematic {
  @media (prefers-reduced-motion: no-preference) {
    .net-link-list a { transition: transform var(--t-quick) var(--ease-descend), box-shadow var(--t-quick), border-color var(--t-quick); }
    .net-link-list a:hover svg { transform: translate(2px, -2px); transition: transform var(--t-quick) var(--ease-descend); }
  }
}

/* --------------------------------------------- about (city pages) */
@layer components {
  .about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .about-grid.is-single { grid-template-columns: minmax(0, 46rem); }
  .about-story, .about-info { padding: 20px 22px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-wrap: anywhere; }
  .about-info { background: linear-gradient(160deg, var(--sky-a), var(--sky-b)); }
  .about-kicker { font: 700 .72rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
  .about-grid p { white-space: pre-line; line-height: 1.65; max-width: 70ch; }
  .about-grid p + p { margin-top: 12px; }
  .about-lead { font: 500 1.14rem/1.6 var(--font-display); }
  .about-more { margin-top: 14px; }
  .about-more p { margin-top: 12px; }
  .about-more summary, .about-zips summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: 6px 0; min-height: 40px; display: flex; align-items: center; }
  .about-more h4 { margin-top: 20px; }
  .about-sources { display: grid; gap: 6px; font-size: .9rem; color: var(--ink-2); }
  .about-sources a { overflow-wrap: anywhere; }
  .about-zip-label { margin-top: 14px; font-weight: 600; }
  .about-info .chip-cloud { margin-top: 8px; }
  .about-zips { margin-top: 6px; }
  @media (max-width: 760px) {
    .about-grid, .about-grid.is-single { grid-template-columns: minmax(0, 1fr); }
    .about-story, .about-info { padding: 16px; }
  }
}
@layer cinematic {
  @media (prefers-reduced-motion: no-preference) {
    .about-more[open] > :not(summary), .about-zips[open] > :not(summary) { animation: panel-in 380ms var(--ease-descend) both; }
  }
}

/* ------------------------------------------------- weather (city pages) */
@layer components {
  .wx-glyph { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .wx-glyph.wx-clear, .wx-glyph.wx-part circle { stroke: var(--amber); }
  .wx-state {
    display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: var(--radius-lg);
    border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent);
  }
  .wx-state .wx-glyph { width: 56px; height: 56px; opacity: .85; }
  .wx-state.is-failed .wx-glyph { stroke: var(--ink-3); }
  .wx-state p + p { margin-top: 6px; }
  .wx { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .wx-kicker { font: 700 .72rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
  .wx-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .wx-now, .wx-outlook, .wx-week { padding: 20px 22px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .wx-now { background: linear-gradient(160deg, var(--sky-a), var(--sky-b) 70%, var(--sky-c)); position: relative; overflow: hidden; }
  .wx-now::after { content: ""; position: absolute; inset: 0; background: var(--contour); background-size: 360px; pointer-events: none; opacity: .8; }
  .wx-now > * { position: relative; z-index: 1; }
  .wx-reading { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .wx-reading .wx-glyph { width: 64px; height: 64px; }
  .wx-temp { font: 600 clamp(3rem, 2.2rem + 3vw, 4.4rem)/1 var(--font-display); letter-spacing: -.02em; }
  .wx-temp span { font-size: .4em; color: var(--ink-2); margin-left: 2px; vertical-align: .9em; }
  .wx-text { font: 600 1.15rem/1.3 var(--font-display); display: flex; flex-direction: column; }
  .wx-text small { font: 500 .9rem var(--font-ui); color: var(--ink-2); margin-top: 2px; }
  .wx-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1px; margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
  .wx-facts > div { padding: 10px 12px; background: color-mix(in srgb, var(--card) 88%, transparent); }
  .wx-facts dt { font: 700 .66rem/1.4 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
  .wx-facts dd { margin-top: 2px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
  .wx-wind { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); }
  .wx-wind svg { width: 13px; height: 13px; fill: var(--teal); transform: rotate(var(--brg)); }
  .wx-source, .wx-credit { font-size: .86rem; color: var(--ink-2); }
  .wx-source { margin-top: 12px; }
  .wx-lead { font: 500 1.08rem/1.55 var(--font-display); margin-bottom: 18px; }
  .wx-outlook p { max-width: 62ch; }
  .wx-week-scroll { overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -6px; padding: 0 6px; }
  .wx-week-body { position: relative; min-width: calc(var(--n) * 78px); }
  .wx-curve { width: 100%; height: auto; overflow: visible; }
  .wx-curve polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  .wx-curve polyline.wx-hi { stroke: var(--amber); }
  .wx-curve polyline.wx-lo { stroke: var(--teal); }
  .wx-curve circle { stroke: var(--card); stroke-width: 2.5; }
  .wx-curve circle.wx-hi { fill: var(--amber); }
  .wx-curve circle.wx-lo { fill: var(--teal); }
  .wx-days { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); text-align: center; margin-top: 4px; }
  .wx-days li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-left: 1px solid var(--line); }
  .wx-days li:first-child { border-left: 0; }
  .wx-day { font: 700 .8rem var(--font-ui); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .wx-days .wx-glyph { width: 32px; height: 32px; }
  .wx-hl { display: flex; gap: 6px; align-items: baseline; }
  .wx-h { font: 600 1.15rem var(--font-display); }
  .wx-l { color: var(--ink-2); font-weight: 600; }
  .wx-short { color: var(--ink-2); font-size: .76rem; line-height: 1.3; }
  .wx-pop { display: inline-flex; align-items: center; gap: 3px; color: var(--teal); font-weight: 700; font-size: .78rem; }
  .wx-pop svg { width: 11px; height: 11px; fill: currentColor; }
  .wx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: .8rem; color: var(--ink-3); }
  .wx-key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: -8px; vertical-align: middle; }
  .wx-key.wx-hi { background: var(--amber); }
  .wx-key.wx-lo { background: var(--teal); }
  .wx-stale { display: block; margin: 4px 0; color: var(--ink); font-weight: 600; }
  .wx-alerts { display: grid; gap: 10px; }
  .wx-alert { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--amber); border-left-width: 5px; background: color-mix(in srgb, var(--amber) 9%, var(--card)); }
  .wx-alert.sev-extreme, .wx-alert.sev-severe { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 9%, var(--card)); }
  .wx-alert > svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  .wx-sev { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; font: 700 .68rem/1.5 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
  .wx-alert details { margin-top: 6px; }
  .wx-alert summary { cursor: pointer; font-weight: 600; }
  .wx-alert details p { margin-top: 6px; max-width: 70ch; }
  @media (max-width: 760px) {
    .wx-top { grid-template-columns: minmax(0, 1fr); }
    .wx-now, .wx-outlook, .wx-week { padding: 16px; }
    .wx-state { flex-direction: column; align-items: flex-start; }
  }
}
@layer cinematic {
  @media (prefers-reduced-motion: no-preference) {
    /* The week's temperature lines draw in, the wind arrow swings to its bearing. */
    .wx-curve polyline { stroke-dasharray: 100; animation: wx-draw 1.1s var(--ease-descend) both; }
    .wx-curve polyline.wx-lo { animation-delay: 160ms; }
    .wx-curve circle { animation: wx-dot 420ms var(--ease-settle) both; animation-delay: 700ms; transform-box: fill-box; transform-origin: center; }
    @keyframes wx-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
    @keyframes wx-dot { from { transform: scale(0); } }
    .wx-wind svg { animation: wx-swing 900ms var(--ease-settle) both; }
    @keyframes wx-swing { from { transform: rotate(0deg); } }
    .wx-pulse { animation: wx-pulse 1.6s ease-in-out infinite; }
    @keyframes wx-pulse { 50% { opacity: .35; transform: translateY(-2px); } }
    .wx-alert { animation: panel-in 420ms var(--ease-descend) both; }
  }
}
