/* Bell drawer (NotificationCenter.tsx). #drawer supplies the sheet, its material and the
   centered frame; this file owns rows and the number column. */

.nc-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.nc-headline { flex: 1; min-width: 0; }
.nc-head h2 { margin: 0; color: var(--ink); font-size: calc(18px + var(--text-size-step)); font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.nc-summary { margin: 2px 0 0; color: var(--muted); font-size: var(--ui-fs-ui); line-height: 1.4; font-variant-numeric: tabular-nums; }
.nc-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 16px; }
.nc-foot { margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: var(--ui-fs-meta); line-height: 1.4; }
.nc-health, .nc-notice, .nc-recovery { margin: 12px 0 0; }
.nc-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nc-done { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--st-ok-deep); font-size: var(--ui-fs-ui); font-weight: 600; line-height: 1.4; }
.nc-done svg { width: 16px; height: 16px; flex: none; }
.nc-loading { margin: 16px 0; color: var(--muted); font-size: var(--ui-fs-ui); }
.nc-body > .empty { margin-top: 24px; }

/* Group headers (R6): uppercase meta + count, more space above than below. */
.nc-section-title, .nc-history > summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--ui-fs-meta); font-weight: 600; letter-spacing: .04em; line-height: 1.4; text-transform: uppercase; }
.nc-section-title { margin: 20px 0 4px; }
.nc-count { color: var(--faint); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.nc-list { margin: 0 -18px; padding: 0; list-style: none; }
.nc-row {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-areas: "glyph main figure" ". acts acts"; gap: 8px 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); transition: background-color .15s ease-out;
}
.nc-list > .nc-row:first-child { border-top-color: transparent; }
.nc-row:hover { background: var(--material-hover, var(--paper-2)); }

/* Status = glyph tint + word + figure ink; money stays neutral, the amount carries it. */
.nc-glyph { grid-area: glyph; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--paper-2); color: var(--ink); }
.nc-glyph svg { width: 18px; height: 18px; }
.nc-row[data-tone="warning"] .nc-glyph { background: var(--st-attn-soft); color: var(--st-attn-deep); }
.nc-row[data-tone="urgent"] .nc-glyph { background: var(--st-alert-soft); color: var(--st-alert-deep); }
.nc-row[data-tone="ahead"] .nc-glyph { background: var(--st-info-soft); color: var(--st-info-deep); }
.nc-row[data-tone="quiet"] .nc-glyph { color: var(--muted); }

.nc-main { grid-area: main; min-width: 0; }
.nc-title { margin: 0; color: var(--ink); font-size: var(--ui-fs-body); font-weight: 600; line-height: 1.4; }
.nc-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
/* The whole row opens the record; the action buttons sit above this layer. */
.nc-open::after { content: ""; position: absolute; inset: 0; }
.nc-open:focus-visible { outline: none; }
.nc-open:focus-visible::after { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: var(--soft-r-ctl, 12px); }
.nc-code { color: var(--muted); font-family: var(--mono); font-size: var(--ui-fs-meta); font-weight: 500; }
.nc-detail { margin: 2px 0 0; color: var(--ink); font-size: var(--ui-fs-ui); line-height: 1.45; overflow-wrap: anywhere; }
.nc-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0 0; color: var(--muted); font-size: var(--ui-fs-meta); line-height: 1.4; font-variant-numeric: tabular-nums; }
.nc-state, .nc-owner { display: inline-flex; align-items: center; gap: 4px; }
.nc-state svg, .nc-owner svg { width: 14px; height: 14px; }
.nc-state.is-urgent { color: var(--st-alert-deep); font-weight: 600; }
.nc-owner { color: var(--ink); }
.nc-main > .error { margin: 6px 0 0; }

/* The number column: how late, or how much. */
.nc-figure { grid-area: figure; display: flex; flex-direction: column; align-items: flex-end; margin: 0; text-align: right; white-space: nowrap; }
.nc-verb { color: var(--muted); font-size: var(--ui-fs-meta); font-weight: 600; line-height: 1.4; }
.nc-figure b { color: var(--ink); font-size: calc(17px + var(--text-size-step)); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.nc-row[data-tone="warning"] .nc-figure :is(b, .nc-verb) { color: var(--st-attn-deep); }
.nc-row[data-tone="urgent"] .nc-figure :is(b, .nc-verb) { color: var(--st-alert-deep); }
.nc-row[data-tone="quiet"] .nc-figure b { color: var(--muted); font-weight: 500; }

/* Row actions: quiet until the row is hovered or focused (D10: one filled button at a time). */
.nc-actions { grid-area: acts; position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nc-actions-label { margin-right: 2px; color: var(--muted); font-size: var(--ui-fs-meta); }
.nc-row:is(:hover, :focus-within) .btn.nc-primary:not(:disabled) { background: var(--material-primary); color: var(--material-primary-ink); border-color: var(--material-primary-edge, transparent); }

.nc-history { margin-top: 20px; border-top: 1px solid var(--line); }
.nc-history > summary { min-height: 44px; cursor: pointer; list-style: none; }
.nc-history > summary::-webkit-details-marker { display: none; }
.nc-history > summary svg { width: 14px; height: 14px; transition: transform .15s ease-out; }
.nc-history[open] > summary svg { transform: rotate(90deg); }
.nc-history > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--soft-r-ctl, 12px); }
.nc-history .nc-row:first-child { border-top-color: var(--line); }

@media (max-width: 699px) {
  .nc-head { padding-top: 10px; }
  .nc-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px 10px; }
  .nc-glyph { width: 28px; height: 28px; border-radius: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .nc-row, .nc-history > summary svg { transition: none; }
  .nc-upcoming[data-fresh], .nc-upcoming[data-fresh] .nc-glyph, #bellBtn .bdg { animation: none; }
}
@media (forced-colors: active) {
  .nc-open:focus-visible::after { outline-color: Highlight; }
  .nc-glyph { border: 1px solid CanvasText; }
}

/* Sắp đến: bookings made here, waiting for check-in. A row that just folded in from the booking toast
   slides in beside the bell and keeps a green wash for a moment; the badge settles calmly whenever its count changes. */
