:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --fg: #1f1c17;
  --muted: #6d675c;
  --line: #e2dccf;
  --accent: #b5481f;
  --accent-fg: #ffffff;
  --ok: #2f7d4a;
  --warn: #a8661b;
  --bad: #b3261e;
  --radius: 8px;
  --stamp: #b3261e;
  --typed: #4a4540;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #201e1b;
    --fg: #ece7de;
    --muted: #9b958a;
    --line: #34312c;
    --accent: #e0784b;
    --accent-fg: #1a120d;
    --ok: #5cb87a;
    --warn: #d99b4a;
    --bad: #ef6b62;
    --stamp: #ef6b62;
    --typed: #b9b2a6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; margin: 18px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--fg); text-decoration: none; }
.brand span { color: var(--accent); }
.admin-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.admin-nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
.admin-nav a:hover { color: var(--accent); }

.footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 28px; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
.footer a { color: var(--muted); }

.flash { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); padding: 9px 12px; border-radius: var(--radius); margin-top: 14px; }

/* forms */
input, select, textarea, button { font: inherit; color: var(--fg); }
input[type=text], input[type=url], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
textarea { min-height: 70px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
label.field > span.hint { font-size: .78rem; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--fg); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--fg); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; color: var(--fg); cursor: pointer; font-weight: 500; }
button.link:hover { color: var(--accent); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.validation { color: var(--bad); font-size: .85rem; }

/* tables */
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
th a { color: inherit; text-decoration: none; }
th a.active { color: var(--fg); }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 1.6rem; }

/* public page */
.days { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.days a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--fg); background: var(--surface); }
.days a.current { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; display: grid; gap: 12px; }
.filters .top { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .top > label { flex: 1 1 150px; }
.filters .top > label:first-child { flex: 3 1 240px; }
.filters .top > .row { flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips .label { font-size: .82rem; color: var(--muted); min-width: 90px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: .86rem; cursor: pointer; user-select: none; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip.inc input:checked + span { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); border-color: var(--ok); }
.chip.exc input:checked + span { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); border-color: var(--bad); text-decoration: line-through; }

.place { margin-top: 22px; }
.day-heading { margin: 30px 0 -6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.day-heading:first-child { margin-top: 12px; }
.place-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--fg); padding-bottom: 4px; margin-bottom: 8px; }
.place-head a { color: var(--fg); text-decoration: none; }
.place-head a:hover { color: var(--accent); }
.dish { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dish:last-child { border-bottom: 0; }
.dish-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dish .title { font-weight: 600; }
.dish .price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dish .desc, .dish .tags { color: var(--muted); font-size: .9rem; margin-top: 2px; }
/* visually hidden but kept when copying text, so copied menus read "Laxlåda – 125 kr" */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { padding: 30px 0; color: var(--muted); }

/* login */
.login { max-width: 360px; margin: 48px auto 0; }

/* admin: drag to reorder sources */
.drag-cell { width: 28px; padding-right: 0; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; font-size: 1.15rem; color: var(--muted); padding: 2px 4px; }
.drag-handle:hover { color: var(--fg); }
tr.dragging { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
tr.dragging .drag-handle { cursor: grabbing; color: var(--accent); }
body.is-dragging { user-select: none; cursor: grabbing; }
.reorder-status { font-weight: 600; }

/* visitor preferences */
.star { background: none; border: 0; padding: 0 4px 0 0; font-size: 1.05em; line-height: 1; cursor: pointer; color: var(--muted); vertical-align: baseline; }
.star:hover, .star.on { color: var(--warn); }
.dish.fav .title { color: var(--fg); }
.fav-mark { color: var(--warn); }
.filter-foot { gap: 10px; align-items: center; }
.filter-foot .spacer { flex: 1; }
dialog.consent { max-width: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); padding: 18px 20px; }
dialog.consent::backdrop { background: rgb(0 0 0 / .35); }
dialog.consent h2 { margin-bottom: 8px; }
.osm { margin-left: 6px; font-size: .78rem; }
.osm a { color: inherit; }
.featured { margin-top: 18px; padding: 4px 16px 14px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.featured-title { margin: 12px 0 0; font-size: 1rem; color: var(--warn); }
.featured .place:first-of-type { margin-top: 12px; }
.section-title { margin: 30px 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* public page logo: the "HEMLIG" lunch stamp */
.hero-logo { max-width: 720px; margin: 22px auto 4px; }
.hero-logo svg { display: block; width: 100%; height: auto; }
