/* Base */
:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px) }
body { margin: 0; padding: 0 }
img { max-width: 100% }
[hidden] { display: none !important }

/* Layout: app shell — sticky brand header, one scrolling view, fixed bottom tab bar; sheets slide up for detail. */
:root {
  --bg: #edf1f0;
  --surface: #ffffff;
  --sunk: #e3e9e8;
  --ink: #16313a;
  --muted: #587077;
  --line: #d2dbdb;
  --accent: #2b6272;          /* Bloubank blue-teal from the letterhead */
  --accent-ink: #ffffff;
  --accent-soft: #d8e7ea;
  --k1: #566b2e;              /* rate card: Kategorie 1 olive */
  --k2: #b5852c;              /* rate card: Kategorie 2 ochre */
  --k3: #13305f;              /* rate card: Kategorie 3 navy */
  --ok: #2d7a4c;  --ok-soft: #dcefe3;
  --warn: #a8701a; --warn-soft: #f6e8cf;
  --bad: #b03a3a; --bad-soft: #f5dddd;
  --holiday: #f3e2cd;
  --holiday-edge: #e7bf8f;
  --on-cat: #ffffff;
  --shadow: 0 1px 2px rgb(22 49 58 / .06), 0 6px 20px rgb(22 49 58 / .07);
  --f-display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --f-caps: "Marcellus SC", "Marcellus", Georgia, serif;
  --f-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1a1d; --surface: #152428; --sunk: #1b2d32; --ink: #e2ecec; --muted: #94aaad; --line: #293d42;
  --accent: #7db4c3; --accent-ink: #0e1a1d; --accent-soft: #1f3a42;
  --k1: #9db56a; --k2: #e1b45f; --k3: #8da9e2;
  --ok: #6cc391; --ok-soft: #173326; --warn: #e3ad55; --warn-soft: #36290f; --bad: #ec8a8a; --bad-soft: #3a1c1c;
  --holiday: #33281b; --holiday-edge: #8a6234; --on-cat: #0e1a1d; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0e1a1d; --surface: #152428; --sunk: #1b2d32; --ink: #e2ecec; --muted: #94aaad; --line: #293d42;
  --accent: #7db4c3; --accent-ink: #0e1a1d; --accent-soft: #1f3a42;
  --k1: #9db56a; --k2: #e1b45f; --k3: #8da9e2;
  --ok: #6cc391; --ok-soft: #173326; --warn: #e3ad55; --warn-soft: #36290f; --bad: #ec8a8a; --bad-soft: #3a1c1c;
  --holiday: #33281b; --holiday-edge: #8a6234; --on-cat: #0e1a1d; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
  color-scheme: dark }

* { box-sizing: border-box }
html { font-size: 17px }
html.big { font-size: 20px }
body { background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.5; font-family: var(--f-body) }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface) }
button, input, select { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.15 }
h1 { font-size: 1.6rem } h2 { font-size: 1.3rem } h3 { font-size: 1.08rem }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
.small { font-size: .88rem }
.label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600 }

.wrap { max-width: 860px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 }
.brand svg { flex: none; color: var(--accent) }
.brand > div { min-width: 0 }
.brand b { display: block; font-family: var(--f-caps); font-weight: 400; font-size: 1.25rem; letter-spacing: .14em; color: var(--accent); line-height: 1 }
.brand small { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none }
.lang button { border: 0; background: none; padding: 7px 11px; font-size: .85rem; font-weight: 600; color: var(--muted) }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }
.brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
@media (max-width: 440px) { .brand small, .top .who { display: none } .brand b { font-size: 1rem; letter-spacing: .1em } .brand svg { width: 28px } }
.textsize { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; min-height: 36px; font-weight: 700; flex: none; line-height: 1 }
.textsize span { font-size: 1.3em }
.textsize[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.who { border: 1px solid var(--line); background: var(--sunk); border-radius: 999px; padding: 7px 11px; font-size: .85rem; max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none }

main { padding-block: 18px calc(88px + env(safe-area-inset-bottom, 0px)) }
.stack { display: flex; flex-direction: column; gap: 16px }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.spread { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap }

/* bottom tabs */
.tabs { position: fixed; inset: auto 0 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) }
.tabs .in { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-around; gap: 4px }
.tabs button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 8px; color: var(--muted); font-size: .82rem; font-weight: 600 }
.tabs button svg { width: 26px; height: 26px }
.tabs button[aria-current="page"] { color: var(--accent); background: var(--accent-soft) }
.tabs button.book { color: var(--accent-ink); background: var(--accent) }

