@font-face {
  font-family: "Khmer OS Battambang";
  src: url("/hqms-brand-assets.php?asset=battambang-font&v=20261118-display-1") format("truetype");
  font-display: swap;
  font-weight: 400;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200B-200D, U+25CC;
}


:root {
  color-scheme: light;
  --paper: #f3f7fa;
  --surface: #fff;
  --white: #fff;
  --ink: #0c2a3a;
  --muted: #4c6474;
  --line: #d8e5ed;
  --strong-line: #9db8c8;
  --ink-blue: #0c3145;
  --brand: #04A7E5;
  --brand-hover: #21b6ed;
  --sky: #e0f3fd;
  --sky-strong: #b8e8fc;
  --rust: #813b2a;
  --rose: #faede7;
  --radius: 12px;
  --panel-shadow: 0 4px 18px #0c314508;
  color: var(--ink);
  font-family: "Khmer OS Battambang", "Aptos", "Segoe UI", system-ui, Khmer, sans-serif;
  font-synthesis: weight;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #0877a6; outline-offset: 3px; }
a { color: var(--ink-blue); text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.35; overflow-wrap: anywhere; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
small { font-size: .84em; }
svg { display: block; }
.icon { width: 18px; height: 18px; stroke-width: 1.7; flex: 0 0 auto; }
.row { display: flex; align-items: center; gap: 9px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.spacer { flex: 1 1 auto; }
.muted, .hint, .quiet-label { color: var(--muted); }
.hint, .quiet-label { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { background: var(--sky); border-color: #7599ab; }
.btn.primary { color: var(--ink); background: var(--brand); border-color: var(--brand); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled { color: #526977; background: #e9f1f6; border-color: var(--line); }
.btn.sm { min-height: 36px; padding: 5px 10px; }
.btn.link { padding-inline: 6px; border-color: transparent; background: transparent; }
.btn.icon-only { width: 40px; flex: 0 0 40px; min-height: 40px; padding: 0; }

input:not([type=checkbox]), select, textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--strong-line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 7px 11px;
}
input::placeholder, textarea::placeholder { color: #687873; }
textarea { min-height: 88px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
label { font-weight: 600; }
label > :is(input:not([type=checkbox]), select, textarea) { display: block; margin-top: 6px; }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand img { flex: 0 0 auto; object-fit: contain; }
.brand-type { font-size: 14px; font-weight: 730; line-height: 1.25; }
.boot { min-height: 100vh; display: grid; align-content: center; justify-items: center; text-align: center; padding: 24px; gap: 12px; }
.boot p { font-weight: 700; }
.boot small { color: var(--muted); }
.lang { display: inline-flex; align-items: stretch; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; overflow: visible; }
.lang button { min-height: 35px; min-width: 36px; border: 0; padding: 3px 9px; color: inherit; background: transparent; font-size: 13px; font-weight: 650; }
.lang button:first-child { border-radius: 5px 0 0 5px; }
.lang button:last-child { border-radius: 0 5px 5px 0; }
.lang button[aria-pressed=true] { background: var(--sky); color: var(--ink-blue); }
.connection { display: inline-flex; align-items: center; gap: 6px; color: #365b4e; font-size: 13px; white-space: nowrap; }
.connection.offline { color: var(--rust); }
.dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; flex: 0 0 auto; }
.context-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.context-label:lang(en) { letter-spacing: .08em; }

.shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 26px 15px 14px;
}
.sidebar .brand { margin: 0 8px 26px; }
.sidebar .brand-type { max-width: 16ch; }
#staff-menu-toggle { display: none; }
.sidebar nav { display: grid; gap: 18px; padding-bottom: 22px; }
.nav-group { display: grid; gap: 3px; }
.nav-label { padding: 4px 11px; color: var(--muted); font-size: 12px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--ink); padding: 6px 10px; border-radius: 5px; }
.nav:hover { background: var(--paper); }
.nav.active { background: var(--sky); color: #0b4a67; box-shadow: inset 3px 0 var(--brand); font-weight: 700; }
.nav-room-number { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: 0 0 21px; }
.user-card { margin-top: auto; padding: 13px 4px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.user-card div { flex: 1; min-width: 0; }
.user-card strong, .user-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { color: var(--muted); }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; color: var(--ink-blue); background: var(--sky); border-radius: 6px; font-weight: 700; }

.main { min-width: 0; }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(18px, 3vw, 44px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; overflow-wrap: anywhere; }
.topbar-title strong { display: block; font-size: 15px; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.clock-box, .tv-clock { text-align: right; white-space: nowrap; }
.clock-box strong, .tv-clock strong { display: block; font-variant-numeric: tabular-nums; line-height: 1.2; }
.clock-box small, .tv-clock small { color: var(--muted); }
.content { padding: 26px clamp(18px, 3vw, 44px); max-width: 1680px; margin-inline: auto; }
.content:focus { outline: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 23px; }
.page-head h1 { font-size: clamp(27px, 3vw, 42px); font-weight: 730; }
.page-head .context-label { margin-bottom: 4px; }
.page-subtitle { margin-top: 5px; color: var(--muted); }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.footer { margin-top: 25px; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.byline { color: var(--muted); }

.measures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  margin: 0 0 22px;
  box-shadow: var(--panel-shadow);
}
.panel + .measures { margin-top: 18px; }
.measures.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.measures > div { padding: 14px clamp(10px, 1.6vw, 23px); min-width: 0; }
.measures > div + div { border-left: 1px solid var(--line); }
.measures dt { color: var(--muted); font-size: 13px; }
.measures dd { font-size: clamp(28px, 3.2vw, 44px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.13; margin-top: 5px; }
.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 24%); gap: 16px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--panel-shadow); }
.panel-head { padding: 15px 17px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel-body, .settings-form { padding: 14px 17px 17px; }
.room-directory table { min-width: 525px; }
.room-directory :is(th, td) { padding: 11px 13px; }
.room-directory th[scope=row] { background: transparent; text-transform: none; letter-spacing: 0; font-weight: 500; }
.desk-name { display: flex; gap: 9px; align-items: center; }
.desk-name strong, .desk-name small, .room-directory td small { display: block; overflow-wrap: anywhere; }
.desk-name > span:last-child { min-width: 0; }
.desk-name small, .room-directory td small { color: var(--muted); }
.desk-mobile-state { display: none; }
.room-number { display: inline-grid; place-items: center; flex: 0 0 33px; width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.room-call-number { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.desk-state { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 5px; font-size: 13px; color: var(--muted); }
.desk-state.active { color: #205844; font-weight: 700; }
.desk-state.paused { color: var(--rust); }
.desk-paused { flex-basis: 100%; color: var(--rust); font-weight: 500; }
.row-link { display: inline-flex; align-items: center; gap: 4px; min-height: 35px; white-space: nowrap; color: #0a5d80; font-weight: 650; }
.row-link:hover { text-decoration: underline; }
.row-link .icon { width: 14px; height: 14px; }
.overview-side { display: grid; gap: 16px; }
.side-section { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #edf5f9; min-width: 0; }
.side-section h2 { font-size: 17px; }
.side-section .hint { margin-top: 3px; }
.side-list { margin: 10px 0 0; padding: 0; list-style: none; }
.side-list li { display: flex; align-items: center; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.side-list li strong { font-variant-numeric: tabular-nums; font-size: 17px; }
.side-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.side-list li time, .side-empty { color: var(--muted); }
.side-empty { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }

.control-grid { display: grid; grid-template-columns: minmax(245px, .42fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.current-box { padding: 17px; border-top: 3px solid var(--brand); }
.current-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.current-heading h2 { font-size: 17px; }
.current-number { display: grid; padding: 16px 0 13px; }
.current-number strong { font-size: clamp(47px, 6vw, 90px); line-height: 1.05; color: var(--ink-blue); font-variant-numeric: tabular-nums; }
.current-number span { color: var(--muted); margin-top: 5px; }
.current-patient { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; border-top: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.current-patient small { display: block; color: var(--muted); }
.control-buttons, .secondary-controls { display: grid; gap: 7px; }
.secondary-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.current-box .hint { margin-top: 10px; }
.shared-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; background: var(--sky); }
.shared-banner small { display: block; color: var(--muted); }

.table-wrap { position: relative; overflow-x: auto; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; }
td, th { padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; }
thead th { font-weight: 650; color: var(--muted); background: #edf5f9; font-size: 13px; }
tbody tr:last-child :is(td, th) { border-bottom: 0; }
tbody tr:hover { background: #f5f9fc; }
.responsive-records { min-width: 550px; }
.responsive-records :is(td,th) { overflow-wrap: anywhere; }
.history-filters label { min-width: 0; color: var(--muted); font-size: 13px; }
.history-filters input { min-width: 0; }
.history-query { flex: 1 1 200px; max-width: 390px; }
.history-pagination, .queue-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.record-field-label { display: none; }
.table-ticket { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-ticket small, .patient-cell small { display: block; font-weight: 400; color: var(--muted); }
.patient-cell { max-width: 22ch; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 93px; max-width: 143px; }
.row-actions .btn { width: 35px; min-height: 35px; padding: 0; }
.row-actions .icon { width: 16px; height: 16px; }
.tabs { display: flex; flex-wrap: wrap; align-items: stretch; padding: 0 13px; border-bottom: 1px solid var(--line); gap: 8px; }
.tab { min-height: 38px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 4px 7px; }
.tab.active { color: var(--ink-blue); border-bottom-color: var(--brand); font-weight: 700; }
.tab b { font-variant-numeric: tabular-nums; }
.table-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; padding: 12px 14px; }
.search { display: flex; align-items: center; flex: 1 1 220px; max-width: 410px; gap: 6px; }
.search .icon { color: var(--muted); }
.queue-total { padding: 9px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.empty { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 105px; padding: 16px; color: var(--muted); text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; background: #eaf1f5; color: #385365; border-radius: 6px; font-size: 12px; font-weight: 650; }
.pill.green { background: #dcebe0; color: #235341; }
.pill.blue { background: #e6ecee; color: #364e61; }
.pill.amber { background: #f4ead7; color: #6e4b19; }
.pill.red { background: var(--rose); color: var(--rust); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(220px, .7fr); gap: 16px; align-items: start; }
.settings-form { display: grid; gap: 13px; }
.settings-profile { border-top: 3px solid var(--brand); }
.settings-save { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.workspace-logo, .workspace-room { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.workspace-logo img, .receipt-logo { object-fit: contain; }
.workspace-logo small, .workspace-room small { display: block; color: var(--muted); }
.workspace-logo strong, .workspace-room strong { overflow-wrap: anywhere; }
.workspace-room { padding: 9px 0; border-bottom: 1px solid var(--line); }
.workspace-room-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.room-voice-audio { width: 100%; }
.room-settings-list > .hint { margin-top: 10px; }
.settings-section { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 12px; font-weight: 700; }
.switch-line, .account-row { display: flex; justify-content: space-between; gap: 9px; align-items: center; }
.switch-line small { display: block; color: var(--muted); }
.account-row { border-top: 1px solid var(--line); padding: 8px 0; }
.room-checkboxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.room-checkboxes label { display: flex; align-items: center; gap: 6px; }
.notice { display: flex; align-items: flex-start; gap: 8px; background: var(--sky); color: var(--ink-blue); padding: 9px 10px; border-radius: 7px; }
.notice[hidden] { display: none; }
.error-notice { background: var(--rose); color: var(--rust); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-grid > .full { grid-column: 1 / -1; }
.field-grid > label[hidden] { display: none; }

dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 60px #0c314530; }
dialog::backdrop { background: #0c31457a; }
.modal-head, .modal-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.modal-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.modal-content { padding: 16px; }
.modal-feedback { margin-top: 12px; }
.timeline-person { color: var(--muted); margin-bottom: 16px; }
.timeline { list-style: none; padding: 0 0 0 15px; margin: 0; border-left: 2px solid var(--sky-strong); }
.timeline-row { position: relative; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-row::before { content: ""; position: absolute; left: -20px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline-row small { display: block; color: var(--muted); }
.ticket-success { text-align: center; }
.ticket-number { font-size: 64px; color: var(--ink-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.toasts { position: fixed; bottom: 14px; right: 14px; z-index: 5; display: grid; gap: 6px; max-width: min(390px, calc(100vw - 28px)); pointer-events: none; }
.toast { background: var(--ink-blue); color: white; padding: 10px 12px; border-radius: 5px; box-shadow: 0 3px 18px #0c314530; }
.toast.error { background: #793b2e; }

.login-layout { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; }
.login-header, .login-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px clamp(18px, 5vw, 72px); }
.login-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.login-header .brand { min-width: 0; }
.login-header .brand-type { overflow-wrap: anywhere; }
.login-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: center; align-content: center;
  gap: clamp(32px, 7vw, 116px); width: min(100%, 1180px); padding: 28px clamp(18px, 5vw, 64px); margin: auto; }
.login-copy { border-inline-start: 3px solid var(--brand); padding-inline-start: clamp(17px, 3vw, 35px); }
.login-copy .context-label { color: #0a5d80; letter-spacing: 0; overflow-wrap: anywhere; }
.login-description { font-size: clamp(28px, 4.5vw, 58px); font-weight: 700; line-height: 1.33; margin-top: 7px; overflow-wrap: anywhere; }
.login-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.access-main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
:is(.access-main, .login-main) .login-box {
  padding: clamp(18px, 3vw, 36px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}
.login-box { width: min(100%, 420px); }
.login-box .brand { margin-bottom: 18px; }
.login-box h1 { font-size: clamp(25px, 3.3vw, 40px); }
.login-box > p { margin: 7px 0 14px; color: var(--muted); }
.login-box .notice { margin-bottom: 10px; }
.login-box form { display: grid; gap: 9px; }
.login-box form > .primary { justify-content: space-between; margin-top: 8px; min-height: 47px; }
.login-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.public-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.public-identity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.public-identity > span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.public-tools { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kiosk { min-height: 100vh; min-height: 100dvh; max-width: 1710px; padding: 18px clamp(16px, 4vw, 65px) 12px; display: flex; flex-direction: column; margin-inline: auto; }
.kiosk-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr); gap: clamp(20px, 7vw, 108px); align-items: center; margin-block: auto; padding: clamp(23px, 5vh, 65px) 0; }
.kiosk-intro .context-label { display: flex; align-items: center; gap: 8px; color: #0a5d80; letter-spacing: 0; overflow-wrap: anywhere; }
.kiosk-intro h1 { max-width: 20ch; font-size: clamp(33px, 5vw, 68px); font-weight: 680; color: var(--ink-blue); margin: 9px 0 11px; }
.kiosk-copy { color: var(--muted); font-size: clamp(15px, 1.5vw, 21px); max-width: 43ch; }
.ticket-stub { min-width: 0; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.ticket-stub > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; background: var(--sky); color: var(--ink-blue); border-radius: 9px 9px 0 0; font-weight: 700; }
.stub-body { padding: 15px 18px 16px; text-align: center; }
.stub-body h2 { font-size: clamp(17px, 1.8vw, 26px); }
.stub-ready { display: grid; align-content: center; min-height: clamp(105px, 18vh, 180px); }
.kiosk-number { display: block; font-size: clamp(66px, 10vw, 154px); color: var(--ink-blue); font-variant-numeric: tabular-nums; font-weight: 730; line-height: 1.04; margin: 4px 0; overflow-wrap: anywhere; }
.stub-reference { color: var(--muted); font-variant-numeric: tabular-nums; }
.stub-actions { position: relative; border-top: 1px dashed var(--strong-line); padding: 15px 17px; display: grid; gap: 8px; text-align: center; }
.stub-actions::before, .stub-actions::after { position: absolute; content: ""; top: -8px; width: 15px; height: 15px; border-radius: 50%; background: var(--paper); border: 1px solid var(--strong-line); }
.stub-actions::before { left: -8px; clip-path: inset(0 0 0 50%); }
.stub-actions::after { right: -8px; clip-path: inset(0 50% 0 0); }
.stub-actions .btn { min-height: 48px; font-size: 17px; }
.stub-actions p { color: var(--muted); }
.stub-actions .inline-status { padding: 7px 8px; }
.stub-actions .error-notice { color: var(--rust); }
.public-footer { display: flex; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 9px; color: var(--muted); font-size: 13px; }

.tv {
  --tv-ink: #f3fbff;
  --tv-muted: #bad3e1;
  --tv-rule: #365b72;
  --tv-highlight: var(--brand);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 23px);
  padding: 16px clamp(15px, 3vw, 50px);
  background: #0a2232;
  color: var(--tv-ink);
}
.tv .public-header { border-color: var(--tv-rule); }
.tv .public-identity > span, .tv-clock small { color: var(--tv-muted); }
.tv .brand img { outline: 1px solid var(--tv-rule); border-radius: 8px; }
.tv .brand-type { font-size: clamp(15px, 1.55vw, 25px); }
.tv-clock strong { font-size: clamp(23px, 3.1vw, 49px); }
.tv-layout { --tv-direction: #57cdf5; display: grid; grid-template-columns: minmax(230px, .85fr) minmax(0, 1.35fr); gap: clamp(11px, 2vw, 29px); flex: 1; }
.tv-layout[data-service="consultation"] { --tv-direction: #6ee2c1; }
.tv-layout[data-service="payment"] { --tv-direction: #ffcf7e; }
.tv-layout[data-call-kind="recall"] { --tv-direction: #ffa29c; }
.tv-layout[data-call-kind="recall-skipped"] { --tv-direction: #cfb5ff; }
.tv-current-call { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(16px, 3vw, 47px); border-left: 3px solid var(--tv-rule); border-radius: 8px; background: #0d293b; }
.tv-current-call.has-call { border-color: var(--tv-direction); }
.tv-current-call .context-label { color: var(--tv-highlight); font-size: clamp(16px, 1.6vw, 26px); }
.tv-hero-ticket { color: var(--tv-highlight); font-size: clamp(58px, 9vw, 172px); line-height: 1.07; font-weight: 730; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 100%; }
.tv-hero-ticket.long-code { font-size: clamp(29px, 4.7vw, 84px); }
.tv-reference { color: var(--tv-muted); font-size: clamp(15px, 1.7vw, 24px); font-variant-numeric: tabular-nums; }
.tv-code-note { color: var(--tv-muted); font-size: clamp(12px, 1.05vw, 17px); }
.tv-destination { border-top: 1px solid var(--tv-rule); padding-top: 10px; margin-top: 10px; display: grid; gap: 3px; width: 100%; }
.tv-destination span { color: var(--tv-direction); }
.tv-destination strong { font-size: clamp(24px, 3.1vw, 47px); line-height: 1.25; }
.tv-idle { display: grid; gap: 3px; }
.tv-idle span { color: #a8bbb0; font-size: clamp(62px, 8.6vw, 150px); line-height: 1.14; }
.tv-idle strong { font-size: clamp(20px, 2.45vw, 41px); line-height: 1.35; }
.tv-directory { --tv-arrow-space: clamp(37px, 5vw, 80px); min-width: 0; display: flex; flex-direction: column; }
.tv-directory ol { padding: 0; margin: 0; list-style: none; flex: 1; display: grid; grid-auto-rows: minmax(min-content, auto); }
.tv-directory-head, .tv-desk { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(68px, .78fr) minmax(62px, .65fr); gap: 7px; align-items: center; }
.tv-directory.no-previous :is(.tv-directory-head, .tv-desk) { grid-template-columns: minmax(0, 1fr) minmax(68px, .5fr); }
.tv-directory-head { color: var(--tv-muted); font-size: clamp(12px, 1.2vw, 18px); padding: 5px 7px; }
.tv-desk { position: relative; border-top: 1px solid var(--tv-rule); padding: clamp(5px, 1.3vh, 15px) 7px; }
.tv-directory-head, .tv-desk { padding-inline-start: var(--tv-arrow-space); }
.tv-desk.is-calling { background: #153c52; box-shadow: inset 3px 0 var(--tv-direction); }
.tv-desk.is-calling .tv-desk-index { color: var(--tv-direction); }
.tv-call-arrow {
  position: absolute; inset-inline-start: 6px; top: 50%;
  width: calc(var(--tv-arrow-space) - 14px); color: var(--tv-direction);
  transform: translateY(-50%); pointer-events: none;
}
.tv-call-arrow.is-nudging { animation: tv-call-nudge .82s ease-in-out 5; }
@keyframes tv-call-nudge {
  50% { transform: translate(8px, -50%); }
}
.tv-desk-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tv-desk-index { color: var(--tv-highlight); font-size: clamp(14px, 1.5vw, 22px); font-variant-numeric: tabular-nums; }
.tv-desk-name strong { display: block; font-size: clamp(17px, 2.04vw, 36px); line-height: 1.28; }
.tv-desk-name strong, .tv-destination strong { overflow-wrap: anywhere; }
.tv-desk-name small { display: block; color: var(--tv-muted); font-size: clamp(11px, 1.2vw, 18px); }
.tv-desk-ticket { color: var(--tv-ink); font-size: clamp(19px, 2.5vw, 41px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-desk-ticket.long-code { font-size: clamp(10px, 1.15vw, 24px); white-space: nowrap; overflow-wrap: normal; }
.tv-many .tv-desk { padding-block: clamp(4px, .65vh, 8px); }
.tv-many .tv-desk-name strong { font-size: clamp(14px, 1.25vw, 23px); }
.tv-many .tv-desk-name small { font-size: clamp(10px, .95vw, 14px); }
.tv-many .tv-desk-ticket { line-height: 1.2; }
.tv-many .tv-desk-ticket:not(.long-code) { font-size: clamp(17px, 1.55vw, 29px); }
.tv-many .tv-previous { font-size: clamp(13px, 1.2vw, 21px); }
.tv-previous { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 7px; color: var(--tv-muted); font-size: clamp(14px, 1.7vw, 26px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-previous > span { min-width: 0; overflow-wrap: anywhere; }
.tv-up-next { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--tv-rule); }
.tv-up-next h2 { align-self: center; padding: 7px 12px; color: var(--tv-highlight); font-size: clamp(14px, 1.45vw, 24px); }
.tv-up-next > div { min-width: 0; padding: 7px 11px; }
.tv-up-next > div { border-left: 1px solid var(--tv-rule); }
.tv-up-next > div > span { color: var(--tv-muted); font-size: clamp(12px, 1.35vw, 21px); }
.tv-up-next small { color: var(--tv-highlight); margin-left: 3px; }
.tv-next-numbers { display: flex; flex-wrap: wrap; gap: 3px 12px; font-variant-numeric: tabular-nums; font-size: clamp(15px, 1.9vw, 28px); }
.tv-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 13px; }
.tv-message { color: var(--tv-muted); font-size: 14px; }
.tv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tv-sound-status { flex-basis: 100%; color: var(--tv-muted); text-align: end; font-size: 13px; }
.tv-sound-status.has-error { color: #ffd09a; }
.tv-tools .btn { min-height: 35px; background: transparent; color: var(--tv-ink); border-color: var(--tv-rule); font-size: 13px; padding: 4px 8px; }
.tv-tools .btn:hover, .tv-tools .btn[aria-pressed=true] { background: #153c52; }
.tv-tools .btn .icon { width: 15px; height: 15px; }
.tv .lang { border-color: var(--tv-rule); }
.tv .connection { color: var(--tv-highlight); padding-right: 3px; }
.tv .connection.offline { color: #ffd0ac; }
.tv :focus-visible { outline-color: var(--tv-highlight); }
@media (min-width: 621px) {
  .tv-many .tv-current-call { align-self: start; position: sticky; top: 16px; min-height: min(56vh, 520px); }
}
@media (min-width: 621px) and (max-height: 820px) {
  .tv-many { gap: 10px; padding-block: 12px; }
  .tv-many .tv-desk { padding-block: 4px; }
}

.receipt-page { padding: 16px; min-height: 100vh; display: grid; align-content: start; justify-items: center; gap: 10px; }
.receipt { max-width: 100%; background: #fff; padding: 4mm; color: #000; text-align: center; }
.receipt h1 { font-size: 13px; }
.receipt p { font-size: 12px; }
.receipt .receipt-secondary { font-size: 10px; }
.receipt hr { border: 0; border-top: 1px solid #111; margin: 2.2mm 0; }
.receipt .big { display: block; font-size: 62px; line-height: 1.04; font-variant-numeric: tabular-nums; }
.receipt .code { font-variant-numeric: tabular-nums; }
.reports-page, .report-print {
  --report-gutter: clamp(14px, 2.5vw, 30px);
  --report-wash: #f5fafc;
  --report-accent-ink: #075478;
}
.reports-page { display: grid; gap: 16px; }
.reports-page .page-head { margin-bottom: 2px; }
.report-views { display: flex; flex-wrap: wrap; gap: 6px 20px; border-bottom: 1px solid var(--line); }
.report-views a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 6px 6px 9px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 650;
}
.report-views a:hover { color: var(--ink); }
.report-views a[aria-current="page"] { color: var(--report-accent-ink); border-bottom-color: var(--brand); }
.report-filters, .report-filter-fields, .report-exports, .telegram-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}
.report-filters { justify-content: space-between; gap: 12px; padding: 12px 16px; }
.report-filter-fields label, .telegram-filters label { font-size: 13px; color: var(--muted); }
.report-filter-fields input, .telegram-filters input {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.report-filter-fields .btn, .report-exports .btn, .telegram-filters .btn { min-height: 43px; }
.report-sheet {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 26px rgba(12, 42, 58, .045);
}
.report-period {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 20px var(--report-gutter);
}
.report-period-label { color: var(--report-accent-ink); font-size: 13px; font-weight: 700; }
.report-period h2 { margin-top: 4px; font-size: clamp(22px, 2.6vw, 32px); }
.report-period time, .report-figures dd, .report-table td { font-variant-numeric: tabular-nums; }
.report-period h2 time { white-space: nowrap; }
.report-date-separator, .report-period-meta { color: var(--muted); }
.report-period-meta { font-size: 13px; text-align: end; }
.report-current { margin-bottom: 3px; color: var(--report-accent-ink); font-weight: 700; }
.report-timezone { display: block; font-size: 12px; }
.report-figures {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1px;
  border-block: 1px solid var(--line);
  background: var(--line);
}
.report-figures > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 12px clamp(11px, 2vw, 25px);
  background: var(--report-wash);
}
.report-figures > div:first-child { background: var(--sky); }
.report-figures dt { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.report-figures dd { margin-top: 3px; font-size: clamp(27px, 3.3vw, 42px); font-weight: 700; line-height: 1.12; }
.report-figures > div:first-child dd { color: var(--report-accent-ink); }
.report-rooms { padding: 19px var(--report-gutter) 6px; }
.report-rooms h3 { margin-bottom: 12px; font-size: 18px; }
.report-table { table-layout: fixed; }
.report-table :is(th,td) { padding: 10px clamp(6px, 1vw, 13px); overflow-wrap: anywhere; }
.report-table thead th { background: var(--report-wash); line-height: 1.5; vertical-align: bottom; }
.report-table thead th:first-child { width: 32%; }
.report-table thead th:nth-child(2) { width: 14%; }
.report-table thead th:nth-child(3) { width: 12%; }
.report-table thead th:nth-child(4) { width: 18%; }
.report-table tbody tr:hover { background: var(--report-wash); }
.report-room { display: flex; align-items: center; gap: 9px; }
.report-room .room-number {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: var(--sky);
  color: var(--report-accent-ink);
  font-size: 12px;
}
.report-table small, .report-note { color: var(--muted); }
.report-cell-label { display: none; }
.report-wait-track {
  display: block;
  width: min(100%, 90px);
  height: 3px;
  margin-top: 3px;
  border-radius: 3px;
  background: var(--sky);
}
.report-wait-track > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.report-note { padding: 12px var(--report-gutter); border-top: 1px solid var(--line); font-size: 12px; }

.telegram-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.telegram-workspace > .panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(12, 42, 58, .045);
}
.telegram-panel-head { padding: 21px var(--report-gutter) 0; }
.telegram-panel-head h2 { font-size: clamp(20px, 2vw, 26px); line-height: 1.45; }
.telegram-panel-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.telegram-panel-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
}
.telegram-panel-heading .pill { padding: 3px 8px; border-radius: 20px; }
.telegram-filters { padding: 15px var(--report-gutter) 20px; }
.telegram-filters > label { flex: 0 1 160px; }
.telegram-error { padding: 0 var(--report-gutter) 14px; color: var(--rust); font-size: 13px; }
#telegram-schedule-form { display: grid; gap: 13px; margin: 16px var(--report-gutter) 19px; }
#telegram-schedule-form .btn { justify-self: start; }
.telegram-schedule-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--report-wash);
  font-size: 14px;
  cursor: pointer;
}
.telegram-schedule-toggle input { flex: 0 0 auto; margin: 0; }
.telegram-schedule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.telegram-schedule-fields label { min-width: 0; color: var(--muted); font-size: 13px; }
.telegram-schedule-fields :is(input, select) { min-width: 0; font-variant-numeric: tabular-nums; }
.telegram-schedule-status { padding: 12px var(--report-gutter) 15px; border-top: 1px solid var(--line); }
.telegram-schedule-status .btn { font-size: 13px; color: var(--report-accent-ink); }
.telegram-schedule-status .btn:disabled { color: var(--muted); }
.telegram-status-list { font-size: 13px; }
.telegram-status-list > div {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 7px;
  align-items: baseline;
  padding: 8px 0;
}
.telegram-status-list > div + div { border-top: 1px solid var(--line); }
.telegram-status-list dt { color: var(--muted); }
.telegram-status-list dd { text-align: end; overflow-wrap: anywhere; }
.telegram-status-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.telegram-schedule-note { margin-top: 6px; }
.status-ok { color: #235341; }
.status-attention { color: var(--rust); }
.telegram-pdf {
  margin: 0 var(--report-gutter) 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--report-wash);
}
.telegram-pdf-file { display: flex; align-items: center; gap: 11px; padding: 13px 14px; }
.telegram-pdf-file h3 { font-size: 15px; line-height: 1.6; }
.telegram-file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 41px;
  height: 44px;
  border-radius: 6px;
  background: var(--sky);
  color: var(--report-accent-ink);
}
.telegram-file-icon .icon { width: 21px; height: 21px; }
.telegram-filenames { display: grid; gap: 9px; padding: 12px 14px; border-block: 1px solid var(--line); }
.telegram-filenames dt { color: var(--muted); font-size: 12px; }
.telegram-filenames dd { margin-top: 2px; font-size: 13px; overflow-wrap: anywhere; }
.telegram-delivery { display: grid; gap: 12px; padding: 13px 14px; }
.telegram-result { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; overflow-wrap: anywhere; }
.telegram-result .icon { width: 16px; height: 16px; margin-top: 2px; }
.telegram-result strong { display: block; line-height: 1.45; }
.telegram-result p { margin-top: 2px; color: var(--muted); }
.telegram-result[data-tone="success"] { color: #235341; }
.telegram-result[data-tone="attention"] { color: var(--rust); }
.telegram-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.telegram-buttons .btn { min-height: 44px; }
.telegram-text { padding: 0 var(--report-gutter) 14px; }
.telegram-text > summary {
  width: fit-content;
  padding: 3px 0;
  color: var(--report-accent-ink);
  font-size: 13px;
  cursor: pointer;
}
.telegram-message {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--report-wash);
}
.telegram-message > header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}
.telegram-message > header .btn { margin-inline-start: auto; }
.telegram-message pre {
  margin: 0;
  padding: 14px clamp(12px, 2vw, 23px);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.65;
}
.telegram-message pre strong:first-child { color: var(--report-accent-ink); font-size: 1.1em; }

.report-print { max-width: 920px; margin: auto; padding: 20px; }
.report-print .print-actions { display: flex; justify-content: end; margin-bottom: 12px; }
.report-print-heading { display: grid; gap: 5px; margin-bottom: 14px; }
.report-print-heading .brand { margin-bottom: 7px; }
.report-print-heading h1 { font-size: clamp(23px, 4vw, 34px); }
.report-print-heading p { color: var(--muted); }

@media (max-width: 1090px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .overview-layout { grid-template-columns: minmax(0, 1fr); }
  .overview-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-grid { grid-template-columns: minmax(210px, .47fr) minmax(0, 1fr); }
}
@media (max-width: 1050px) {
  .telegram-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 830px) {
  .shell { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; height: auto; padding: 10px 15px; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; }
  .sidebar .brand { margin: 0; }
  .sidebar .brand-type { max-width: none; overflow-wrap: anywhere; }
  #staff-menu-toggle { display: inline-flex; }
  .sidebar .nav span:last-child { min-width: 0; overflow-wrap: anywhere; }
  .sidebar nav { display: none; grid-row: 2; grid-column: 1 / -1; gap: 7px; padding: 7px 0 0; border-top: 1px solid var(--line); }
  .sidebar nav.is-open { display: grid; }
  .nav-group { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav-label { flex-basis: 100%; padding: 4px 6px; }
  .nav { min-height: 44px; padding: 4px 7px; font-size: 13px; }
  .nav .icon { width: 15px; height: 15px; }
  .nav-room-number { flex-basis: auto; }
  .user-card { margin-top: 0; border: 0; padding: 0; }
  .user-card .avatar, .user-card > div { display: none; }
  .kiosk-layout { gap: 20px; }
}
@media (max-width: 700px) {
  .login-main, .kiosk-layout { grid-template-columns: minmax(0, 1fr); }
  .login-main { gap: 24px; align-content: start; }
  .login-main .login-box { grid-row: 1; width: 100%; }
  .login-copy { border: 0; padding: 0; }
  .login-description { font-size: 20px; }
  .login-shortcuts { margin-top: 12px; }
  .responsive-records, .responsive-records tbody { display: block; min-width: 0; }
  .responsive-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-records tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .responsive-records tbody tr:last-child { border-bottom: 0; }
  .responsive-records :is(th,td) { border: 0; padding: 4px 0; }
  .responsive-records .patient-cell { max-width: none; }
  .responsive-records td:last-child { grid-column: 1 / -1; }
  .responsive-records .row-actions { min-width: 0; max-width: none; }
  .responsive-records .row-actions .btn { width: 43px; min-height: 43px; }
  .record-field-label { display: inline; margin-inline-end: 5px; font-size: 12px; }
  .history-filters > :is(label, .btn) { flex: 1 1 100%; max-width: none; }
}
@media (max-width: 620px) {
  .topbar { align-items: start; flex-wrap: wrap; gap: 7px; }
  .top-actions { justify-content: flex-start; }
  .clock-box { display: none; }
  .content { padding-top: 16px; }
  .measures, .measures.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .measures > div:nth-child(odd) { border-left: 0; }
  .measures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .room-directory table { min-width: 0; }
  .room-directory :is(th,td) { padding: 8px 6px; }
  .room-directory thead th { font-size: 11px; }
  .room-directory :is(th,td):nth-child(4), .room-directory .desk-en { display: none; }
  .desk-mobile-state { display: block; }
  .desk-mobile-state .desk-state { font-size: 12px; }
  .room-directory .room-number { flex-basis: 25px; width: 25px; height: 25px; font-size: 12px; }
  .desk-name { gap: 5px; }
  .desk-name strong { font-size: 13px; }
  .room-directory td small { overflow-wrap: anywhere; }
  .row-link .icon { display: none; }
  .control-grid, .settings-grid, .overview-side, .tv-layout { grid-template-columns: minmax(0, 1fr); }
  .public-header, .public-identity { flex-wrap: wrap; gap: 5px 11px; }
  .public-tools { justify-content: flex-start; }
  .kiosk-layout { align-items: start; }
  .tv-current-call { min-height: 162px; padding: 13px; }
  .tv-desk { padding: 6px; padding-inline-start: var(--tv-arrow-space); }
  .tv .public-identity .brand-type { max-width: 21ch; }
  .tv-up-next { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-up-next h2 { grid-column: 1 / -1; padding: 6px; border-bottom: 1px solid var(--tv-rule); }
  .tv-up-next > div { padding: 6px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media screen and (max-width: 680px) {
  .report-filters { padding: 12px; }
  .report-filter-fields, .report-exports { flex: 1 1 100%; }
  .report-filter-fields label, .report-exports .btn { flex: 1 1 0; min-width: 0; }
  .report-filter-fields .btn { flex: 1 1 100%; }
  .report-period { align-items: start; flex-direction: column; padding-block: 16px; }
  .report-period-meta { text-align: start; }
  .report-timezone { display: inline; margin-inline-start: 4px; }
  .report-figures { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-figures > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .report-table, .report-table tbody { display: block; }
  .report-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-block: 9px;
    border-bottom: 1px solid var(--line);
  }
  .report-table tbody tr:last-child { border-bottom: 0; }
  .report-table :is(th,td) { border: 0; padding: 4px 5px; }
  .report-table th[scope="row"] { grid-column: 1 / -1; margin-bottom: 3px; }
  .report-cell-label { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
  .telegram-filters > label { flex-grow: 1; }
  .telegram-buttons .btn { flex: 1 1 auto; }
}
@media screen and (max-width: 440px) {
  .telegram-filters > :is(label, .btn) { flex: 1 1 100%; }
}
@media print {
  html, body, #app { background: #fff; }
  .receipt-page { display: block; padding: 0; min-height: 0; }
  .receipt, .report-print { margin: 0 auto; }
  .receipt-tools, .print-actions, .toasts, dialog { display: none !important; }
  .report-print { padding: 0; }
  .report-sheet { box-shadow: none; }
  .report-period, .report-figures, .report-table tr, .report-note { break-inside: avoid; }
  .report-table :is(th,td) { padding: 6px; }
  .report-figures dd { font-size: 26px; }
  .report-wait-track { display: none; }
  .table-wrap { overflow: visible; }
}

/* Queue alerts and device pairing */
.hqms-alert-bell{position:relative;flex:none}
.hqms-alert-bell.active{background:#e0f4fc;color:#075b7c}
.hqms-alert-badge{position:absolute;inset:-6px -6px auto auto;display:grid;place-items:center;min-width:22px;height:22px;padding:0 4px;border:2px solid white;border-radius:999px;background:#04a7e5;color:#0c2a3a;font:700 11px/1 system-ui}
.hqms-alert-panel{overflow:hidden}
.hqms-alert-list{list-style:none;padding:0;margin:0}
.hqms-alert-list li{border-bottom:1px solid #e3eef4}
.hqms-alert-list li:last-child{border:0}
.hqms-alert-link{display:grid;grid-template-columns:42px minmax(0,1fr) auto 18px;gap:14px;align-items:center;padding:14px 18px;color:inherit;text-decoration:none}
.hqms-alert-link:hover,.hqms-alert-link:focus-visible{background:#edf8fd}
.hqms-alert-link:focus-visible{outline:2px solid #00739e;outline-offset:-3px}
.hqms-alert-link>.icon{width:18px;color:#086188}
.hqms-device-list li{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px 18px}
.toasts a.toast{pointer-events:auto;text-decoration:underline;text-underline-offset:3px}
#alert-ticket-target{outline:2px solid #00739e;outline-offset:-2px;scroll-margin-block:5rem 1rem}
.hqms-alert-list strong,.hqms-alert-list small,.hqms-alert-meta time{display:block;overflow-wrap:anywhere}
.hqms-alert-list small,.hqms-alert-meta time,.hqms-alert-form small{color:#4c6474}
.hqms-alert-symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#e0f3fd;color:#086188}
.hqms-alert-symbol svg{width:21px;height:21px}
.hqms-alert-symbol[data-kind=completed]{background:#e2f4ed;color:#265f48}
.hqms-alert-symbol[data-kind=payment_waiting],.hqms-alert-symbol[data-kind=skipped]{background:#fff2dc;color:#774b19}
.hqms-alert-symbol[data-kind=cancelled]{background:#faeae5;color:#893c28}
.hqms-alert-meta{text-align:right}
.hqms-alert-meta b{font-variant-numeric:tabular-nums;font-size:1.45rem;line-height:1.15;color:#075b7c}
.hqms-alert-meta time{font-size:.82rem}
.hqms-alert-empty{min-height:140px;display:grid;justify-items:center;align-content:center;gap:10px}
.hqms-alert-form,.hqms-alert-config{display:grid;gap:14px}
.hqms-alert-form label{display:grid;gap:6px}
.hqms-alert-form .switch-line,.hqms-alert-options label{display:flex;gap:10px;align-items:center}
.hqms-alert-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;border:1px solid #d8e8ef;border-radius:12px;padding:12px}
.hqms-alert-options input{width:18px;height:18px;accent-color:#04a7e5}
.hqms-alert-panel>.notice{margin:12px}
@media(max-width:540px){
  .hqms-alert-link{padding:12px;gap:8px;grid-template-columns:34px minmax(0,1fr) minmax(0,6.6rem) 16px}
  .hqms-device-list li{padding:12px;gap:9px;grid-template-columns:34px minmax(0,1fr) auto}
  .hqms-alert-link>.icon{width:16px}
  .hqms-alert-symbol{width:34px;height:34px;border-radius:10px}
}