.nc-upcoming[data-tone="ahead"] .nc-glyph { background: var(--st-ok-soft); color: var(--st-ok-deep); }
.nc-upcoming[data-fresh] { animation: nc-land 520ms cubic-bezier(.16, 1, .3, 1) both, nc-wash 2.4s ease-out 300ms both; }
.nc-upcoming[data-fresh] .nc-glyph { animation: nc-glyph-pop 320ms cubic-bezier(.16, 1, .3, 1) 140ms both; }
#bellBtn .bdg { animation: nc-bdg-pop 280ms cubic-bezier(.16, 1, .3, 1); }
@keyframes nc-land { from { opacity: 0; transform: translateX(24px); } }
@keyframes nc-wash { from { background-color: color-mix(in srgb, var(--st-ok-soft) 90%, transparent); } }
@keyframes nc-glyph-pop { from { opacity: 0; transform: scale(.86); } }
@keyframes nc-bdg-pop { 0% { opacity: .6; transform: scale(.88); } 100% { opacity: 1; transform: scale(1); } }
/* Approval record dialog (bell › chi tiết bản ghi). The bell popover list belongs to the shell. */
.modal-approval .stategrid { margin: 8px 0 12px; }
.modal-approval .notice { margin-bottom: 12px; }
.modal-approval .modal-footer { flex-wrap: wrap; }
.modal-approval .tag { font-size: var(--ui-fs-meta); line-height: 1.4; }
.approval-content { margin: 6px 0 12px; font-size: var(--ui-fs-body); line-height: 1.6; }
.approval-trail { margin: 6px 0 12px; }
.approval-trail .ln > span:last-child { max-width: 60%; text-align: right; font-size: var(--ui-fs-meta); overflow-wrap: anywhere; }
.approval-trail time { color: var(--faint); font-family: var(--mono); font-size: var(--ui-fs-meta); }
.approval-trail small { display: block; margin-top: 4px; }
.approval-note { margin-bottom: 12px; font-size: var(--ui-fs-meta); }
/* Itemized folio evidence: checkout, refund approval and receipts. Amounts are right-aligned tabular figures. */
.local-folio-breakdown, .local-refund-breakdown { display: grid; gap: 18px; min-width: 0; color: var(--ink); font-size: var(--ui-fs-ui); line-height: 1.45; }
.local-folio-group, .local-refund-reconciliation { min-width: 0; }
.local-folio-group + .local-folio-group, .local-refund-reconciliation { padding-top: 16px; border-top: 1px solid var(--line); }
.local-folio-group h3, .local-refund-reconciliation h3 { margin: 0 0 8px; color: inherit; font-family: var(--sans); font-size: var(--ui-fs-body); font-weight: 650; line-height: 1.4; }
.local-refund-reconciliation h4 { margin: 16px 0 6px; font-size: var(--ui-fs-ui); font-weight: 650; line-height: 1.4; }
.local-folio-items, .local-folio-subtotals, .local-refund-facts { min-width: 0; margin: 0; padding: 0; }
.local-folio-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; min-width: 0; padding: 5px 0; }
.local-folio-row dt { flex: 1 1 12ch; min-width: 0; overflow-wrap: anywhere; }
.local-folio-row dd { flex: 0 1 auto; max-width: 100%; margin: 0 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.local-folio-basis { display: block; margin-top: 4px; color: var(--muted); font-size: var(--ui-fs-meta); font-weight: 400; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.local-folio-items > .local-folio-row + .local-folio-row { border-top: 1px solid var(--line); }
.local-folio-subtotals { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--ui-fs-meta); }
.local-folio-net { color: var(--ink); font-size: var(--ui-fs-ui); font-weight: 650; }
.local-folio-note { margin: 0; color: var(--muted); font-size: var(--ui-fs-ui); line-height: 1.5; overflow-wrap: anywhere; }
.local-refund-total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line-strong); font-size: var(--ui-fs-body); font-weight: 650; }

/* Grouped view (checkout review, refund approval): original charges and discount bases stay
   visible; only rule IDs, approval history and allocation evidence disclose. */
.local-folio-grouped { gap: 28px; font-size: max(1rem, var(--ui-fs-ui)); line-height: 1.5; }
.local-folio-grouped .local-folio-group + .local-folio-group { padding-top: 0; border: 0; }
.local-folio-grouped .local-folio-group h3 { margin-bottom: 12px; font-size: max(1.125rem, var(--ui-fs-body)); }
.local-folio-grouped .local-folio-items > .local-folio-row + .local-folio-row { border: 0; }
.local-folio-grouped .local-folio-discount-heading { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--st-ok-deep); font-size: max(.875rem, var(--ui-fs-meta)); }
.local-folio-discount-heading strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.local-folio-grouped .local-folio-basis { margin-top: 4px; font-size: max(.875rem, var(--ui-fs-meta)); }
.local-folio-grouped .local-folio-subtotals { margin-top: 10px; padding-top: 10px; }
.local-folio-grouped .local-folio-net { font-size: inherit; }
.local-folio-discount-detail { min-width: 0; padding: 4px 0; }
.local-folio-discount-detail + .local-folio-discount-detail { border-top: 1px solid var(--line); }
.local-folio-discount-detail > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 0; list-style: none; cursor: pointer; }
.local-folio-discount-detail > summary::-webkit-details-marker { display: none; }
.local-folio-discount-detail > summary:hover .local-folio-discount-copy > strong { text-decoration: underline; text-underline-offset: 3px; }
.local-folio-discount-detail > summary:focus-visible { outline: 2px solid var(--focus-ring, var(--ink)); outline-offset: 3px; border-radius: 4px; }
.local-folio-discount-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.local-folio-discount-copy > strong { font-weight: 650; }
.local-folio-discount-amount { flex-shrink: 0; align-self: flex-start; color: var(--st-ok-deep); font-weight: 650; font-variant-numeric: tabular-nums; }
.local-folio-chev { display: grid; flex: none; place-items: center; width: 16px; height: 16px; color: var(--muted); }
.local-folio-chev svg { width: 14px; height: 14px; }
.local-folio-discount-detail[open] > summary > .local-folio-chev { transform: rotate(90deg); }
.local-folio-discount-evidence { padding: 4px 12px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: max(.875rem, var(--ui-fs-meta)); line-height: 1.5; overflow-wrap: anywhere; }
.local-folio-discount-evidence p { margin: 0; }
.local-folio-discount-evidence p + p { margin-top: 8px; }

@media (max-width: 600px) { .local-folio-row { column-gap: 12px; } }
@media (max-width: 380px) {
  .local-folio-discount-detail > summary { flex-wrap: wrap; column-gap: 8px; }
  .local-folio-discount-copy { flex-basis: 55%; }
  .local-folio-chev { margin-left: auto; }
}
@media (prefers-contrast: more) { .local-folio-grouped { --muted: var(--ink); --line: var(--ink); } }
@media (prefers-reduced-motion: no-preference) { .local-folio-chev { transition: transform .15s; } }
/* Keyboard shortcuts: on-screen guide/editor and sequence indicator.
   Reuses the shared material tokens; no new palette. */