/* buttons & inputs */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 16px; min-height: 44px; font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; justify-content: center }
.btn:hover { border-color: var(--accent) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn.danger { color: var(--bad); border-color: var(--bad) }
.btn.ghost { border-color: transparent; background: none; color: var(--accent) }
.btn.sm { padding: 6px 12px; min-height: 38px; font-size: .88rem }
.btn:disabled { opacity: .45; cursor: not-allowed }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.field > span { font-size: .88rem; font-weight: 600; color: var(--muted) }
input[type=text], input[type=email], input[type=number], input[type=date], select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 10px; min-width: 0 }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft) }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none }
.seg button { border: 0; background: var(--surface); padding: 8px 12px; min-height: 40px; font-size: .9rem; font-weight: 600; color: var(--muted) }
.seg button + button { border-left: 1px solid var(--line) }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }
.seg.cat button[aria-pressed="true"][data-v="1"] { background: var(--k1); color: var(--on-cat) }
.seg.cat button[aria-pressed="true"][data-v="2"] { background: var(--k2); color: var(--on-cat) }
.seg.cat button[aria-pressed="true"][data-v="3"] { background: var(--k3); color: var(--on-cat) }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px }
.panel.flush { padding: 0; overflow: hidden }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; white-space: nowrap }
.pill.ok { background: var(--ok-soft); color: var(--ok) }
.pill.warn { background: var(--warn-soft); color: var(--warn) }
.pill.bad { background: var(--bad-soft); color: var(--bad) }
.pill.plain { background: var(--sunk); color: var(--muted) }
.pill.demo { background: var(--sunk); color: var(--muted); border: 1px dashed var(--line) }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; font-size: .85rem; font-weight: 600; background: var(--sunk) }
.chip.t::before, .chip.h::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent) }
.chip.h::before { background: var(--k2); border-radius: 50% }
.note { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: .84rem }

/* calendar */
.calhead { display: flex; align-items: center; gap: 10px }
.calhead h1 { flex: 1; text-align: center; font-size: 1.7rem }
.calhead h1 small { font-family: var(--f-body); font-size: 1rem; color: var(--muted); margin-left: 8px }
.iconbtn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none }
.iconbtn svg { width: 22px; height: 22px }
.legend { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: .88rem; color: var(--muted) }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--line) }

/* day list: one large row per day */
.daylist { display: flex; flex-direction: column; gap: 8px }
.dayrow { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 8px; min-height: 72px }
.dayrow:hover { border-color: var(--accent) }
.dayrow.sun { margin-bottom: 12px }
.dayrow.hol { border-left: 7px solid var(--holiday-edge) }
.dayrow.today { border: 2px solid var(--accent) }
.dayrow.past { opacity: .55 }
.dayrow .date { display: flex; flex-direction: column; align-items: center; line-height: 1 }
.dayrow .date b { font-family: var(--f-display); font-weight: 400; font-size: 1.8rem }
.dayrow .date small { font-size: .82rem; color: var(--muted); font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em }
.dayrow .info { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.dayrow .tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.dayrow .line { font-size: 1rem; color: var(--ink) }
.dayrow .line b { font-size: 1.1rem; font-variant-numeric: tabular-nums }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--accent); margin-right: 8px; vertical-align: 0 }
.dot.h { background: var(--k2); border-radius: 50% }
.badge { font-weight: 700; font-size: .9rem; padding: 3px 10px; border-radius: 6px; white-space: nowrap }
.badge.ok { background: var(--ok-soft); color: var(--ok) }
.badge.warn { background: var(--warn-soft); color: var(--warn) }
.badge.bad { background: var(--bad-soft); color: var(--bad) }
.evtag { background: var(--k2); color: var(--on-cat); border-radius: 6px; padding: 3px 10px; font-weight: 700; font-size: .9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.holtag { font-size: .85rem; font-weight: 600; color: var(--muted) }

/* month grid: big number of free places per day */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px }
.dow { text-align: center; font-size: .85rem; font-weight: 700; color: var(--muted); padding-bottom: 2px; text-transform: uppercase }
.cell { min-height: 74px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 3px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface) }
.cell.ok { background: var(--ok-soft) } .cell.warn { background: var(--warn-soft) } .cell.bad { background: var(--bad-soft) }
.cell .d { font-size: .9rem; font-weight: 700; line-height: 1.2; padding: 0 5px; border-radius: 5px }
.cell.hol .d { background: var(--holiday-edge); color: var(--ink) }
.cell .n { font-size: 1.45rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: auto }
.cell.ok .n { color: var(--ok) } .cell.warn .n { color: var(--warn) } .cell.bad .n { color: var(--bad) }
.cell .w { font-size: .72rem; font-weight: 600; color: var(--muted); line-height: 1 }
.cell.has-ev { box-shadow: inset 0 5px 0 var(--k2) }
.cell.today { outline: 3px solid var(--accent); outline-offset: -3px }
.cell.past { opacity: .5 }
.cell.empty { visibility: hidden }
.cell:hover:not(.empty) { border-color: var(--accent) }
.cell .cev, .cell .det { display: none }
@media (min-width: 760px) {
  .cal { gap: 8px }
  .cell { min-height: 128px; padding: 8px; align-items: stretch; text-align: center }
  .cell .d { align-self: flex-start; font-size: 1rem }
  .cell .n { font-size: 1.7rem }
  .cell .cev { display: block; font-size: .78rem; font-weight: 700; background: var(--k2); color: var(--on-cat); border-radius: 4px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left }
  .cell .det { display: block; font-size: .8rem; color: var(--ink); line-height: 1.35; margin-top: 4px }
  .cell.has-ev { box-shadow: none }
}

