:root {
  --ink: #13273a;
  --ink-deep: #0d1d2b;
  --cream: #f4efe6;
  --paper: #fbfaf7;
  --sand: #dfd5c5;
  --gold: #efc477;
  --burgundy: #93414a;
  --muted: #68737b;
  --line: rgba(19, 39, 58, .16);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.top { background: var(--ink); color: var(--cream); }
.top-inner { width: min(1100px, calc(100% - 32px)); margin: 0 auto; display: flex; align-items: center; gap: 18px; min-height: 72px; min-width: 0; max-width: 100%; }
.brand { color: var(--cream); text-decoration: none; display: flex; flex-direction: row; align-items: center; gap: 10px; line-height: 1.05; margin-right: auto; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font-family: var(--serif); font-weight: 500; font-size: 18px; }
.brand em { color: var(--gold); font-family: var(--serif); font-size: 14px; }
.identity-admin-logo { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(239, 196, 119, .55); }
.identity-login-logo img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.nav-toggle { display: none; border: 1px solid rgba(244,239,230,.35); color: var(--cream); background: transparent; min-height: 40px; padding: 0 12px; }
.admin-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.admin-nav a { color: rgba(244,239,230,.8); text-decoration: none; font-size: 13px; font-weight: 700; padding: 8px 10px; border-radius: 3px; }
.admin-nav a[aria-current="page"], .admin-nav a:hover { color: var(--ink); background: var(--gold); }
main { width: min(1100px, calc(100% - 32px)); max-width: 100%; min-width: 0; margin: 28px auto 64px; overflow-x: clip; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 52px); letter-spacing: -.03em; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.card { background: var(--paper); border: 1px solid var(--line); padding: 16px 18px; }
.card span { display: block; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.card strong { display: block; margin-top: 8px; font-family: var(--serif); font-size: 34px; font-weight: 400; }
.card a { color: var(--burgundy); }
.panel { background: var(--paper); border: 1px solid var(--line); padding: 18px; margin-bottom: 18px; min-width: 0; max-width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--sand); }
.badge.pending, .badge.awaiting_validation, .badge.open { background: var(--gold); }
.badge.claimed { background: #cfe0ef; }
.badge.confirmed, .badge.validated, .badge.closed { background: #d7eadf; }
.badge.rejected, .badge.refused, .badge.cancelled, .badge.off { background: #f3d7d6; }
.badge.dine_in, .badge.takeaway { background: var(--ink); color: var(--cream); }
.badge.prep-queued { background: var(--gold); }
.badge.prep-in_progress { background: #cfe0ef; }
.badge.prep-ready { background: #bfe3cd; }
.badge.prep-not_dispatched { background: var(--sand); color: var(--muted); }
.ready-handover { border-left: 3px solid #2f7d57; }
.station-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.station-links a { text-decoration: none; border: 1px solid var(--line); background: var(--paper); padding: 10px 14px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.flash { padding: 12px 14px; margin-bottom: 16px; background: var(--paper); border-left: 3px solid var(--burgundy); }
.flash.ok { border-color: #2f7d57; }
form.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
label { display: block; font-size: 13px; margin-bottom: 4px; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--line); background: white; color: var(--ink); padding: 10px; min-height: 44px; border-radius: 3px; }
fieldset { min-inline-size: 0; min-width: 0; }
textarea { min-height: 90px; }
.grid { display: grid; gap: 14px; min-width: 0; }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.grid > * { min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button, button, .button-link { border: 0; cursor: pointer; background: var(--ink); color: var(--cream); min-height: 44px; padding: 10px 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.button.light, button.light { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.danger, button.danger { background: var(--burgundy); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { width: auto; min-height: 0; }
.error { color: var(--burgundy); margin: 0 0 12px; }
.muted { color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; }
dl.split { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.qr-sheet { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.qr-sheet img { width: 220px; height: auto; background: white; border: 1px solid var(--line); }
.qr-sheet h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 8px; }
.qr-sheet form { margin-top: 12px; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 22px; }
.floor-card { border: 1px solid var(--line); padding: 14px; background: #e5f6ea; }
.floor-card h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0 0 4px; }
.floor-card p { margin: 0 0 8px; }
.floor-card.pending { background: #f6e2c4; }
.floor-card.confirmed { background: #f6d4d2; }
.floor-card.inactive { background: #eceae6; color: var(--muted); }
.floor-state { font-weight: 800; }
.floor-booking { font-size: 14px; }
.field-hint { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.card.vs { border-left: 3px solid var(--gold); }
.card.ops, .panel.ops { background: #eef3f1; }
.card.ops { border-left: 3px solid #2f7d57; }
.card .sub, .card em.sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; letter-spacing: 0; text-transform: none; font-style: normal; font-weight: 600; }
.card strong small { display: block; font-family: var(--sans); font-size: 14px; font-weight: 700; margin-top: 6px; }
.delta-up { color: #2f7d57; }
.delta-down { color: var(--burgundy); }
.disclaimer { background: #f6e2c4; border: 1px solid var(--line); padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.filters.dates { margin-top: 0; }
.sortable { color: inherit; text-decoration: none; font-weight: 800; }
.sortable[aria-sort="descending"]::after { content: " ↓"; }
.sortable[aria-sort="ascending"]::after { content: " ↑"; }
.identity-preview .hours-list { list-style: none; margin: 12px 0; padding: 0; }
.identity-hours-preview li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.identity-thumbs, .identity-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; min-width: 0; max-width: 100%; }
.identity-thumbs img, .identity-photo-card img { width: 100%; max-width: 100%; height: 110px; object-fit: cover; background: #eceae6; }
.identity-thumbs figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.identity-hours { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; max-width: 100%; }
.identity-day { border: 1px solid var(--line); padding: 12px; min-width: 0; max-width: 100%; }
.identity-hours-preview span, .identity-hours-preview strong { min-width: 0; overflow-wrap: anywhere; }
.identity-tabs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.identity-tab { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.identity-tab.active { background: var(--ink); color: var(--cream); }
.identity-pane { display: none; grid-gap: 12px; min-width: 0; max-width: 100%; }
.identity-pane.active { display: grid; grid-template-columns: minmax(0, 1fr); }
.identity-pane > * { min-width: 0; }
.identity-mark-fallback { width: 32px; height: 32px; border: 1px solid rgba(147, 65, 74, .4); border-radius: 10px; display: inline-flex; justify-content: center; align-items: flex-end; gap: 3px; padding-bottom: 7px; }
.identity-mark-fallback span { width: 2px; height: 10px; background: var(--gold); display: block; }
.identity-form, .identity-preview { min-width: 0; max-width: 100%; }
.identity-form { grid-template-columns: minmax(0, 1fr); }
.identity-form > * { min-width: 0; }
.identity-form h2 { font-family: var(--serif); font-weight: 400; margin: 18px 0 6px; }
.identity-save-default { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.identity-appearance { min-width: 0; max-width: 100%; }
.identity-appearance-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 18px 0 6px; }
.identity-appearance-head h2 { margin: 0; flex: 1 1 auto; min-width: 0; }
.identity-apply-theme { flex: 0 0 auto; margin-left: auto; min-height: 44px; }
.identity-theme-applied { margin: 0 0 8px; color: #2f7d57; font-size: 14px; font-weight: 700; }
.identity-photo-card { min-width: 0; max-width: 100%; }
.identity-photo-card input[type="file"] { max-width: 100%; min-width: 0; }
.identity-public-link { margin: -8px 0 18px; }
.identity-public-link a { color: var(--burgundy); font-weight: 700; }
.identity-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; max-width: 100%; }
.identity-theme-card { display: grid; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; min-width: 0; }
.identity-theme-card.is-selected, .identity-theme-card:has(input:checked) { border-color: var(--ink); background: var(--cream); }
.identity-theme-card.is-disabled { cursor: not-allowed; opacity: .55; background: #f3f1ed; }
.identity-theme-card input { width: auto; min-height: 0; margin: 0; accent-color: var(--ink); }
.identity-theme-card img, .identity-theme-placeholder { width: 100%; height: 92px; object-fit: cover; background: #eceae6; }
.identity-theme-placeholder { display: block; }
.identity-theme-card strong { font-size: 14px; }
.identity-theme-card span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.identity-site-copy { min-width: 0; max-width: 100%; }
.identity-site-copy > h2 { font-family: var(--serif); font-weight: 400; margin: 18px 0 6px; }
.identity-copy-restored { margin: 0 0 8px; color: #2f7d57; font-size: 14px; font-weight: 700; }
.identity-copy-block { border: 1px solid var(--line); background: #f7f4ee; padding: 0; min-width: 0; max-width: 100%; }
.identity-copy-block + .identity-copy-block { margin-top: 10px; }
.identity-copy-block > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 800; min-height: 44px; }
.identity-copy-block > summary::-webkit-details-marker { display: none; }
.identity-copy-block > summary::before { content: "▸"; color: var(--muted); margin-right: 8px; }
.identity-copy-block[open] > summary::before { content: "▾"; }
.identity-copy-block > summary span { flex: 1 1 auto; min-width: 0; }
.identity-copy-body { display: grid; gap: 16px; padding: 0 14px 16px; min-width: 0; }
.identity-copy-field { display: grid; gap: 8px; min-width: 0; }
.identity-copy-field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.identity-copy-field-head > span { font-size: 13px; font-weight: 700; }
.identity-copy-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.identity-restore { background: transparent; color: var(--ink); border: 1px solid var(--line); min-height: 36px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.identity-restore:hover, .identity-restore:focus { border-color: var(--ink); background: var(--paper); }
@media (max-width: 860px) {
  .qr-sheet { grid-template-columns: 1fr; }
  .identity-apply-theme { margin-left: 0; }

  .cards, .grid-3, .grid-2, dl.split, .identity-photos, .identity-thumbs, .identity-themes, .identity-copy-langs { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .admin-nav { display: none; width: 100%; padding-bottom: 12px; }
  .admin-nav.open { display: flex; flex-direction: column; align-items: stretch; }
  .top-inner { flex-wrap: wrap; padding: 12px 0; }
}
