/* Kitchen screen: big, plain and readable from across a kitchen. Sizes are in rem so A− / A+ scale everything. */
:root { --top: #1d2430; --top-ink: #e8ecf2; }
html { font-size: 16px; }
body { background: var(--bg); font-size: 1rem; line-height: 1.35; }

.k-brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: var(--top-ink); white-space: nowrap; }
.k-brand b { color: #f0b35a; }
.k-brand span { font-weight: 600; opacity: .8; margin-left: 2px; }
.k-brand.big { font-size: 1.6rem; color: var(--ink); text-align: center; margin-bottom: 18px; }

/* sign in */
.k-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #1d2430, #3a2a2a); }
.k-auth-card { background: var(--card); padding: 28px; border-radius: 16px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.k-wide { width: 100%; }

/* top bar */
.k-top { position: sticky; top: 0; z-index: 20; background: var(--top); color: var(--top-ink); display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; flex-wrap: wrap; font-size: 15px; }
.k-top select { background: #2b3442; color: var(--top-ink); border-color: #3b4656; min-height: 36px; padding: 4px 10px; width: auto; max-width: 220px; }
.k-ghost { background: transparent; border: 1px solid transparent; color: var(--top-ink); border-radius: 8px; min-height: 36px; padding: 4px 10px; font-weight: 700; }
.k-ghost:hover { background: rgba(255, 255, 255, .08); }
.k-tabs { display: flex; gap: 2px; background: #2b3442; border-radius: 10px; padding: 3px; }
.k-tabs button { border: 0; background: none; color: var(--top-ink); padding: 6px 14px; border-radius: 8px; font-weight: 700; opacity: .8; }
.k-tabs button[aria-current=page] { background: var(--top-ink); color: var(--top); opacity: 1; }
.k-datenav { display: flex; align-items: center; gap: 2px; }
.k-datebtn { position: relative; font-weight: 800; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; min-width: 9.5em; text-align: center; }
.k-datebtn:hover { background: rgba(255, 255, 255, .08); }
.k-datebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; padding: 0; border: 0; }
.k-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.k-clock { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; margin-right: 4px; }
.k-live { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; margin-right: 6px; }
.k-live.on { background: #3ccf7a; }
.k-menu { position: relative; }
.k-menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 250px; padding: 6px; z-index: 30; display: grid; gap: 2px; }
.k-menu-list > button, .k-menu-list > a { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.k-menu-list > button:hover, .k-menu-list > a:hover { background: var(--hover); }
.k-menu-list .check { padding: 6px 12px; margin: 0; }
.k-who { padding: 8px 12px 4px; color: var(--muted); font-size: 13px; }
.k-seg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; font-weight: 600; }
.k-seg { display: flex; background: var(--soft-2); border-radius: 8px; padding: 2px; }
.k-seg button { border: 0; background: none; padding: 4px 9px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.k-seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }

.k-main { padding: 14px; max-width: 1600px; margin: 0 auto; }
.k-print-title { display: none; }
.k-empty { padding: 30px; text-align: center; color: var(--muted); background: var(--card); border-radius: 14px; font-size: 1.1rem; }

/* today: numbers along the top */
.k-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.k-stat { background: var(--card); border-radius: 12px; padding: .6rem .9rem; box-shadow: var(--shadow); min-width: 7.5rem; }
.k-stat b { display: block; font-size: 2rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.k-stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.k-stat.main { background: var(--top); color: var(--top-ink); }
.k-stat.main span { color: #b9c2cf; }
.k-stat.ok b { color: var(--ok); }
.k-stat.bad b { color: var(--bad); }
.k-note { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; padding: .7rem .9rem; margin-bottom: 12px; font-size: 1.05rem; }
.k-closed { background: var(--soft-2); border-radius: 12px; padding: .7rem .9rem; margin-bottom: 12px; font-weight: 700; }

.k-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 1fr); gap: 14px; align-items: start; }
.k-side { display: grid; gap: 14px; }
.k-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: .8rem 1rem; }
.k-card h2, .k-arrivals > h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.k-card.bad { border: 2px solid var(--bad-line); }
.k-card.bad h2 { color: var(--bad); }

.k-offline { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; text-align: center; padding: .6rem 14px max(.6rem, env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,.15); }

/* arrivals in clock windows */
.k-arrivals { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: .8rem 1rem; }
.k-win { border-top: 1px solid var(--line); padding: .5rem 0 .4rem; scroll-margin-top: 140px; }
.k-win:first-of-type { border-top: 0; }
.k-gone > summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: .45rem 0; border-top: 1px solid var(--line); }
.k-gone[open] > summary { margin-bottom: .2rem; }
.k-win-head { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: .7rem; align-items: center; margin-bottom: .3rem; }
.k-win-head .t { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.k-win-head .n { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.k-win-head .n small { font-weight: 600; color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.k-bar { height: .7rem; background: var(--soft-2); border-radius: 99px; overflow: hidden; }
.k-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--accent) 70%, var(--card)); border-radius: 99px; }
.k-win.now { background: color-mix(in srgb, var(--accent) var(--tint), var(--card)); border-radius: 10px; padding-left: .5rem; padding-right: .5rem; margin: 0 -.5rem; border-top-color: transparent; }
.k-win.now .t::after { content: 'now'; display: block; width: max-content; font-size: .68rem; line-height: 1.4; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 7px; margin-top: 2px; }
.k-win.past .k-win-head { opacity: .5; }
.k-row { display: grid; grid-template-columns: 3.4rem 3.6rem 2.8rem minmax(0, 1fr) auto; gap: .6rem; align-items: start; padding: .45rem 0 .45rem .3rem; border-left: 4px solid transparent; }
.k-row + .k-row { border-top: 1px dashed var(--line-soft); }
.k-row.diet { border-left-color: var(--bad); }
.k-row.k-head { padding-top: 0; padding-bottom: .1rem; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.k-row.k-head .cv { font-size: inherit; justify-self: end; white-space: nowrap; }
.k-row.left { opacity: .45; }
.k-row .tm { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.k-row .tb { font-weight: 800; }
.k-row .cv { font-weight: 800; font-size: 1.15rem; text-align: right; font-variant-numeric: tabular-nums; }
.k-row .who b { font-size: 1.05rem; }
.k-row .who small { display: block; color: var(--muted); font-size: .85rem; }
.k-icons { margin-left: .3rem; letter-spacing: .1em; }
.k-dietline { color: var(--bad); font-weight: 700; margin-top: .15rem; }
.k-poline { color: var(--muted); font-size: .9rem; margin-top: .1rem; }
.k-poline.todo { color: var(--warn-ink); }
.k-poline.over { color: var(--bad); font-weight: 700; }
.k-row .who small.k-extra { color: var(--ink); }
.k-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.k-st { font-size: .85rem; font-weight: 800; border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; background: var(--soft-2); color: var(--muted); }
.k-st.seated { background: var(--ok-bg); color: var(--ok-ink); }
.k-st.arrived { background: var(--warn-bg); color: var(--warn-ink); }
.k-st.late { background: var(--warn-bg); color: var(--warn-ink); }
.k-st.coming { background: var(--ok-bg); color: var(--ok-ink); }
.k-st.req { background: var(--req-bg); color: var(--req-ink); }

/* lists in the side cards */
.k-list { display: grid; gap: .5rem; }
.k-li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: .5rem; }
.k-li .tm { font-weight: 800; font-variant-numeric: tabular-nums; }
.k-li small { color: var(--muted); }
.k-li.left { opacity: .45; }
.k-tot { width: 100%; border-collapse: collapse; font-size: 1rem; }
.k-tot td { padding: .3rem 0; border-bottom: 1px solid var(--line-soft); }
.k-tot td:last-child { text-align: right; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; width: 3rem; }
.k-tot tr.sec td { color: var(--muted); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .6rem; border-bottom: 0; }
details.k-more { margin-top: .3rem; }
details.k-more summary { cursor: pointer; color: var(--accent-fg); font-weight: 600; font-size: .9rem; }
.k-guests { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .4rem; }
.k-guests th { text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: .2rem .4rem .2rem 0; }
.k-guests td { padding: .25rem .4rem .25rem 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
.k-guests td.d { color: var(--bad); font-weight: 700; }

/* week */
.k-week { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (min-width: 1100px) { .k-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; } }
.k-day { position: relative; text-align: left; background: var(--card); border: 2px solid transparent; border-radius: 14px; box-shadow: var(--shadow); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .45rem; color: inherit; font: inherit; }
.k-day:hover { border-color: var(--line-strong); }
.k-day.today { border-color: var(--accent); }
.k-day.closed { opacity: .65; }
.k-day header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 6px; }
.k-day header b { font-size: 1.15rem; }
.k-day header .tag { position: absolute; top: -.65rem; right: .7rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 7px; }
.k-day .tot b { font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.k-day .tot span { color: var(--muted); font-weight: 600; margin-left: .3rem; }
.k-day .svcs { color: var(--muted); font-weight: 600; font-size: .9rem; }
.k-day .svcs b { color: var(--ink); }
.k-day ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .25rem; font-size: .9rem; }
.k-day li { border-left: 3px solid var(--accent); padding-left: .4rem; }
.k-day li.req { border-left-color: var(--req-ink); }
.k-flags { display: flex; flex-wrap: wrap; gap: .3rem; }
.k-flag { font-size: .8rem; font-weight: 800; border-radius: 99px; padding: .1rem .5rem; background: var(--soft-2); color: var(--muted); white-space: nowrap; }
.k-flag.bad { background: var(--bad-bg); color: var(--bad-ink); }
.k-flag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.k-flag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.k-day .note { font-size: .85rem; background: var(--note-bg); border-radius: 8px; padding: .3rem .5rem; }

/* events */
.k-evhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.k-evhead h2 { margin: 0; font-size: 1.2rem; }
.k-evhead select { width: auto; min-height: 36px; padding: 4px 10px; }
.k-evlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 0 14px; align-items: start; }
.k-evdate { margin: .6rem 0 .5rem; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.k-evs { display: grid; gap: 12px; }
.k-ev { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: .8rem 1rem; border-left: 5px solid var(--accent); display: grid; gap: .35rem; align-content: start; }
.k-ev.req { border-left-color: var(--req-ink); }
.k-ev.pay { border-left-color: var(--warn); }
.k-ev-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem; }
.k-ev-top .tm { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.k-ev-top .what { font-size: 1.1rem; font-weight: 800; }
.k-ev .meta { color: var(--muted); font-weight: 600; }
.k-ev .dishes { font-size: .95rem; }
.k-ev .dishes b { font-variant-numeric: tabular-nums; }

/* phones and narrow tablets */
@media (max-width: 900px) {
  .k-grid { display: flex; flex-direction: column; }
  .k-side { display: contents; }
  .k-diet-card { order: 1; }
  .k-arrivals { order: 2; }
  .k-side > .k-card:not(.k-diet-card) { order: 3; }
}
@media (max-width: 700px) {
  html { font-size: 15px; }
  .k-top { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .k-top .k-brand { display: none; }
  .k-top select { flex: 1; max-width: none; min-width: 0; }
  .k-actions { margin-left: 0; }
  .k-actions #smaller, .k-actions #bigger, .k-actions .k-print { display: none; }
  .k-tabs { order: 5; width: 100%; }
  .k-tabs button { flex: 1; padding: 7px 4px; }
  .k-datenav { order: 6; width: 100%; justify-content: space-between; }
  .k-datebtn { flex: 1; }
  .k-main { padding: 10px; }
  .k-stat { min-width: 0; flex: 1 1 6.5rem; }
  .k-stat b { font-size: 1.6rem; }
  .k-row { grid-template-columns: 3rem 3rem 2.4rem minmax(0, 1fr); }
  .k-row .st { grid-column: 4; justify-self: start; }
  .k-week { grid-template-columns: minmax(0, 1fr); }
}

/* paper copy for the kitchen wall */
@media print {
  :root { --bg: #fff; --card: #fff; --shadow: none; }
  body { background: #fff; }
  .k-top, .k-offline, details.k-more summary, .k-gone > summary { display: none !important; }
  details.k-more > * { display: block; }
  .k-main { padding: 0; max-width: none; }
  .k-print-title { display: block; font-size: 18px; margin: 0 0 10px; }
  .k-card, .k-arrivals, .k-day, .k-ev, .k-stat { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .k-win.past .k-win-head, .k-row.left, .k-li.left { opacity: 1; }
  .k-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .k-week { grid-template-columns: repeat(4, 1fr); }
  .k-evlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-scroll { overflow: visible; }
}