/* list rows */
.list > * + * { border-top: 1px solid var(--line) }
.item { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px }
.item .ttl { font-weight: 700 }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .88rem }
.kv dt { color: var(--muted) } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums }

/* sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(8 20 24 / .45); display: flex; align-items: flex-end; justify-content: center }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92%; overflow: auto; border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) }
.sheet .grab { position: sticky; top: 0; background: var(--bg); padding: 14px 0 10px; display: flex; align-items: center; gap: 10px; z-index: 2; border-bottom: 1px solid var(--line); margin-bottom: 14px }
.sheet .grab h2 { flex: 1 }
@media (min-width: 700px) { .scrim { align-items: center } .sheet { border-radius: 16px; max-height: 88% } }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .22s ease-out } @keyframes up { from { transform: translateY(24px); opacity: .6 } } }

/* booking form */
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr)); gap: 8px }
.unit { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 4px; min-height: 52px; text-align: center; font-size: .95rem; font-weight: 600; display: flex; flex-direction: column; gap: 1px }
.unit small { font-weight: 400; font-size: .78rem; color: var(--muted) }
.units.h { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)) }
.unit small.hn { font-weight: 600; color: inherit; font-size: .82rem }
.tabs .cnt { display: inline-block; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .72rem; margin-left: 4px; line-height: 1.5 }
.unit[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.unit[aria-pressed="true"] small { color: inherit; opacity: .8 }
.unit:disabled { background: var(--sunk); color: var(--muted); text-decoration: line-through; cursor: not-allowed }
.guest { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line) }
.guest:first-child { border-top: 0 }
.guest .ctl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1 }
.guest .ctl select { width: auto; flex: 1; min-width: 7rem; padding: 8px; font-size: .95rem }
.guest .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; align-self: center; font-size: .9rem }
.total { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); margin-top: 6px }
.total .sum { flex: 1 }
.total .sum b { font-size: 1.35rem; font-family: var(--f-display); font-weight: 400; display: block; line-height: 1.1 }
.err { color: var(--bad); font-size: .84rem; font-weight: 600 }

/* invoice */
.invoice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 16px }
.invoice .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--accent); padding-bottom: 12px }
.invoice .head b { font-family: var(--f-caps); font-weight: 400; letter-spacing: .14em; color: var(--accent); font-size: 1.3rem }
.tablewrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; font-size: .86rem }
th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
tfoot td { border-bottom: 0; font-weight: 700 }
.catdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px }
.c1 { background: var(--k1) } .c2 { background: var(--k2) } .c3 { background: var(--k3) }
.ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: .04em }

/* admin */
.subtabs { display: flex; gap: 6px; overflow-x: auto }
.subtabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .85rem; white-space: nowrap }
.subtabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px }
.stat b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; margin-top: 2px; font-variant-numeric: tabular-nums }
@media (max-width: 520px) { .stat b { font-size: 1.05rem } .grid2 { grid-template-columns: 1fr } }
.ratecard { display: grid; gap: 10px }
.rc { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface) }
.rc header { padding: 10px 14px; color: var(--on-cat) }
.rc header h3 { font-family: var(--f-caps); letter-spacing: .08em }
.rc header p { margin: 2px 0 0; font-size: .78rem; opacity: .9 }
.rc .body { padding: 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.rc .body .full { grid-column: 1 / -1 }
.rc input { padding: 7px 8px }
.rc .cur { position: relative } .rc .cur::before { content: "R"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem } .rc .cur input { padding-left: 22px }
.bg1 { background: var(--k1) } .bg2 { background: var(--k2) } .bg3 { background: var(--k3) }

/* sign in */
.signin { min-height: 70vh; display: grid; place-items: center }
.signin .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px }
.signin .crest { text-align: center; color: var(--accent); display: flex; flex-direction: column; align-items: center; gap: 6px }
.signin .crest b { font-family: var(--f-caps); font-weight: 400; font-size: 2.1rem; letter-spacing: .16em; line-height: 1 }
.signin .crest small { letter-spacing: .2em; text-transform: uppercase; font-size: .7rem; color: var(--muted) }
.members { display: grid; gap: 8px }
.members button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px }
.members button:hover { border-color: var(--accent) }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
.proto { text-align: center; font-size: .8rem; color: var(--muted); padding-top: 8px }
