/* German Wheels dashboard — brand of germanwheels.com.ua: near-black, mint accent, squared display caps, sharp corners.
   Dark is the default (like the site); [data-theme="light"] switches the palette. */
:root {
  --bg: #05080b; --panel: #0b1015; --soft: #111820; --hover: #121b22; --ink: #eef3f2; --muted: #8b9a96; --line: #1c262c;
  --accent: #72ebd6; --accent-ink: #05080b; --accent-text: #72ebd6;
  --side: #05080b; --side-ink: #b9c5c2; --side-line: #1c262c; --side-on: #101a1f;
  --conf: #5cb8ff; --conf-bg: rgba(92, 184, 255, .16); --call: #b48cff; --call-bg: rgba(180, 140, 255, .15);
  --new: #f2b14d; --new-bg: rgba(242, 177, 77, .13); --ok: #4fd18b; --ok-bg: rgba(79, 209, 139, .13);
  --done: #a9b4bd; --done-bg: rgba(169, 180, 189, .12); --bad: #ff6b6b; --bad-bg: rgba(255, 107, 107, .13);
  --cancel: #6f7c80; --cancel-bg: rgba(111, 124, 128, .14);
  --live: #72ebd6; --live-bg: rgba(114, 235, 214, .13);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --r: 2px;
  --display: "Russo One", "Arial Black", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
  font: 400 15px/1.45 var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] {
  --conf: #1b6fcf; --conf-bg: #deebfb; --call: #6a3fd3; --call-bg: #ece4fd;
  --bg: #e4eaf1; --panel: #eef2f7; --soft: #e7edf3; --hover: #f4f7fa; --ink: #0a0e13; --muted: #5a6572; --line: #c9d2dd;
  --accent-text: #0e7d66;
  --side: #e4eaf1; --side-ink: #3b4652; --side-line: #c9d2dd; --side-on: #d8e0e9;
  --new: #9a5a00; --new-bg: #fff0d4; --ok: #0f7a45; --ok-bg: #dcf2e6; --done: #4b5563; --done-bg: #e8ecef;
  --bad: #c0262d; --bad-bg: #fde5e5; --cancel: #808b8d; --cancel-bg: #eceeee;
  --live: #0e7d66; --live-bg: rgba(114, 235, 214, .32);
  --shadow: 0 14px 40px rgba(5, 8, 11, .16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); padding: 30px; border-radius: var(--r); display: grid; gap: 14px; }
