:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #eeede9;
  --text: #1b1a18;
  --muted: #66625c;
  --muted-2: #4f4b46;
  --border: #e3e1dc;
  --border-strong: #cfccc6;
  --accent: #a8321e;
  --accent-ink: #a8321e;
  --accent-soft: #f7ebe8;
  --accent-line: #e2bcb3;
  --on-accent: #ffffff;
  --ink: #1b1a18;
  --on-ink: #ffffff;
  --off: #b8b4ad;
  --fill-low: #b8b4ad;
  --fill-mid: #4f4b46;
  --pulse: 27 26 24;
  --red: var(--accent);
  --red-ink: var(--accent-ink);
  --red-soft: var(--accent-soft);
  --green: var(--ink);
  --green-ink: var(--text);
  --green-soft: var(--surface-2);
  --amber: #b7791f;
  --amber-ink: #6b4a10;
  --amber-soft: #f6ecd9;
  --blue-soft: var(--surface-2);
  --shadow: 0 1px 2px rgb(27 26 24 / .06);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, Inter, "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, Inter, "Segoe UI", system-ui, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
/* Dark palette, written twice (CSS cannot share a block between a media query and a selector): keep the two in step.
   The first follows the system unless Impostazioni → Tema says light, the second is the theme chosen there (theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311;
    --surface: #1e1c19;
    --surface-2: #2a2723;
    --text: #ece7df;
    --muted: #a0978c;
    --muted-2: #b3aa9f;
    --border: #34302b;
    --border-strong: #45403a;
    --accent: #e2a355;
    --accent-ink: #efb46e;
    --accent-soft: #3a2c1c;
    --accent-line: #6b4a26;
    --on-accent: #141311;
    --ink: #ece7df;
    --on-ink: #141311;
    --off: #57514a;
    --fill-low: #57514a;
    --fill-mid: #8f877c;
    --pulse: 236 231 223;
    --amber: #e2a355;
    --amber-ink: #efb46e;
    --amber-soft: #3a2c1c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311;
  --surface: #1e1c19;
  --surface-2: #2a2723;
  --text: #ece7df;
  --muted: #a0978c;
  --muted-2: #b3aa9f;
  --border: #34302b;
  --border-strong: #45403a;
  --accent: #e2a355;
  --accent-ink: #efb46e;
  --accent-soft: #3a2c1c;
  --accent-line: #6b4a26;
  --on-accent: #141311;
  --ink: #ece7df;
  --on-ink: #141311;
  --off: #57514a;
  --fill-low: #57514a;
  --fill-mid: #8f877c;
  --pulse: 236 231 223;
  --amber: #e2a355;
  --amber-ink: #efb46e;
  --amber-soft: #3a2c1c;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* WebKit checks touch-action on the tapped element itself, so it goes on everything to stop double-tap zoom. */
