/* ============================================================
   app.css — Global Design System
   Architecture: @layer reset → base → layout → components → utilities
   Tokens live in :root (outside layers, always available).
   Brand overrides go in brands/*.css — :root token overrides only.
   ============================================================ */

@layer reset, base, layout, components, utilities;


/* ============================================================
   Tokens — outside layers so every layer can reference them
   ============================================================ */

:root {
  /* Spacing (4 px base unit) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Type scale */
  --text-xs:   0.6875rem;   /*  11 px */
  --text-sm:   0.8125rem;   /*  13 px */
  --text-base: 1rem;        /*  16 px */
  --text-lg:   1.125rem;   /*  18 px */
  --text-xl:   1.25rem;    /*  20 px */
  --text-2xl:  1.5rem;     /*  24 px */
  --text-3xl:  1.875rem;   /*  30 px */

  /* Neutral palette (warm undertone) */
  --n-50:  #f9f8f6;
  --n-100: #f0ede8;
  --n-150: #e5e1da;
  --n-200: #d5d0c8;
  --n-300: #bab3a9;
  --n-400: #9e9689;
  --n-500: #7d746a;
  --n-600: #5d5750;
  --n-700: #3b3830;
  --n-800: #201e18;
  --n-900: #0d0c0a;

  /* Surfaces */
  --bg:        white;
  --bg-subtle: hsl(44 15% 93%);
  --surface:   hsl(44 35% 99%);

  /* Borders */
  --border:        #7d746a;   /* ~8:1 on bg */
  --border-subtle: #a8a299;   /* ~5:1 on bg */

  /* Text */
  --text:        #1c1b18;
  --text-muted:  #3b3830;   /* ~14:1 on bg */
  --text-faint:  #5d5750;   /* ~10:1 on bg */

  /* Interactive */
  --link:         #1a4e8a;
  --link-visited: #5b2d8a;

  /* Status colors */
  --success:    #14532d;
  --success-bg: #f0fdf4;
  --success-bd: #bbf7d0;

  --error:    #991b1b;
  --error-bg: #fef2f2;
  --error-bd: #fecaca;

  --warning:    #7c2d12;
  --warning-bg: #fff7ed;
  --warning-bd: #fed7aa;

  /* Typography */
  --font:      system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  /* Shape */
  --radius: 3px;

  /* Layout */
  --max-w:    72rem;
  --page-px:  clamp(var(--sp-4), 4vw, var(--sp-8));
  --header-h: 2.75rem;
}


/* ============================================================
   Reset
   ============================================================ */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }

  @media (prefers-reduced-motion: no-preference) {
    html { interpolate-size: allow-keywords; }
  }

  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }

  input, button, textarea, select { font: inherit; }

  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  p   { text-wrap: pretty; }
  h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

  #root, #__next { isolation: isolate; }
}


/* ============================================================
   Base — element selectors only, no classes
   ============================================================ */

@layer base {
  html {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-base);
  }

  a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }

  a:visited { color: var(--link-visited); }
  a:hover   { text-decoration-thickness: 2px; }

  a:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
    border-radius: var(--radius);
  }

  h1 { font-size: var(--text-2xl);  line-height: 1.2;  font-weight: 700; }
  h2 { font-size: var(--text-xl);   line-height: 1.25; font-weight: 600; }
  h3 { font-size: var(--text-lg);   line-height: 1.3;  font-weight: 600; }
  h4 { font-size: var(--text-base); line-height: 1.4;  font-weight: 600; }
  h5 { font-size: var(--text-sm);   line-height: 1.4;  font-weight: 600; }
  h6 {
    font-size: var(--text-xs);
    line-height: 1.4;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  code, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--n-100);
    padding: 0.1em 0.35em;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
  }

  pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--n-100);
    padding: var(--sp-4);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    overflow-x: auto;
  }

  pre code { background: none; border: none; padding: 0; font-size: inherit; }

  hr {
    border: none;
    border-top: 1px solid var(--border);
  }

  small { font-size: var(--text-sm); color: var(--text-muted); }

  /* Default form layout — stacked fields, constrained width */
  form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    max-width: 36rem;
  }

  /* Submit buttons render as primary actions by default */
  input[type="submit"],
  button[type="submit"] {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-2) var(--sp-5);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(to bottom, var(--n-700), var(--n-800));
    border: 1px solid var(--n-900);
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  input[type="submit"]:hover,
  button[type="submit"]:hover {
    background: linear-gradient(to bottom, var(--n-600), var(--n-700));
  }

  input[type="submit"]:active,
  button[type="submit"]:active {
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
  }

  input[type="submit"]:focus-visible,
  button[type="submit"]:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
  }

  /* Custom elements do not inherit typography from parents by default */
  beer-localtime {
    display: inline;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-transform: inherit;
    vertical-align: baseline;
  }

  beer-localtime time {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-transform: inherit;
  }
}


