/* Styles of the table-pattern modules (Karte, Reservierungen, Tische und Bereiche). Linked from index.html after
   app.css. Uses the variables of app.css. Every class starts with tbl- unless it extends a shared one. */

/* Groups with an action in the title row */
.tbl-group-head { padding-right: .35rem; }
.tbl-group-head .group-title { margin-left: .9rem; }
.tbl-summary { margin-top: -.6rem; margin-bottom: 1.1rem; }
.tbl-actions { margin: -.4rem 0 1.5rem; }
.tbl-order { display: inline-flex; gap: .1rem; }

/* Tags on rows */
.tbl-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.tbl-tags .tag { align-self: auto; }
.tag.tbl-out { background: #fbe4e1; color: #8c2219; }
.tag.tbl-star { display: inline-flex; align-items: center; gap: .2rem; background: #f6ecd6; color: #6b4a0b; }
.tag.tbl-star svg { width: .8rem; height: .8rem; }
.tag.tbl-missing { background: #fbf1df; color: #6b4a0b; }
.tag.tbl-wish { background: #e9efe4; color: #3e5a2a; }
.tag.tbl-anfrage { background: #fbf1df; color: #6b4a0b; }
.tag.tbl-geändert { background: #e6eef6; color: #2a5170; }
.tag.tbl-erschienen { background: var(--brand-soft); color: var(--brand); }
.tag.tbl-nicht_erschienen, .tag.tbl-abgesagt { background: #fbe4e1; color: #8c2219; }
.tag.tbl-area-open { background: var(--brand-soft); color: var(--brand); }
.tag.tbl-area-closed { background: var(--fill); color: var(--ink-2); }
.tbl-item.is-out .row-title { color: var(--ink-2); }

/* Reservation rows */
.tbl-res { align-items: flex-start; padding-top: .75rem; padding-bottom: .8rem; }
.tbl-res .chevron { align-self: center; }
.tbl-time { display: grid; flex: none; width: 3.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tbl-time b { font-size: 1.08rem; color: var(--brand); }
.tbl-time small { color: var(--ink-2); font-size: .76rem; }
.tbl-note { font-style: italic; }
.tbl-res.is-cancelled .row-title { text-decoration: line-through; color: var(--ink-2); }
.tbl-res.is-cancelled .tbl-time b, .tbl-res.is-past .tbl-time b { color: var(--ink-2); }

/* Reservierungen screen */
.tbl-entry-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; margin: 0 0 1.5rem; }
.tbl-daynav { padding: .5rem .6rem .75rem; margin-bottom: 1rem; display: grid; gap: .5rem; scroll-margin-top: 5.5rem; }
.tbl-daynav-row { display: flex; align-items: center; gap: .4rem; }
.tbl-daynav-row .segmented { flex: 1; }
.tbl-day { flex: 1; margin: 0; text-align: center; font-size: 1.05rem; font-weight: 650; }
.tbl-next svg { width: .7rem; height: 1.1rem; }
.tbl-stats { margin-bottom: .6rem; }
.tbl-stats b { white-space: normal; overflow-wrap: anywhere; }
.tbl-hours { margin: 0 .25rem .9rem; }
.tbl-list { margin-bottom: 1.5rem; }
.tbl-request .request-wish { color: var(--ink-2); }
.tbl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; padding: .9rem 1rem .5rem; }
.tbl-tile { display: grid; gap: .15rem; align-content: start; min-height: 4.2rem; padding: .7rem .8rem; border: 0; border-radius: 12px; background: var(--fill);
  color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.tbl-tile:active { background: #e8e6e0; }
.tbl-tile-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.tbl-tile b { font-size: 1rem; font-weight: 650; color: var(--brand); line-height: 1.3; white-space: nowrap; }
.tbl-tile b + b { font-size: .95rem; font-weight: 600; color: var(--ink); }
.tag.tbl-answered { background: #e6eef6; color: #2a5170; }
.tbl-group-row .tbl-tags .tag { white-space: normal; }
.tbl-filter { margin: 0 0 .6rem; }
.tbl-answer { display: block; margin-top: .25rem; font-weight: 400; font-style: italic; }
.tbl-week .row[aria-current="date"] { background: var(--brand-soft); }
.tbl-week .row.is-past .row-title { color: var(--ink-2); }

/* Tische view */
.tbl-table-row { align-items: flex-start; gap: .7rem; }
.tbl-table-name { display: grid; flex: none; width: 6.2rem; line-height: 1.25; }
.tbl-table-name small { color: var(--ink-2); font-size: .78rem; }
.tbl-bars { flex: 1; min-width: 0; }
.tbl-bar { min-height: 2.75rem; font-variant-numeric: tabular-nums; }
.tbl-bar.tbl-erschienen { background: var(--brand-soft); border-color: transparent; }
.tbl-bar.tbl-anfrage { border-style: dashed; }
.tbl-free { color: var(--ink-3); font-size: .9rem; align-self: center; min-height: 2.75rem; display: inline-flex; align-items: center; }
.tbl-free:empty { display: none; }
/* A guest who did not come: struck through, the table counts as free. */
.tbl-bar.tbl-nicht_erschienen { background: transparent; border-style: dashed; color: var(--ink-2); text-decoration: line-through; }
.tbl-area-head { gap: .6rem; }
.tbl-area-head .row-title { font-weight: 650; }
.tbl-area-action { flex: none; color: var(--brand); font-weight: 600; font-size: .92rem; }
.tbl-area-status { gap: .6rem; flex-wrap: wrap; }
.tbl-area-status .button { flex: none; }
.tbl-area-closed { margin-top: -.5rem; }

/* Sheets (the shell's sheet body keeps every row at its content height). */
.tbl-status { margin: 0; padding: .65rem .8rem; border-radius: 11px; font-size: .95rem; font-weight: 500; background: var(--fill); }
.tbl-status.ok { background: var(--brand-soft); color: var(--brand); }
.tbl-status.warn { background: #fbf1df; color: #4d3608; }
.tbl-detail { margin-bottom: .2rem; }
.tbl-contact { margin-top: .4rem; }
.tbl-contact .button { font-weight: 600; overflow-wrap: anywhere; }
.tbl-more { margin-top: .2rem; }
.button.tbl-quiet { background: var(--fill); color: var(--ink); }
.tbl-history summary { min-height: 2.75rem; display: flex; align-items: center; color: var(--brand); font-weight: 600; cursor: pointer; }
.tbl-party { gap: .4rem; }
.tbl-party-input { max-width: 8rem; }
/* Time chips keep their size when chosen: the check mark sits in the corner, so no chip moves under the finger. */
.tbl-times .chip { position: relative; font-variant-numeric: tabular-nums; min-width: 4.4rem; justify-content: center; }
.tbl-times .tbl-check:empty { display: none; }
.tbl-times .tbl-check { position: absolute; top: -.35rem; right: -.35rem; display: grid; place-items: center; width: 1.15rem; height: 1.15rem;
  border-radius: 50%; background: var(--brand); color: var(--cream); box-shadow: 0 0 0 2px var(--cream); }
.tbl-times .tbl-check svg { width: .7rem; height: .7rem; }
.tbl-times .chip.is-taken { color: var(--ink-3); text-decoration: line-through; }
.sheet-body .chip.on svg { color: currentColor; }
.tbl-live-error:empty { display: none; }
.tbl-impact-intro { margin: 0; font-size: .9rem; color: #4d3608; }
.tbl-inline-actions { display: flex; flex-wrap: wrap; gap: .25rem; margin-left: -.6rem; }
.tbl-inline-switch { display: inline-flex; align-items: center; gap: .5rem; position: relative; color: var(--ink-2); font-size: .9rem; }

/* Allergens: a letter and its name on each chip */
.tbl-letters .chip { gap: .45rem; }
.tbl-letters .chip b { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 6px; background: var(--fill); font-size: .82rem; }
.tbl-letters .chip.on b { background: rgba(255, 255, 255, .2); }

/* Sizes and prices */
.tbl-variant { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, 8.5rem) auto; gap: .5rem; align-items: center; }
.tbl-variant .amount { max-width: none; min-width: 0; }
.tbl-variant .field-error { grid-column: 1 / -1; margin: 0; }

/* Mittagsmenü */
.tbl-lunch-actions { margin: 0 0 1rem; justify-items: stretch; }
.tbl-lunch-day { display: grid; gap: .75rem; padding-bottom: 1rem; }
.tbl-lunch-day .day-head .tag { align-self: center; }
.tbl-lunch-past { display: grid; gap: .15rem; padding: .7rem 1rem; margin-bottom: .5rem; background: var(--cream); box-shadow: none; border: 1px solid var(--line); }
.tbl-past-day { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.tbl-past-dishes { font-size: .93rem; color: var(--ink-2); overflow-wrap: anywhere; }
.tag.tbl-today { background: var(--brand); color: var(--cream); }
.tbl-dish { display: grid; gap: .35rem; }
.tbl-dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin: -.1rem 0 0 -.6rem; }
.tbl-dish-meta:empty { display: none; }
.tbl-dish-meta .tag { align-self: center; }
.tbl-dish-allergens { font-size: .9rem; min-height: 2.75rem; }
.tbl-dish-allergens.missing { color: #8a5a00; }
.tbl-suggest:empty { display: none; }
/* Suggestions scrolled into view stay above the floating save bar. */
.tbl-suggest { scroll-margin-bottom: 11rem; }
.preview.tbl-complete .preview-title { color: var(--brand); }
.tbl-lunch-row .row-value { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* Legend */
.tbl-legend { margin-bottom: 1.5rem; }
.tbl-legend summary { cursor: pointer; list-style: none; }
.tbl-legend summary::-webkit-details-marker { display: none; }
.tbl-legend summary .row-title { color: var(--brand); font-weight: 600; }
.tbl-legend-list { margin: 0; padding: .2rem 1rem 1rem; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .35rem .9rem; font-size: .93rem; }
.tbl-legend-list b { display: inline-block; min-width: 1.3rem; color: var(--brand); }

/* K13: online pause, passed requests, week numbers */
.tbl-pause-row { margin: -.9rem 0 1.4rem; }
.tbl-pause-button { display: inline-flex; align-items: center; gap: .45rem; margin-left: -.6rem; }
.tbl-pause-button svg { width: 1.05rem; height: 1.05rem; }
.tbl-pause { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .8rem; padding: .55rem .9rem; border-radius: 12px; background: #fbf1df; color: #4d3608; }
.tbl-pause-text { font-weight: 550; }
.tbl-pause .text-button { margin-left: -.6rem; }
.request-what .tag.tbl-today { margin-right: .45rem; vertical-align: .08rem; }
.tbl-passed .row-value { color: var(--ink-2); }
.tbl-week-numbers { display: grid; gap: .2rem; margin: 0 .25rem .75rem; }
.tbl-week-line { margin: 0; font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.tbl-week-line.muted { color: var(--ink-2); font-size: .88rem; }

/* Entry: source chips, wishes, the Stammgast suggestion, „Mehr“ */
.tbl-source { gap: .4rem; }
.tbl-source .chip { gap: .3rem; }
.tbl-source .chip svg { width: .85rem; height: .85rem; }
.tbl-guest-suggest { display: grid; gap: .35rem; margin-top: -.35rem; }
.tbl-guest-suggest .field-hint { margin: 0; }
.tbl-guest-suggest .tbl-guest-row { border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }
.tbl-guest-row .row-title { overflow-wrap: anywhere; }
.tbl-guest-take { flex: none; color: var(--brand); font-weight: 600; font-size: .92rem; }
/* The whole line of a regular stays readable: visits, last visit and no-shows are why the owner picks her. */
.tbl-guest-row .row-value, .tbl-guest-link .row-value { display: block; -webkit-line-clamp: none; overflow: visible; }
.tbl-phone { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl-guest-picked { display: flex; align-items: flex-start; gap: .7rem; margin-top: -.35rem; padding: .7rem .8rem; border-radius: 12px; background: var(--brand-soft); color: var(--ink); }
.tbl-guest-picked .row-icon { color: var(--brand); flex: none; }
.tbl-guest-picked .row-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.tbl-guest-picked .row-title { font-weight: 650; color: var(--brand); }
.tbl-guest-picked .text-button { flex: none; margin: -.35rem -.4rem 0 0; }
.tbl-guest-link { margin: .35rem 0 0; padding-left: 0; padding-right: 0; border-top: 1px solid var(--line); }
.tbl-more-block > .text-button { display: inline-flex; align-items: center; gap: .4rem; margin-left: -.6rem; }
.tbl-more-block .card { display: grid; }
.tbl-more-block .card > .field, .tbl-more-block .card > .tbl-status, .tbl-more-block .card > .impact { margin: .2rem 1rem .8rem; }
.tbl-wa-hint { margin: 0; }
.tbl-next { background: var(--brand-soft); color: var(--brand); }
.tbl-visit .row-value { color: var(--ink-2); }
.tbl-guest-note { margin: .4rem 0 .2rem; justify-items: start; }
.tbl-guest-note .field { width: 100%; }

/* Print and share: the paper scales with its frame (container units), the same node prints at full size. */
.tbl-paper-frame { margin: 0 0 1.2rem; padding: clamp(.6rem, 3vw, 1.4rem); border-radius: 16px; background: var(--fill); }
.tbl-paper-frame.is-card { display: grid; place-items: center; }
.tbl-paper { container-type: inline-size; box-sizing: border-box; width: 100%; margin: 0 auto; padding: 7cqw 8cqw; border-radius: 4px;
  background: var(--paper-surface, #fff); color: var(--paper-text, #1f1f1f); font-family: var(--paper-body, sans-serif);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08); }
.tbl-paper-lunch { aspect-ratio: 210 / 297; display: flex; flex-direction: column; }
.tbl-paper-card { max-width: 22rem; aspect-ratio: 105 / 148; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3cqw; }
.tbl-paper .paper-head { margin-bottom: 4cqw; border-bottom: .5cqw solid var(--paper-accent, #2f4937); padding-bottom: 2.5cqw; }
.tbl-paper .paper-name { margin: 0; color: var(--paper-accent, #2f4937); font-size: 2.6cqw; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.tbl-paper .paper-title { margin: .6cqw 0 0; font-family: var(--paper-display, serif); font-size: 7.4cqw; line-height: 1.1; font-weight: 700; }
.tbl-paper .paper-range { margin: 1cqw 0 0; font-size: 3cqw; opacity: .85; }
.tbl-paper .paper-group { margin: 0 0 3.4cqw; break-inside: avoid; }
.tbl-paper .paper-group-title { margin: 0 0 1.2cqw; font-family: var(--paper-display, serif); font-size: 3.9cqw; color: var(--paper-accent, #2f4937); }
.tbl-paper .paper-group-title small { font-family: var(--paper-body, sans-serif); font-size: 2.4cqw; font-weight: 500; color: var(--paper-text, #1f1f1f); opacity: .85; }
.tbl-paper .paper-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 3cqw; padding: .8cqw 0; break-inside: avoid; }
.tbl-paper .paper-item-name { margin: 0; font-size: 2.9cqw; font-weight: 600; }
.tbl-paper .paper-price { margin: 0; font-size: 2.8cqw; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-paper .paper-desc { grid-column: 1 / -1; margin: 0; font-size: 2.4cqw; opacity: .85; }
.tbl-paper .paper-letters { font-size: 2cqw; font-weight: 500; opacity: .85; letter-spacing: .06em; }
.tbl-paper .paper-legend { margin-top: 3cqw; font-size: 2cqw; line-height: 1.5; opacity: .85; }
.tbl-paper .paper-legend p { margin: 0; }
.tbl-paper .paper-foot { margin-top: 3cqw; padding-top: 1.6cqw; border-top: .25cqw solid currentColor; font-size: 2.2cqw; opacity: .85; }
.tbl-paper-lunch .paper-day { display: grid; grid-template-columns: 22cqw minmax(0, 1fr); gap: 2cqw; padding: 2.2cqw 0; border-bottom: .2cqw solid rgba(0, 0, 0, .1); }
.tbl-paper-lunch .paper-day-name { margin: 0; font-size: 3cqw; color: var(--paper-accent, #2f4937); }
.tbl-paper-lunch .paper-dishes { display: grid; gap: .8cqw; }
.tbl-paper-lunch .paper-dish { margin: 0; font-size: 3cqw; line-height: 1.3; }
.tbl-paper-lunch .paper-dish.muted { opacity: .8; }
.tbl-paper-lunch .paper-course { display: block; font-size: 1.9cqw; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tbl-paper-lunch .paper-veg { font-size: 2.1cqw; color: var(--paper-accent, #2f4937); }
.tbl-paper-lunch .paper-prices { margin-top: auto; padding-top: 3cqw; font-size: 3cqw; font-weight: 600; }
.tbl-paper-lunch .paper-prices p { margin: 0 0 .8cqw; }
.tbl-paper-card .paper-name { font-size: 4.4cqw; }
.tbl-paper-card .paper-title { font-size: 11cqw; }
.tbl-paper-card .paper-qr { width: 52cqw; aspect-ratio: 1; }
.tbl-paper-card .paper-qr svg { display: block; width: 100%; height: 100%; }
.tbl-paper-card .paper-desc { font-size: 4.2cqw; opacity: .85; grid-column: auto; }
.tbl-paper-card .paper-url { margin: 0; font-size: 3.8cqw; font-weight: 600; overflow-wrap: anywhere; }
.tbl-print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  html.tbl-print-on body > *:not(#tbl-print-root) { display: none !important; }
  html.tbl-print-on body { background: #fff !important; }
  html.tbl-print-on .tbl-print-root { display: block; }
  .tbl-print-root .tbl-paper { box-shadow: none; border-radius: 0; padding: 0; max-width: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .tbl-print-root .tbl-paper-lunch { aspect-ratio: auto; min-height: 270mm; }
  .tbl-print-cards { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0; }
  .tbl-print-cards .tbl-paper-card { aspect-ratio: auto; height: 135mm; padding: 8mm; border: .2mm dashed #bbb; }
}

@media (max-width: 360px) {
  .tbl-time { width: 3.2rem; }
  .tbl-table-name { width: 5rem; }
}