.kbd-combo { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.kbd-stroke { display:inline-flex; align-items:center; gap:3px; }
.kbd-then { color:var(--faint); font-size:calc(12px + var(--text-size-step)); }
.kbd-combo kbd, .kbd-note kbd {
  display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px; box-sizing:border-box;
  border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; background:var(--paper); color:var(--ink);
  font:600 calc(12px + var(--text-size-step))/1.3 var(--mono, ui-monospace, monospace);
}
.kbd-combo.reserved kbd { border-color:var(--st-attn); color:var(--st-attn-deep); background:var(--st-attn-soft); }

.kbd-settings { max-width:880px; }
.kbd-settings .kbd-body { overflow:visible; padding:0; }
.kbd-scopes { gap:4px 8px; }
.kbd-body { flex:1; overflow-y:auto; padding:4px 12px 12px; }
.kbd-grouphead { display:flex; align-items:center; gap:12px; margin:20px 4px 4px; }
.kbd-settings .kbd-grouphead { margin-inline:0; }
.kbd-grouphead h3 { margin:0; color:var(--ink); font-size:calc(12px + var(--text-size-step)); font-weight:650; letter-spacing:.04em; line-height:1.4; text-transform:uppercase; }
.kbd-count { margin-left:auto; color:var(--muted); font-size:calc(12px + var(--text-size-step)); font-variant-numeric:tabular-nums; }
.kbd-body ul { margin:0; padding:0; list-style:none; }
.kbd-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:8px 12px; min-height:44px; padding:8px 4px; border-bottom:1px solid var(--line); }
.kbd-row:last-child { border-bottom:0; }
.kbd-settings .kbd-row { padding-inline:0; }
.kbd-settings .kbd-note { margin-inline:0; }
.kbd-settings .kbd-foot { justify-content:flex-start; padding-inline:0; }
.kbd-label { display:flex; align-items:center; gap:8px; min-width:0; font-size:calc(.84rem + var(--text-size-step)); }
.kbd-label svg { width:16px; height:16px; flex:none; color:var(--muted); }
.kbd-bindings { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.kbd-chip { display:inline-flex; align-items:center; gap:8px; min-height:32px; padding:3px 4px 3px 8px; border:1px solid var(--line); border-radius:var(--soft-r-pill); background:var(--paper); }
.kbd-remove, .kbd-add { position:relative; display:inline-grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:var(--soft-r-ctl); background:none; color:var(--muted); cursor:pointer; }
.kbd-remove::before, .kbd-add::before { content:""; position:absolute; inset:-8px; }
.kbd-remove:hover, .kbd-add:hover { background:var(--material-hover); color:var(--ink); }
.kbd-remove svg, .kbd-add svg { width:16px; height:16px; }
.kbd-add { border:1px dashed var(--ui-field-edge); }
.kbd-reset { min-height:28px; padding:2px 6px; border:0; border-radius:var(--soft-r-ctl); background:none; color:var(--muted); font:inherit; font-size:calc(12px + var(--text-size-step)); text-decoration:underline; cursor:pointer; }
.kbd-recorder { display:inline-flex; align-items:center; gap:4px; min-height:32px; padding:0 8px; border:1px solid var(--ui-field-edge); border-radius:var(--soft-r-ctl); background:var(--paper); color:var(--ink); font:inherit; font-size:calc(12px + var(--text-size-step)); }
.kbd-remove:focus-visible, .kbd-add:focus-visible, .kbd-reset:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.kbd-recorder:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.kbd-none { color:var(--faint); font-size:calc(13px + var(--text-size-step)); }
.kbd-msg { grid-column:1 / -1; display:flex; gap:6px; margin:0; font-size:calc(12px + var(--text-size-step)); line-height:1.4; }
.kbd-msg svg { width:14px; height:14px; flex:none; margin-top:1px; }
.kbd-msg.warn { color:var(--st-attn-deep); }
.kbd-msg.err { color:var(--st-alert-deep); }
.kbd-note { margin:16px 4px 0; color:var(--muted); font-size:calc(12px + var(--text-size-step)); line-height:1.5; }
.kbd-foot { display:flex; justify-content:flex-end; gap:8px; padding:10px 12px; border-top:1px solid var(--line); }
.kbd-foot .btn { display:inline-flex; align-items:center; gap:6px; }
.kbd-foot .btn svg { width:16px; height:16px; }
@media (max-width: 560px) {
  .kbd-row { grid-template-columns:minmax(0,1fr); }
  .kbd-bindings { justify-content:flex-start; }
}
@media (max-width: 767px), (pointer: coarse) {
  .kbd-remove, .kbd-add { width:44px; height:44px; }
  .kbd-reset, .kbd-recorder, .kbd-foot .btn { min-height:44px; }
}

/* On-screen hints switch at the top of Hệ thống › Phím tắt. */
.kbd-hints { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 16px; padding:12px 16px; border:1px solid var(--line); border-radius:var(--soft-r-shell); background:var(--paper); }
.kbd-hints h3 { margin:0; font-size:calc(14px + var(--text-size-step)); font-weight:700; }
.kbd-hints p { margin:2px 0 0; color:var(--muted); font-size:calc(13px + var(--text-size-step)); line-height:1.45; max-width:60ch; }
@media (max-width: 560px) { .kbd-hints { flex-direction:column; align-items:flex-start; } }

@media (forced-colors: active) {
  .kbd-combo kbd { border-color:CanvasText; }
}
/* Search-bar assistant prototype. Self-contained so the shell and v9 sheets stay untouched. */

.topsearch.has-agent input { padding-right: 92px }
.topsearch.has-agent .khint { right: 50px }
.topsearch .va-search-mic {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px
}
.topsearch .va-search-mic::before {
  content: "";
  position: absolute;
  inset: -4px
}
.topsearch .va-search-mic svg { width: 18px; height: 18px }

:root dialog#modal.react-operational-modal > .mcard.modal-ledger.voice-agent {
  width: min(640px, 100%);
  height: min(640px, calc(100dvh - 2 * var(--overlay-gap)))
}
.va-body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto auto; gap: 12px; flex: 1 }
.va-log {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto
}
.va-hint { margin: 0; color: var(--muted) }
.va-turn {
  margin: 0;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--r);
  line-height: 1.45
}
.va-user { justify-self: end; background: var(--ops-soft); color: var(--ink) }
.va-assistant { justify-self: start; background: var(--paper-2); color: var(--ink) }
.va-wait { color: var(--muted) }
.va-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--paper)
}
.va-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 }
.va-card dt { color: var(--muted) }
.va-card dd { margin: 0 }
.va-actions { display: flex; justify-content: flex-end; gap: 8px }
.va-input { display: flex; gap: 8px; align-items: center }
.va-input input {
  flex: 1;
  min-width: 0;
  min-height: var(--ui-hit, 44px);
  padding: 0 12px;
  border: 1px solid var(--ui-field-edge);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink)
}
.va-mic.on { color: var(--st-alert); border-color: var(--st-alert) }
.va-msg { display: grid; gap: 4px }
.va-msg-user { justify-items: end }
.va-msg-assistant { justify-items: start }
.va-stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--ui-fs-meta);
  font-variant-numeric: tabular-nums
}
.va-stats-line span + span::before { content: '·'; margin-right: 8px }
.va-model { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; color: var(--muted) }
.va-model select {
  min-width: 0;
  max-width: 100%;
  min-height: var(--ui-hit, 44px);
  padding: 0 10px;
  border: 1px solid var(--ui-field-edge);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink)
}
.va-price { font-size: var(--ui-fs-meta); font-variant-numeric: tabular-nums }
.va-totals { color: var(--ink) }
.va-totals > summary { cursor: pointer; color: var(--muted); font-variant-numeric: tabular-nums }
.va-totals > :not(summary) { margin-top: 8px }
.va-table { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r) }
.va-table table { width: 100%; border-collapse: collapse; font-size: var(--ui-fs-meta); font-variant-numeric: tabular-nums }
.va-table th, .va-table td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line2) }
.va-table thead th { position: sticky; top: 0; background: var(--paper-2); color: var(--muted); font-weight: 600 }
.va-table th:first-child { text-align: left }
.va-table tbody th { font-weight: 400 }
.va-table tr:last-child > * { border-bottom: 0 }
.va-table tr[aria-current] > * { background: var(--ops-soft); font-weight: 600 }
.va-note { margin: 0; color: var(--muted); font-size: var(--ui-fs-meta) }
@media (max-width: 699px) {
  .va-input input, .va-model select { font-size: max(16px, var(--ui-fs-body)) }
}
@media (max-width: 480px) {
  /* The per-reply line already shows tokens; keep the cost columns on screen. */
  .va-table :is(th, td):nth-child(4), .va-table :is(th, td):nth-child(5) { display: none }
}
@media (prefers-reduced-motion: reduce) {
  .voice-agent *, .topsearch .va-search-mic { transition: none; animation: none }
}
@media (forced-colors: active) {
  .va-card, .va-table, .va-input input, .va-model select { border-color: CanvasText }
  .va-mic.on { outline: 2px solid Highlight; outline-offset: 2px }
}
/* One searchable catalog table; detail is a transient, interactive hover card. */
#modal[data-modal="modal-room-information"] .mcard.modal-room-information {width:min(1200px,calc(100vw - 32px));max-width:none;height:min(860px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);display:flex;flex-direction:column;overflow:hidden;background:var(--paper);color:var(--ink)}
.modal-room-information .mhead {flex-shrink:0;min-height:60px}
.modal-room-information .mhead .iconbtn {min-width:44px;min-height:44px}
.ri-toolbar {display:flex;align-items:end;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line);flex-shrink:0}
.ri-search {display:grid;gap:6px;max-width:400px;flex:1;font-size:calc(13px + var(--text-size-step,0px));font-weight:600}
.ri-search input {width:100%;min-width:0;min-height:44px;border:1px solid var(--line-strong);border-radius:8px;padding:10px 12px;background:var(--paper);color:var(--ink);font:inherit;font-size:calc(14px + var(--text-size-step,0px))}
.ri-search input::placeholder {color:var(--muted);opacity:1}
.ri-count,.ri-hint {margin:0 0 12px;color:var(--muted);font-size:calc(13px + var(--text-size-step,0px))}
.ri-hint {margin-left:auto;text-align:right}
.ri-table-scroll {min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.ri-table {width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:calc(14px + var(--text-size-step,0px));text-align:left}
.ri-table thead th {position:sticky;top:0;z-index:1;background:var(--paper-2);color:var(--muted);font-size:calc(13px + var(--text-size-step,0px));font-weight:600;padding:12px 16px;border-bottom:1px solid var(--line)}
.ri-table th:first-child {width:180px}.ri-table th:nth-child(2) {width:30%}.ri-table th:last-child {width:150px}
.ri-table tbody :is(th,td) {padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}
.ri-table tbody tr:hover,.ri-table tr[data-preview="true"] {background:var(--paper-2)}
.ri-table .ri-money {text-align:right;font-weight:650;font-variant-numeric:tabular-nums}
.ri-description strong,.ri-description span {display:block}.ri-description strong {font-weight:600}.ri-description span {margin-top:4px;color:var(--muted)}
.ri-room {display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--ink);cursor:pointer;font:inherit;font-weight:700;text-align:left}
.ri-thumbnail {width:76px;height:56px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:6px;overflow:hidden;background:var(--paper-2)}
.ri-thumbnail img {width:100%;height:100%;object-fit:cover}
.ri-thumbnail-empty {display:grid;justify-items:center;gap:3px;color:var(--muted)}.ri-thumbnail-empty svg {width:20px;height:20px}.ri-thumbnail-empty small {font-size:12px;font-weight:400}
#modal .modal-room-information :is(button,input):focus-visible {outline:2px solid var(--focus-ring);outline-offset:2px}
.ri-preview {position:fixed;inset:auto;margin:0;padding:0;max-width:calc(100vw - 24px);overflow:auto;border:1px solid var(--line-strong);border-radius:14px;background:var(--paper);color:var(--ink);box-shadow:0 14px 48px rgba(0,0,0,.22);font:inherit;overscroll-behavior:contain}
.ri-preview-anchor {scrollbar-width:thin;animation:ri-preview-in .16s cubic-bezier(.16,1,.3,1)}
@keyframes ri-preview-in {from{opacity:0;transform:translateY(4px)}}
.ri-preview button:focus-visible {outline:2px solid var(--focus-ring);outline-offset:2px}
/* The room number in drawer and modal headers: dotted underline and camera hint say "this opens the room card". */
.ri-number {display:inline-flex;align-items:center;gap:.3em;min-height:44px;margin:0 -.25em;padding:0 .25em;border:0;border-radius:10px;background:none;color:inherit;font:inherit;letter-spacing:inherit;line-height:inherit;cursor:pointer;text-decoration:underline dotted var(--muted) 1.5px;text-underline-offset:.16em;transition:background-color .15s,text-decoration-color .15s}
.ri-number svg {width:.4em;height:.4em;min-width:16px;min-height:16px;flex:none;color:var(--muted)}
.ri-number:hover,.ri-number[aria-expanded="true"] {background:var(--material-hover);text-decoration-style:solid;text-decoration-color:currentColor}
.ri-number:focus-visible {outline:2px solid var(--focus-ring);outline-offset:2px}
@media(prefers-reduced-motion:reduce) {.ri-preview-anchor{animation:none}.ri-number{transition:none}}
@media(forced-colors:active) {.ri-number[aria-expanded="true"]{outline:2px solid Highlight;outline-offset:-2px}}
/* modal-system.css sizes every modal-ledger button to body text; the big header numbers (check-in, confirm booking) keep the header's size. */
#modal .modal-ledger .ci-room .ri-number {font-size:inherit;line-height:inherit}
.ri-preview-bar {position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:4px 12px 4px 20px;background:var(--paper);border-bottom:1px solid var(--line);font-size:calc(13px + var(--text-size-step,0px));color:var(--muted)}
.ri-preview-close,.ri-album-controls button {display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border:0;border-radius:6px;background:transparent;color:var(--ink);cursor:pointer;font-size:20px}
.ri-preview-close:hover,.ri-album-controls button:not(:disabled):hover {background:var(--paper-2)}.ri-preview-close svg {width:18px;height:18px}
.ri-album-controls {display:flex;align-items:center;justify-content:space-between;font-size:calc(13px + var(--text-size-step,0px));color:var(--muted)}.ri-album-controls button:disabled {opacity:.4;cursor:default}
.ri-filmstrip {display:flex;gap:8px;flex-wrap:wrap}.ri-filmstrip button {width:64px;height:48px;border:2px solid transparent;border-radius:6px;padding:2px;background:var(--paper);cursor:pointer}.ri-filmstrip button[aria-pressed="true"] {border-color:var(--focus-ring)}.ri-filmstrip img {width:100%;height:100%;object-fit:cover}
.ri-detail {padding:20px;font-size:calc(14px + var(--text-size-step,0px))}
.ri-room-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.ri-room-heading p {margin:0 0 6px;color:var(--muted);font-size:calc(13px + var(--text-size-step,0px));overflow-wrap:anywhere}
.ri-room-heading h2 {font-size:calc(22px + var(--text-size-step,0px));line-height:1.25;margin:0;overflow-wrap:anywhere}
.ri-equipment {border:1px solid var(--line-strong);border-radius:6px;padding:6px 10px;font-size:calc(13px + var(--text-size-step,0px));flex-shrink:0}
.ri-photo {margin:0;background:var(--paper-2);border-radius:10px;overflow:hidden}
.ri-photo img {width:100%;height:220px;object-fit:contain;display:block}
.ri-photo figcaption {padding:8px 12px;font-size:calc(12px + var(--text-size-step,0px));color:var(--muted)}
.ri-no-photo {height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--muted)}
.ri-no-photo svg {width:28px;height:28px}
.ri-section {margin-top:24px}
.ri-section h3 {font-size:calc(14px + var(--text-size-step,0px));font-weight:650;margin:0 0 12px}
.ri-prices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;margin:0;padding:16px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ri-prices dt,.ri-facts dt {font-size:calc(13px + var(--text-size-step,0px));color:var(--muted);margin-bottom:6px}
.ri-prices dd {font-size:calc(18px + var(--text-size-step,0px));font-weight:650;font-variant-numeric:tabular-nums;margin:0;overflow-wrap:anywhere}
.ri-caption {font-size:calc(13px + var(--text-size-step,0px));line-height:1.5;color:var(--muted);margin:12px 0 0}
.ri-facts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;margin:0}
.ri-facts dd {margin:0;line-height:1.5;overflow-wrap:anywhere}
.ri-empty {padding:32px;align-self:center;color:var(--muted);font-size:calc(14px + var(--text-size-step,0px));line-height:1.6}