/* ============================================================
   Layout — app shell and page-level structure
   ============================================================ */

@layer layout {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--n-800);
    color: var(--n-50);
    display: flex;
    align-items: center;
    padding-inline: var(--page-px);
    border-bottom: 1px solid var(--n-900);
    gap: var(--sp-6);
  }

  .app-header .brand {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--n-50);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .app-header .brand:visited { color: var(--n-50); }
  .app-header .brand:hover   { color: #fff; text-decoration: none; }

  .app-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  .app-header nav a {
    color: var(--n-200);
    text-decoration: none;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--radius);
    white-space: nowrap;
  }

  .app-header nav a:visited { color: var(--n-200); }

  .app-header nav a:hover {
    color: var(--n-50);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
  }

  .app-header nav a[aria-current="page"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .app-main {
    max-width: var(--max-w);
    margin-inline: auto;
    padding: var(--sp-6) var(--page-px) var(--sp-16);
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
  }

  /* tighter rhythm variant — attach to <main> when a page is denser */
  .app-main[data-spacing="compact"] { gap: var(--sp-3); }
}


/* ============================================================
   Components
   ============================================================ */

@layer components {

  /* --- Flash messages --- */

  .flash {
    max-width: var(--max-w);
    margin-inline: auto;
    padding: var(--sp-3) var(--page-px) 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .flash:empty { display: none; }

  .flash-item {
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    border: 1px solid;
    border-left-width: 3px;
  }

  .flash-item[data-type="notice"] {
    background: var(--success-bg);
    border-color: var(--success-bd);
    border-left-color: var(--success);
    color: var(--success);
  }

  .flash-item[data-type="alert"] {
    background: var(--error-bg);
    border-color: var(--error-bd);
    border-left-color: var(--error);
    color: var(--error);
  }


  /* --- Breadcrumbs --- */

  .breadcrumbs { margin-bottom: 0; }

  .breadcrumbs ol {
    list-style: none;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
  }

  .breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
  }

  .breadcrumbs li + li::before {
    content: "›";
    margin-inline: var(--sp-2);
    color: var(--text-faint);
    font-size: 1.1em;
    line-height: 1;
  }

  .breadcrumbs a           { color: var(--link); text-decoration: none; }
  .breadcrumbs a:visited   { color: var(--link-visited); }
  .breadcrumbs a:hover     { text-decoration: underline; text-underline-offset: 2px; }

  .breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 500; }


  /* --- Path navigation (breadcrumbs sibling: immediate routing links) --- */

  .path-nav-context {
    margin-block: var(--sp-5) var(--sp-5);
    padding-block: var(--sp-4) var(--sp-3);
    border-bottom: 1px solid var(--border-subtle);
  }

  .path-nav-context ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-6);
    list-style: none;
    padding: 0;
    margin: var(--sp-2) 0 0;
  }

  .path-nav-context li {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
  }

  .path-nav-context a { color: var(--link); text-decoration: none; }
  .path-nav-context a:visited { color: var(--link-visited); }
  .path-nav-context a:hover { text-decoration: underline; text-underline-offset: 2px; }


  /* --- Vertical navigation --- */

  .vertical-nav {
    display: grid;
    gap: var(--sp-3);
    margin-block: var(--sp-8) var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border-subtle);
  }

  .vertical-nav .eyebrow { margin: 0; }

  .vertical-nav-list,
  .vertical-nav-children {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
  }

  .vertical-nav-list { gap: var(--sp-3); }

  .vertical-nav-item {
    display: grid;
    gap: var(--sp-2);
  }

  .vertical-nav-link {
    display: grid;
    grid-template-columns: var(--sp-6) minmax(0, 1fr);
    align-items: center;
    gap: var(--sp-3);
    width: fit-content;
    max-width: 100%;
    color: var(--text);
    text-decoration: none;
    line-height: 1.2;
  }

  .vertical-nav-link:visited { color: var(--text); }
  .vertical-nav-link:hover .vertical-nav-text { text-decoration: underline; text-underline-offset: 3px; }

  .vertical-nav-link:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: var(--sp-1);
    border-radius: var(--radius);
  }

  .vertical-nav-link[aria-current="page"] {
    color: var(--text);
    font-weight: 700;
  }

  .vertical-nav-link[aria-current="page"] .vertical-nav-text {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }

  .vertical-nav-icon {
    display: inline-flex;
    width: var(--sp-6);
    height: var(--sp-6);
    color: var(--text-muted);
  }

  .vertical-nav-icon svg {
    width: 100%;
    height: 100%;
  }

  .vertical-nav-text {
    min-width: 0;
    font-size: var(--text-xl);
    font-weight: 650;
    letter-spacing: -0.015em;
  }

  .vertical-nav-children {
    gap: var(--sp-4);
    margin-left: calc(var(--sp-3) + (var(--sp-6) / 2));
    padding-block: var(--sp-2);
    padding-left: calc((var(--sp-6) / 2) + var(--sp-4));
    border-left: 2px solid var(--border-subtle);
  }

  .vertical-nav-children .vertical-nav-link { color: var(--text-muted); }

  .vertical-nav-link[data-icon="false"] { grid-template-columns: minmax(0, 1fr); }

  .vertical-nav-children .vertical-nav-text {
    font-size: var(--text-lg);
    font-weight: 600;
  }

  .vertical-nav[data-icons="false"] .vertical-nav-children {
    margin-left: 0;
    padding-left: var(--sp-5);
  }


  /* --- Page header --- */

  .page-header {
    display: flex;
    align-items: baseline;
    gap: var(--sp-4);
    flex-wrap: wrap;
    padding-bottom: var(--sp-4);
    border-bottom: 2px solid var(--border);
  }

  /* stack layout: title+summary stacked in first column, actions on the right */
  .page-header[data-layout="stack"] { align-items: flex-start; }
  .page-header[data-layout="stack"] > div:not(.page-actions) { flex: 1 1 auto; }

  .page-header h1 { flex-shrink: 0; }

  /* summary paragraph inside any page-header */
  .page-header p {
    margin: var(--sp-2) 0 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 60ch;
  }

  .page-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    flex-shrink: 0;
  }


  /* --- Buttons --- */

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.6;
    color: var(--n-700);
    background: linear-gradient(to bottom, var(--surface), var(--n-100));
    border: 1px solid var(--border);
    border-bottom-color: var(--n-300);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    user-select: none;
    -webkit-user-select: none;
  }

  .btn:visited { color: var(--n-700); }

  .btn:hover {
    background: linear-gradient(to bottom, var(--n-100), var(--n-150));
    border-color: var(--n-300);
    color: var(--n-800);
    text-decoration: none;
  }

  .btn:active {
    background: var(--n-150);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(1px);
  }

  .btn:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
  }

  .btn[data-variant="primary"] {
    color: #fff;
    background: linear-gradient(to bottom, var(--n-700), var(--n-800));
    border-color: var(--n-900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .btn[data-variant="primary"]:visited { color: #fff; }

  .btn[data-variant="primary"]:hover {
    background: linear-gradient(to bottom, var(--n-600), var(--n-700));
    color: #fff;
  }

  .btn[data-variant="danger"] {
    color: var(--error);
    border-color: var(--error-bd);
    background: linear-gradient(to bottom, var(--surface), var(--error-bg));
  }

  .btn[data-variant="danger"]:visited { color: var(--error); }

  .btn[data-variant="danger"]:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
  }

  /* button_to wraps a <form>; flatten so it participates in flex layout */
  form.btn-form { display: contents; }


  /* --- Forms --- */

  .field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  .field label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
  }

  .field input,
  .field select,
  .field textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-sm);
    color: var(--text);
  }

  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    outline: 2px solid var(--link);
    outline-offset: 0;
    border-color: var(--link);
  }

  .field input::placeholder,
  .field textarea::placeholder { color: var(--text-faint); }

  .field textarea { resize: vertical; min-height: 6rem; }

  .field input[type="checkbox"] { width: fit-content; cursor: pointer; }

  .field[data-layout="inline"] {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-2);
  }

  .field[data-layout="inline"] label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    cursor: pointer;
    font-weight: 500;
  }

  .field-hint {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
    max-width: 40rem;
    line-height: 1.4;
  }

  fieldset.errors {
    border: 1px solid var(--error-bd);
    border-left: 3px solid var(--error);
    background: var(--error-bg);
    border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4);
    color: var(--error);
  }

  fieldset.errors legend {
    font-size: var(--text-sm);
    font-weight: 600;
    padding-inline: var(--sp-1);
  }

  fieldset.errors ul {
    padding-left: var(--sp-5);
    margin-top: var(--sp-2);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    font-size: var(--text-sm);
  }

  .form-actions {
    display: flex;
    gap: var(--sp-3);
    align-items: center;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--sp-2);
  }


  /* --- Tables --- */

  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  table {
    border-collapse: collapse;
    width: 100%;
    font-size: var(--text-sm);
  }

  .table-wrap table { border-radius: 0; }

  thead {
    background: var(--n-50);
    border-bottom: 2px solid var(--border);
  }

  th {
    text-align: left;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
  }

  td {
    text-align: left;
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    color: var(--text);
  }

  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover { background: var(--bg-subtle); }

  td.row-actions { white-space: nowrap; text-align: right; }

  td.row-actions a,
  td.row-actions button {
    font-size: var(--text-xs);
    color: var(--link);
    margin-left: var(--sp-3);
  }

  td.row-actions a:visited { color: var(--link-visited); }

  td.row-actions button {
    appearance: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-weight: 400;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
  }

  td.row-actions button:hover { text-decoration-thickness: 2px; }

  td.row-actions button:active {
    box-shadow: none;
    transform: none;
  }

  td.row-actions button:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
    border-radius: var(--radius);
  }


  /* --- Definition lists --- */

  dl.record {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  dl.record dt {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--n-50);
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
  }

  dl.record dd {
    font-size: var(--text-sm);
    padding: var(--sp-2) var(--sp-4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
  }

  dl.record dt:last-of-type,
  dl.record dd:last-child { border-bottom: none; }


  /* --- Typographic constructs --- */

  /* Primary layout atoms — use these instead of visual containers */

  .headline-lockup {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  /* deck: standfirst / summary line below a headline */
  .deck {
    font-size: var(--text-lg);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-muted);
  }

  /* folio: section / page identifier above a primary landmark */
  .folio {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
  }

  /* pull-quote: extracted excerpt — padding only, no border, no background */
  .pull-quote {
    font-size: var(--text-2xl);
    font-weight: 400;
    font-style: italic;
    padding-inline: var(--sp-8);
    border: none;
    background: none;
    margin: 0;
  }

  /* caption: subordinate text below a <figure> */
  .caption {
    font-size: var(--text-xs);
    font-style: italic;
    color: var(--text-muted);
  }


  /* --- Section headers --- */

  .section { margin-bottom: var(--sp-8); }

  .section-header {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
  }

  .section-header h2 { font-size: var(--text-lg); }

  .count-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-faint);
    background: var(--n-100);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 0.1em 0.55em;
  }


  /* --- Status indicators --- */

  .status {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .status[data-state="active"]      { color: var(--success); }
  .status[data-state="inactive"]    { color: var(--text-faint); }


  /* --- Menus index — chronological editorial list --- */

  .menu-entry {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    gap: var(--sp-1);
  }

  .menu-entry:last-child { border-bottom: none; }

  .menu-entry-title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
  }

  .menu-entry-title a {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--link);
    text-decoration: none;
  }

  .menu-entry-title a:visited { color: var(--link-visited); }
  .menu-entry-title a:hover   { text-decoration: underline; }

  .menu-entry-notes {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.45;
  }

  .menu-entry-actions {
    display: flex;
    gap: var(--sp-4);
    font-size: var(--text-xs);
  }

  .menus-index-tz {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-faint);
  }


  /* --- Location list — two-column editorial --- */

  .location-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .location-entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-4) var(--sp-8);
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border-subtle);
    align-items: start;
  }

  .location-entry:last-child { border-bottom: none; }

  .location-entry h2 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
  }

  .location-entry h2 a { text-decoration: none; color: var(--text); }
  .location-entry h2 a:visited { color: var(--text); }
  .location-entry h2 a:hover   { color: var(--link); text-decoration: underline; }

  .location-entry-meta {
    margin: var(--sp-1) 0 0;
    font-size: var(--text-xs);
    color: var(--text-faint);
  }

  .location-entry-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    flex-shrink: 0;
  }


  /* --- Brand list — typographic editorial --- */

  .brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .brand-entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-4) var(--sp-8);
    padding: var(--sp-5) 0;
    border-bottom: 1px solid var(--border-subtle);
    align-items: start;
  }

  .brand-entry:last-child { border-bottom: none; }

  .brand-entry h2 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
  }

  .brand-entry h2 a { text-decoration: none; color: var(--text); }
  .brand-entry h2 a:visited { color: var(--text); }
  .brand-entry h2 a:hover   { color: var(--link); text-decoration: underline; }

  .brand-entry-tagline {
    margin: var(--sp-1) 0 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.45;
  }

  .brand-entry-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
  }


  /* --- Brand places list (in brand show partial) --- */

  .brand-places-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .brand-places-list li {
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .brand-places-list li:last-child { border-bottom: none; }

  .brand-places-list h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
  }

  .brand-places-list h3 a { text-decoration: none; color: var(--text); }
  .brand-places-list h3 a:visited { color: var(--text); }
  .brand-places-list h3 a:hover   { color: var(--link); }


  /* --- Chips --- */

  .chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
  }

  .chip-row[data-spacing="spaced"] { margin-block: var(--sp-6); }

  .chip {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.2em var(--sp-2);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: var(--n-50);
    color: var(--text-muted);
  }

  .chip[data-variant="accent"] {
    border-color: var(--border);
    color: var(--text);
    background: var(--n-100);
  }

  .chip-row .chip code {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.85em;
  }


  /* --- KV stack (key-value pairs) --- */

  .kv-stack {
    margin: 0;
    padding: var(--sp-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--n-50);
  }

  .kv-stack[data-size="sm"] { font-size: var(--text-sm); }

  .kv-stack > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--sp-3) var(--sp-6);
    padding: var(--sp-1) 0;
  }

  .kv-stack > div + div {
    border-top: 1px dashed var(--border-subtle);
    margin-top: var(--sp-1);
  }

  .kv-stack dt {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
  }

  .kv-stack dd {
    margin: 0;
    justify-self: end;
    text-align: right;
  }


  /* --- Tap list page --- */

  .tap-list-page {
    max-width: 56rem;
    margin-inline: auto;
  }

  .tap-list-page > .breadcrumbs { margin-bottom: var(--sp-5); }

  /* venue header */
  .tap-list-page > header {
    padding-block: var(--sp-8);
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--sp-8);
  }

  .tap-list-page > header:has(+ aside) { margin-bottom: 0; }

  .tap-list-hero {
    display: grid;
    gap: var(--sp-8);
  }

  .tap-list-timing > * + * { margin-top: var(--sp-3); }

  .tap-list-timing .overline {
    margin: 0;
    padding-top: var(--sp-2);
    border-top: 2px solid var(--border);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.35;
  }

  .tap-list-timing .date-line { margin: 0; }

  .tap-list-timing time {
    display: block;
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--text);
  }

  .tap-list-ident { }

  .tap-list-ident h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  .tap-list-ident p {
    font-size: var(--text-base);
    line-height: 1.45;
    color: var(--text-muted);
    margin-top: var(--sp-2);
  }

  /* provenance aside */
  .tap-list-page > aside {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding-block: var(--sp-6) var(--sp-8);
    margin-bottom: var(--sp-8);
  }

  .tap-list-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
  }

  .tap-list-meta .sep { opacity: 0.4; }

  .tap-list__freshness-callout {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left-width: 3px;
    background: var(--surface);
    align-self: flex-start;
    max-width: 38rem;
  }

  .tap-list-page .notes {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-style: italic;
    border-left: 3px solid var(--border);
    padding-left: var(--sp-3);
    margin-bottom: var(--sp-6);
  }

  /* style sections */
  .tap-list-page section { margin-bottom: var(--sp-10); }

  .tap-list-page section h2 {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-1);
  }

  .tap-list-page ul {
    list-style: none;
    padding: 0;
  }

  /* tap list items */
  .tap-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: var(--sp-6);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .tap-item:last-child { border-bottom: none; }

  .tap-item-name {
    font-weight: 600;
    font-size: var(--text-base);
    grid-column: 1;
    grid-row: 1;
  }

  .tap-item[data-available="false"] .tap-item-name span,
  .tap-item[data-available="false"] .tap-item-desc,
  .tap-item[data-available="false"] .tap-item-note { opacity: 0.55; }

  .tap-item-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: var(--sp-2);
    padding-inline: var(--sp-2);
    padding-block: 0.125rem;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    line-height: 1.2;
  }

  .tap-item-abv {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    white-space: nowrap;
  }

  .tap-item[data-available="false"] .tap-item-abv { opacity: 0.55; }

  .tap-item-desc {
    grid-column: 1 / -1;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--sp-1);
  }

  .tap-item-note {
    grid-column: 1 / -1;
    font-size: var(--text-xs);
    color: var(--text-faint);
    font-style: italic;
    margin-top: var(--sp-1);
  }

  .tap-item-status {
    grid-column: 1 / -1;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--sp-1);
  }

  .tap-item-status time { font-family: var(--font-mono); }

  /* admin nav bar on tap list pages */
  .tap-list-admin-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
    padding: var(--sp-3) 0;
    margin-bottom: var(--sp-6);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    color: var(--text-muted);
  }

  .tap-list-admin-bar a           { color: var(--link); text-decoration: none; }
  .tap-list-admin-bar a:visited   { color: var(--link-visited); }
  .tap-list-admin-bar a:hover     { text-decoration: underline; }

  @media (min-width: 768px) {
    .tap-list-hero {
      grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
      gap: var(--sp-10);
      align-items: start;
    }

    .tap-list-timing { display: flex; flex-direction: column; }

    .tap-list-ident {
      grid-column: 2;
      grid-row: 1;
      justify-self: end;
      text-align: right;
      max-width: 22rem;
    }

    .tap-list-ident h1 { font-size: var(--text-3xl); }
  }


  /* --- Menus index (daily tap list listing) --- */

  .menus-index {
    display: flex;
    flex-direction: column;
    gap: var(--sp-10);
  }

  .menus-index section > header {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding-bottom: var(--sp-3);
    margin-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border-subtle);
  }

  .menus-index section h2 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
  }

  .tap-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }


  /* --- Brand home (directory) --- */

  .brand-home {
    display: grid;
    gap: var(--sp-10);
    max-width: 58rem;
  }

  .brand-home > header {
    max-width: 65ch;
    padding-bottom: var(--sp-8);
    border-bottom: 2px solid var(--border);
  }

  /* eyebrow label — reusable utility class for overline labels */
  .eyebrow {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
  }

  .brand-home h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: var(--text);
  }

  .brand-home > header > p {
    max-width: 52ch;
    font-size: var(--text-lg);
    line-height: 1.5;
    color: var(--text-muted);
    margin-top: var(--sp-3);
  }

  .brand-home > nav {
    display: grid;
    gap: var(--sp-8);
  }

  .brand-home section {
    display: grid;
    gap: var(--sp-4);
    padding-bottom: var(--sp-8);
  }

  .brand-home section:last-child { padding-bottom: 0; border-bottom: none; }

  .brand-home section > h2 { max-width: 36rem; }

  .brand-home section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: var(--text);
  }

  .brand-home ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--sp-1);
  }

  .brand-home ul li { margin: 0; }

  .directory-simple-list {
    gap: var(--sp-6);
    max-width: 42rem;
  }

  .directory-simple-list .nav-item {
    gap: var(--sp-2);
    padding: var(--sp-1) 0 var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
  }

  .directory-simple-list .nav-item > a {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text);
    text-decoration-thickness: 2px;
  }

  .directory-simple-list .nav-item > p {
    max-width: 48ch;
    font-size: var(--text-base);
  }

  .directory-view-switch {
    padding-top: var(--sp-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
  }

  /* nav item — link entry in the directory */
  .nav-item {
    display: grid;
    gap: var(--sp-1);
    padding: var(--sp-3) 0;
  }

  .nav-item > a {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.2;
    color: var(--link);
    text-underline-offset: 3px;
    width: fit-content;
    outline-offset: var(--sp-1);
  }

  .nav-item > a:visited { color: var(--text); }

  .nav-item > a:focus-visible {
    outline: 2px solid var(--link);
    border-radius: var(--radius);
  }

  .nav-item > p {
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--text-muted);
  }

  .nav-item[data-state="disabled"] {
    cursor: not-allowed;
    opacity: 0.58;
  }

  .nav-item[data-state="disabled"] > a { color: var(--text-muted); }
  .nav-item[data-state="disabled"] > a:hover { text-decoration: none; }

  .nav-item[data-state="disabled"] > a:focus-visible {
    text-decoration: none;
    z-index: 1;
    position: relative;
  }

  @media (min-width: 768px) {
    .brand-home section {
      grid-template-columns: minmax(12rem, 0.42fr) minmax(0, 1fr);
      gap: var(--sp-8);
    }

    .brand-home ul { margin-top: -0.1rem; }
  }

  @media (min-width: 1024px) {
    .brand-home { gap: var(--sp-12); }
    .brand-home > header { padding-top: var(--sp-4); }
  }


  /* --- Age gate dialog --- */

  dialog.age-gate {
    width: 100vw;
    height: 100dvh;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--bg, #fff);
  }

  dialog.age-gate[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: age-gate-in 0.3s ease forwards;
  }

  @keyframes age-gate-in { to { opacity: 1; } }

  dialog.age-gate::backdrop { background: rgba(0, 0, 0, 0.6); }

  dialog.age-gate > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-6);
    max-width: 28rem;
    padding: var(--sp-12) var(--sp-8);
    text-align: center;
  }

  dialog.age-gate .brand {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  dialog.age-gate h1 { font-size: var(--text-3xl); line-height: 1.15; color: var(--text); }

  dialog.age-gate .disclaimer {
    font-size: var(--text-sm);
    color: var(--text-faint);
    max-width: 40ch;
  }

  dialog.age-gate .actions {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--sp-2);
  }

  /* age gate uses larger, bespoke button sizing */
  dialog.age-gate .btn {
    padding: var(--sp-3) var(--sp-8);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid currentColor;
    background: transparent;
    transition: opacity 0.15s;
  }

  dialog.age-gate .btn:hover       { opacity: 0.75; }
  dialog.age-gate .btn:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

  dialog.age-gate .btn[data-variant="yes"] {
    background: var(--text);
    color: var(--bg, #fff);
    border-color: var(--text);
  }

  dialog.age-gate .btn[data-variant="no"] { color: var(--text-muted); }


  /* --- Bulk import --- */

  .bulk-import {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--sp-8);
    align-items: start;
    max-width: 72rem;
  }

  .bulk-import > aside {
    padding-top: var(--sp-2);
  }

  .bulk-import aside .eyebrow {
    margin-bottom: var(--sp-4);
  }

  .bulk-import aside pre {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: var(--sp-4);
    font-size: var(--text-sm);
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 0 0 var(--sp-4);
  }

  .bulk-import aside dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
    margin: 0;
  }

  .bulk-import aside dl dt { font-weight: 600; color: var(--text-muted); }
  .bulk-import aside dl dd { margin: 0; }

  /* override default form max-width constraint inside bulk import */
  .bulk-import > form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
    max-width: none;
  }

  .bulk-import form textarea {
    width: 100%;
    font-family: ui-monospace, monospace;
    font-size: var(--text-sm);
    line-height: 1.6;
    resize: vertical;
  }

  @media (max-width: 768px) {
    .bulk-import {
      grid-template-columns: 1fr;
    }

    .bulk-import > form {
      padding-top: var(--sp-6);
      border-top: 1px solid var(--border-subtle);
    }
  }


  /* --- Responsive overrides --- */

  @media (max-width: 768px) {
    .page-header { gap: var(--sp-3); }

    .page-actions {
      margin-left: 0;
      width: 100%;
    }

    .app-header nav a { font-size: var(--text-sm); }
  }

  @media (max-width: 480px) {
    :root {
      --page-px: var(--sp-4);
      --text-2xl: 1.25rem;
    }

    .app-header { gap: var(--sp-3); }
    .app-header nav a { padding-inline: var(--sp-2); }

    form { max-width: 100%; }

    .table-wrap { -webkit-overflow-scrolling: touch; }
  }

}