*, *::before, *::after { touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.app { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
h3 { margin: 0 0 12px; font-size: 15px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; width: 100%; font-size: 16px;
}
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label input, label textarea { color: var(--text); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; margin: 8px 0 0; }
.error { color: var(--red-ink); min-height: 1em; margin: 0; }
.num, .hour-range, .day-stats b, .order .time { font-variant-numeric: tabular-nums; }

.btn {
  font: inherit; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; cursor: pointer; min-height: 40px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn.primary { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 4px 10px; font-size: 13px; min-height: 32px; }
.btn.big { min-height: 48px; font-size: 16px; font-weight: 700; }
.btn.danger { color: var(--red-ink); border-color: var(--border-strong); background: transparent; }
.btn.danger.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.chip-btn { height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; }
.link-btn { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* ---------- header ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 10px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.brand { display: flex; margin: 0; color: var(--text); }
/* Shrinks on phones so bell + "Domani, dom 4" stay on one line next to it. */
.brand-logo { display: block; width: clamp(120px, calc(100vw - 245px), 176px); height: auto; aspect-ratio: 421.75 / 213.375; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; position: relative; }
.date-btn { height: 44px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 14px; border-radius: 22px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 700; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.bell-btn { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.bell-btn[aria-expanded="true"] { background: var(--surface-2); }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.bell-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / .18); overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.bell-head h3 { margin: 0; font-size: 16px; }
.bell-hint { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.bell-list { overflow-y: auto; overscroll-behavior: contain; }
.bell-item { display: flex; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.static { cursor: default; }
.bell-item.static:hover { background: none; }
.bell-item .k { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 4px; background: transparent; }
.bell-item.unread .k { background: var(--accent); }
.bell-item .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.bell-item .t b { font-size: 14px; }
.bell-item.unread .t b { font-weight: 800; }
.bell-item .t span { font-size: 13px; color: var(--muted-2); overflow-wrap: anywhere; }
.bell-item .t small { font-size: 12px; color: var(--muted); }
.bell-item.k-tech .t b { color: var(--accent-ink); }
.bell-empty { padding: 24px 16px; text-align: center; color: var(--muted); margin: 0; }
.order.flash { animation: flash 2.5s ease-out; border-color: var(--ink); }
.date-wrap { position: relative; }
.date-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
.date-wrap:focus-within .date-other { outline: 2px solid var(--ink); outline-offset: 2px; }
.date-other { width: 100%; margin-top: 12px; }
.day-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -6px 8px 0; }
.day-head h3 { margin: 0; font-size: 18px; }
.day-list { display: flex; flex-direction: column; max-height: 58vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.day-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.day-row:last-child { border-bottom: 0; }
.day-row .d { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.day-row .d b { font-size: 16px; }
.day-row .d small { font-size: 13px; color: var(--muted); }
.day-row .n { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-row.closed .n, .day-row .n.none { color: var(--muted); font-weight: 500; }
.day-row.past { opacity: .75; }
.day-row.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.day-row .tick { width: 20px; color: var(--ink); visibility: hidden; }
.day-row.active .tick { visibility: visible; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text); }
.live .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ink); }
.live.off { color: var(--muted); }
.live.off .dot { background: var(--off); }
.accept {
  flex: 1; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 0 14px;
  border-radius: 24px; border: 1px solid var(--accent-line); background: var(--accent-soft); cursor: pointer; text-align: left;
}
.accept.on { background: var(--surface-2); border-color: var(--border-strong); }
.accept-text { display: flex; flex-direction: column; line-height: 1.15; }
.accept-text b { font-size: 15px; }
.accept-text small { font-size: 12px; color: var(--muted); }
.track { width: 52px; height: 32px; border-radius: 16px; background: var(--off); position: relative; flex-shrink: 0; transition: background .2s; }
.accept.on .track { background: var(--ink); }
.knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: left .2s; }
.accept.on .knob { left: 23px; }
.accept:disabled { cursor: default; opacity: .8; }
.in-line { height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 24px; border: 0; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.pulse { width: 9px; height: 9px; border-radius: 5px; background: var(--ink); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(var(--pulse) / .45); } 70% { box-shadow: 0 0 0 7px rgb(var(--pulse) / 0); } 100% { box-shadow: 0 0 0 0 rgb(var(--pulse) / 0); } }

/* ---------- layout & nav ---------- */
body.app > main { padding: 12px 16px 110px; max-width: 760px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.bottom-nav button.active { color: var(--ink); font-weight: 700; }
.nav-icon { position: relative; display: flex; }
.nav-badge { position: absolute; top: -4px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: var(--on-ink); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fab {
  position: fixed; right: max(16px, calc(50vw - 364px)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 19;
  height: 56px; display: none; align-items: center; gap: 8px; padding: 0 20px 0 16px; border-radius: 28px; border: 0;
  background: var(--ink); color: var(--on-ink); font-size: 16px; font-weight: 700; box-shadow: 0 6px 18px rgb(0 0 0 / .25); cursor: pointer;
}
body.on-orders .fab { display: inline-flex; }
.readonly-orders .fab { display: none !important; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 0 8px -6px; padding: 0 8px; border: 0; background: none; color: var(--text); font-weight: 700; cursor: pointer; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.span-2 { grid-column: span 2; }
.voice-row { display: flex; gap: 8px; }
input[type=range] { padding: 0; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-form .wide { grid-column: span 2; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { background: var(--green-soft); color: var(--green-ink); padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.switch { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.switch input { width: 44px; height: 26px; appearance: none; background: var(--off); border-radius: 999px; position: relative; padding: 0; border: 0; cursor: pointer; transition: .2s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { left: 21px; }
.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.check input { width: auto; }

/* ---------- more ---------- */
.more-head { padding: 4px 2px 12px; }
.whoami { font-size: 14px; color: var(--muted); }
.more-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.more-list > * { display: flex; flex-direction: column; gap: 1px; padding: 14px 16px; min-height: 56px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; color: var(--text); text-decoration: none; cursor: pointer; }
.more-list > *:last-child { border-bottom: 0; }
.more-list span { font-size: 16px; font-weight: 700; }
.more-list small { font-size: 13px; color: var(--muted); }
.more-list .danger-row span { color: var(--red-ink); }

/* ---------- orders ---------- */
.day-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 4px; margin-bottom: 12px; }
.day-stats div { display: flex; flex-direction: column; align-items: center; }
.day-stats b { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.day-stats span { font-size: 12px; color: var(--muted); }
.day-stats .todo b { color: var(--accent-ink); }
.hour-nav { display: flex; align-items: center; gap: 8px; }
.hour-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hour-range { font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.hour-dots { display: flex; gap: 6px; height: 6px; }
.hour-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--border-strong); transition: width .2s; }
.hour-dots i.now { background: var(--muted-2); }
.hour-dots i.on { width: 18px; background: var(--ink); }
.oven-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-top: 6px; }
.oven-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.oven-title .muted { font-weight: 500; }
.now-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); }
.now-tag .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ink); }
.go-now { height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.slot-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.slot-cell { display: flex; flex-direction: column; gap: 5px; padding: 7px 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.slot-cell.current { border: 2px solid var(--ink); padding: 6px 5px; }
.slot-cell.past { opacity: .5; }
.slot-cell .top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; white-space: nowrap; }
.slot-cell .t { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-cell .l { font-size: 10px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot-cell.full .l { color: var(--accent-ink); }
.slot-cell .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.slot-cell .fill { height: 100%; background: var(--fill-low); }
.slot-cell.mid .fill { background: var(--fill-mid); }
.slot-cell.full .fill { background: var(--accent); }
.slot-empty { grid-column: 1 / -1; color: var(--muted); font-size: 14px; padding: 6px 2px; }
.status-filter { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 14px 0 10px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.status-filter button { height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; }
.status-filter button b { font-size: 16px; font-weight: 800; line-height: 1.1; color: var(--text); }
.status-filter button span { font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-filter button.active { background: var(--ink); color: var(--on-ink); }
.status-filter button.active b { color: var(--on-ink); }
.order-list { display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 15px; }
.order { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.order.late { border-color: var(--accent-line); }
.order.fresh { border: 2px solid var(--ink); padding: 13px; animation: flash 2.5s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--accent); } }
.order.cancelled { opacity: .6; }
.order.cancelled .who { text-decoration: line-through; }
.order .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order .id { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.order .time { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.order.late .time { color: var(--accent-ink); }
.order .who { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.order .meta { display: block; font-size: 12px; color: var(--muted); }
.order .tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.tag.st-nuovo { background: var(--accent-soft); color: var(--accent-ink); }
.tag.st-pronto { background: var(--surface-2); color: var(--text); }
.tag.st-ritirato, .tag.st-annullato { color: var(--muted); }
.tag.fresh { background: var(--ink); color: var(--on-ink); }
.tag.late { background: var(--accent-soft); color: var(--accent-ink); }
.order ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.order li { display: flex; align-items: baseline; gap: 8px; font-size: 16px; line-height: 1.3; }
.order li .q { min-width: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.order li em { display: block; font-style: normal; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.order .note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; }
.order .note svg { flex-shrink: 0; margin-top: 2px; }
.order .foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.order .total { font-size: 16px; font-weight: 800; margin-right: auto; font-variant-numeric: tabular-nums; }
.next-btn { height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border: 0; border-radius: 12px; color: var(--on-ink); font-size: 15px; font-weight: 700; cursor: pointer; background: var(--ink); }
.done-tag { height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700; }
.readonly-orders .order .foot button { display: none; }

/* ---------- sheets ---------- */
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(640px, 94vw); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog.sheet.bottom { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
dialog.sheet.bottom .btn { width: 100%; }
dialog.sheet.full { width: 100%; max-width: 560px; height: 100%; max-height: 100%; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: var(--bg); }
dialog.sheet.full[open] { display: flex; flex-direction: column; }
@media (min-width: 600px) { dialog.sheet.full { height: 92vh; margin: auto; border-radius: 20px; border: 1px solid var(--border); } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet-title { flex: 1; display: flex; flex-direction: column; }
.sheet-title h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.sheet-title small { font-size: 12px; color: var(--muted); }
.sheet-head .chip-btn { margin-right: 6px; }

/* ---------- chat order ---------- */
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 12px; }
.chat-inner { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.msg-row.staff { align-items: flex-end; }
.bubble { max-width: 85%; padding: 10px 13px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--border); font-size: 16px; line-height: 1.35; white-space: pre-line; }
.msg-row.staff .bubble { border-radius: 16px 4px 16px 16px; background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.bubble.typing { color: var(--muted); }
.draft-card { width: min(320px, 90%); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.draft-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.draft-card li { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.draft-card li .q { min-width: 24px; font-weight: 800; }
.draft-card li .n { flex: 1; font-weight: 600; }
.draft-card li em { display: block; font-style: normal; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.draft-card li .p { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.draft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.draft-grid div { display: flex; flex-direction: column; min-width: 0; }
.draft-grid div:last-child { align-items: flex-end; }
.draft-grid small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.draft-grid b { font-size: 15px; overflow-wrap: anywhere; }
.draft-grid b.missing { color: var(--accent-ink); font-weight: 600; }
.draft-card .oven { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.chips button, .chips a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }
.chips .primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chips .danger { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.chips .dark { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.chat-foot { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.chat-examples { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px; padding: 0 12px; scrollbar-width: none; }
.chat-examples button { flex-shrink: 0; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px dashed var(--border-strong); background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chat-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.chat-form input { flex: 1; height: 48px; border-radius: 24px; padding: 0 16px; }
.round-btn { width: 48px; height: 48px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.round-btn.send { border: 0; background: var(--ink); color: var(--on-ink); }
.round-btn.listening { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); animation: pulse 1.6s infinite; }

#toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 84px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; pointer-events: none; }
.toast { background: var(--ink); color: var(--on-ink); padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / .2); max-width: 420px; font-weight: 600; }

/* ---------- menu & stock (list language of the calls page) ---------- */
.mn-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mn-title .calls-stats { margin: 2px 0 0; }
.mn-add { height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px 0 12px; border: 0; border-radius: 22px; background: var(--ink); color: var(--on-ink); font-size: 15px; font-weight: 700; cursor: pointer; }
.readonly-menu .mn-add, .readonly-menu .mn-step [data-step] { display: none; }
.mn-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.mn-seg button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; background: none; color: var(--muted-2); font-size: 15px; font-weight: 700; cursor: pointer; }
.mn-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.theme-seg { grid-template-columns: repeat(3, 1fr); }
.mn-seg .n { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.mn-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.mn-row:last-child { border-bottom: 0; }
.mn-main { flex: 1; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 10px 6px 10px 14px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.mn-main:hover { background: var(--surface-2); }
.readonly-menu .mn-main { cursor: default; }
.readonly-menu .mn-main:hover { background: none; }
.mn-line { max-width: 100%; display: flex; align-items: baseline; gap: 8px; }
.mn-line b { font-size: 16px; overflow-wrap: anywhere; }
.mn-line .num { flex-shrink: 0; font-size: 14px; color: var(--muted-2); }
.mn-desc { max-width: 100%; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-row.off .mn-line, .mn-row.off .mn-desc { opacity: .5; }
.mn-main .cl-badge { margin-top: 2px; }
.mn-toggle { width: 78px; flex-shrink: 0; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.mn-toggle input { width: 44px; height: 26px; appearance: none; background: var(--off); border-radius: 999px; position: relative; padding: 0; border: 0; cursor: pointer; transition: .2s; }
.mn-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: .2s; }
.mn-toggle input:checked { background: var(--ink); }
.mn-toggle input:checked::after { left: 21px; background: var(--on-ink); }
.mn-toggle input:disabled { opacity: .5; cursor: default; }
.mn-step { flex-shrink: 0; display: flex; align-items: center; padding-right: 6px; }
.mn-step [data-step] { width: 40px; height: 44px; border: 0; background: none; color: var(--text); font-size: 22px; cursor: pointer; }
.mn-qty { min-width: 52px; height: 36px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; }
.mn-qty.low { border-color: transparent; background: var(--amber-soft); color: var(--amber-ink); }
.mn-qty.zero { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
small.low { color: var(--amber-ink); }
small.zero { color: var(--accent-ink); font-weight: 700; }

.chip-btn.dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.mn-form { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.mn-form label, .mn-field > span { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.mn-form label { gap: 6px; }
.mn-form input { height: 48px; border-radius: 12px; }
.mn-form .hint { margin: -8px 0 0; font-size: 12px; }
.mn-form .grid-2 { grid-template-columns: 1fr 1fr; align-items: end; }
.mn-field { display: flex; flex-direction: column; gap: 8px; }
.mn-field .hint { margin: 0; }
.mn-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-cats .cl-chip { height: 40px; padding: 0 14px; font-size: 14px; }
.mn-stepper { height: 48px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.mn-stepper button { width: 48px; height: 48px; flex-shrink: 0; border: 0; background: none; color: var(--text); font-size: 22px; cursor: pointer; }
.mn-stepper b { font-size: 17px; }
.mn-stepper.big { height: 60px; }
.mn-stepper.big button { width: 64px; height: 60px; font-size: 26px; }
.mn-stepper.big input { height: 58px; min-width: 0; border: 0; border-radius: 0; background: none; text-align: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.mn-stepper.big input::-webkit-outer-spin-button, .mn-stepper.big input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mn-avail { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.mn-avail > span:first-child { display: flex; flex-direction: column; }
.mn-avail b { font-size: 15px; }
.mn-avail small { font-size: 12px; color: var(--muted); }
.mn-avail .track { width: 52px; height: 32px; flex-shrink: 0; position: relative; border-radius: 16px; background: var(--off); transition: .2s; }
.mn-avail .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: .2s; }
.mn-avail[aria-pressed="true"] .track { background: var(--ink); }
.mn-avail[aria-pressed="true"] .knob { left: 23px; background: var(--on-ink); }
.mn-rrow { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 2px 6px 14px; border-bottom: 1px solid var(--border); }
.mn-rrow:last-child { border-bottom: 0; }
.mn-rrow .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mn-rrow .who b { font-size: 15px; overflow-wrap: anywhere; }
.mn-rrow .who small { font-size: 12px; color: var(--muted); }
.mn-rrow .who small.low { color: var(--amber-ink); }
.mn-rrow .who small.zero { color: var(--accent-ink); }
.mn-none { margin: 0; padding: 16px 14px; font-size: 14px; color: var(--muted); }
.mn-delete { align-self: center; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--accent-ink); font-size: 15px; font-weight: 700; cursor: pointer; }
.mn-used { margin: 0; font-size: 14px; color: var(--text); }
.mn-moves { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mn-moves > div { display: grid; grid-template-columns: 104px 44px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted-2); }
.mn-moves > div:last-child { border-bottom: 0; }
.mn-moves b { color: var(--text); text-align: right; }
#stock-pick .calls-search { margin-bottom: 10px; }
#pick-list { display: flex; flex-direction: column; gap: 12px; }
.mn-pick { max-height: 44vh; }
.mn-pick button { min-height: 52px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 6px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.mn-pick button:last-child { border-bottom: 0; }
.mn-pick button:hover { background: var(--surface-2); }
.mn-pick small { font-size: 12px; color: var(--muted); }
.mn-create { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.mn-create .hint { margin: 0; }

/* ---------- kb, settings (unchanged layout) ---------- */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kb-grid .card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
/* ---------- calls: list + conversation (full page on phones, side panel from 1000px) ---------- */
.calls-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.calls-head h2 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; }
.calls-stats { margin: -6px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.calls-search { position: relative; display: block; color: var(--muted); }
.calls-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.calls-search input { height: 44px; border-radius: 22px; padding: 0 16px 0 40px; background: var(--surface); }
.calls-chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.calls-chips::-webkit-scrollbar { display: none; }
.cl-chip { flex-shrink: 0; height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.cl-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.cl-chip .n { font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }
.cl-chip.drop::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.cl-chip.set { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.calls-chips .sep { flex-shrink: 0; width: 1px; margin: 6px 2px; background: var(--border); }
.cl-live { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 0; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); text-align: left; cursor: pointer; }
.cl-live .top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.cl-live .top > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.cl-live .pulse { background: var(--on-ink); }
.cl-live b { font-size: 17px; }
.cl-live .last { display: flex; flex-direction: column; gap: 2px; font-size: 13px; opacity: .85; }
.cl-live .last span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-live .go { font-size: 13px; font-weight: 700; text-decoration: underline; }
.cl-day { margin: 18px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cl-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cl-row { width: 100%; min-height: 64px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.cl-row:last-child { border-bottom: 0; }
.cl-row:hover { background: var(--surface-2); }
.cl-row[aria-current="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.cl-row .t { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-row .who { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.cl-row .who b { max-width: 100%; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-row .chan { font: 11px ui-monospace, Menlo, monospace; }
.cl-badge { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted-2); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-badge.order { background: var(--ink); color: var(--on-ink); }
.cl-badge.warn { background: var(--accent-soft); color: var(--accent-ink); }
.cl-badge.live { background: var(--amber-soft); color: var(--amber-ink); }
.cl-badge .pulse { width: 7px; height: 7px; background: var(--amber-ink); }
.cl-more { display: flex; margin: 14px auto 0; }
.cl-foot { text-align: center; }
.call-side { display: none; }

.cl-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 6px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); }
.cl-head .ti { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cl-head .ti b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-head .ti small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-tech { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.cl-tech .sw { position: relative; width: 36px; height: 22px; border-radius: 11px; background: var(--off); transition: background .15s; }
.cl-tech .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.cl-tech[aria-pressed="true"] .sw { background: var(--ink); }
.cl-tech[aria-pressed="true"] .sw::after { transform: translateX(14px); }
.cl-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.cl-order { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cl-order .top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cl-order .top b { font-size: 16px; }
.cl-order .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.cl-order ul { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.cl-order li { display: flex; gap: 6px; }
.cl-order li .q { min-width: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-order li em { font-style: normal; font-weight: 700; color: var(--accent-ink); }
.cl-order.none { flex-direction: row; color: var(--muted); }
.cl-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 12px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 12px; color: var(--muted); }
.cl-meta b { display: block; color: var(--text); font: 600 12px ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.cl-lines { display: flex; flex-direction: column; gap: 8px; }
.cl-b { max-width: 84%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cl-b small { padding: 0 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-b .bub { padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.cl-b.a { align-self: flex-start; }
.cl-b.a .bub { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; }
.cl-b.c { align-self: flex-end; align-items: flex-end; }
.cl-b.c .bub { background: var(--ink); color: var(--on-ink); border-radius: 16px 4px 16px 16px; }
.cl-b.cont { margin-top: -4px; }
.cl-ev { align-self: center; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cl-ev .pill { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted-2); font-size: 12px; font-weight: 600; text-align: center; }
.cl-ev.ok .pill { background: var(--ink); color: var(--on-ink); }
.cl-ev.warn .pill { background: var(--amber-soft); color: var(--amber-ink); }
.cl-ev pre { max-width: 100%; margin: 0; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; font: 11px/1.4 ui-monospace, Menlo, monospace; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.cl-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.cl-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.cl-typing i:nth-child(2) { animation-delay: .2s; }
.cl-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .cl-typing i, .cl-badge .pulse, .cl-live .pulse { animation: none; } }
.order .call-link { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (min-width: 1000px) {
  body.on-calls > main { max-width: 1240px; }
  .calls-layout { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .calls-chips { margin: 0; padding: 0 0 2px; flex-wrap: wrap; }
  .call-side { position: sticky; top: 12px; display: flex; flex-direction: column; height: calc(100vh - var(--nav-h) - 40px); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
  .call-side .cl-head { padding-top: 8px; }
  .call-side > .empty { margin: auto; }
}
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.special-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
details.tech { border-top: 1px solid var(--border); padding-top: 12px; }
details.tech summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.tech[open] summary { margin-bottom: 8px; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

/* ---------- users & permissions ---------- */
.readonly-kb #tab-kb > .card:first-of-type, .readonly-kb #kb-list button { display: none; }
.readonly-settings #settings-save { display: none; }
.user-card.off { opacity: .6; }
.user-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.perm-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.perm-grid label.changed select { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.user-card .row-end { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; }
.user-card .row-end input { flex: 1 1 200px; max-width: 280px; }
.activity-list { max-height: 520px; overflow: auto; margin-top: 10px; }
.activity-row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.user-head select { width: auto; min-width: 160px; }
.sim-perms { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0; }
.sim-perms legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.sim-perms label.changed { color: var(--amber-ink); font-weight: 600; }
.perm-grid label.check { flex-direction: row; align-items: center; gap: 6px; }
.sim-perms .hint { flex-basis: 100%; margin: 2px 0 0; }
/* ---------- public demo settings ---------- */
.demo-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; margin: 12px 0; }
.demo-controls label:not(.switch) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 240px; }
.demo-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.demo-link input { flex: 1 1 260px; font-family: ui-monospace, monospace; font-size: 13px; }
.demo-visitors { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; align-items: center; }
.demo-visitors .btn { margin-left: 8px; }
.vapi-presets { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.vapi-presets label { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.vapi-presets .hint { flex-basis: 100%; }
#demo-card h4 { margin: 16px 0 8px; }