@media(max-width:899px) and (min-width:700px) {
 .ri-table thead th,.ri-table tbody :is(th,td) {padding:10px 8px}
 .ri-table th:first-child {width:138px}.ri-table th:nth-child(2) {width:27%}.ri-table th:last-child {width:120px}
 .ri-thumbnail {width:56px;height:48px}.ri-hint {display:none}
}
@media(max-width:699px) {
 #modal[data-modal="modal-room-information"] .mcard.modal-room-information {width:calc(100vw - 16px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}
 .ri-toolbar {padding:12px;gap:8px;align-items:end}.ri-search {min-width:0}.ri-count {font-size:12px;white-space:nowrap}.ri-hint {display:none}
 .ri-table,.ri-table tbody {display:block}.ri-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .ri-table tbody tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;padding:14px;border-bottom:1px solid var(--line)}
 .ri-table tbody :is(th,td) {display:block;width:auto;padding:0;border:0;min-width:0}
 .ri-table tbody th:first-child {width:auto;grid-column:1/-1}.ri-description {grid-column:1/-1}
 .ri-table td[data-label]::before {content:attr(data-label);display:block;margin-bottom:3px;color:var(--muted);font-size:calc(12px + var(--text-size-step,0px));font-weight:400}
 .ri-table .ri-money {text-align:left}.ri-room {gap:14px;font-size:18px}.ri-thumbnail {width:84px;height:60px}
 .ri-detail {padding:16px}.ri-photo img {height:180px}.ri-prices {gap:16px}.ri-prices dd {font-size:calc(16px + var(--text-size-step,0px))}
}
/* Shortcut tracker: a keyboard docked at the bottom for a moment after a shortcut.
   Reuses the shared material tokens; green (--st-ok) only ever means "a shortcut landed / was used". */

