:root {
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #edf3f0; --text: #18302b;
  --muted: #6f827d; --line: #dce7e2; --brand: #176b5d; --brand-2: #d8eee8;
  --danger: #c4554b; --shadow: 0 16px 50px rgba(31, 75, 65, .08);
}
* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans SC", "Microsoft YaHei", "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { min-height:68px; height:auto; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:max(8px, env(safe-area-inset-top)) max(20px, calc((100vw - 1440px)/2)) 8px; background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:10; overflow:visible; }
.brand, .login-logo { font-size:20px; font-weight:900; letter-spacing:.08em; color:var(--text); text-decoration:none; }
.brand span, .login-logo span { color:var(--brand); }
.brand { flex:0 0 auto; }
.topbar-actions { min-width:0; display:flex; align-items:center; justify-content:flex-end; gap:8px; overflow-x:auto; scrollbar-width:none; padding:2px 0; }
.topbar-actions::-webkit-scrollbar { display:none; }
.topbar-actions form { margin:0; }
.merchant-name { font-size:13px; color:var(--muted); margin-right:10px; }
.icon-button, .ghost-link { border:1px solid var(--line); background:transparent; color:var(--text); border-radius:10px; padding:8px 12px; min-height:40px; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; cursor:pointer; white-space:nowrap; flex:0 0 auto; }
.page { max-width:1440px; margin:auto; padding:34px 20px 60px; }
.hero-actions { display:flex; align-items:flex-end; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.terminal-printer-picker { display:grid; gap:5px; color:var(--muted); font-size:12px; font-weight:700; min-width:210px; }
.terminal-printer-picker select { min-height:40px; padding:8px 10px; background:var(--surface); }
.hero-row { display:flex; justify-content:space-between; align-items:end; gap:24px; margin-bottom:28px; }
h1, h2, h3, p { margin-top:0; }
h1 { font-size:clamp(28px, 4vw, 44px); letter-spacing:-.04em; margin-bottom:8px; }
h2 { font-size:21px; }
.eyebrow { color:var(--brand); font-size:11px; font-weight:900; letter-spacing:.18em; margin-bottom:7px; }
.muted { color:var(--muted); }
.primary-button, .danger-button { border:0; border-radius:12px; padding:13px 20px; min-height:44px; color:white; font-weight:800; cursor:pointer; }
.primary-button { background:var(--brand); }
.danger-button { background:var(--danger); width:100%; }
.ghost-button { width:100%; min-height:44px; border:1px solid var(--line); background:var(--surface); color:var(--brand); border-radius:10px; padding:10px; font-weight:800; cursor:pointer; }
.stats-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; margin-bottom:38px; }
.settings-stats { margin-bottom:18px; }
.stats-grid article { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:18px; }
.stats-grid span { display:block; color:var(--muted); font-size:12px; margin-bottom:8px; }
.stats-grid strong { font-size:22px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.section-heading h2 { margin:0; }
.legend { color:var(--muted); font-size:12px; display:flex; gap:6px; align-items:center; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; margin-left:8px; }
.dot.available { background:#6eaa72; }.dot.in-use { background:#47a66b; }.dot.due-soon { background:#d2a744; }.dot.overdue { background:#d86a5f; }.dot.cleaning, .dot.reserved { background:#7198bd; }
.room-grid { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:8px; align-items:stretch; }
.empty-board { grid-column:1 / -1; background:var(--surface); border:1px dashed var(--line); border-radius:18px; padding:36px; text-align:center; color:var(--muted); }
.empty-board h3 { color:var(--text); margin-bottom:8px; }
.room-card { min-height:206px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:10px; box-shadow:var(--shadow); display:flex; flex-direction:column; overflow:hidden; }
.room-card.tappable { cursor:pointer; transition:transform .15s ease, background .15s ease, border-color .15s ease; }
.room-card.tappable:hover { transform:translateY(-1px); background:var(--brand-2); border-color:rgba(23,107,93,.25); }
.room-card.tappable:focus-visible { outline:3px solid var(--brand-2); outline-offset:3px; }
.room-card.active.in_use { border-top:5px solid #47a66b; }
.room-card.active.due_soon { background:#fff4cc; border-color:#e0b742; border-top:5px solid #d2a744; }
.room-card.active.overdue { background:#ffe3de; border-color:#dd8f86; border-top:5px solid #d86a5f; }
.room-card.cleaning { border-top:4px solid #7198bd; }
.room-card.reserved { border-top:4px solid #4c89c8; }
.room-top { display:flex; justify-content:space-between; color:var(--muted); font-size:11px; text-transform:uppercase; }
.status-pill { color:var(--brand); background:var(--brand-2); padding:4px 8px; border-radius:99px; font-weight:800; }
.room-card.active.in_use .status-pill { color:#226f3e; background:#dff3e7; }
.room-card.active.due_soon .status-pill { color:#7b5600; background:#ffe3a3; }
.room-card.active.overdue .status-pill { color:#8f2b24; background:#ffcfc8; }
.room-card.reserved .status-pill { color:#2f669e; background:#dcecff; }
.room-card h3 { font-size:18px; margin:10px 0 4px; line-height:1.15; }
.room-title-line { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.room-title-line h3 { margin:9px 0 2px; }
.room-title-line span { color:var(--muted); font-weight:800; }
.session-number-card { display:grid; gap:2px; margin:10px 0 5px; }
.session-number-card span { color:var(--muted); font-size:10px; font-weight:900; letter-spacing:.08em; }
.session-number-card strong { color:var(--text); font-size:30px; line-height:1; letter-spacing:.06em; font-weight:900; }
.rule-name, .empty-message { color:var(--muted); font-size:11px; min-height:22px; line-height:1.3; }
.session-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 8px; color:var(--muted); font-size:10px; margin-top:2px; }
.live-numbers { display:flex; align-items:end; justify-content:space-between; margin:4px 0 3px; }
.live-numbers strong:first-child { font-size:22px; }.live-numbers small { font-size:10px; margin-left:3px; }
.live-numbers strong:last-child { font-size:18px; color:var(--brand); }
.room-card.active.due_soon .live-numbers strong:last-child { color:#805900; }
.room-card.active.overdue .live-numbers strong:last-child { color:#983229; }
.cap { text-align:right; font-size:11px; color:var(--muted); }
.card-actions { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:auto; }
.card-actions.quad { grid-template-columns:repeat(2, 1fr); }
.card-actions a, .card-actions button { border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:4px 3px; min-height:30px; text-align:center; text-decoration:none; cursor:pointer; font-size:11px; line-height:1.15; display:flex; align-items:center; justify-content:center; }
.card-actions button { background:var(--brand); color:white; border-color:var(--brand); }
.card-actions.quad button:nth-child(3) { background:var(--surface-2); color:var(--brand); border-color:var(--line); }
.room-card > .ghost-button { margin-top:auto; }
.tap-hint { margin-top:auto; color:var(--brand); font-weight:900; font-size:13px; }
dialog { border:0; border-radius:20px; padding:0; background:var(--surface); color:var(--text); box-shadow:0 30px 100px rgba(0,0,0,.35); width:min(92vw, 560px); max-height:calc(100dvh - 28px); overflow:auto; }
dialog::backdrop { background:rgba(7,20,16,.55); backdrop-filter:blur(4px); }
.dialog-card { padding:28px; position:relative; display:grid; gap:14px; }
.dialog-close { position:absolute; right:18px; top:18px; border:0; background:var(--surface-2); color:var(--text); width:30px; height:30px; border-radius:50%; cursor:pointer; }
.dialog-card label, .stack-form label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:700; }
input, select, textarea { width:100%; min-height:44px; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:10px; padding:11px; outline-color:var(--brand); }
input::placeholder, textarea::placeholder { color:#9aaaa5; font-weight:500; opacity:1; }
.people-input { cursor:pointer; caret-color:transparent; }
.people-keypad[hidden] { display:none; }
.people-keypad { display:grid; gap:12px; padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); }
.keypad-header { display:flex; justify-content:space-between; align-items:center; color:var(--text); }
.keypad-close { border:0; width:28px; height:28px; border-radius:50%; background:var(--surface); color:var(--text); cursor:pointer; }
.keypad-display { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px; text-align:center; font-size:22px; font-weight:900; letter-spacing:.06em; }
.keypad-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.keypad-key { min-height:48px; border:0; border-radius:12px; background:var(--surface); color:var(--text); font-size:22px; font-weight:900; cursor:pointer; box-shadow:0 1px 0 rgba(0,0,0,.03); }
.keypad-key:active { transform:translateY(1px); }
.keypad-key.backspace { background:var(--text); color:var(--surface); }
.keypad-confirm { width:100%; min-height:48px; }
.checkout-summary { background:var(--surface-2); padding:20px; border-radius:14px; display:flex; justify-content:space-between; align-items:center; }
.checkout-summary strong:last-child { color:var(--brand); font-size:24px; }
.detail-list { display:grid; gap:8px; }
.detail-list div { display:flex; justify-content:space-between; gap:18px; padding:10px 0; border-bottom:1px solid var(--line); }
.detail-list span { color:var(--muted); font-size:12px; }
.detail-list strong { text-align:right; }
.detail-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:4px; }
.detail-actions .secondary-button:only-child { grid-column:1 / -1; }
.login-page, .public-body { min-height:100vh; display:grid; place-items:center; padding:20px; background:radial-gradient(circle at top right, var(--brand-2), var(--bg) 50%); }
.login-card, .public-card { width:min(100%, 440px); background:var(--surface); padding:38px; border:1px solid var(--line); border-radius:24px; box-shadow:var(--shadow); }
.login-card h1 { margin-top:35px; margin-bottom:24px; }
.login-lang-form { display:flex; justify-content:flex-end; margin:-12px 0 12px; }
.stack-form { display:grid; gap:15px; }
.demo-note, .public-note { color:var(--muted); font-size:11px; text-align:center; margin:18px 0 0; }
.flash { max-width:900px; margin:0 auto 20px; background:var(--brand-2); color:var(--brand); padding:12px 16px; border-radius:10px; }
.flash.warning { background:#fff4d2; color:#8a6100; }
.flash.error { background:#f7deda; color:#9f3f37; }
.settings-grid { display:grid; grid-template-columns:1fr 1.5fr; gap:18px; }
.settings-extra { grid-template-columns:1.5fr 1fr; margin-top:18px; }
.settings-menu { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:24px; margin-bottom:18px; }
.settings-menu-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-top:18px; }
.settings-menu-button { position:relative; display:grid; grid-template-columns:auto 1fr; gap:4px 12px; align-items:center; min-height:82px; padding:16px; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); color:var(--text); text-decoration:none; transition:background .15s ease, transform .15s ease; }
.settings-menu-button:hover { background:var(--brand-2); transform:translateY(-1px); }
.settings-menu-button::after { content:"›"; position:absolute; right:16px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:24px; }
.settings-menu-button span { grid-row:1 / span 2; width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center; background:var(--surface); color:var(--brand); font-size:11px; font-weight:900; letter-spacing:.04em; }
.settings-menu-button strong { padding-right:24px; }
.settings-menu-button small { color:var(--muted); padding-right:24px; line-height:1.35; }
.settings-section-back { grid-column:1 / -1; justify-self:start; margin-bottom:12px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:24px; }
.mode-panel, .merchant-panel, .receipt-panel { display:grid; grid-template-columns:1fr 1.4fr; gap:24px; margin-bottom:18px; align-items:start; }
.printer-panel { margin-bottom:18px; }
.printer-panel-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.print-warning { margin:10px 0 0; color:var(--danger); font-size:12px; line-height:1.55; }
.printer-add { border-top:0; margin-top:0; margin-left:auto; padding-top:0; flex:0 0 min(360px, 100%); }
.printer-add summary { white-space:nowrap; }
.printer-list .printer-item { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.printer-connection-form { flex:1 1 860px; display:grid; grid-template-columns:minmax(120px, 1.1fr) minmax(120px, .9fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) 70px auto; gap:6px; align-items:center; min-width:0; }
.printer-connection-form input, .printer-connection-form select { min-height:36px; padding:7px 9px; font-size:12px; }
.printer-connection-form button { min-height:36px; padding:7px 10px; white-space:nowrap; }
.token-chip { display:block; max-width:100%; overflow:auto; white-space:nowrap; padding:9px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--brand); font-size:11px; }
.printer-actions { display:flex; flex:0 1 auto; max-width:100%; gap:6px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.printer-actions form { margin:0; }
.printer-actions .secondary-button, .printer-actions .small-danger { min-height:36px; padding:7px 10px; font-size:12px; white-space:nowrap; }
.printer-api-note { display:flex; gap:8px; flex-wrap:wrap; align-items:center; color:var(--muted); font-size:12px; }
.printer-api-note code { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:5px 7px; color:var(--text); }
.mode-options { display:grid; grid-template-columns:1fr 1fr auto; gap:12px; align-items:stretch; }
.mode-option { display:flex; gap:10px; align-items:flex-start; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); cursor:pointer; }
.mode-option input { width:auto; margin-top:4px; }
.mode-option span { display:grid; gap:4px; }
.mode-option small { color:var(--muted); line-height:1.45; }
.check-option { display:flex !important; grid-template-columns:none !important; gap:10px !important; align-items:flex-start; padding:13px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--text) !important; cursor:pointer; }
.check-option input { width:auto; margin-top:4px; }
.check-option span { display:grid; gap:3px; }
.check-option small { color:var(--muted); font-weight:500; line-height:1.45; }
.item-list { display:grid; gap:8px; margin:20px 0 28px; }
.item-list > div { display:grid; gap:8px; padding:12px; background:var(--surface-2); border-radius:10px; }
.item-list > .clickable-item { position:relative; display:flex; align-items:center; justify-content:space-between; gap:12px; transition:background .15s ease, transform .15s ease; }
.item-list > .clickable-item:hover { background:var(--brand-2); transform:translateY(-1px); }
.item-card-link { flex:1; display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--text); text-decoration:none; }
.item-card-link::after { content:""; position:absolute; inset:0; border-radius:10px; z-index:0; }
.item-card-link > *, .clickable-item form { position:relative; z-index:1; }
.item-row { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.item-list strong { flex:1; }
.item-list span { color:var(--muted); font-size:11px; text-align:right; }
.item-list form { margin:0; }
.small-danger { border:1px solid rgba(196,85,75,.35); color:var(--danger); background:transparent; border-radius:8px; padding:7px 10px; min-height:38px; cursor:pointer; font-weight:800; }
.item-edit summary { display:inline-flex; width:max-content; border:1px solid var(--line); background:var(--surface); color:var(--brand); border-radius:8px; padding:7px 12px; font-size:12px; font-weight:800; cursor:pointer; list-style:none; }
.item-edit summary::-webkit-details-marker { display:none; }
.inline-edit-form { display:grid; gap:10px; margin-top:10px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.inline-actions { display:flex; justify-content:flex-end; }
.inline-actions .primary-button { padding:10px 18px; }
.compact { border-top:1px solid var(--line); padding-top:24px; }
.collapsible-form { border-top:1px solid var(--line); padding-top:18px; margin-top:20px; }
.collapsible-form summary { display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:12px 18px; border-radius:12px; background:var(--brand); color:white; font-weight:900; cursor:pointer; list-style:none; }
.collapsible-form summary::-webkit-details-marker { display:none; }
.collapsible-form summary:focus-visible { outline:3px solid var(--brand-2); outline-offset:3px; }
.collapsible-form[open] summary { margin-bottom:18px; background:var(--surface-2); color:var(--brand); border:1px solid var(--line); }
.collapsible-form .compact { border-top:0; padding-top:0; }
.form-actions { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; }
.secondary-button { border:1px solid var(--line); background:var(--surface); color:var(--brand); border-radius:12px; padding:13px 18px; min-height:44px; font-weight:800; cursor:pointer; text-decoration:none; text-align:center; }
.form-pair, .form-triple { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.form-triple { grid-template-columns:repeat(3,1fr); }
.edit-panel { max-width:820px; margin:0 auto; }
.resume-panel { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); display:grid; gap:12px; }
.history-search { margin-bottom:18px; }
.history-form { display:grid; grid-template-columns:1.4fr repeat(2, .8fr) auto auto; gap:12px; align-items:end; }
.history-form label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:700; }
.history-reset { text-align:center; text-decoration:none; }
.history-heading { margin-bottom:16px; }
.history-table { display:grid; gap:8px; }
.history-row { display:grid; grid-template-columns:1.05fr 1fr .55fr 1.15fr 1.15fr .65fr .75fr .75fr 1fr; gap:10px; align-items:center; padding:12px; border-radius:12px; background:var(--surface-2); font-size:12px; }
.history-head { background:transparent; color:var(--muted); font-size:11px; font-weight:900; padding-top:0; padding-bottom:0; }
.history-row strong { color:var(--text); }
.history-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.history-actions form { margin:0; }
.history-actions a, .history-actions button { border:1px solid var(--line); border-radius:8px; padding:6px 8px; color:var(--brand); background:var(--surface); text-decoration:none; font-weight:800; cursor:pointer; font-size:12px; }
.empty-history { background:var(--surface-2); border-radius:14px; padding:28px; text-align:center; color:var(--muted); }
.empty-history h3 { color:var(--text); margin-bottom:8px; }
.control-list { display:grid; gap:10px; }
.control-row { display:grid; grid-template-columns:1.2fr .8fr .7fr .7fr auto; gap:10px; align-items:end; padding:12px; background:var(--surface-2); border-radius:12px; }
.control-row strong { display:block; margin-bottom:4px; }
.control-row span, .control-row label { color:var(--muted); font-size:12px; font-weight:700; }
.control-row form { display:contents; }
.control-row input, .control-row select { background:var(--surface); }
.control-head { color:var(--muted); font-size:12px; font-weight:900; background:transparent; padding-top:0; padding-bottom:0; }
.public-card { text-align:center; }
.public-amount { background:var(--brand); color:white; border-radius:18px; padding:24px; margin:28px 0; }
.public-amount span { display:block; font-size:12px; opacity:.8; }.public-amount strong { display:block; font-size:44px; margin-top:4px; }
.session-details { display:grid; gap:0; text-align:left; }
.session-details div { display:flex; justify-content:space-between; padding:13px 0; border-bottom:1px solid var(--line); }
.session-details dt { color:var(--muted); }.session-details dd { margin:0; font-weight:800; }
.maintenance-modal-backdrop {
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(8, 22, 18, .52);
  backdrop-filter:blur(2px);
}
.maintenance-modal-backdrop.is-leaving { opacity:0; transition:opacity .12s ease; }
.maintenance-modal {
  width:min(92vw, 680px);
  max-height:calc(100vh - 48px);
  overflow:auto;
  padding:38px;
  border:2px solid #d8e4df;
  border-radius:28px;
  color:#092b25;
  background:#fff;
  box-shadow:0 28px 80px rgba(0, 0, 0, .32);
}
.maintenance-modal h2 {
  margin:0 0 10px;
  color:#092b25;
  font-size:clamp(28px, 4vw, 38px);
  line-height:1.15;
  letter-spacing:.02em;
}
.maintenance-help {
  margin:0 0 24px;
  color:#4b625d;
  font-size:20px;
  line-height:1.55;
}
.maintenance-input {
  width:100%;
  min-height:68px;
  padding:0 20px;
  border:2px solid #d8e4df;
  border-radius:18px;
  color:#092b25;
  background:#fff;
  font-size:24px;
  font-weight:800;
  outline:none;
}
.maintenance-input::placeholder { color:#6e817c; opacity:1; }
.maintenance-input:focus {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(23, 107, 93, .13);
}
.maintenance-options {
  display:grid;
  gap:14px;
  margin-top:6px;
}
.maintenance-option {
  display:grid;
  gap:8px;
  width:100%;
  min-height:92px;
  padding:18px 20px;
  border:2px solid #d8e4df;
  border-radius:20px;
  color:#092b25;
  background:#fff;
  text-align:left;
  cursor:pointer;
}
.maintenance-option strong {
  font-size:24px;
  line-height:1.2;
}
.maintenance-option span {
  color:#50635f;
  font-size:17px;
  line-height:1.45;
}
.maintenance-option.selected {
  border-color:#d99522;
  background:#fff4d8;
  box-shadow:0 0 0 4px rgba(217, 149, 34, .22);
}
.maintenance-option.selected strong {
  color:#6f4300;
}
.maintenance-option.selected span {
  color:#6f4300;
}
.maintenance-option.danger.selected {
  border-color:var(--danger);
  background:#ffe7e2;
  box-shadow:0 0 0 4px rgba(204, 83, 61, .18);
}
.maintenance-option.danger.selected strong,
.maintenance-option.danger.selected span {
  color:#9f3320;
}
.maintenance-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:28px;
}
.maintenance-actions.single { grid-template-columns:1fr; }
.maintenance-action-button {
  min-height:64px;
  border-radius:18px;
  border:1px solid var(--line);
  font-size:22px;
  font-weight:900;
  cursor:pointer;
}
.maintenance-action-button.primary {
  border-color:var(--brand);
  color:#fff;
  background:var(--brand);
}
.maintenance-action-button.secondary {
  color:var(--brand);
  background:#fff;
}
.maintenance-action-button.danger {
  border-color:var(--danger);
  color:#fff;
  background:var(--danger);
}
@media (max-width:1200px) {
  .room-grid { grid-template-columns:repeat(6, 1fr); }
  .history-form { grid-template-columns:1fr 1fr; }
  .history-table { overflow-x:auto; }
  .history-row { min-width:980px; }
  .printer-panel-head { margin-bottom:14px; }
  .printer-list .printer-item { align-items:flex-start; }
  .printer-connection-form { flex-basis:100%; grid-template-columns:minmax(120px, 1fr) minmax(120px, .9fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(110px, .8fr) 70px auto; }
  .printer-actions { width:100%; justify-content:flex-start; }
}
@media (min-width:901px) and (max-width:1200px) and (orientation:landscape) {
  .topbar { min-height:62px; height:auto; padding:max(7px, env(safe-area-inset-top)) 14px 7px; gap:8px; }
  .brand { font-size:18px; }
  .merchant-name { display:none; }
  .topbar-actions { flex:1 1 auto; gap:5px; padding:0; overflow:visible; flex-wrap:wrap; row-gap:4px; }
  .topbar .icon-button { min-height:36px; padding:6px 10px; font-size:13px; line-height:1; border-radius:9px; }
  .page { padding:14px 16px 36px; }
  .hero-row { margin-bottom:12px; align-items:center; gap:14px; }
  h1 { font-size:clamp(24px, 2.7vw, 30px); margin-bottom:2px; }
  .hero-row .eyebrow { margin-bottom:4px; }
  .hero-row .muted { margin-bottom:0; font-size:13px; }
  .hero-row .primary-button { min-height:38px; padding:9px 16px; border-radius:10px; }
  .stats-grid { gap:10px; margin-bottom:24px; }
  .stats-grid article { padding:12px 14px; border-radius:14px; }
  .stats-grid span { margin-bottom:4px; }
  .stats-grid strong { font-size:20px; }
  .section-heading { margin-bottom:10px; }
  .room-grid { grid-template-columns:repeat(6, minmax(0, 1fr)); gap:8px; }
  .room-card { min-height:198px; padding:9px; border-radius:14px; }
  .room-card h3 { font-size:17px; margin-top:8px; }
  .session-number-card strong { font-size:28px; }
  .rule-name, .empty-message { min-height:22px; }
  .live-numbers strong:first-child { font-size:21px; }
  .live-numbers strong:last-child { font-size:18px; }
  .card-actions { gap:5px; }
  .card-actions a, .card-actions button { min-height:34px; padding:5px 4px; font-size:11px; border-radius:9px; }
  .room-card > .ghost-button { min-height:46px; }
  dialog { width:min(90vw, 560px); }
  .dialog-card { gap:12px; padding:24px; }
  .dialog-close { width:38px; height:38px; right:16px; top:16px; }
  .keypad-grid { gap:8px; }
  .keypad-key { min-height:44px; }
}
@media (pointer:coarse) and (min-width:700px) and (max-width:1200px) and (orientation:portrait) {
  .room-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; }
  .room-card { aspect-ratio:1 / 1; min-height:auto; padding:10px; border-radius:16px; }
  .room-card h3 { font-size:18px; margin-top:8px; }
  .session-number-card strong { font-size:28px; }
  .card-actions a, .card-actions button { min-height:36px; }
}
@media (pointer:coarse) and (min-width:700px) {
  .icon-button, .ghost-link, .primary-button, .danger-button, .secondary-button, .ghost-button { min-height:46px; }
  .card-actions a, .card-actions button { min-height:44px; }
  .collapsible-form summary { min-height:48px; }
  .small-danger { min-height:42px; padding:8px 12px; }
  .login-card { transform:translateY(28px); }
}
@media (pointer:coarse) and (min-width:901px) and (max-width:1200px) and (orientation:landscape) {
  .topbar .icon-button { min-height:36px; padding:6px 10px; font-size:13px; }
  .hero-row .primary-button { min-height:38px; padding:9px 16px; }
  .card-actions a, .card-actions button { min-height:34px; }
}
@media (max-width:900px) {
  .stats-grid { grid-template-columns:repeat(2,1fr); }.room-grid { grid-template-columns:repeat(3,1fr); }.settings-grid, .settings-menu-grid, .mode-panel, .merchant-panel, .receipt-panel { grid-template-columns:1fr; }
  .merchant-name { display:none; }
  .mode-options { grid-template-columns:1fr; }
  .printer-panel-head, .printer-list .printer-item { display:grid; grid-template-columns:1fr; }
  .printer-connection-form { grid-template-columns:1fr 1fr; }
  .printer-connection-form button { grid-column:1 / -1; }
  .printer-add { width:100%; }
  .printer-actions { justify-content:flex-start; }
  .control-head { display:none; }
  .control-row { display:block; padding:14px; }
  .control-row form { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .control-row form label:first-child { grid-column:1 / -1; }
  .control-row form button { grid-column:1 / -1; width:100%; }
}
@media (max-width:700px) {
  .room-grid { grid-template-columns:repeat(2, 1fr); }
  .history-form { grid-template-columns:1fr; }
  .hero-row { display:grid; align-items:start; gap:12px; }
  .control-row form { grid-template-columns:1fr; }
}
@media (max-width:600px) {
  .topbar { padding:0 12px; }.merchant-name { display:none; }.icon-button { padding:7px 8px; font-size:11px; }
  .page { padding:24px 12px 50px; }.hero-row { align-items:start; }.hero-row .primary-button { padding:11px 13px; white-space:nowrap; }
  .hero-actions { width:100%; justify-content:flex-start; }.terminal-printer-picker { min-width:min(100%, 240px); }
  .stats-grid { gap:8px; }.stats-grid article { padding:13px; }.stats-grid strong { font-size:18px; }
  .room-card { min-height:220px; }.legend { display:none; }.item-row { align-items:flex-start; flex-wrap:wrap; }
  .printer-connection-form { grid-template-columns:1fr; }
  .printer-connection-form button { grid-column:auto; }
  .form-pair, .form-triple { grid-template-columns:1fr; }.login-card, .public-card { padding:28px 22px; }
}
@media (max-width:420px) {
  .room-grid { grid-template-columns:1fr; }
}
@media (orientation:portrait) and (min-width:540px) and (min-height:700px) {
  .room-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; }
  .room-card { aspect-ratio:1 / 1; min-height:auto; padding:10px; border-radius:16px; }
  .room-card h3 { font-size:18px; margin-top:8px; }
  .session-number-card strong { font-size:28px; }
  .card-actions a, .card-actions button { min-height:36px; }
}

@media (orientation:portrait) and (min-width:540px) and (min-height:700px) {
  .room-card.active { padding:8px; }
  .room-card.active .room-top { font-size:10px; line-height:1.1; }
  .room-card.active .status-pill { padding:3px 7px; }
  .room-card.active .room-title-line h3 { margin:6px 0 0; font-size:17px; }
  .room-card.active .room-title-line span { font-size:12px; }
  .room-card.active .rule-name { min-height:auto; margin-bottom:4px; font-size:10px; line-height:1.2; max-height:24px; overflow:hidden; }
  .room-card.active .session-meta { font-size:9px; gap:2px 5px; margin-top:0; }
  .room-card.active .live-numbers { margin:2px 0; }
  .room-card.active .live-numbers strong:first-child { font-size:20px; }
  .room-card.active .live-numbers strong:last-child { font-size:16px; }
  .room-card.active .card-actions { gap:4px; margin-top:auto; }
  .room-card.active .card-actions a,
  .room-card.active .card-actions button { min-height:30px; padding:3px 2px; font-size:10px; border-radius:8px; }
}
