:root {
  --bg: #f3f7f5;
  --card: #ffffff;
  --text: #16241f;
  --muted: #62736c;
  --line: #e2ebe7;
  --accent: #2f8f78;
  --accent-dark: #226e5c;
  --accent-soft: #e4f4ee;
  --danger: #d0453f;
  --danger-soft: #fdecea;
  --warn: #c98a12;
  --warn-soft: #fdf4e0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 36, 31, .04), 0 8px 24px rgba(22, 36, 31, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; }
a { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- кнопки и поля ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  background: var(--accent-soft); color: var(--accent-dark);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .08s, opacity .15s;
}
.btn:hover { background: #d4ede4; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #f9d9d6; }
.btn.warn { background: var(--warn-soft); color: #8a5d05; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line); }
.btn.big { font-size: 20px; padding: 18px 28px; }
.btn.sm { font-size: 13px; padding: 7px 12px; }
.btn.block { width: 100%; }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  padding: 11px 14px; width: 100%; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
label.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.pill.off { background: var(--danger-soft); color: var(--danger); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- шапка ---------- */

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 24px; background: rgba(255, 255, 255, .8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.logo i {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3fae90, #257560); color: #fff; font-style: normal; font-size: 15px;
}
.topbar .spacer { flex: 1; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

/* ---------- модалки и тосты ---------- */

.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 25, 21, .45); z-index: 50;
  display: grid; place-items: center; padding: 20px; animation: fade .15s;
}
.modal { background: #fff; border-radius: 22px; padding: 26px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #16241f; color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: rise .2s;
  max-width: calc(100vw - 32px);
}
.toast.err { background: var(--danger); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes flash { 0%, 100% { background: transparent; } 50% { background: rgba(80, 220, 170, .25); } }

/* ---------- панель: список очередей ---------- */

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.qcard h3 { font-size: 20px; margin-bottom: 6px; }
.qcard .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.qcard .nums b { display: block; font-size: 24px; white-space: nowrap; }
.qcard .nums span { font-size: 13px; }
.qcard .links { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 50px 20px; }

/* ---------- панель оператора ---------- */

.op { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .op { grid-template-columns: 1fr; } }

.win-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.win-tabs button {
  border: 0; border-radius: 12px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--muted); box-shadow: var(--shadow);
}
.win-tabs button.active { background: var(--accent); color: #fff; }
.win-tabs button small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }

.current { text-align: center; padding: 30px 22px; }
.current .caption { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.current .num { font-size: clamp(64px, 10vw, 110px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 8px 0 4px; color: var(--accent-dark); }
.current .num.none { color: #b9c9c2; font-size: 44px; margin: 24px 0; }
.current .who { font-size: 18px; min-height: 26px; }
.current .timer { font-size: 14px; color: var(--muted); margin-top: 4px; }
.current .main-btn { margin: 22px 0 14px; width: 100%; font-size: 22px; padding: 20px; }
.current .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.kbd { font-size: 12px; color: var(--muted); margin-top: 14px; }
.kbd kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: inherit; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.stats div { background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 22px; }
.stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list .lbl { font-weight: 800; font-size: 18px; min-width: 72px; }
.list .info { flex: 1; min-width: 0; font-size: 14px; }
.list .info .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .info .meta { color: var(--muted); font-size: 12px; }
.list .info .meta.svc { color: var(--accent-dark); font-weight: 700; font-size: 18px; margin-bottom: 2px; }
.list .info .meta.note { color: var(--text); font-size: 18px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; margin-bottom: 2px; }
.modal .list .info .name { white-space: normal; }
.note-box { margin: 10px auto 0; max-width: 460px; text-align: left; background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; font-size: 16px; white-space: pre-wrap; word-break: break-word; }
.note-box span { display: block; font-size: 12px; font-weight: 600; color: #8a5d05; margin-bottom: 2px; }
.text-opts { padding-left: 30px; }
.svc-tag { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.svc-options { display: grid; gap: 8px; margin-bottom: 16px; text-align: left; }
.svc-options label {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); font-weight: 600; transition: border-color .15s, background .15s;
}
.svc-options input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0; }
.svc-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.list .acts { display: flex; gap: 6px; }
.status-tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.status-tag.served { background: var(--accent-soft); color: var(--accent-dark); }
.status-tag.noshow, .status-tag.removed { background: var(--danger-soft); color: var(--danger); }
.status-tag.left { background: var(--warn-soft); color: #8a5d05; }

.others { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.others span { font-size: 13px; background: #fff; border-radius: 10px; padding: 6px 10px; box-shadow: var(--shadow); }

.msg-bar { display: flex; gap: 8px; margin-top: 10px; }
.side > .card + .card { margin-top: 20px; }

/* ---------- посетитель ---------- */

.visitor { max-width: 440px; margin: 0 auto; padding: 22px 18px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.visitor .qname { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; margin-bottom: 18px; text-align: center; }
.visitor .qname .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fbf8f; flex: none; }
.visitor .qname .dot.off { background: var(--danger); }
.visitor .card { text-align: center; }
.announce { background: var(--warn-soft); color: #6d4a04; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 15px; text-align: center; }

.ring { position: relative; width: 250px; height: 250px; margin: 6px auto 12px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .bg { stroke: var(--accent-soft); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .inner small { color: var(--muted); font-size: 14px; }
.ring .inner b { font-size: 52px; letter-spacing: -.02em; color: var(--accent-dark); }

.big-status { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.visitor .foot { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }

.called-screen {
  background: linear-gradient(160deg, #37a585, #1f6a57); color: #fff; border-radius: 26px; padding: 34px 22px; text-align: center;
  animation: pulse 1.6s ease-in-out infinite;
}
.called-screen .t { font-size: 22px; font-weight: 700; }
.called-screen .n { font-size: 76px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.called-screen .w { font-size: 30px; font-weight: 800; background: rgba(255, 255, 255, .18); display: inline-block; padding: 8px 20px; border-radius: 16px; margin-top: 6px; }

.join-stats { display: flex; justify-content: center; gap: 22px; margin: 18px 0 22px; flex-wrap: wrap; }
.join-stats b { display: block; font-size: 34px; }
.join-stats span { font-size: 13px; color: var(--muted); }

/* ---------- табло ---------- */

body.board {
  background: #0f1714; color: #eef6f2; overflow: hidden; height: 100vh; --u: min(1vh, .6vw);
  display: grid; grid-template-rows: auto 1fr auto;
}
.board header { display: flex; align-items: center; justify-content: space-between; padding: calc(2.2 * var(--u)) 3vw; font-size: calc(2.6 * var(--u)); }
.board header .title { font-weight: 700; font-size: calc(3.4 * var(--u)); }
.board header .clock { font-variant-numeric: tabular-nums; font-size: calc(3.4 * var(--u)); font-weight: 600; opacity: .85; }
.board main { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.4vw; padding: 0 3vw calc(2 * var(--u)); min-height: 0; }
.board .panel { background: #17231f; border-radius: calc(2.4 * var(--u)); padding: calc(2.6 * var(--u)) 2.4vw; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.board .panel h2 { font-size: calc(2.4 * var(--u)); text-transform: uppercase; letter-spacing: .1em; opacity: .55; font-weight: 600; margin-bottom: calc(1.6 * var(--u)); }
.board .calls { display: flex; flex-direction: column; gap: calc(1.2 * var(--u)); }
.board .call {
  display: grid; grid-template-columns: auto auto 1fr; gap: 2vw; align-items: center;
  padding: calc(1.2 * var(--u)) 1.6vw; border-radius: calc(1.6 * var(--u)); background: #1e2e29;
}
.board .call .n { white-space: nowrap; }
.board .call .w { line-height: 1.1; }
.board .call .n { font-size: calc(7 * var(--u)); font-weight: 800; color: #62e0b5; letter-spacing: -.01em; }
.board .call .arrow { font-size: calc(4.5 * var(--u)); opacity: .4; }
.board .call .w { font-size: calc(5 * var(--u)); font-weight: 700; text-align: right; }
.board .call.first { background: #24463b; }
.board .call.first .n { font-size: calc(10 * var(--u)); }
.board .call.first .w { font-size: calc(5.5 * var(--u)); }
.board .call.fresh { animation: flash .7s ease-in-out 5; }
.board .none { font-size: calc(4 * var(--u)); opacity: .35; margin: auto; }
.board .side { display: grid; grid-template-rows: 1fr auto; gap: 2.4vw; min-height: 0; }
.board .next-list { display: flex; flex-wrap: wrap; gap: calc(1 * var(--u)); align-content: flex-start; }
.board .next-list span { font-size: calc(3.6 * var(--u)); font-weight: 700; background: #1e2e29; padding: .8vh 1.2vw; border-radius: calc(1.2 * var(--u)); }
.board .qr { display: flex; align-items: center; gap: 1.6vw; }
.board .qr img { height: calc(20 * var(--u)); width: calc(20 * var(--u)); background: #fff; border-radius: calc(1.4 * var(--u)); padding: .8vh; }
.board .qr b { font-size: calc(3 * var(--u)); display: block; margin-bottom: .6vh; }
.board .qr span { font-size: calc(2.2 * var(--u)); opacity: .65; }
.board footer { padding: calc(1.6 * var(--u)) 3vw; font-size: calc(3 * var(--u)); background: #c98a12; color: #1b1405; font-weight: 700; text-align: center; }
.board footer.hidden { display: none; }
.board .wait-count { font-size: calc(2.4 * var(--u)); opacity: .6; margin-top: auto; padding-top: calc(1.4 * var(--u)); }
.board .overlay {
  position: fixed; inset: 0; background: rgba(10, 16, 14, .88); display: grid; place-items: center; z-index: 20; cursor: pointer; text-align: center;
}
.board .overlay div { font-size: calc(3.4 * var(--u)); }
.board .overlay b { display: block; font-size: calc(5 * var(--u)); margin-bottom: calc(1 * var(--u)); }
.board .corner { position: fixed; right: 1vw; bottom: calc(1 * var(--u)); opacity: 0; transition: opacity .3s; display: flex; gap: 8px; z-index: 5; }
.board:hover .corner { opacity: 1; }
.board.closed main::after { content: ''; }

@media (max-aspect-ratio: 1/1) {
  body.board { --u: min(.75vh, 1vw); }
  .board main { grid-template-columns: 1fr; grid-template-rows: 1.3fr 1fr; }
  .board .side { grid-template-columns: 1fr auto; grid-template-rows: none; }
}

/* ---------- печать ---------- */

.poster { max-width: 720px; margin: 0 auto; padding: 50px 30px; text-align: center; }
.poster h1 { font-size: 46px; margin-bottom: 12px; }
.poster .sub { font-size: 24px; color: var(--muted); margin-bottom: 30px; }
.poster img { width: 440px; max-width: 100%; }
.poster .steps { display: flex; justify-content: center; gap: 30px; margin-top: 30px; font-size: 18px; }
.poster .steps b { display: block; font-size: 30px; color: var(--accent); }
.poster .url { margin-top: 26px; font-size: 16px; color: var(--muted); word-break: break-all; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* ---------- сотрудники и две очереди ---------- */

.accepts { font-size: 13px; color: var(--muted); margin-top: 4px; }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg button b { display: inline-block; min-width: 22px; margin-left: 4px; padding: 1px 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; }
.staff-row { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.staff-head { display: flex; gap: 10px; align-items: center; }
.staff-head .lbl { font-weight: 800; color: var(--muted); min-width: 18px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.chips label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); font-size: 14px; font-weight: 500;
}
.chips input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- талон посетителя (телефон — главный экран) ---------- */

.center { text-align: center; }
.visitor #view { display: grid; gap: 14px; }
.tk { padding: 20px; }
.tk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tk-top small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.tk-num { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-dark); line-height: 1.1; }
.tk-top .svc-tag { margin-top: 4px; font-size: 13px; }
.tk-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 16px; }
.tk-main > div { background: var(--bg); border-radius: 16px; padding: 14px 12px; }
.tk-main b { display: block; font-size: 38px; line-height: 1.05; letter-spacing: -.02em; }
.tk-main > div:last-child b { font-size: 30px; line-height: 1.25; }
.tk-main span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.tk-next { margin: 16px 0; padding: 16px; border-radius: 16px; background: #fff3d1; }
.tk-next b { display: block; font-size: 28px; color: #7a5200; }
.tk-next span { color: #7a5200; }
.tk.next { box-shadow: inset 0 0 0 3px #f2c14e, var(--shadow); }
.tk-bar { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.tk-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s ease; }
.tk.next .tk-bar i { background: #e0a81e; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 15px; line-height: 1.4; }
.notice.ok { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
.notice.warn { background: var(--warn-soft); color: #6d4a04; box-shadow: none; }
#alerts .muted.small { margin: 8px 0 0; }

.live { padding: 16px 18px; }
.live-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.live-row span { color: var(--muted); white-space: nowrap; }
.live-row b { text-align: right; }
.live-row em { font-style: normal; font-weight: 500; color: var(--muted); }
.live-status { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 10px; color: var(--muted); }
.live-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3fbf8f; flex: none; }
.live-status.off { color: var(--danger); }
.live-status.off::before { background: var(--danger); animation: pulse 1s infinite; }

.called-screen .go-btn { margin-top: 22px; background: #fff; color: var(--accent-dark); font-size: 22px; }
.called-screen.acked { animation: none; }
body[data-state="called"] { background: #dff3ea; }

/* ---------- мини-табло на телефоне ---------- */

.mini-board { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.live .mini-board { box-shadow: none; padding: 0; margin-bottom: 6px; }
.mb-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.mb-row { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--bg); margin-bottom: 6px; }
.mb-row b { font-size: 20px; font-weight: 800; color: var(--accent-dark); }
.mb-row i { font-style: normal; color: var(--muted); }
.mb-row em { font-style: normal; font-weight: 600; text-align: right; font-size: 15px; }
.mb-row.first { background: var(--accent-soft); }
.mb-row.first b { font-size: 26px; }
.mb-row.fresh { animation: flash .7s ease-in-out 5; }
.mb-row.mine { box-shadow: inset 0 0 0 2px #f2c14e; }
.mb-empty { padding: 4px 2px; color: var(--muted); font-size: 15px; }
.mb-next { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.mb-next span { margin-right: 2px; }
.mb-next b { background: var(--bg); color: var(--text); padding: 3px 8px; border-radius: 8px; font-size: 14px; }
.mb-next b.mine { background: #fff3d1; color: #7a5200; }

/* ---------- несколько услуг и режим вызова ---------- */

.svc-sep { margin: 0 6px; color: var(--muted); font-weight: 400; }
.svc-done { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
.call-mode { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 20px; }
.call-mode > span { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.call-mode button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
}
.call-mode button b { margin-left: 4px; font-size: 12px; padding: 1px 6px; border-radius: 8px; background: var(--bg); }
.call-mode button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.call-mode + .main-btn { margin-top: 12px; }
.serve-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.chip.done { cursor: default; border-style: dashed; font-weight: 500; }
.hours-opts { padding-left: 30px; }
.hours-grid { display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; align-items: center; }
.hours-grid span { font-weight: 700; color: var(--muted); }
.hours-grid input { padding: 8px 12px; font-size: 15px; }
.hours-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.svc-options label.closed { opacity: .55; cursor: not-allowed; flex-wrap: wrap; }
.svc-options label.closed small { flex-basis: 100%; font-weight: 500; color: var(--danger); font-size: 13px; padding-left: 32px; margin-top: -4px; }
.tk-services { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 60%; }
.svc-tag.done { background: var(--bg); color: var(--muted); text-decoration: line-through; }

/* ---------- панель сотрудника: компьютер, на весь экран ---------- */

body.op-body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.op-top { position: static; flex: none; padding: 10px 20px; flex-wrap: nowrap; gap: 10px; }
.op-top > * { flex: none; }
.op-top .op-qname { flex: 0 1 auto; }
.op-top .spacer { flex: 1 1 0; min-width: 10px; }
.op-qname { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.op-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 36vw); }

/* сотрудники — вкладками в строку */
.staff-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.staff-item {
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; text-align: left;
  border: 1.5px solid transparent; background: #fff; box-shadow: var(--shadow); border-radius: 14px; padding: 7px 10px 7px 14px;
  cursor: pointer; font: inherit; color: var(--text);
}
.staff-item:hover { border-color: var(--line); }
.staff-item.active { background: var(--accent); color: #fff; }
.si-name { font-weight: 700; font-size: 15px; white-space: nowrap; }
.si-status { grid-column: 1; font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.staff-item.busy .si-status { color: #9a6a00; font-weight: 600; }
.staff-item.active .si-status { color: rgba(255, 255, 255, .85); }
.si-count { grid-row: 1 / span 2; grid-column: 2; min-width: 32px; text-align: center; font-weight: 800; background: var(--accent-soft); color: var(--accent-dark); border-radius: 10px; padding: 5px 8px; }
.si-count.zero { background: var(--bg); color: #aab9b3; }
.staff-item.active .si-count { background: rgba(255, 255, 255, .22); color: #fff; }

.op-main { display: flex; flex-direction: column; gap: 14px; padding: 14px 20px 18px; overflow: auto; min-width: 0; }
.op-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.op-me { font-size: 26px; font-weight: 800; }
.op-main .accepts { font-size: 14px; margin: 0; }
.op-main .current { flex: 1 1 0; min-height: 190px; overflow: auto; display: flex; flex-direction: column; justify-content: center; padding: 18px 24px; }
.cur-label { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-height: 18px; }
.op-main .current .num { font-size: clamp(60px, 12vh, 130px); margin: 0; }
.op-main .current .note-box { max-width: 620px; }
.op-controls { padding: 18px 22px; text-align: center; }
.op-controls .call-mode { margin-top: 0; display: flex; gap: 10px; align-items: center; justify-content: center; }
.op-controls .call-mode.hidden { display: none; }
.call-mode label { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.call-mode select { width: auto; max-width: 100%; min-width: 280px; font-weight: 600; padding: 9px 12px; }
.op-controls .main-btn { width: 100%; font-size: 24px; padding: 18px; margin: 10px 0; }
.op-controls .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.op-controls .kbd { margin-top: 12px; }
.op-main .stats { margin-top: 0; flex: none; }
.op-main .stats div { padding: 8px 14px; }
.op-main .stats b { font-size: 20px; }
.op-main .op-head, .op-main .op-controls, .op-main .msg-card { flex: none; }
.msg-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.msg-card input { flex: 1; }
.msg-ico { font-size: 20px; padding-left: 4px; }

.op-queue { display: flex; flex-direction: column; gap: 14px; padding: 14px 20px 18px 0; min-height: 0; }
.op-wait { flex: 1 1 62%; display: flex; flex-direction: column; min-height: 0; }
.op-recent { flex: 1 1 38%; display: flex; flex-direction: column; min-height: 0; }
.list.scroll { overflow: auto; flex: 1; min-height: 0; margin: 0 -8px; padding: 0 8px; }

@media (max-width: 1100px) { .op-layout { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 900px) {
  body.op-body { height: auto; overflow: auto; display: block; }
  .op-layout { display: block; }
  .op-queue { padding: 0 20px 20px; }
  .op-wait, .op-recent { max-height: 70vh; }
}

/* ---------- широкие окна для компьютера ---------- */

.modal.wide { max-width: min(1200px, 95vw); }
.table-wrap, #staffList { overflow-x: auto; margin: 0 -4px 14px; padding: 0 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fbfa; }
.data-table .pref { font-weight: 800; font-size: 17px; }
.data-table .acts { text-align: right; white-space: nowrap; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-align: left; }
.linklike:hover { color: var(--accent-dark); text-decoration: underline; }
.ok-text { color: var(--accent-dark); }
.danger-text { color: var(--danger); }
.add-row { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; align-items: end; }

.matrix .corner { width: 30%; min-width: 220px; }
.matrix .st-col { min-width: 200px; vertical-align: bottom; text-transform: none; letter-spacing: 0; }
.st-head { display: flex; gap: 2px; align-items: center; }
.st-head input { min-width: 0; padding: 8px 10px; font-size: 14px; font-weight: 700; }
.st-head .btn { padding: 6px 8px; }
.matrix .svc-name { font-weight: 600; }
.matrix .cell { text-align: center; }
.matrix .cell label { display: flex; justify-content: center; padding: 6px; cursor: pointer; }
.matrix .cell input { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }
.matrix tfoot td { border-bottom: 0; padding-top: 8px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.two-col .hours-opts, .two-col .text-opts { padding-left: 0; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
/* невысокие экраны ноутбуков */
@media (max-height: 820px) {
  .op-controls .kbd { display: none; }
  .op-controls { padding: 14px 18px; }
  .op-controls .main-btn { padding: 14px; margin: 8px 0; }
  .op-main { gap: 10px; }
  .op-main .current { padding: 12px 20px; }
}

.join-stats .hint-cell { display: flex; align-items: center; max-width: 170px; }
.join-stats .hint-cell span { font-size: 14px; color: var(--accent-dark); font-weight: 600; text-align: left; }
.tk-total { margin: -6px 0 14px; font-size: 15px; color: var(--muted); }
.tk-total b { color: var(--text); }

.modal.mid { max-width: min(960px, 95vw); }
.pill.warn { background: var(--warn-soft); color: #8a5d05; }
.learn-box { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.learn-box b { color: var(--text); display: block; margin-bottom: 2px; }

/* ---------- карточка «Сейчас у вас» ---------- */
.op-main .current { justify-content: safe center; }
.op-main .current > * { flex-shrink: 0; }
.op-main .current .who { min-height: 0; }
.op-main .current .timer { margin: 2px 0 8px; }
.op-main .current.dense .num { font-size: clamp(52px, 8vh, 96px); }
.serve-block { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; }
.serve-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.serve-block .serve-chips { margin-top: 0; }
.chip.static { cursor: default; }
.serve-rest { font-size: 14px; color: #8a5d05; background: var(--warn-soft); padding: 6px 12px; border-radius: 10px; }
.serve-done { margin-top: 10px; font-size: 14px; color: var(--muted); }
.serve-done span { font-size: 13px; }

/* ---------- памятка для студента ---------- */
.info-card { padding: 16px 18px; text-align: left; border-left: 4px solid var(--accent); }
.info-title { font-weight: 700; margin-bottom: 6px; }
.info-text { white-space: pre-wrap; line-height: 1.5; font-size: 16px; word-break: break-word; }
.info-text a { color: var(--accent-dark); }
.visitor .info-card { text-align: left; }
.tk-top { flex-wrap: wrap; }
.tk-services { flex-basis: 100%; max-width: none; justify-content: flex-start; margin-top: 8px; }
.tk-services .svc-tag { margin: 0; font-size: 13px; }

/* ---------- статус сотрудника: не начал / отошёл ---------- */
.staff-item.st-off .si-status { color: #9aa8a3; }
.staff-item.st-away .si-status { color: #b06f00; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.staff-item.st-off:not(.active) .si-name { color: var(--muted); }
.staff-item.active.st-away .si-status, .staff-item.active.st-off .si-status { color: rgba(255, 255, 255, .85); }
.op-main .current.paused .num.none { color: #c9a45a; }
.op-main .current.paused .timer { font-size: 15px; line-height: 1.5; }
.away-tag { background: var(--warn-soft); color: #8a5d05; padding: 4px 12px; border-radius: 999px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.main-btn.start { background: #2f6fb0; }
.main-btn.start:hover { background: #245a90; }
.shift-row { margin-top: 10px; }
.shift-row:empty { display: none; }

.pause-box { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: 16px; font-weight: 600; text-align: left; line-height: 1.4; }
.pause-box.away { background: var(--warn-soft); color: #7a5200; }
.pause-box.off { background: #eef2f7; color: #3f5268; }
.svc-options small.paused-note { color: #9a6a00; }
.svc-options label small.paused-note { flex-basis: 100%; font-weight: 500; font-size: 13px; padding-left: 32px; margin-top: -4px; }
.svc-options label:has(small.paused-note) { flex-wrap: wrap; }
.mb-away { font-size: 13px; color: #9a6a00; padding: 4px 2px; }
.board .away { font-size: calc(2.6 * var(--u)); color: #f2c14e; padding: calc(.6 * var(--u)) calc(.4 * var(--u)); }
.op-main .current .num.none { font-size: clamp(40px, 6.5vh, 60px); margin: 10px 0 6px; }

/* ---------- режим приёма ---------- */
.mode-pill { border: 0; cursor: pointer; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-pill.extra { background: #e3eefb; color: #245a90; }
.mode-pill .caret { opacity: .6; margin-left: 2px; }
.mode-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 10px; cursor: pointer; }
.mode-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.mode-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.mode-opt b { display: block; font-size: 16px; margin-bottom: 2px; }
.mode-opt span { color: var(--muted); font-size: 14px; }
.mode-comment { margin: -2px 0 12px 32px; }

.msg-pill { border: 0; cursor: pointer; background: var(--warn-soft); color: #8a5d05; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-field { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.msg-row { display: flex; gap: 8px; }
.msg-row input { flex: 1; }
.op-top .op-qname { flex: 0 1 auto; min-width: 140px; }
.op-top .mode-pill { flex: 0 1 auto; min-width: 90px; max-width: 360px; }
.op-top .msg-pill { flex: 0 2 auto; min-width: 60px; max-width: 280px; }

/* талон — по центру */
.tk-top { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.tk-top > div { width: 100%; }
.tk-num { font-size: 44px; }
.tk-services { justify-content: center; }