/* ============================================================
   Utilities — spacing and flex only
   ============================================================ */

@layer utilities {
  .flex          { display: flex; }
  .flex-col      { flex-direction: column; }
  .flex-wrap     { flex-wrap: wrap; }
  .flex-shrink-0 { flex-shrink: 0; }

  .items-center  { align-items: center; }
  .items-start   { align-items: flex-start; }

  .justify-between { justify-content: space-between; }
  .justify-center  { justify-content: center; }
  .justify-end     { justify-content: flex-end; }

  .ml-auto { margin-left: auto; }

  .gap-1 { gap: var(--sp-1); }
  .gap-2 { gap: var(--sp-2); }
  .gap-3 { gap: var(--sp-3); }
  .gap-4 { gap: var(--sp-4); }
  .gap-6 { gap: var(--sp-6); }
  .gap-8 { gap: var(--sp-8); }

  .p-2 { padding: var(--sp-2); }
  .p-3 { padding: var(--sp-3); }
  .p-4 { padding: var(--sp-4); }

  .px-2 { padding-inline: var(--sp-2); }
  .px-3 { padding-inline: var(--sp-3); }
  .px-4 { padding-inline: var(--sp-4); }

  .py-2 { padding-block: var(--sp-2); }
  .py-4 { padding-block: var(--sp-4); }

  .mt-2 { margin-top: var(--sp-2); }
  .mt-4 { margin-top: var(--sp-4); }
  .mt-8 { margin-top: var(--sp-8); }

  .mb-2 { margin-bottom: var(--sp-2); }
  .mb-4 { margin-bottom: var(--sp-4); }
}


/* ============================================================
   Print — outside layers (unlayered specificity beats all layers)
   ============================================================ */

@media print {
  .app-header,
  .breadcrumbs,
  .page-actions,
  .tap-list-admin-bar { display: none; }

  .app-main       { padding: 0; max-width: 100%; }
  .tap-list-page  { max-width: 100%; }
}