.login h1 { margin: 0; font: 400 22px/1.15 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.login p { margin: 0; color: var(--muted); font-size: 14px; }
.login .brand-mark { font: 400 13px/1 var(--display); letter-spacing: .08em; color: var(--accent-text); text-transform: uppercase; }

/* shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--side-line); }
.brand { font: 400 17px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); padding: 4px 12px 22px; display: flex; align-items: center; gap: 10px; }
.brand i { width: 10px; height: 10px; background: var(--accent); display: inline-block; flex: none; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-left: 2px solid transparent; text-decoration: none; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: var(--side-on); color: var(--ink); }
.nav a.on { background: var(--side-on); color: var(--ink); border-left-color: var(--accent); }
.nav a b { margin-left: auto; font: 400 12px/1 var(--display); background: var(--accent); color: var(--accent-ink); padding: 4px 7px; }
.side .grow { flex: 1; }
.side .out, .side .theme { background: none; border: 0; color: #7f8c89; text-align: left; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.side .out:hover, .side .theme:hover { background: var(--side-on); color: var(--ink); }
.side .theme svg { width: 16px; height: 16px; flex: none; }
.content { min-width: 0; display: flex; flex-direction: column; }
.main { min-width: 0; padding: 22px 30px 60px; }

/* top bar — mirrors the site header: bordered cells, Kyiv clock, theme switch */
.hdr { position: sticky; top: 0; z-index: 15; padding: 14px 30px 0; background: var(--bg); }
.hdr-row { display: flex; border: 1px solid var(--line); background: var(--bg); min-height: 78px; }
.hdr-locs { display: flex; border-right: 1px solid var(--line); flex: none; }
.hdr-loc { border: 0; background: none; color: var(--ink); padding: 12px 18px; text-align: left; display: grid; gap: 5px; align-content: center; min-width: 136px; }
.hdr-loc + .hdr-loc { border-left: 1px solid var(--line); }
.hdr-loc b { font: 400 17px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.hdr-loc span { font-size: 13px; color: var(--muted); }
.hdr-loc[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.hdr-loc[aria-pressed="true"] span { color: var(--accent-ink); opacity: .75; }
.hdr-loc:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--hover); }
.hdr-loc:disabled { cursor: default; }
.hdr-loc:disabled b { color: var(--muted); }
.hdr-info { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 24px; align-content: center; padding: 10px 20px; font-size: 15px; color: var(--muted); }
.hdr-info > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-info .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-info a { color: inherit; text-decoration: none; }
.hdr-info a:hover { color: var(--accent-text); }
.ico { width: 20px; height: 20px; color: var(--accent-text); flex: none; display: inline-grid; }
.ico svg { width: 100%; height: 100%; }
.hdr-cell { display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-left: 1px solid var(--line); flex: none; }
.clock { display: grid; gap: 2px; }
.clock b { font: 400 20px/1 var(--display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock span { font-size: 14px; color: var(--muted); white-space: nowrap; }
.clock-city { font: 400 12px/1 var(--display); color: var(--accent-text); letter-spacing: .08em; text-transform: uppercase; }
.tgl { position: relative; width: 64px; height: 32px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: #0d1418; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55); cursor: pointer; flex: none; }
.tgl i { position: absolute; top: 3px; left: 35px; width: 24px; height: 24px; border-radius: 50%; transition: left .25s ease, background .25s ease;
  background: radial-gradient(circle at 35% 35%, #ffffff 0 30%, #cfd6dc 72%); box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.tgl i::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: 12px; left: 7px; background: rgba(120, 132, 142, .55); box-shadow: 6px -6px 0 -1px rgba(120, 132, 142, .45); }
:root[data-theme="light"] .tgl { background: #eef2f7; box-shadow: inset 0 1px 4px rgba(10, 14, 19, .12); }
:root[data-theme="light"] .tgl i { left: 4px; background: radial-gradient(circle at 40% 40%, #fff6bf 0 22%, #ffd84a 60%, #f4c21f 100%); box-shadow: 0 0 10px rgba(255, 210, 60, .65); }
:root[data-theme="light"] .tgl i::after { display: none; }
.login-top { position: fixed; top: 16px; right: 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.top h1 { font: 400 22px/1.15 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0 auto 0 0; text-wrap: balance; }
.top h1 em { font-style: normal; color: var(--accent-text); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; gap: 2px; border-right: 0; border-bottom: 1px solid var(--side-line); }
  .brand { padding: 4px 8px; font-size: 14px; white-space: nowrap; }
  .brand span { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav a.on { border-bottom-color: var(--accent); }
  .side .grow { display: none; }
  .side .out, .side .theme { white-space: nowrap; font-size: 14px; }
  .side .theme span { display: none; }
  .main { padding: 14px 14px 60px; }
  .hdr { position: static; padding: 12px 14px 0; }
  .hdr-row { flex-wrap: wrap; }
  .hdr-locs { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .hdr-loc { flex: 1; min-width: 0; padding: 12px 16px; }
  .hdr-info { flex: 1 1 100%; grid-template-columns: minmax(0, 1fr); padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .hdr-cell { padding: 8px 16px; min-height: 56px; border-left: 0; }
  .clock-cell { flex: 1; }
  .clock-cell + .hdr-cell { border-left: 1px solid var(--line); }
}

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font: 400 13px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; padding: 11px 16px; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.primary.sm { padding: 8px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 38px; height: 38px; padding: 0; }
input[type=text], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], input[type=search], select, textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); min-width: 0; font-size: 15px;
}
input[type=color] { padding: 0; width: 56px; height: 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
textarea { resize: vertical; min-height: 64px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
/* own select arrow: same height as text fields, chevron with air on the right (native one sat at the edge) */
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b9a96' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
select::-ms-expand { display: none; }
.field { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field > input, .field > select, .field > textarea, .field > div, .field > pre { text-transform: none; letter-spacing: 0; }
.field > input, .field > select, .field > textarea { color: var(--ink); font-weight: 400; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 500; text-transform: none; letter-spacing: 0; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); font-size: 14px; margin: 0; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* badges */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r); font-size: 12px; font-weight: 650; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.st.new { color: var(--new); background: var(--new-bg); }
.st.confirmed { color: var(--ok); background: var(--ok-bg); }
.st.done { color: var(--done); background: var(--done-bg); }
.st.no_show { color: var(--bad); background: var(--bad-bg); }
.st.canceled { color: var(--cancel); background: var(--cancel-bg); }
.st.sent { color: var(--ok); background: var(--ok-bg); }
.st.pending, .st.sending { color: var(--new); background: var(--new-bg); }
.st.failed { color: var(--bad); background: var(--bad-bg); }
.st.skipped { color: var(--cancel); background: var(--cancel-bg); }
.tg { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: #229ed9; padding: 1px 6px; border-radius: var(--r); vertical-align: middle; }

/* cards & tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 13px; font-size: 13px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.stat b { color: var(--ink); font: 400 20px/1 var(--display); }
.stat.warn b { color: var(--new); }
.stat.accent b { color: var(--accent-text); }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--hover); }
td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl-empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* day timeline */
.tl { position: relative; display: grid; grid-template-columns: 58px 1fr; overflow: hidden; }
.tl-hours { position: relative; border-right: 1px solid var(--line); }
.tl-hours span { position: absolute; right: 8px; font-size: 12px; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.tl-body { position: relative; display: grid; }
.tl-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.tl-line.half { border-top-style: dashed; opacity: .55; }
.tl-lane { position: relative; border-right: 1px solid var(--line); cursor: copy; }
.tl-lane:last-child { border-right: 0; }
.tl-lane:hover { background: var(--hover); }
.tl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 3; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; background: var(--accent); }
.bk { display: block; width: 100%; border-radius: var(--r); padding: 5px 8px 5px 10px; font-size: 13px; line-height: 1.3; overflow: hidden; cursor: pointer; border: 0; text-align: left; z-index: 2; background: var(--soft); color: var(--ink); border-left: 3px solid var(--muted); }
.bk:hover { filter: brightness(1.08); box-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.bk b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.bk.new { background: var(--new-bg); border-left-color: var(--new); }
.bk.confirmed { background: var(--ok-bg); border-left-color: var(--ok); }
.bk.done { background: var(--done-bg); border-left-color: var(--done); opacity: .85; }
.bk.no_show { background: var(--bad-bg); border-left-color: var(--bad); }
.lanes-head { display: grid; grid-template-columns: 58px 1fr; border-bottom: 1px solid var(--line); }
.lanes-head div { display: grid; }
.lanes-head span { padding: 9px 10px; font: 400 11px/1 var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-right: 1px solid var(--line); }
.lanes-head span:last-child { border-right: 0; }
.closed { padding: 40px; text-align: center; color: var(--muted); }
.day-list { display: none; }
@media (max-width: 700px) {
  .tl-wrap { display: none; }
  .day-list { display: block; }
}
.dl-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.dl-item:hover { background: var(--hover); }
.dl-item:last-child { border-bottom: 0; }
.dl-item .t { font: 400 15px/1.3 var(--display); font-variant-numeric: tabular-nums; width: 52px; flex: none; }
.dl-item .c { flex: 1; min-width: 0; }
.dl-item .c b { display: block; }
.dl-item .c span { font-size: 13px; color: var(--muted); }
.canceled-list { margin-top: 14px; }
.canceled-list summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }

/* drawer & modal */
.ov { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.ov.center { justify-content: center; align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(540px, 100%); height: 100%; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; box-shadow: var(--shadow); animation: slide .2s; display: flex; flex-direction: column; }
@keyframes slide { from { transform: translateX(30px); } }
.modal { width: min(580px, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.d-head { position: sticky; top: 0; background: var(--panel); z-index: 2; padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.d-head h2 { margin: 0; font: 400 17px/1.2 var(--display); text-transform: uppercase; letter-spacing: .01em; flex: 1; }
.d-body { padding: 18px 20px 24px; display: grid; gap: 16px; }
.d-foot { position: sticky; bottom: 0; background: var(--panel); padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.d-foot .sp { flex: 1; }
.sec h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv span { color: var(--muted); }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.slots-grid button { padding: 7px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slots-grid button:hover { border-color: var(--accent); }
.slots-grid button small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }
.slots-grid button.full { background: var(--soft); color: var(--muted); }
.slots-grid button.past { opacity: .4; }
.slots-grid button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slots-grid button.on small { color: inherit; }
.timeline { display: grid; gap: 8px; font-size: 13px; }
.timeline div { display: flex; gap: 10px; }
.timeline time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }

/* settings */
.set-grid { display: grid; gap: 16px; max-width: 900px; }
.set { padding: 20px 22px; }
.set h2 { margin: 0 0 4px; font: 400 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.set > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.set .body { display: grid; gap: 12px; }
.hours { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 10px; }
.hours-row .t { display: flex; gap: 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.chip button { border: 0; background: none; padding: 0 4px; color: var(--muted); font-size: 16px; line-height: 1; }
pre.code { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-size: 12px; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all; color: var(--ink); }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; display: flex; gap: 10px; align-items: center; background: linear-gradient(transparent, var(--bg) 30%); }

/* toasts */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--accent); color: var(--accent-ink); padding: 11px 16px; border-radius: var(--r); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: fade .2s; }
.toast.bad { background: var(--bad); color: #fff; }

/* requests */
.req { display: flex; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req.is-new { box-shadow: inset 3px 0 0 var(--accent); }
.req-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.req-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.req-phone { font-variant-numeric: tabular-nums; font-weight: 600; text-decoration: none; color: var(--accent-text); }
.req-what { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.req-comment, .req-note { font-size: 14px; }
.req-note { color: var(--muted); }
.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 50%; }
.req-side .actions { justify-content: flex-end; }
@media (max-width: 700px) { .req { flex-direction: column; } .req-side { align-items: flex-start; max-width: none; } .req-side .actions { justify-content: flex-start; } }

/* ===== Розклад: controls */
.day-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: -4px 0 14px; }
.seg { display: flex; border: 1px solid var(--line); background: var(--panel); max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; display: grid; text-align: left; gap: 1px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button span { font-size: 11px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button[aria-pressed="true"] span { color: var(--accent-ink); opacity: .75; }
.seg button:disabled { color: var(--muted); cursor: default; }
.bk.live { background: var(--live-bg); border-left-color: var(--live); box-shadow: inset 0 0 0 1px var(--live); }
.bk.unassigned { border: 1px dashed var(--new); border-left: 3px solid var(--new); }
.bk[draggable="true"] { cursor: grab; }
.bk .tag, .tag { display: inline-block; font: 400 9px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 3px 5px; background: var(--new); color: #05080b; margin-right: 5px; vertical-align: 1px; }
.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--live-bg) !important; }

/* queue (shared) */
.queue { align-self: start; }
.queue h3, .box-h { margin: 0; padding: 10px 12px; font: 400 12px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); color: var(--muted); }
.queue h3 b { color: var(--new); }
.queue .list { display: grid; gap: 6px; padding: 10px; }

/* layout 1 — post columns */
.lay-posts { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; }

.tl-scroll { overflow-x: auto; }
.tl-heads, .tl { min-width: calc(58px + var(--n) * 150px); }
.tl-heads { display: grid; grid-template-columns: 58px repeat(var(--n), minmax(150px, 1fr)); border-bottom: 1px solid var(--line); }
.tl-heads span { padding: 10px; font: 400 12px/1 var(--display); text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); display: flex; justify-content: space-between; gap: 6px; }
.tl-heads span:last-child { border-right: 0; }
.tl-heads em { font: 600 11px/1 var(--body); font-style: normal; color: var(--accent-text); text-transform: none; }
.tl-body { grid-template-columns: repeat(var(--n), minmax(150px, 1fr)); }
.buf { position: absolute; left: 10px; right: 10px; background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); opacity: .9; pointer-events: none; }
.assign { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.assign button { display: grid; gap: 3px; text-align: left; padding: 11px 12px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); color: var(--ink); }
.assign button b { font: 400 15px/1 var(--display); text-transform: uppercase; }
.assign button small { font-size: 12px; color: var(--muted); }
.assign button:hover:not(:disabled) { border-color: var(--accent); }
.assign button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 860px) { .lay-posts { grid-template-columns: 1fr; } .lay-posts .queue { position: static; } }

/* layout 2 — floor plan */
.lay-plan { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.plan { padding: 14px; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan.protasiv { grid-template-columns: 1fr 1.35fr; grid-template-areas: "p1 p2" "p3 p2" "p3 p4" "p5 p4" "gate gate"; }
.plan .gate { grid-area: gate; text-align: center; font: 400 11px/1 var(--display); letter-spacing: .3em; color: var(--muted); padding: 8px; border-top: 2px dashed var(--line); text-transform: uppercase; }
.post-tile { border: 1px solid var(--line); background: var(--bg); padding: 12px; display: grid; gap: 8px; min-height: 150px; align-content: start; cursor: pointer; min-width: 0; }
.post-tile:hover { border-color: var(--muted); }
.post-tile.busy { border-color: var(--live); }
.post-tile.big { min-height: 230px; }
.pt-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-h b { font: 400 18px/1 var(--display); text-transform: uppercase; }
.pill { font: 400 10px/1 var(--display); letter-spacing: .06em; padding: 5px 7px; text-transform: uppercase; white-space: nowrap; }
.pill.free { background: var(--ok-bg); color: var(--ok); }
.pill.busy { background: var(--accent); color: var(--accent-ink); }
.pt-now b { display: block; font-size: 15px; }
.pt-now span { color: var(--muted); font-size: 13px; }
.prog { height: 4px; background: var(--line); }
.prog i { display: block; height: 100%; background: var(--accent); }
.pt-next { font-size: 12px; color: var(--muted); display: grid; gap: 3px; border-top: 1px solid var(--line); padding-top: 6px; }
.pt-next b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-side { display: grid; gap: 12px; }
.hours-mini { display: grid; gap: 6px; padding: 10px 12px; }
.hm { display: grid; grid-template-columns: 46px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.hm .cap { display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-auto-flow: column; gap: 3px; }
.hm .cap i { height: 10px; background: var(--line); }
.hm .cap i.f { background: var(--accent); }
.hm .cap i.u { background: var(--new); }
.hm.now { color: var(--accent-text); font-weight: 700; }
@media (max-width: 860px) { .lay-plan { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .post-tile { min-height: 120px; padding: 10px; } .post-tile.big { min-height: 180px; } }

/* layout 3 — hour × post */
.hg { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hg th { font: 400 12px/1 var(--display); text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-right: 1px solid var(--line); }
.hg th.warn { color: var(--new); }
.hg td { border-right: 1px solid var(--line); padding: 5px; vertical-align: top; }
.hg th:last-child, .hg td:last-child { border-right: 0; }
.hg td.h { font: 400 15px/1 var(--display); padding: 10px 8px; font-variant-numeric: tabular-nums; }
.hg td.h small { display: block; margin-top: 6px; font: 600 11px/1 var(--body); color: var(--accent-text); }
.hg tr.now td { background: var(--live-bg); }
.hg .stack { display: grid; gap: 4px; }
.hg td.empty::after { content: "вільно"; display: block; text-align: center; font-size: 11px; color: var(--muted); opacity: .5; padding: 10px 0; }
.load { display: grid; gap: 4px; }
.load b { font: 400 14px/1 var(--display); }
.load .meter { height: 6px; background: var(--line); }
.load .meter i { display: block; height: 100%; background: var(--accent); }
.load .meter i.over { background: var(--bad); }

/* layout 4 — phone feed */
.lay-feed { max-width: 560px; }
.fd-filter { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; }
.fd-filter button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 8px 12px; font-size: 13px; font-weight: 600; border-radius: var(--r); }
.fd-filter button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fd-grp { border-bottom: 1px solid var(--line); }
.fd-grp:last-child { border-bottom: 0; }
.fd-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px; font: 400 15px/1 var(--display); }
.fd-h .cap { display: flex; gap: 3px; align-items: center; font: 600 12px/1 var(--body); color: var(--muted); }
.fd-h .cap i { width: 12px; height: 8px; background: var(--line); }
.fd-h .cap i.f { background: var(--accent); }
.fd-card { margin: 0 12px 10px; border: 1px solid var(--line); background: var(--bg); padding: 10px; display: grid; gap: 8px; }
.fd-card.unassigned { border-style: dashed; border-color: var(--new); }
.fd-card.live { border-color: var(--live); }
.fd-card.past { opacity: .55; }
.fd-top, .fd-who { cursor: pointer; }
.fd-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.fd-top b { font: 400 16px/1 var(--display); }
.fd-top span { font-size: 12px; color: var(--muted); }
.fd-who { font-size: 14px; }
.fd-who small { display: block; color: var(--muted); font-size: 12px; }
.fd-posts { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
.fd-posts button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 9px 0; font: 400 13px/1 var(--display); border-radius: var(--r); }
.fd-posts button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fd-posts button:disabled { opacity: .3; text-decoration: line-through; cursor: not-allowed; }

/* settings: locations */
.locs { display: grid; gap: 10px; }
.loc-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 560px) { .loc-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); width: 100%; }
  .seg button { background: var(--panel); }
  .seg button + button { border-left: 0; }
  .day-ctl > .btn.primary { width: 100%; }
}

@media (max-width: 1360px) and (min-width: 861px) {
  .hdr-row { flex-wrap: wrap; }
  .hdr-info { order: 5; width: 100%; flex: none; border-top: 1px solid var(--line); grid-template-columns: repeat(4, minmax(0, max-content)); }
  .clock-cell { margin-left: auto; }
}

/* layout switch with icons */
.seg-ico button { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.seg-ico .ico { width: 22px; height: 22px; color: var(--accent-text); }
.seg-ico button[aria-pressed="true"] .ico { color: var(--accent-ink); }
.seg-txt { display: grid; gap: 2px; text-align: left; }
.seg-txt b { font-size: 15px; font-weight: 650; }
.seg-txt small { font-size: 12px; color: var(--muted); font-weight: 500; }
.seg-ico button[aria-pressed="true"] small { color: var(--accent-ink); opacity: .75; }


/* readability: descriptions ~2px larger */
:root { font-size: 16px; }
.nav a { font-size: 16px; }
.bk { font-size: 14px; }
.bk b { font-size: 15px; }
.bk span { font-size: 14px; }
.stat { font-size: 15px; }
.stat b { font-size: 22px; }
.small { font-size: 14px; }
.hint { font-size: 13px; }
.field { font-size: 13px; }
th { font-size: 12px; }
table { font-size: 15px; }
.tl-hours span { font-size: 13px; }
.tl-heads span { font-size: 13px; }
.tl-heads em { font-size: 13px; }
.queue h3, .box-h { font-size: 13px; }
.pt-now b { font-size: 16px; }
.pt-now span, .pt-next { font-size: 14px; }
.hm { font-size: 13px; }
.fd-top span { font-size: 13px; }
.fd-who { font-size: 15px; }
.fd-who small { font-size: 14px; }
.dl-item .c span { font-size: 14px; }
.timeline { font-size: 14px; }
.req-what, .req-comment, .req-note { font-size: 15px; }
.set > p { font-size: 14px; }
.loc-card { border: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; background: var(--bg); }
@media (max-width: 560px) { .seg-ico button { padding: 9px 10px; gap: 8px; } }

@media (max-width: 1360px) and (min-width: 861px) { .hdr-info .t { overflow: visible; } }

/* schedule: inner scroll (the page stays put), sticky post headers and hours */
.lay-posts { align-items: start; }
.lay-posts .queue { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.lay-posts .queue .list { overflow-y: auto; min-height: 0; flex: 1; align-content: start; }
.tl-scroll { overflow: auto; overscroll-behavior: contain; position: relative; }
.tl-scroll .tl-heads { position: sticky; top: 0; z-index: 8; background: var(--panel); }
.tl-scroll .tl-heads span:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.tl-scroll .tl { overflow: visible; }
.tl-scroll .tl-hours { position: sticky; left: 0; z-index: 5; background: var(--panel); }
.tl-now { z-index: 6; }
.tl-now::after { content: attr(data-t); position: absolute; left: 0; top: -11px; transform: translateX(-100%); margin-left: -6px; font: 400 12px/1 var(--display); background: var(--accent); color: var(--accent-ink); padding: 5px 6px; z-index: 7; }
[data-scroll="grid"] { overflow: auto; overscroll-behavior: contain; }
[data-scroll="grid"] .hg thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
@media (max-width: 860px) { .lay-posts .queue { height: auto !important; max-height: 240px; } }
.main:has([data-scroll]) { padding-bottom: 16px; }

/* ===== Compact sidebar (Tresor Hub pattern): groups, icons, collapsible rail */
.shell { grid-template-columns: 224px 1fr; }
.side { padding: 18px 12px 12px; gap: 0; }
.brand { padding: 4px 10px 18px; font-size: 15px; align-items: flex-start; }
.brand i { margin-top: 4px; }
.brand small { display: block; margin-top: 5px; font: 500 12px/1.2 var(--body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.nav { display: grid; gap: 2px; }
.nav-group-t { font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 8px; }
.nav-group-t:first-child { padding-top: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-left: 0; border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--side-ink); }
.nav a .ico { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav a:hover .ico { color: var(--ink); }
.nav a.on { background: rgba(114, 235, 214, .10); color: var(--ink); border-left: 0; }
.nav a.on .ico { color: var(--accent-text); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--accent); }
:root[data-theme="light"] .nav a.on { background: rgba(14, 125, 102, .10); }
.nav a .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a b { font-size: 11px; padding: 3px 7px; }
.side-foot { display: flex; align-items: center; gap: 4px; padding: 12px 4px 0; border-top: 1px solid var(--side-line); }
.who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.who > i { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 400 14px/1 var(--display); font-style: normal; flex: none; }
.who div { display: grid; min-width: 0; }
.who b { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-only { width: 34px; height: 34px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 6px; flex: none; padding: 0; }
.icon-only:hover { background: var(--side-on); color: var(--ink); }
.icon-only .ico { width: 18px; height: 18px; color: inherit; }
.side .out { padding: 0; }

/* collapsed rail */
.side-mini .shell { grid-template-columns: 68px 1fr; }
.side-mini .side { padding: 18px 8px 12px; }
.side-mini .brand { justify-content: center; padding: 4px 0 18px; }
.side-mini .brand > span, .side-mini .nav-group-t, .side-mini .nav a .lbl, .side-mini .who div { display: none; }
.side-mini .nav-group-t + a, .side-mini .nav a:first-of-type { margin-top: 0; }
.side-mini .nav { gap: 4px; }
.side-mini .nav a { justify-content: center; padding: 10px 0; }
.side-mini .nav a.on::before { left: -8px; }
.side-mini .nav a b { position: absolute; top: 1px; right: 1px; padding: 2px 4px; font-size: 10px; line-height: 1; }
.side-mini .side-foot { flex-direction: column; gap: 6px; padding: 12px 0 0; }
.side-mini .who { justify-content: center; }

@media (max-width: 860px) {
  .side-mini .shell, .shell { grid-template-columns: 1fr; }
  .nav { display: flex; }
  .nav-group-t, .side-foot .who, .side-foot .icon-only:not(.out) { display: none; }
  .nav a { padding: 8px 10px; border-radius: 6px; }
  .nav a.on::before { display: none; }
  .side-foot { border-top: 0; padding: 0; }
  .brand small { display: none; }
}

.brand { position: relative; display: flex; }
.brand > span { flex: 1; min-width: 0; }
.collapse-btn { margin: -6px -4px 0 auto; }
.side-mini .brand { flex-direction: column; align-items: center; gap: 12px; }
.side-mini .collapse-btn { margin: 0; }
@media (max-width: 860px) { .collapse-btn { display: none !important; } }

/* ===== Header, variant 3 ("тонкий навбар" + day toolbar), chosen 02.11 */
.hdr { padding: 12px 30px 0; }
.tb { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--bg); min-height: 46px; }
.tb-locs { display: flex; border-right: 1px solid var(--line); flex: none; }
.locpill { align-self: stretch; border: 0; background: none; color: var(--ink); padding: 0 16px; font: 400 14px/1 var(--display); text-transform: uppercase; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.locpill + .locpill { border-left: 1px solid var(--line); }
.locpill small { font: 500 12px/1 var(--body); text-transform: none; color: var(--muted); }
.locpill[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.locpill[aria-pressed="true"] small { color: var(--accent-ink); opacity: .7; }
.locpill:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--hover); }
.locpill:disabled { color: var(--muted); cursor: default; }
.tb-info { flex: 1; min-width: 0; padding: 0 16px; }
.contact-line { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; align-content: center; font-size: 14px; color: var(--muted); }
.contact-line > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.contact-line .ico { width: 16px; height: 16px; }
.contact-line a { color: inherit; text-decoration: none; }
.contact-line a:hover { color: var(--accent-text); }
.tb-cell { display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--line); flex: none; }
.mini-clock { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mini-clock small { font: 400 11px/1 var(--display); color: var(--accent-text); letter-spacing: .08em; text-transform: uppercase; }
.mini-clock b { font: 400 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.tgl.sm { width: 52px; height: 26px; }
.tgl.sm i { width: 18px; height: 18px; top: 3px; left: 29px; }
:root[data-theme="light"] .tgl.sm i { left: 4px; }
.main { padding-top: 14px; }

/* day toolbar */
.day-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.datenav { display: flex; align-items: center; gap: 8px; }
.datebig { margin: 0; padding: 0 4px; font: 400 19px/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.datebig em { font-style: normal; color: var(--accent-text); }
.date-pick { position: relative; display: inline-flex; }
.date-hidden { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.tbar-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; flex: 1; min-width: 0; }
.tbar-ctl .sp { flex: 1; }
.ibtn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; font-weight: 600; font-size: 15px; border-radius: 2px; }
.ibtn:hover { border-color: var(--muted); }
.ibtn .ico { width: 20px; height: 20px; color: var(--accent-text); }
.assign-btn b { color: var(--new); font: 400 15px/1 var(--display); }
.seg-mini { display: flex; border: 1px solid var(--line); }
.seg-mini button { border: 0; background: var(--panel); color: var(--ink); height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.seg-mini button + button { border-left: 1px solid var(--line); }
.seg-mini button:hover:not([aria-pressed="true"]) { background: var(--hover); }
.seg-mini .ico { width: 20px; height: 20px; color: var(--accent-text); }
.seg-mini button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg-mini button[aria-pressed="true"] .ico { color: var(--accent-ink); }
.seg-mini.icons button .lbl { display: none; }
.seg-mini.icons button[aria-pressed="true"] .lbl { display: inline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.chips b { font: 400 17px/1 var(--display); color: var(--ink); margin-right: 4px; }
.chips .w b { color: var(--new); }
.chips .w:only-child, .chips span.w:not(:has(b)) { color: var(--new); font-weight: 600; }
.chips .a b { color: var(--accent-text); }
.btn.compact { padding: 11px 16px; }

@media (max-width: 1100px) and (min-width: 861px) {
  .tb { flex-wrap: wrap; }
  .tb-info { order: 5; flex: 1 1 100%; border-top: 1px solid var(--line); padding: 8px 16px; }
  .tb-locs + .tb-info + .tb-cell { margin-left: auto; }
}
@media (max-width: 860px) {
  .hdr { padding: 10px 14px 0; }
  .tb { flex-wrap: wrap; }
  .tb-locs { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .locpill { flex: 1; justify-content: center; min-height: 42px; }
  .tb-info { flex: 1 1 100%; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .contact-line { font-size: 13px; gap: 6px 14px; }
  .tb-cell { min-height: 44px; border-left: 0; }
  .tb-cell:first-of-type { flex: 1; }
  .tb-cell + .tb-cell { border-left: 1px solid var(--line); }
  .datebig { font-size: 16px; }
  .ibtn { height: 38px; min-width: 38px; }
  .day-toolbar { gap: 8px; }
  .tbar-ctl { flex: 1 1 100%; }
}

/* GW monogram instead of the plain square */
.brand .gw-mark { width: 32px; height: 32px; margin-top: 0; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 400 13px/1 var(--display); font-style: normal; letter-spacing: .02em; }
.brand { align-items: center; gap: 10px; }
.side-mini .brand { gap: 10px; }
@media (max-width: 860px) { .brand .gw-mark { width: 28px; height: 28px; font-size: 12px; } }
.brand small { white-space: nowrap; }

/* booking colours: confirmed = neutral with mint stripe, done = green "ready", past-but-open = grey */
.bk.confirmed { background: var(--soft); border-left-color: var(--accent); }
.bk.completed { background: var(--ok-bg); border-left-color: var(--ok); opacity: 1; }
.bk.completed b { color: var(--ok); }
.st.confirmed { color: var(--accent-text); background: var(--live-bg); }
.st.done { color: var(--ok); background: var(--ok-bg); }
.fd-card.completed { border-color: var(--ok); background: var(--ok-bg); opacity: 1; }
/* reschedule panel in the booking card */
.resched { margin-top: 12px; border: 1px solid var(--accent); background: var(--bg); padding: 14px; display: grid; gap: 12px; }
.resched-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.resched-h b { font: 400 15px/1 var(--display); text-transform: uppercase; }
[hidden] { display: none !important; }

.btn.done-all { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); padding: 10px 14px; }
.btn.done-all:hover { filter: brightness(1.1); }
.q-sub { margin: 10px 0 2px; font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* undo after «Відмітити готовими»: ring empties over the remaining time */
.btn.undo-btn { color: var(--new); border-color: var(--new); background: var(--new-bg); padding: 8px 14px 8px 10px; gap: 8px; }
.btn.undo-btn b { font: 400 15px/1 var(--display); min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.ring { width: 24px; height: 24px; display: inline-grid; }
.ring svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .ring-bg { stroke: var(--line); }
.ring .ring-fg { stroke: var(--new); stroke-dasharray: 56.55; stroke-dashoffset: 0; animation: ring-empty var(--left) linear forwards; }
@keyframes ring-empty { to { stroke-dashoffset: 56.55; } }
@media (prefers-reduced-motion: reduce) { .ring .ring-fg { animation: none; } }
/* no-show = red, like done = green */
.bk.no_show { background: var(--bad-bg); border-left-color: var(--bad); opacity: 1; }
.bk.no_show b { color: var(--bad); }
.fd-card.no-show { border-color: var(--bad); background: var(--bad-bg); opacity: 1; }

/* day switcher in booking forms */
.dstep { display: grid; gap: 8px; }
.dstep-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dstep-label { min-width: 0; flex: 1; display: flex; gap: 8px; align-items: baseline; justify-content: center; height: 40px; align-items: center; padding: 0 10px; border: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
.dstep-label b { font: 400 16px/1 var(--display); text-transform: uppercase; }
.dstep-label em { font-style: normal; font-weight: 600; font-size: 16px; color: var(--accent-text); }
.dstep-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dstep-days button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 0 7px; display: grid; gap: 2px; justify-items: center; border-radius: 2px; }
.dstep-days button:hover:not([aria-pressed="true"]) { border-color: var(--muted); }
.dstep-days small { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.dstep-days b { font: 400 18px/1.1 var(--display); }
.dstep-days .is-today small { color: var(--accent-text); }
.dstep-days .is-sun { opacity: .6; }
.dstep-days button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dstep-days button[aria-pressed="true"] small { color: var(--accent-ink); opacity: .75; }
.dur-field { max-width: 220px; }

/* real logo in the sidebar; the GW mark stays for the collapsed menu */
.brand .brand-logo { display: block; color: var(--ink); }
.brand .brand-logo svg { display: block; width: 128px; height: auto; }
@media (min-width: 861px) { :root:not(.side-mini) .brand .gw-mark { display: none; } }
.brand small { margin-top: 8px; }

/* drop target and reschedule preview on the schedule */
.ghost { position: absolute; left: 4px; right: 4px; z-index: 4; pointer-events: none; display: flex; flex-wrap: wrap; gap: 2px 8px; align-content: flex-start; padding: 4px 8px; overflow: hidden;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--ink); font-size: 13px; line-height: 1.25; }
.ghost b { font: 400 14px/1.25 var(--display); color: var(--accent-text); }
.ghost.bad { border-color: var(--bad); background: var(--bad-bg); }
.ghost.bad b { color: var(--bad); }
.ghost.preview { animation: ghostPulse 1.6s ease-in-out infinite; }
.ghost.q { position: relative; left: auto; right: auto; min-height: 52px; margin-bottom: 8px; }
@keyframes ghostPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 28%, transparent); } }
.bk.moving { opacity: .35; }
@media (prefers-reduced-motion: reduce) { .ghost.preview { animation: none; } }
/* reschedule preview: the schedule moves out from under the card and stays readable */
@media (min-width: 1100px) {
  body.previewing .main { padding-right: calc(min(540px, 100%) + 16px); }
  body.previewing .ov { background: rgba(0, 0, 0, .18); }
}

/* status colours on the schedule: not confirmed = amber, confirmed = blue (clear at a glance) */
.bk.new { background: color-mix(in srgb, var(--new) 22%, var(--panel)); border-left: 4px solid var(--new); }
.bk.confirmed { background: color-mix(in srgb, var(--conf) 20%, var(--panel)); border-left: 4px solid var(--conf); }
.bk.unassigned { border: 0; border-left-width: 4px; border-left-style: solid; outline: 1px dashed var(--new); outline-offset: -1px; }
.bk.confirmed.unassigned { outline-color: var(--conf); }
.st.confirmed { color: var(--conf); background: var(--conf-bg); }
.st.archived { color: var(--muted); background: var(--soft); }
.fd-card.st-new.next { border-left: 4px solid var(--new); }
.fd-card.st-confirmed.next { border-left: 4px solid var(--conf); }
/* archive */
.btn.ghost-archive { color: var(--muted); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-fill:disabled { opacity: .45; }
.archive-box { display: grid; gap: 12px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.reason-chips button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 9px 12px; font-size: 14px; font-weight: 600; border-radius: 2px; }
.reason-chips button:hover { border-color: var(--muted); }
.reason-chips button[aria-checked="true"] { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.bk.new.unassigned { border-left-color: var(--new); }
.bk.confirmed.unassigned { border-left-color: var(--conf); }

/* waiting for a post: a gold light runs around the card, in sync for all of them */
@property --q-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.bk.waiting, .fd-card.waiting { position: relative; outline: 0; }
.bk.waiting::before, .fd-card.waiting::before, .qcard.waiting::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; padding: 2px; border-radius: inherit;
  background: conic-gradient(from var(--q-ang), color-mix(in srgb, var(--new) 30%, transparent) 0 52%, var(--new) 74%, #fff0c2 84%, var(--new) 90%, color-mix(in srgb, var(--new) 30%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: q-spin 2.4s linear infinite; animation-delay: var(--q-delay, 0ms);
}
.fd-card.waiting { border-color: transparent; }
@keyframes q-spin { to { --q-ang: 360deg; } }
@media (prefers-reduced-motion: reduce) { .bk.waiting::before, .fd-card.waiting::before, .qcard.waiting::before { animation: none; background: var(--new); } }
.bk.waiting { border-left-color: var(--new); }

/* expanded «Без посту» card: full lead info + actions */
.qcard { position: relative; display: grid; gap: 6px; padding: 11px 12px 12px 14px; cursor: pointer; font-size: 14px; line-height: 1.3;
  background: color-mix(in srgb, var(--new) 16%, var(--panel)); border-left: 4px solid var(--new); }
.qcard.confirmed { background: color-mix(in srgb, var(--conf) 16%, var(--panel)); border-left-color: var(--conf); }
.qcard:hover { filter: brightness(1.06); }
.qcard[draggable="true"] { cursor: grab; }
.qcard.moving { opacity: .35; }
.qc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qc-time { font: 400 18px/1 var(--display); }
.qc-top .st { font-size: 11px; }
.qc-who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.qc-who b { font-size: 15px; font-weight: 650; }
.qc-who a { color: var(--accent-text); font-weight: 600; text-decoration: none; position: relative; z-index: 2; }
.qc-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-line.car { font-weight: 600; }
.qc-comment { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-style: italic; }
.qc-meta { font-size: 12px; color: var(--muted); }
.qc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.qbtn { position: relative; z-index: 2; flex: 1 1 auto; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 10px; font-weight: 650; font-size: 13px; border-radius: 2px; white-space: nowrap; }
.qbtn:hover { border-color: var(--muted); }
.qbtn.ok { background: var(--ok); border-color: var(--ok); color: #05080b; flex-basis: 100%; }
.qbtn.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.queue .list { gap: 10px; }
/* site bookings on the «Заявки» page */
.sec-h { margin: 18px 0 10px; font: 400 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.sec-h b { color: var(--new); }
.site-new:empty { display: none; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

/* schedule cards: car → phone → service */
.bk .ph { color: var(--ink); opacity: .85; font-variant-numeric: tabular-nums; }
/* expanded cards: car and phone first */
.qc-car { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-car.none { font-weight: 500; font-size: 14px; color: var(--muted); }
.qc-phone { color: var(--accent-text); font-weight: 700; font-size: 15px; text-decoration: none; position: relative; z-index: 2; width: max-content; font-variant-numeric: tabular-nums; }
.qc-phone:hover { text-decoration: underline; }
/* call-back requests: violet, phone first */
.sec-h.call { color: var(--call); }
.ccard { position: relative; display: grid; gap: 6px; align-content: start; padding: 11px 12px 12px 14px; font-size: 14px; line-height: 1.3;
  background: color-mix(in srgb, var(--call) 12%, var(--panel)); border-left: 4px solid var(--call); }
.ccard.booked { background: var(--panel); border-left-color: var(--ok); opacity: .85; }
.cc-state { font: 400 12px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--call); padding: 5px 7px; background: var(--call-bg); }
.ccard.new .cc-state::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--call); margin-right: 6px; vertical-align: 1px; animation: callPing 1.4s ease-in-out infinite; }
@keyframes callPing { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--call) 25%, transparent); } }
.cc-phone { font: 400 21px/1.1 var(--display); color: var(--ink); text-decoration: none; width: max-content; font-variant-numeric: tabular-nums; }
.cc-phone:hover { color: var(--call); }
.cc-facts { display: grid; gap: 3px; font-size: 13px; }
.cc-facts span { display: flex; gap: 8px; }
.cc-facts i { font-style: normal; color: var(--muted); width: 52px; flex: none; }
.cc-note { font-size: 13px; padding: 6px 8px; background: var(--soft); white-space: pre-line; }
.qbtn.call { background: var(--call); border-color: var(--call); color: #fff; flex-basis: 100%; text-align: center; text-decoration: none; }
.qbtn.ok-soft { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
@media (prefers-reduced-motion: reduce) { .ccard.new .cc-state::before { animation: none; } }
/* archive */
.acard { display: grid; gap: 6px; align-content: start; padding: 11px 12px 12px 14px; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--muted); }
.st.archived { white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
/* records: period switcher + day groups */
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.period-label { font: 400 17px/1 var(--display); text-transform: uppercase; padding: 0 6px; min-width: 200px; text-align: center; }
.list-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.stat-chip { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 6px 10px; font-size: 13px; border-radius: 2px; }
.stat-chip b { color: var(--ink); font: 400 15px/1 var(--display); }
.stat-chip.new b { color: var(--new); } .stat-chip.confirmed b { color: var(--conf); } .stat-chip.done b { color: var(--ok); } .stat-chip.no_show b, .stat-chip.canceled b { color: var(--bad); }
.stat-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); background: var(--live-bg); }
.rec-tbl tr.day-h td { background: var(--soft); padding: 9px 12px; font-size: 13px; color: var(--muted); position: sticky; top: 0; }
.rec-tbl tr.day-h b { color: var(--ink); display: inline-block; }
.rec-tbl tr.day-h b::first-letter { text-transform: uppercase; }
.rec-tbl .car-cell { font-weight: 650; }
.ac-reason { font-size: 13px; font-weight: 650; color: var(--bad); }
.ac-reason::before { content: 'Причина: '; color: var(--muted); font-weight: 400; }

/* ===== key client block: dark header card (car → phone → name), the same in light theme ===== */
.qcard, .ccard { padding: 0; gap: 0; background: var(--panel); }
.qc-hero, .c-hero { --hero: var(--muted); position: relative; display: grid; gap: 7px; padding: 12px 14px 13px; color: #eef3f2;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--hero) 30%, #121a21) 0%, #0e1419 55%, #0a0e12 100%); }
.qcard.new .qc-hero, .c-hero.new { --hero: var(--new); }
.qcard.confirmed .qc-hero, .c-hero.confirmed { --hero: var(--conf); }
.ccard .qc-hero { --hero: var(--call); }
.c-hero.done { --hero: var(--ok); } .c-hero.no_show, .c-hero.canceled { --hero: var(--bad); }
.qc-hero .qc-top, .c-hero .qc-top { min-height: 26px; }
.ch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); font-size: 13px; font-weight: 650; color: #fff; white-space: nowrap; }
.ch-pill .ico { width: 15px; height: 15px; }
.ch-meta { font-size: 12px; color: rgba(238, 243, 242, .66); text-align: right; }
.qc-hero .qc-car, .c-hero .qc-car { font: 400 20px/1.15 var(--display); letter-spacing: .01em; color: #fff; white-space: normal; }
.c-hero .qc-car { font-size: 27px; }
.qc-hero .qc-car.none, .c-hero .qc-car.none { font: 500 15px/1.2 var(--body); color: rgba(238, 243, 242, .55); }
.qc-hero .qc-phone, .c-hero .qc-phone, .qc-hero .cc-phone { display: inline-flex; align-items: center; gap: 7px; color: #72ebd6; font: 700 17px/1.1 var(--body); text-decoration: none; width: max-content; font-variant-numeric: tabular-nums; position: relative; z-index: 2; }
.c-hero .qc-phone { font-size: 21px; }
.qc-hero .cc-phone { font: 400 21px/1.1 var(--display); color: #fff; }
.qc-phone .ico, .cc-phone .ico { width: 17px; height: 17px; }
.qc-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-name { color: rgba(238, 243, 242, .85); font-weight: 600; font-size: 14px; }
.ch-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ch-tag { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(238, 243, 242, .8); white-space: nowrap; }
.ch-tag.ok { background: rgba(114, 235, 214, .16); color: #72ebd6; }
.ch-tag.warn { background: rgba(242, 177, 77, .2); color: #f2b14d; }
.ch-tag.bad { background: rgba(255, 107, 107, .18); color: #ff8c8c; }
.ch-comment { display: flex; gap: 8px; font-style: italic; color: rgba(238, 243, 242, .78); font-size: 14px; }
.ch-comment .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; font-style: normal; }
.c-hero { margin: 0 0 4px; border-left: 4px solid var(--hero); gap: 9px; padding: 16px 18px; }
.ch-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.c-hero .btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); color: #fff; }
.c-hero .btn:hover { background: rgba(255, 255, 255, .14); }
.c-hero .st, .qc-hero .st { background: rgba(0, 0, 0, .35); }
/* body list under the header, check-list style */
.qc-list { list-style: none; margin: 0; padding: 10px 14px 4px; display: grid; gap: 6px; }
.qc-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; min-width: 0; }
.qc-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-list li.cmt span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-style: italic; color: var(--muted); }
.qc-list li.meta { font-size: 12px; color: var(--muted); }
.qc-list .ico { width: 16px; height: 16px; flex: none; color: var(--accent-text); margin-top: 1px; }
.qcard .qc-acts, .ccard .qc-acts { padding: 6px 12px 12px; }
.ccard > .cc-facts, .ccard > .qc-comment, .ccard > .cc-note, .ccard > .qbtn { margin: 0 14px; }
.ccard > .cc-facts { padding-top: 10px; }
.ccard > .qc-comment, .ccard > .cc-note { margin-top: 6px; }
/* icons inside buttons */
.btn .ico, .qbtn .ico { width: 17px; height: 17px; flex: none; }
.qbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.drawer .actions .btn .ico { width: 18px; height: 18px; }
/* cards in grids must shrink to their column */
.qgrid > *, .qcard > *, .ccard > *, .qc-hero > *, .c-hero > * { min-width: 0; }
.qc-hero .qc-top, .c-hero .qc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.qc-hero .qc-top .st { white-space: nowrap; }
.qbtn { min-width: 0; }
.qbtn span { overflow: hidden; text-overflow: ellipsis; }
.qc-hero .qc-car { overflow-wrap: anywhere; }

/* hover preview over schedule cards */
.hovercard { position: fixed; z-index: 60; width: 300px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--muted);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45); animation: fade .12s; }
.hovercard.new { border-left-color: var(--new); } .hovercard.confirmed { border-left-color: var(--conf); } .hovercard.done { border-left-color: var(--ok); } .hovercard.no_show { border-left-color: var(--bad); }
.hovercard.new .qc-hero { --hero: var(--new); } .hovercard.confirmed .qc-hero { --hero: var(--conf); } .hovercard.done .qc-hero { --hero: var(--ok); } .hovercard.no_show .qc-hero { --hero: var(--bad); }
.hovercard .qc-list { padding-bottom: 8px; }
.hc-hint { font-size: 12px; color: var(--muted); padding: 7px 14px 9px; border-top: 1px solid var(--line); }

/* month calendar popover */
.calpop { position: fixed; z-index: 70; width: 300px; padding: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); display: grid; gap: 10px; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-head b { font: 400 15px/1 var(--display); text-transform: uppercase; }
.cp-head .ibtn { height: 34px; min-width: 34px; }
.cp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cp-grid i { font-style: normal; font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cp-grid button { height: 36px; border: 1px solid transparent; background: var(--soft); color: var(--ink); font-weight: 600; font-size: 14px; border-radius: 2px; }
.cp-grid button:hover { border-color: var(--muted); }
.cp-grid button.sun { color: var(--muted); }
.cp-grid button.today { border-color: var(--accent); color: var(--accent-text); }
.cp-grid button.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cp-foot { display: flex; gap: 6px; }
.cp-foot .btn { flex: 1; }

/* compact drag image for queue cards (built off-screen for setDragImage) */
.bk.drag-chip { position: fixed; top: -1000px; left: -1000px; display: block; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.qcard.dragging { opacity: .4; }

/* phone and name on one line in the dark header */
.ch-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ch-line .ch-name { font-size: 15px; color: rgba(238, 243, 242, .9); }
.c-hero .ch-line .ch-name { font-size: 17px; }
.acard .ch-line .ch-name { color: var(--ink); }
.qc-sub:empty { display: none; }
/* icons on filled buttons take the button text colour (no mint on mint) */
.btn.primary .ico, .btn.danger-fill .ico, .qbtn.ok .ico, .qbtn.call .ico, .tile.main .ico { color: currentColor; }

/* live push cards (top right) */
#push { position: fixed; top: 14px; right: 14px; z-index: 80; display: grid; gap: 10px; width: min(360px, calc(100vw - 28px)); }
.push { position: relative; display: flex; gap: 12px; padding: 13px 38px 13px 13px; background: #0e1419; color: #eef3f2; border: 1px solid rgba(255, 255, 255, .14);
  border-left: 4px solid var(--accent); box-shadow: 0 18px 48px rgba(0, 0, 0, .5); animation: pushIn .35s cubic-bezier(.2, .8, .2, 1); }
.push.req { border-left-color: var(--call); }
.push-ic { width: 36px; height: 36px; display: grid; place-items: center; flex: none; background: var(--accent); color: #05080b; border-radius: 50%; }
.push.req .push-ic { background: var(--call); color: #fff; }
.push-ic .ico { width: 18px; height: 18px; color: currentColor; }
.push-t { display: grid; gap: 3px; min-width: 0; }
.push-t small { font: 400 11px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase; color: #72ebd6; }
.push.req .push-t small { color: #c9adff; }
.push-t b { font-size: 16px; font-weight: 700; }
.push-t > span { font-size: 13px; color: rgba(238, 243, 242, .75); }
.push-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.push-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; border-radius: 50%; }
@keyframes pushIn { from { transform: translateX(30px); opacity: 0; } }
/* a lead that just arrived: glows for a while */
.is-fresh { animation: freshGlow 1.6s ease-in-out 4; }
.is-fresh::after { content: 'НОВА'; position: absolute; top: -8px; right: 10px; z-index: 3; font: 400 10px/1 var(--display); letter-spacing: .06em; padding: 4px 6px; background: var(--accent); color: #05080b; }
.ccard.is-fresh::after { background: var(--call); color: #fff; }
.qcard, .ccard { overflow: visible; }
@keyframes freshGlow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { .is-fresh, .push { animation: none; } }

/* «Перенести» while its panel is open */
.drawer .actions .btn.is-active { border-color: var(--accent); background: var(--live-bg); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
/* slot grid reloads in place (dimmed), no spinner jump */
.slots-grid { transition: opacity .12s; }
.slots-grid.loading { opacity: .45; pointer-events: none; }

/* «потрібен інший час» */
.qbtn.main-move { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); flex-basis: 100%; }
.qbtn.main-move .ico { color: currentColor; }
.bk .tag.need { background: var(--bad); color: #fff; }
.bk .moved { color: var(--accent-text); }

/* call-back request drawer */
.c-hero.call { --hero: var(--call); }
.c-hero .cc-phone { display: inline-flex; align-items: center; gap: 8px; font: 400 26px/1.1 var(--display); color: #fff; text-decoration: none; }
.c-hero .cc-phone .ico { width: 20px; height: 20px; color: #c9adff; }
.ccard { cursor: pointer; }
.ccard:hover { filter: brightness(1.06); }
.acard { cursor: pointer; }

/* status buttons: the current one is lit in its colour; ↺ = press again to undo */
.st-acts .btn.on { box-shadow: inset 0 0 0 1px currentColor; }
.st-acts .btn.on.st-confirmed { background: var(--conf-bg); border-color: var(--conf); color: var(--conf); }
.st-acts .btn.on.st-done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.st-acts .btn.on.st-no_show, .st-acts .btn.on.st-canceled { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.st-acts .btn.on.st-archive { background: var(--soft); border-color: var(--muted); color: var(--ink); }
.st-acts .btn.on .ico { color: currentColor; }
.st-acts .undo-x { font-weight: 700; opacity: .8; margin-left: 2px; }
.st-acts .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== sales board ===== */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(188px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kb-col { --stc: var(--muted); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--stc); display: flex; flex-direction: column; min-height: 320px; max-height: calc(100vh - 260px); }
.kb-col.arch { opacity: .8; }
.kb-col.drop { outline: 2px dashed var(--stc); outline-offset: -2px; background: color-mix(in srgb, var(--stc) 8%, var(--panel)); }
.kb-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.kb-head > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-head b { font: 400 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.kb-n { font: 400 13px/1 var(--display); padding: 4px 7px; background: color-mix(in srgb, var(--stc) 22%, transparent); color: var(--stc); }
.kb-head small { color: var(--muted); font-size: 12px; }
.kb-list { padding: 10px; display: grid; gap: 8px; overflow-y: auto; align-content: start; flex: 1; }
.kb-empty { color: var(--muted); font-size: 13px; padding: 14px 6px; text-align: center; border: 1px dashed var(--line); }
.kb-card { position: relative; display: grid; gap: 5px; padding: 10px 11px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--stc); cursor: grab; font-size: 14px; }
.kb-card:hover { border-color: var(--muted); border-left-color: var(--stc); }
.kb-card.dragging { opacity: .4; }
.kb-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kb-int { font-weight: 700; line-height: 1.25; }
.kb-int.none { font-weight: 500; color: var(--muted); font-style: italic; }
.kb-amt { font: 400 14px/1.25 var(--display); color: var(--ok); white-space: nowrap; }
.kb-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 700; text-decoration: none; width: max-content; font-variant-numeric: tabular-nums; }
.kb-phone .ico { width: 15px; height: 15px; }
.kb-who { color: var(--ink); opacity: .85; font-size: 13px; }
.kb-note { font-size: 12px; color: var(--muted); background: var(--soft); padding: 4px 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-note.bad { color: var(--bad); }
.kb-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.kb-meta .ico { width: 13px; height: 13px; color: var(--muted); }
.deal-badge { background: #ff9f43 !important; color: #05080b !important; }
.st.deal { color: var(--stc); background: color-mix(in srgb, var(--stc) 16%, transparent); }
.c-hero.deal { border-left-color: var(--hero); }
.stage-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stage-steps button { --stc: var(--muted); display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 650; font-size: 13px; text-align: left; border-radius: 2px; }
.stage-steps button i { font: 400 12px/1 var(--display); font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; background: var(--soft); color: var(--muted); border-radius: 50%; flex: none; }
.stage-steps button.past i { background: color-mix(in srgb, var(--stc) 25%, transparent); color: var(--stc); }
.stage-steps button:hover:not(.on) { border-color: var(--stc); }
.stage-steps button.on { border-color: var(--stc); background: color-mix(in srgb, var(--stc) 16%, var(--panel)); color: var(--stc); box-shadow: inset 0 0 0 1px var(--stc); }
.stage-steps button.on i { background: var(--stc); color: #05080b; }
.push.deal { border-left-color: #ff9f43; }
.push.deal .push-ic { background: #ff9f43; color: #05080b; }
.push.deal .push-t small { color: #ffc58f; }
@media (max-width: 700px) { .stage-steps { grid-template-columns: 1fr 1fr; } }
.kb-top { flex-direction: column; gap: 3px; }

/* inside a frame that reaches under the screen edges (iPhone): keep content inside the safe area */
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

/* services as toggles (one or several per booking) */
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; font-weight: 400; }
.svc-chips button { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 11px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600; border-radius: 2px; }
.svc-chips button small { color: var(--muted); font-weight: 500; font-size: 12px; }
.svc-chips button:hover { border-color: var(--muted); }
.svc-chips button.on { border-color: var(--accent); background: var(--live-bg); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.svc-total { font-size: 13px; color: var(--muted); margin-left: 4px; }
.field.span2 { grid-column: 1 / -1; }

/* what a sales lead wants */
.specs { display: grid; gap: 12px; }
.seg-need { display: flex; flex-wrap: wrap; gap: 6px; text-transform: none; letter-spacing: 0; }
.seg-need button { padding: 9px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 650; font-size: 14px; border-radius: 2px; }
.seg-need button[aria-pressed="true"] { border-color: #ff9f43; color: #ff9f43; background: color-mix(in srgb, #ff9f43 14%, var(--panel)); box-shadow: inset 0 0 0 1px #ff9f43; }
.specs .field select + input[type=text] { margin-top: 1px; } /* «Свій варіант» under its list only */
.specs .grid2 { align-items: start; }
.specs .field { align-content: start; }

/* «Записи і ліди»: one list for bookings, sales and call-back requests */
.type-tag { display: inline-block; font: 400 11px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; padding: 4px 7px; white-space: nowrap; }
.type-tag.t-bk { color: var(--conf); background: var(--conf-bg); }
.type-tag.t-deal { color: #ff9f43; background: color-mix(in srgb, #ff9f43 15%, transparent); }
.type-tag.t-req { color: var(--call); background: var(--call-bg); }
.need-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; color: var(--new); background: var(--new-bg); }
.stat-chip.type-bk b { color: var(--conf); } .stat-chip.type-deal b { color: #ff9f43; } .stat-chip.type-req b { color: var(--call); }
.chip-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }

/* autofill: fields pre-filled from the client's text or history */
.af-lab { display: inline-flex; align-items: center; gap: 0; }
.af-mark { display: inline-block; width: max-content; justify-self: start; align-self: center; flex: none; margin-left: 6px; padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; color: var(--accent-ink, #05080b); background: #72ebd6; border-radius: 999px; cursor: help; }
.af-note { display: grid; gap: 2px; margin: 0; padding: 8px 10px; font-size: 12.5px; line-height: 1.4; color: rgba(238, 243, 242, .85); background: rgba(114, 235, 214, .1); border-left: 2px solid #72ebd6; }
.af-note b { color: #72ebd6; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

/* confirm flight: queue card → its place on the schedule */
.fly-ghost { position: fixed; z-index: 950; pointer-events: none; overflow: hidden; border-radius: 12px; background: var(--bg); box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(114, 235, 214, .35); }
.fly-ghost.in-flight { box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 2px rgba(114, 235, 214, .6); }
.fly-ghost .fly-big { position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); transform-origin: 50% 50%; animation: none !important; }
.fly-ghost .fly-mini { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; animation: none !important; }
.bk.fly-target { opacity: 0 !important; }
.bk.fly-land { animation: fly-land .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes fly-land { 0% { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(114, 235, 214, .9); } 60% { transform: scale(.98); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(114, 235, 214, 0); } }
@media (prefers-reduced-motion: reduce) { .bk.fly-land { animation: none; } }

/* v52: lead inbox — purchase hint, request journal, client history */
.ch-tag.sale { background: rgba(255, 159, 67, .2); color: #ff9f43; }
.qbtn.sale, .btn.sale { border-color: rgba(255, 159, 67, .55); color: #ff9f43; }
.rlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rlog-i { display: grid; grid-template-columns: 96px 1fr; column-gap: 12px; font-size: 13px; line-height: 1.45; padding-left: 12px; border-left: 2px solid var(--line, rgba(255,255,255,.12)); }
.rlog-i time { color: var(--muted, #93a29e); font-variant-numeric: tabular-nums; grid-row: span 2; }
.rlog-i .muted { grid-column: 2; }
.rlog-i.repeat { border-left-color: #f2b14d; }
.rlog-i.to_sale { border-left-color: #ff9f43; }
.rlog-i.booked { border-left-color: #72ebd6; }
.rlog-i.archived { border-left-color: #ff6b6b; }
@media (max-width: 560px) { .rlog-i { grid-template-columns: 1fr; } .rlog-i time { grid-row: auto; } }

/* v53: no call actions — the card leads with «Записати в розклад», then «Перенести в продажі»; phones are plain text */
.qbtn.wide { flex-basis: 100%; }
.qc-acts .qbtn.ok { padding: 11px 10px; font-size: 14px; }
.cc-phone, .qc-phone, .kb-phone { user-select: all; cursor: text; }
.qc-hero .cc-phone:hover, .cc-phone:hover { color: inherit; }
.qc-phone:hover { text-decoration: none; }

/* v54: every request card has the same rows — phone / name / car / tags / facts — and buttons sit at the bottom */
.ccard { display: flex; flex-direction: column; }
.ccard > .qc-acts { margin-top: auto; }
.cc-name { font-weight: 650; font-size: 15px; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-hero .cc-name, .c-hero .cc-name { color: rgba(238, 243, 242, .86); }
.cc-name.none, .cc-facts .none { color: var(--muted); font-weight: 500; }
.qc-hero .qc-car.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.c-hero .cc-name { font-size: 17px; }

/* v55: request drawer actions — same layout as the card: big «Записати в розклад», then two equal buttons */
.req-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-acts > .btn { min-height: 46px; width: 100%; }
.req-acts > .btn.primary { grid-column: 1 / -1; min-height: 52px; font-size: 14px; }
.req-acts > .btn:not(.primary) { font-weight: 650; }
.req-acts > :nth-child(n+4) { grid-column: 1 / -1; }
.btn.bad-line { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.bad-line:hover { border-color: var(--bad); }
.btn.bad-line .ico { color: currentColor; }

/* v56: clear hover / press states on request actions (card and drawer) */
.qbtn, .req-acts > .btn { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; cursor: pointer; }
.qbtn:hover, .req-acts > .btn:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .45); }
.qbtn:active, .req-acts > .btn:active { transform: translateY(1px); }
.qbtn:focus-visible, .req-acts > .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* main action: lighter mint + glow */
.qbtn.main-move:hover, .req-acts > .btn.primary:hover { background: #a6f6e8; border-color: #a6f6e8; filter: none; box-shadow: 0 0 0 3px rgba(114, 235, 214, .22), 0 6px 18px rgba(114, 235, 214, .18); }
/* sales: orange tint */
.qbtn.sale:hover, .req-acts > .btn.sale:hover { background: rgba(255, 159, 67, .14); border-color: #ff9f43; color: #ffb36b; }
/* archive: red tint */
.qbtn.bad:hover, .req-acts > .btn.bad-line:hover { background: var(--bad-bg); border-color: var(--bad); color: #ff8a8a; }
:root[data-theme="light"] .qbtn:hover, :root[data-theme="light"] .req-acts > .btn:not(.primary):not(.sale):not(.bad-line):hover { background: rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .35); }
.qbtn.sale .ico, .qbtn.bad .ico, .req-acts > .btn.sale .ico { color: currentColor; }