.fb-board { position:fixed; z-index:80; left:50%; bottom:24px; width:min(620px, calc(100vw - 32px)); padding:14px 16px 16px; border:1px solid var(--line); border-radius:16px; background:var(--paper); box-shadow:var(--mat-lift); pointer-events:none;
  opacity:0; visibility:hidden; transform:translate(-50%, 8px); transition:opacity .2s ease, transform .2s ease, visibility 0s .2s; }
.fb-board[data-open] { opacity:1; visibility:visible; transform:translate(-50%, 0); transition-delay:0s; }
.fb-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:56px; margin-bottom:10px; }
.fb-state { min-width:0; }
.fb-sum { display:grid; justify-items:end; margin:0; color:var(--muted); font-size:calc(13px + var(--text-size-step)); text-align:right; white-space:nowrap; }
.fb-sum b { color:var(--ink); font-variant-numeric:tabular-nums; }
.fb-sum span { display:flex; align-items:center; gap:6px; font-size:calc(12px + var(--text-size-step)); }
.fb-legend { width:28px; height:8px; border:1px solid var(--line); border-radius:4px; background:linear-gradient(90deg, var(--paper), color-mix(in srgb, var(--st-ok) 48%, var(--paper))); }

/* The hit pill */
.fb-pill { position:relative; display:inline-flex; align-items:center; gap:14px; padding:10px 18px 10px 12px; border:1px solid var(--line); border-radius:var(--soft-r-pill); background:var(--paper-2); animation:fb-rise .22s cubic-bezier(.3,.7,.3,1) both; }
.fb-pill:not(.waiting)::after { content:''; position:absolute; inset:-2px; border-radius:inherit; border:2px solid var(--st-ok); opacity:0; animation:fb-ping .8s ease-out .12s; }
.fb-sep { align-self:stretch; width:1px; margin:4px 0; background:var(--line); }
.fb-dest { display:flex; align-items:center; gap:10px; }
.fb-dest > span { display:grid; line-height:1.2; }
.fb-dest small { color:var(--muted); font-size:calc(12px + var(--text-size-step)); }
.fb-dest b { font-size:calc(15px + var(--text-size-step)); font-weight:700; }
.fb-dest svg, .fb-tick { width:18px; height:18px; }
.fb-tick { fill:none; stroke:var(--st-ok); stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.fb-tick path { stroke-dasharray:16; stroke-dashoffset:16; animation:fb-draw .3s ease-out .2s forwards; }

/* The pill's keys press down in a short wave, then settle green. */
.fb-pill .fb-caps { gap:8px; }
.fb-pill .fb-caps kbd { min-width:34px; height:34px; padding:0 9px; border-bottom-width:3px; border-radius:9px; font-size:calc(15px + var(--text-size-step)); font-weight:700; --d:0ms; animation:fb-press .38s cubic-bezier(.3,.7,.3,1) var(--d) both; }
.fb-pill .fb-caps kbd ~ kbd { --d:70ms; }
.fb-pill .fb-caps .kbd-stroke ~ .kbd-stroke kbd { --d:140ms; }
.fb-pill.waiting { gap:12px; border-style:dashed; border-color:var(--line-strong); animation-duration:.18s; }
.fb-pill.waiting .fb-caps kbd { animation:none; }
.fb-pill.waiting ul { display:flex; gap:14px; margin:0; padding:0; list-style:none; color:var(--muted); font-size:calc(13px + var(--text-size-step)); }
.fb-pill.waiting li { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.fb-pill.waiting li.more { color:var(--faint); }
.fb-board[data-waiting] .fb-sum { display:none; }
.fb-pill.waiting li kbd { font-family:inherit; display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px; border:1px solid var(--line-strong); border-bottom-width:2px; border-radius:6px; background:var(--paper); color:var(--ink); font-size:calc(12px + var(--text-size-step)); font-weight:650; line-height:1; }

/* The keyboard: keys press with the fingers; tint is how often the shortcut was used today. */
.fb-keyboard { display:grid; justify-items:center; gap:6px; }
.fb-row { display:flex; gap:6px; }
.fb-row.mods { margin-top:2px; }
.fb-key { display:inline-grid; place-items:center; min-width:44px; height:44px; padding:0 6px; border:1px solid var(--line); border-bottom-width:3px; border-radius:9px; background:var(--paper-2); color:var(--faint); font-family:inherit; font-size:calc(14px + var(--text-size-step)); font-weight:600; line-height:1; transition:transform .08s, border-bottom-width .08s, background .3s; }
.fb-key.bound { border-color:var(--line-strong); background:color-mix(in srgb, var(--st-ok) calc(var(--heat) * 1%), var(--paper)); color:var(--ink); }
.fb-row.mods .fb-key { min-width:72px; }
.fb-key.down { transform:translateY(2px); border-bottom-width:1px; }
.fb-key.lit { animation:fb-key-ting 1.6s cubic-bezier(.3,.7,.3,1) both; }
.fb-key.next { outline:2px solid var(--ops); outline-offset:2px; animation:fb-breathe 1s ease-in-out infinite; }

@keyframes fb-press { 0% { transform:none; border-bottom-width:3px; } 30% { transform:translateY(2px); border-bottom-width:1px; background:var(--st-ok-soft); border-color:var(--st-ok); color:var(--st-ok-deep); } 100% { transform:none; border-bottom-width:3px; background:var(--st-ok-soft); border-color:var(--st-ok); color:var(--st-ok-deep); } }
@keyframes fb-key-ting { 0% { transform:none; border-bottom-width:3px; } 12% { transform:translateY(2px); border-bottom-width:1px; background:var(--st-ok-soft); border-color:var(--st-ok); color:var(--st-ok-deep); } 30% { transform:none; border-bottom-width:3px; background:var(--st-ok-soft); border-color:var(--st-ok); color:var(--st-ok-deep); } 100% { background:var(--st-ok-soft); border-color:var(--st-ok); color:var(--st-ok-deep); } }
@keyframes fb-rise { from { opacity:0; transform:translateY(6px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes fb-ping { 0% { opacity:.55; transform:scale(1); } 100% { opacity:0; transform:scale(1.1, 1.5); } }
@keyframes fb-draw { to { stroke-dashoffset:0; } }
@keyframes fb-breathe { 0%, 100% { opacity:1; } 50% { opacity:.45; } }

/* Keyboard shortcuts do not exist on touch; the status line still announces each hit. */
@media (max-width: 767px), (pointer: coarse) { .fb-board { display:none; } }
@media (prefers-reduced-motion: reduce) {
  .fb-board { transition:opacity .01ms; transform:translate(-50%, 0); }
  .fb-pill, .fb-pill .fb-caps kbd, .fb-key.lit { animation-duration:.01ms; animation-delay:0s; }
  .fb-pill::after, .fb-key.next { animation:none; }
  .fb-tick path { animation:none; stroke-dashoffset:0; }
  .fb-key { transition:none; }
}
@media (forced-colors: active) {
  .fb-board, .fb-pill, .fb-key { border-color:CanvasText; }
  .fb-key.lit { border-color:Highlight; }
  .fb-key.next { outline-color:Highlight; }
}
/* Universal search palette (Command/Ctrl K): fixed frame with in-place record previews. */
:is(dialog,[role="dialog"]).spl { width:min(760px, calc(100vw - 32px)); height:min(690px, calc(100dvh - 64px)); max-width:none; max-height:none; margin:auto; padding:0; border:0; background:transparent; overflow:visible; }
dialog.spl::backdrop { background:var(--material-overlay); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); }
:is(dialog,[role="dialog"]).spl:is([open],[data-state="open"]) .spl-card { animation:spl-in .16s cubic-bezier(.2, .8, .2, 1); }
@keyframes spl-in { from { opacity:0; transform:scale(.985) translateY(-6px); } }
.spl-card { position:relative; display:grid; grid-template-rows:auto minmax(0, 1fr) auto; height:100%; border:1px solid var(--line); border-radius:20px; background:var(--paper); backdrop-filter:blur(36px) saturate(1.4); -webkit-backdrop-filter:blur(36px) saturate(1.4); color:var(--ink); box-shadow:var(--mat-lift); overflow:hidden; }

/* Search field: large and quiet, with an inline completion for the first result. */
.spl-field { display:flex; align-items:center; gap:14px; padding:14px 68px 14px 24px; border-bottom:1px solid var(--line); }
.spl-field > svg { width:24px; height:24px; flex:none; color:var(--muted); }
.spl-input { position:relative; flex:1; min-width:0; }
.spl-input input, .spl-ghost { width:100%; padding:6px 0; border:0; font:inherit; font-size:calc(1.5rem + var(--text-size-step)); font-weight:500; letter-spacing:-.01em; }
.spl-input input { position:relative; background:transparent; color:inherit; outline:0; }
.spl-input input::placeholder { color:var(--muted); }
.spl-ghost { position:absolute; inset:0; color:var(--muted); opacity:.6; white-space:pre; overflow:hidden; pointer-events:none; }
.spl-ghost span { visibility:hidden; }

.spl-body { display:grid; grid-template-columns:minmax(0, 1fr); min-height:0; }

/* Results */
.spl-list { overflow-y:auto; overscroll-behavior:contain; padding:6px 10px 12px; border-right:0; }
.spl-group, .spl-label { padding:12px 12px 6px; color:var(--muted); font-size:calc(.75rem + var(--text-size-step)); font-weight:700; }
.spl-opt { display:grid; grid-template-columns:32px minmax(0, 1fr) auto; align-items:center; gap:12px; width:100%; min-height:52px; padding:6px 12px; border:0; border-radius:10px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.spl-opt[aria-selected="true"] { background:var(--material-selection); }
.spl-opt-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:8px; background:var(--paper-2); color:var(--muted); }
.spl-opt-icon svg { width:18px; height:18px; }
.spl-opt-text { display:grid; min-width:0; }
.spl-opt-text :is(b, small) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spl-opt-text b { font-weight:600; font-size:calc(.9375rem + var(--text-size-step)); }
.spl-opt-text small { color:var(--muted); font-size:calc(.8125rem + var(--text-size-step)); }
.spl-empty { display:grid; gap:6px; padding:28px 16px; color:var(--muted); }
.spl-empty b { color:var(--ink); }

/* Preview */
.spl-preview { display:grid; grid-template-rows:minmax(0, 1fr) auto; min-height:0; }
.spl-preview-body { display:grid; grid-auto-rows:max-content; align-content:start; gap:18px; padding:24px 28px; overflow-y:auto; overscroll-behavior:contain; }
.spl-head { display:flex; align-items:flex-start; gap:16px; }
.spl-head > div { flex:1; min-width:0; }
.spl-head h2 { margin:0; font-size:calc(1.375rem + var(--text-size-step)); font-weight:750; letter-spacing:-.015em; }
.spl-head p { margin:2px 0 0; color:var(--muted); font-size:calc(.875rem + var(--text-size-step)); }
.spl-badges, .spl-chips { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; }
.spl-chips { margin-top:0; }
.spl-avatar { display:grid; place-items:center; flex:none; width:52px; height:52px; border-radius:50%; background:var(--guest-avatar-bg, var(--paper-2)); box-shadow:inset 0 0 0 1.5px var(--guest-edge-hover, var(--line)); color:var(--guest-avatar-ink, var(--ink)); font-weight:800; font-size:calc(1.0625rem + var(--text-size-step)); }
.spl-avatar.is-icon { border-radius:14px; box-shadow:none; color:var(--muted); }
.spl-avatar svg { width:24px; height:24px; }
.spl-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px 20px; margin:0; }
.spl-facts div { display:grid; gap:2px; }
.spl-facts dt { color:var(--muted); font-size:calc(.75rem + var(--text-size-step)); }
.spl-facts dd { margin:0; font-weight:600; font-variant-numeric:tabular-nums; }
.spl-id-section .spl-label, .spl-tags-section .spl-label { padding-left:0; padding-top:0; }
.spl-id-missing { margin:0; padding:10px 14px; border:1px dashed var(--line); border-radius:10px; color:var(--muted); font-size:calc(.8125rem + var(--text-size-step)); }
.spl-stay { padding:2px 16px 14px; border:1px solid var(--line); border-radius:14px; }
.spl-stay .spl-label { padding-left:0; }
.spl-live { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 14px; }
.spl-live span { color:var(--muted); font-size:calc(.875rem + var(--text-size-step)); }
.spl-notes { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.spl-notes li { padding:6px 12px; border-radius:8px; background:var(--paper-2); }
.spl-folio { display:grid; border:1px solid var(--line); border-radius:14px; overflow:hidden; font-variant-numeric:tabular-nums; }
.spl-folio div { display:flex; justify-content:space-between; gap:16px; padding:9px 16px; }
.spl-folio .is-due { border-top:1px solid var(--line); background:var(--paper-2); font-weight:800; }

/* Actions: quiet tiles naming the destination screen, one filled primary action. */
.spl-actions { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; padding:12px 18px 16px; border-top:1px solid var(--line); }
.spl-actions:has(> :nth-child(4):last-child) { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.spl-action { display:grid; grid-template-columns:18px minmax(0, 1fr) auto; align-items:center; gap:10px; min-height:52px; padding:8px 12px; border:1px solid var(--line); border-radius:var(--soft-r-card); background:var(--paper); color:var(--ink); font:inherit; text-align:left; cursor:pointer; transition:background-color .14s var(--ease), border-color .14s var(--ease); }
.spl-action:hover { background:color-mix(in srgb, var(--paper) 94%, var(--ink)); border-color:var(--line-strong); }
.spl-action:active { background:color-mix(in srgb, var(--paper) 88%, var(--ink)); }
.spl-action:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.spl-action svg { width:18px; height:18px; flex:none; color:var(--muted); transition:color .14s var(--ease); }
.spl-action:hover svg { color:var(--ink); }
.spl-action > span { display:grid; gap:1px; min-width:0; }
.spl-action b { font-size:var(--ui-fs-ui); font-weight:650; line-height:1.35; }
.spl-action small { color:var(--muted); font-size:var(--ui-fs-meta); font-weight:400; line-height:1.35; }
.spl-action.is-primary { border-color:transparent; background:var(--material-primary); color:var(--material-primary-ink); }
.spl-action.is-primary:hover { border-color:transparent; background:var(--material-primary-hover); }
.spl-action.is-go { border-color:transparent; background:var(--material-go); color:var(--material-go-ink); }
.spl-action.is-go:hover { border-color:transparent; background:var(--material-go-hover); }
.spl-action:is(.is-primary, .is-go) svg { color:currentColor; opacity:.9; }
.spl-action:is(.is-primary, .is-go):hover svg { color:currentColor; opacity:1; }
.spl-action:is(.is-primary, .is-go) small { color:inherit; opacity:.82; }

.spl-action kbd, .spl-foot kbd { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; box-sizing:border-box; border:1px solid var(--line); border-bottom-width:2px; border-radius:var(--soft-r-ctl); background:var(--paper); color:var(--muted); font-family:var(--mono, ui-monospace, monospace); font-size:var(--ui-fs-meta); font-weight:600; line-height:1; font-variant-numeric:tabular-nums; white-space:nowrap; }
.spl-action kbd { background:var(--paper-2); }
.spl-action:is(.is-primary, .is-go) kbd { border-color:transparent; background:color-mix(in srgb, currentColor 18%, transparent); color:inherit; }
.spl-foot { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; padding:10px 20px; border-top:1px solid var(--line); color:var(--muted); font-size:var(--ui-fs-meta); line-height:1.4; }
.spl-foot span { display:inline-flex; align-items:center; gap:5px; }
.spl-foot-end { margin-left:auto; }
@media (max-width: 1119px) {
  .spl-actions:has(> :nth-child(4):last-child) { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .spl-actions { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (pointer: coarse) {
  .spl-action { grid-template-columns:18px minmax(0, 1fr); }
  .spl-action kbd { display:none; }
}

@media (max-width: 760px) {
  :is(dialog,[role="dialog"]).spl { width:calc(100vw - 16px); height:min(690px, calc(100dvh - 24px)); }
  .spl-card { border-radius:16px; }
  .spl-field { padding:10px 64px 10px 16px; }
  .spl-input input, .spl-ghost { font-size:calc(1.25rem + var(--text-size-step)); }
  .spl-body { grid-template-columns:1fr; grid-template-rows:minmax(0, 1fr); }
  .spl-list { border-right:0; border-bottom:1px solid var(--line); }
  .spl-preview { overflow-y:auto; grid-template-rows:minmax(0, 1fr) auto; }
  .spl-preview-body { overflow-y:auto; padding:18px; }
  .spl-foot { display:none; }
}
@media (prefers-reduced-transparency: reduce) {
  .spl-card { background:var(--paper); backdrop-filter:none; -webkit-backdrop-filter:none; }
  dialog.spl::backdrop { backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@media (prefers-reduced-motion: reduce) {
  :is(dialog,[role="dialog"]).spl:is([open],[data-state="open"]) .spl-card { animation:none; }
  .spl-action, .spl-action svg { transition:none; }
}
@media (forced-colors: active) {
  .spl-card { border-color:CanvasText; }
  .spl-opt[aria-selected="true"] { forced-color-adjust:none; background:Highlight; color:HighlightText; }
  .spl-action { border-color:ButtonBorder; }
  .spl-action:is(.is-primary, .is-go) { border-color:Highlight; }
}

.spl-group { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.spl-group > span { font-weight:500; font-variant-numeric:tabular-nums; }
.spl-bindings { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; max-width:150px; }

.spl-close { position:absolute; top:12px; right:12px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:var(--soft-r-ctl); background:transparent; color:var(--muted); cursor:pointer; }
.spl-close svg { width:18px; height:18px; }
.spl-close:hover { background:var(--material-hover); }
.spl-close:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }


/* Detail and results occupy the same frame; long profiles and actions share one scroll area. */
.spl .spl-preview { grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
.spl-detail-scroll { overflow-y:auto; overscroll-behavior:contain; }
.spl .spl-preview-body { overflow:visible; }
.spl-back { display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 24px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--muted); font:inherit; text-align:left; cursor:pointer; }
.spl-back svg { width:16px; height:16px; transform:rotate(180deg); }
.spl-back span { margin-left:auto; font-variant-numeric:tabular-nums; }
.spl-back:hover { background:var(--material-hover); }
.spl-result-end { display:flex; align-items:center; gap:8px; }
.spl-result-end > svg { width:16px; height:16px; color:var(--muted); }
.spl-opt--guest { min-height:76px; }
.spl-guest-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; padding-top:4px; color:var(--muted); font-size:calc(12px + var(--text-size-step)); font-variant-numeric:tabular-nums; }
.spl-meta-field { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; min-height:22px; }
.spl-meta-field svg { width:15px; height:15px; }
@media(max-width:650px){
 .spl-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; max-height:32dvh; overflow:auto; }
 .spl-action { grid-template-columns:16px minmax(0,1fr); gap:8px; min-height:48px; padding:8px 10px; }
 .spl-action:focus-visible { outline-offset:-2px; }
 .spl-action svg { width:16px; height:16px; }
 .spl-action kbd { display:none; }
 .spl-action:first-child:nth-last-child(odd) { grid-column:1 / -1; }
}
@media(max-width:600px){
 .spl-guest-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 10px; }
 .spl-opt { gap:8px; padding:8px; }
 .spl-opt--guest .spl-result-end .tag { display:none; }
}
@media(max-width:360px){
 .spl-actions { grid-template-columns:minmax(0,1fr); }
}
/* LineItems: Khoản · SL · Đơn giá · Thành tiền. Flat journal in the ledger; grouped with subtotals on checkout and receipts. Tokens only. */
.line-items { min-width: 0; width: 100%; container-type: inline-size; color: var(--ink); font-size: var(--ui-fs-ui); line-height: 1.45; font-variant-numeric: tabular-nums; }
.li-table { width: 100%; border-collapse: collapse; }
.li-table :is(th, td) { padding: 8px 0; text-align: right; font-weight: 400; vertical-align: baseline; white-space: nowrap; border-bottom: 1px solid var(--line); }
.li-table :is(th, td) + :is(th, td) { padding-left: 14px; }
.li-table :is(th[scope="row"], thead th:first-child) { width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.li-table th[scope="row"] > svg { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; color: var(--muted); }
.li-table thead th { padding: 0 0 6px; color: var(--muted); font-size: calc(12px + var(--text-size-step, 0px)); font-weight: 600; letter-spacing: .02em; }
.li-table thead th + th { padding-left: 14px; }
.li-qty { min-width: 2.5ch; font-weight: 600; }
.li-unit { color: var(--muted); }
.li-amt { font-weight: 650; }
.li-act { width: 1%; padding-block: 2px; }
.li-act > * { vertical-align: middle; }
.li-group :is(th, td) { padding-top: 14px; border-bottom: 0; font-weight: 650; }
tbody + tbody .li-group :is(th, td) { padding-top: 18px; }
.li-sub :is(th, td) { padding-top: 6px; border-bottom: 0; color: var(--muted); font-weight: 600; }
.li-sub .li-amt { color: var(--ink); font-weight: 650; }
.li-sys th[scope="row"] { padding-left: 20px; }
.li-meta { display: none; color: var(--muted); font-size: calc(12px + var(--text-size-step, 0px)); }
.li-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--muted); font-size: calc(12px + var(--text-size-step, 0px)); }
.li-auto { padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: calc(12px + var(--text-size-step, 0px)); font-weight: 600; }
.li-empty { margin: 0; color: var(--muted); font-size: var(--ui-fs-ui); line-height: 1.5; }
/* tones */
:is(.li-pay, .li-deposit, .li-discount) :is(.li-amt, th > svg) { color: var(--st-ok-deep); }
.li-reversal :is(.li-amt, th > svg) { color: var(--st-attn-deep); }
.li-reversed th { color: var(--faint); text-decoration: line-through; }
.li-reversed .li-amt { color: var(--faint); }
/* ledger (POS folio): one ringed block per group. The ring + 18px card radius come from the shape scale; the block sits
 * inside the folio panel, so it gets the ring only, never a second lift. */
.li-ledger { display: grid; gap: 12px; }
.li-block { padding: 0 16px 4px; border-radius: var(--soft-r-card); box-shadow: var(--soft-ring); }
.li-block header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 6px; border-bottom: 1px solid var(--line); }
.li-block h3 { margin: 0; font-size: var(--ui-fs-body); font-weight: 650; }
.li-ledger tbody tr:last-child :is(th, td) { border-bottom: 0; }
.li-ledger .li-meta { display: block; }
.li-ledger .li-actions { display: inline-flex; align-items: center; gap: 6px; }
.li-ledger .li-table .li-amt { padding-right: 12px; }
.li-ledger .li-table .li-act { padding-left: 4px; }
.li-ledger .li-disc th[scope="row"] { padding-left: 18px; }
.li-ledger .li-disc :is(th, td) { border-bottom: 0; }
.li-ledger .li-sub :is(th, td) { padding-top: 10px; }
.li-ledger .li-net :is(th, td) { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; }
/* narrow: drop the Đơn giá column, show "2 × unit" under the label instead */
@container (max-width: 480px) {
  .li-table .li-unit { display: none; }
  .li-table .li-meta { display: block; }
  .li-table :is(th, td) + :is(th, td) { padding-left: 10px; }
  .li-block { padding-inline: 12px; }
  .li-ledger .li-disc th[scope="row"] { padding-left: 0; }
}
@media (forced-colors: active) { .li-block { border: 1px solid CanvasText; box-shadow: none; } }
/* paper: the column comes back, rows never split across pages */
@media print {
  .line-items { color: black; font-size: 10pt; }
  .li-table :is(th, td) { border-color: var(--receipt-print-rule); }
  .li-table thead th, .li-unit { color: var(--receipt-ink-pay); font-size: 9pt; }
  .li-row, .li-sub, .li-group, .li-block { break-inside: avoid; }
  .li-table .li-unit { display: table-cell; }
  .li-table .li-meta { display: none; }
  .li-auto { border: 1px solid var(--receipt-print-edge); background: none; }
  .li-ledger .li-meta { display: block; }
  .li-block { border: 1px solid CanvasText; box-shadow: none; }
}
.ui-history { min-width: 0; container-type: inline-size; color: var(--ink); }
.ui-history-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.ui-history-head h3 { margin: 0; font-size: calc(16px + var(--text-size-step)); font-weight: 700; }
.ui-history-head > span { color: var(--muted); font-size: var(--ui-fs-meta); font-variant-numeric: tabular-nums; }
.ui-history .ui-history-frame { border-radius: 0; border-top: 1px solid var(--line); }
.ui-history-table { min-width: max(640px, 46em); table-layout: fixed; line-height: 1.5; }
.ui-history-at { width: 18%; }
.ui-history-action { width: 25%; }
.ui-history-detail { width: 35%; }
.ui-history-actor { width: 22%; }
.ui-history .ui-history-table th { padding: 12px; color: var(--ink); font-weight: 700; white-space: normal; }
.ui-history .ui-history-table td { padding: 14px 12px; vertical-align: top; overflow-wrap: anywhere; }
.ui-history-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }
.ui-history-table :is(strong, time b) { font-weight: 650; }
.ui-history-table time { display: grid; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-history-table time span { color: var(--muted); font-size: var(--ui-fs-meta); }
.ui-history-table .ui-history-empty { padding-block: 24px; color: var(--muted); }
.ui-history-foot { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: var(--ui-fs-meta); line-height: 1.5; }
.ui-history-foot svg { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; }
.ui-history-scroll-hint { display: none; margin: 0 0 8px; color: var(--muted); font-size: var(--ui-fs-meta); }
@container (max-width: 639px) { .ui-history-scroll-hint { display: block; } }
.attention-settings{display:grid;gap:16px}.attention-rule{display:grid;grid-template-columns:minmax(200px,1fr) minmax(280px,1fr);gap:20px;padding:20px 0;border-bottom:1px solid var(--line)}.attention-rule:last-child{border-bottom:0}.attention-rule h3{margin:0 0 6px}.attention-rule p{margin:0 0 8px}.attention-rule-fields{border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;align-items:end;gap:12px}.attention-rule-fields label,.attention-arrival label{display:grid;gap:6px;font-size:calc(13px + var(--text-size-step,0px))}.attention-rule-fields input[type=number]{width:145px;max-width:100%}.attention-rule-fields label:first-child{display:flex;align-items:center;align-self:center}.attention-arrival{display:grid;gap:12px;max-width:520px}.attention-toast{position:fixed;z-index:600;bottom:24px;right:24px;max-width:min(480px,calc(100vw - 32px));padding:16px;display:flex;align-items:center;gap:12px;border:1px solid var(--line);background:var(--paper);color:var(--ink);box-shadow:var(--mat-lift-sm);border-radius:16px}.attention-toast span{min-width:0;overflow-wrap:anywhere}@media(max-width:760px){.attention-rule{grid-template-columns:1fr}.attention-rule-fields{gap:10px}.attention-toast{right:16px;bottom:84px}.attention-arrival input,.attention-arrival select{min-width:0;width:100%;font-size:max(16px,var(--ui-fs-body))}}
.attention-rule-fields input[type=number],.attention-arrival input,.attention-arrival select{min-height:var(--ui-hit,44px);border:1px solid var(--ui-field-edge);border-radius:10px;padding:8px 10px;background:var(--paper);color:var(--ink);font:inherit;box-shadow:none}.attention-rule-fields input[type=checkbox]{accent-color:var(--ops)}.attention-rule-fields input:focus-visible,.attention-arrival :is(input,select):focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
