/* Kivorsa design system: violet brand, dark sidebar, soft light surfaces (dark mode follows the OS). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('./inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('./inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('./inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
:root {
  --brand: #7c5cff;
  --brand-600: #6a46f2;
  --brand-50: #f3efff;
  --brand-100: #e7defe;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #a855f7 55%, #e879f9 100%);
  --side-bg: #15112a;
  --side-bg-2: #211a3d;
  --side-text: #b8b2d6;
  --side-active: rgba(139, 92, 246, 0.22);
  --bg: #f4f3f9;
  --panel: #ffffff;
  --panel-2: #faf9fd;
  --line: #ecebf4;
  --line-2: #dfdcec;
  --text: #1c1830;
  --muted: #7c7894;
  --in: #f2f1f8;
  --out: #efe9ff;
  --note: #fff7d9;
  --note-line: #f2dea0;
  --green: #15803d;
  --green-bg: #e3f6ea;
  --red: #dc2626;
  --red-bg: #fdecec;
  --blue: #2563eb;
  --blue-bg: #e8effe;
  --amber: #a16207;
  --amber-bg: #fef3c7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 17, 48, 0.04), 0 8px 28px rgba(23, 17, 48, 0.06);
  --shadow-lg: 0 24px 60px rgba(23, 17, 48, 0.22);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9b84ff;
    --brand-600: #8a70ff;
    --brand-50: #241d42;
    --brand-100: #2f2657;
    --side-bg: #0d0a1c;
    --side-bg-2: #1a1533;
    --bg: #110e20;
    --panel: #19152c;
    --panel-2: #1e1934;
    --line: #2a2445;
    --line-2: #362e58;
    --text: #eceaf6;
    --muted: #9d97bb;
    --in: #241e3c;
    --out: #2f2559;
    --note: #352c18;
    --note-line: #5c4b1d;
    --green: #4ade80;
    --green-bg: #12301f;
    --red: #f87171;
    --red-bg: #3a1717;
    --blue: #7aa2ff;
    --blue-bg: #18244a;
    --amber: #fbbf24;
    --amber-bg: #3a2e10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
/* Phones: the visible height (address bar included), no font inflation in landscape, no grey tap flash. */
@supports (height: 100dvh) { #app { height: 100dvh; } }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-600); text-decoration: none; }
h1 { font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 0; }
h4 { font-size: 13px; margin: 0 0 10px; color: var(--text); font-weight: 650; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 18px; }
.pad-x { padding: 0 16px; }
.grow { flex: 1; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.error { color: var(--red); }
.warn { color: var(--amber); }
.splash { display: grid; place-items: center; height: 100%; color: var(--muted); }
.icon { flex: none; display: block; }

/* inputs */
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius-sm);
  padding: 8px 11px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--brand); }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0; font-weight: 550; }
label > input, label > select, label > textarea { margin-top: 5px; color: var(--text); font-size: 14px; font-weight: 400; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--text); white-space: nowrap; transition: 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-600); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, 0.28); }
.btn.primary:hover:not(:disabled) { background: var(--brand-600); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-bg); background: var(--red-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-600); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; }
.btn.more { display: flex; margin: 12px auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; flex: none; transition: 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--brand-50); color: var(--brand-600); }
.icon-btn.on { background: var(--brand-50); color: var(--brand-600); }
.icon-btn:disabled { opacity: 0.4; }
button.link { border: 0; background: none; color: var(--brand-600); padding: 0; cursor: pointer; font-weight: 600; }

/* pills & chips */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); vertical-align: middle; text-transform: none; }
.pill.purple { background: var(--brand-50); color: var(--brand-600); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.soft { background: var(--in); color: var(--muted); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.add { border: 1px dashed var(--line-2); background: transparent; color: var(--muted); padding: 3px 7px; cursor: pointer; }
.chip-x { border: 0; background: none; color: inherit; padding: 0 0 0 2px; cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.6; }
.chip-x:hover { opacity: 1; }
.delta { font-size: 12px; font-weight: 700; margin-left: 6px; }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.banner { display: flex; align-items: center; gap: 8px; background: var(--brand-50); color: var(--brand-600); padding: 9px 16px; font-size: 13px; font-weight: 550; }
.banner.warn { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-sm); }
.support-card { margin-top: 16px; }
.support-switch { display: inline-flex; align-items: center; gap: 10px; }
.support-visits { list-style: none; margin: 0; padding: 0 6px 4px; }
.support-visits li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px; color: var(--text); }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.empty-art { width: 168px; height: 168px; object-fit: contain; margin-bottom: 4px; animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .empty-art { animation: none; } }
.empty-title { font-weight: 700; font-size: 15px; }

/* avatar */
.avatar {
  position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 650; letter-spacing: 0.01em;
  background: linear-gradient(145deg, hsl(var(--h) 85% 93%), hsl(calc(var(--h) + 25) 75% 86%)); color: hsl(var(--h) 45% 32%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 80% / 0.6);
}
.chan-badge { position: absolute; right: -3px; bottom: -3px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px var(--panel), 0 1px 3px rgba(0, 0, 0, 0.18); }
@media (prefers-color-scheme: dark) {
  .avatar { background: linear-gradient(145deg, hsl(var(--h) 40% 30%), hsl(calc(var(--h) + 25) 45% 24%)); color: hsl(var(--h) 80% 86%); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 40% / 0.6); }
}
.logo { display: block; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(124, 92, 255, 0.35)); }

/* modal & menus */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 12, 38, 0.45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 20px; padding: 20px 22px; width: min(440px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(660px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pop-wrap { position: relative; }
.menu { position: absolute; z-index: 30; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--text); }
.menu button:hover { background: var(--brand-50); color: var(--brand-600); }
.menu.right { right: 0; top: 42px; }

/* ---------- login ---------- */
.login-page { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, #3b2a86 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #6d28d9 0%, transparent 55%), #120e26; }
.login { width: min(380px, 100%); background: var(--panel); padding: 30px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.login .btn { margin-top: 16px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 16px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; padding: 0 6px; }
.workspace { display: flex; align-items: center; gap: 10px; background: var(--side-bg-2); border-radius: 14px; padding: 10px; }
.ws-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ws-text { display: grid; line-height: 1.2; }
.ws-text strong { color: #fff; font-size: 13.5px; }
.ws-text small { color: var(--side-text); font-size: 11.5px; }
.side-nav { display: grid; gap: 3px; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--side-text); font-weight: 550; }
.side-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.side-item.active { background: var(--side-active); color: #fff; }
.side-item span:first-of-type { flex: 1; }
.nav-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 8px; position: relative; }
.side-badge { font-size: 11.5px; font-weight: 650; padding: 5px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); }
.side-badge.warn { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.me { display: flex; align-items: center; gap: 10px; border: 0; background: var(--side-bg-2); color: var(--side-text); border-radius: 14px; padding: 8px 10px; cursor: pointer; text-align: left; }
.me-text { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.me-text strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11.5px; }
.side-foot .menu { bottom: 58px; left: 0; right: 0; }
.main { min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.bottom-nav { display: none; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 344px minmax(0, 1fr); height: 100%; }
.conv-list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 20px 16px 10px 20px; }
.list-tool { padding: 0 16px 8px; }
.push-banner { display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 10px 8px 10px 12px; border-radius: 14px; background: var(--brand-50); color: var(--text); font-size: 13px; line-height: 1.35; }
.push-banner > .icon { color: var(--brand-600); }
.push-banner .btn { flex: none; }
.tabs { display: flex; gap: 0; padding: 4px 6px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 5px 5px; border-radius: 999px; font-weight: 600; font-size: 12px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; letter-spacing: -0.01em; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--brand-50); color: var(--brand-600); }
.tab-count { font-size: 10.5px; background: var(--brand); color: #fff; border-radius: 999px; padding: 0 5px; line-height: 17px; }
.list-scroll { overflow-y: auto; flex: 1; padding: 8px; }
.conv { display: flex; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 11px 12px; border-radius: 14px; cursor: pointer; color: var(--text); }
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--brand-50); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-name { font-weight: 750; }
.conv-time { color: var(--muted); font-size: 12px; flex: none; }
.conv-preview { flex: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-preview { color: var(--text); }
.conv-flag { color: var(--muted); }
.unread-dot { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.thread-empty { display: grid; place-items: center; height: 100%; }

.thread { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
.thread.with-panel { grid-template-columns: minmax(0, 1fr) 320px; }
.thread-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.thread-head .back { display: none; }
.who { flex: 1; min-width: 90px; display: grid; grid-template-columns: minmax(0, 1fr); border: 0; background: none; padding: 0; margin: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.who-name { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { color: var(--green); display: inline-flex; align-items: center; gap: 5px; }
.online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.assign { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px 0 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.assign select { border: 0; margin: 0; padding: 6px 4px; box-shadow: none; background: transparent; width: auto; max-width: 130px; font-weight: 600; color: var(--text); text-overflow: ellipsis; }
.messages { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 6px; background: var(--panel-2); }
.day { text-align: center; margin: 12px 0 6px; }
.day span { background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.out { justify-content: flex-end; }
.bubble-row.note { justify-content: center; }
.bubble { max-width: min(560px, 76%); border-radius: 18px; padding: 9px 13px 6px; overflow-wrap: anywhere; position: relative; }
.bubble.in { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.out { background: var(--out); border-bottom-right-radius: 6px; }
.bubble.note { background: var(--note); border: 1px dashed var(--note-line); max-width: 70%; border-radius: 14px; }
.bubble-label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--brand-600); margin-bottom: 3px; }
.bubble.note .bubble-label { color: var(--amber); }
.bubble .text { white-space: pre-wrap; }
.tpl-gap { display: inline-block; min-width: 1.9em; padding: 0 4px; margin: 0 1px; border: 1px dashed var(--line-2); border-radius: 5px; color: var(--muted); line-height: 1.25; text-align: center; cursor: help; }
.tpl-note { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.bubble img.image { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; }
.bubble img.sticker { max-width: 140px; }
.bubble video { max-width: 100%; max-height: 320px; border-radius: 12px; }
.bubble audio { width: 260px; max-width: 100%; }
.file { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 4px 0; }
.quote { border-left: 3px solid var(--brand); padding: 2px 8px; margin-bottom: 5px; color: var(--muted); font-size: 12.5px; max-height: 3.4em; overflow: hidden; }
.meta { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; }
.st-read { color: var(--brand); }
.st-failed { color: var(--red); }
.fail { color: var(--red); font-size: 12px; margin-top: 3px; }

.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 16px 12px; }
.composer-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.composer-tabs > button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; cursor: pointer; }
.composer-tabs > button.active { background: var(--brand-50); color: var(--brand-600); }
.composer.note-mode .composer-tabs > button.active { background: var(--amber-bg); color: var(--amber); }
.channel-select { width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 999px; }
.window { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.window.ok { color: var(--green); background: var(--green-bg); }
.window.closed { color: var(--amber); background: var(--amber-bg); }
.composer textarea { resize: none; min-height: 52px; max-height: 220px; border-radius: 14px; background: var(--panel-2); field-sizing: content; }
.composer.note-mode textarea { background: var(--note); border-color: var(--note-line); }
.composer-hint { padding: 12px 14px; background: var(--panel-2); border-radius: 14px; color: var(--muted); font-size: 13px; }
.composer-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.send-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px rgba(124, 92, 255, 0.35); }
.send-btn:disabled { opacity: 0.45; box-shadow: none; cursor: default; }

.tpl-list { display: grid; gap: 8px; margin-top: 10px; }
.tpl { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--text); }
.tpl:hover { border-color: var(--brand); }
.tpl-name { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-text { color: var(--muted); white-space: pre-wrap; max-height: 4.4em; overflow: hidden; font-size: 13px; }
.tpl-preview { background: var(--out); border-radius: 14px; padding: 12px 14px; white-space: pre-wrap; margin: 12px 0; display: grid; gap: 6px; }

/* customer panel */
.panel { border-left: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { display: flex; gap: 4px; padding: 14px 14px 10px; }
.panel-tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font-weight: 650; color: var(--muted); cursor: pointer; }
.panel-tabs button.active { background: var(--panel); color: var(--brand-600); box-shadow: var(--shadow); }
.panel-body { overflow-y: auto; padding: 0 14px 16px; display: grid; gap: 12px; align-content: start; }
.customer-head { display: flex; align-items: center; gap: 12px; }
.customer-name { font-weight: 750; font-size: 15.5px; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 14px 0 4px; font-size: 13px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; text-align: right; }
.customer-card .stats { border-top: 1px solid var(--line); padding-top: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.tag-form input { padding: 3px 9px; border-radius: 999px; font-size: 12px; width: 120px; }
.about { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; overflow-wrap: anywhere; }
.about .icon { color: var(--muted); }
.field-row { margin: 8px 0; }
.card-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); }
.card-toggle h4 { margin: 0; }
.note-form { display: grid; gap: 8px; justify-items: end; }
.note-card { background: var(--note); border-color: var(--note-line); padding: 12px; }
.note-card .text { white-space: pre-wrap; margin-bottom: 6px; }

/* ---------- pages ---------- */
/* Rows as tall as their content: otherwise a card that scrolls sideways (tables, the settings tabs)
   shrinks to nothing or scrolls on its own once the page is taller than the screen. */
.page { height: 100%; overflow-y: auto; padding: 28px 32px 40px; display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; }
.page.narrow { max-width: 860px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; display: flex; align-items: baseline; flex-wrap: wrap; }
.period { display: flex; align-items: center; gap: 8px; margin: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px 0 12px; color: var(--muted); }
.period select { border: 0; margin: 0; box-shadow: none; width: auto; background: transparent; font-weight: 600; color: var(--text); }
.chart { position: relative; }
.chart svg { width: 100%; height: 280px; display: block; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--muted); font-size: 11px; }
.chart-line { stroke: var(--brand); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.hover-line { stroke: var(--brand); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.hover-dot { fill: var(--panel); stroke: var(--brand); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 8px 12px; display: grid; font-size: 12.5px; pointer-events: none; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar select { width: auto; border-radius: 999px; }
.search-box { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.search-box input { border: 0; box-shadow: none; padding: 9px 0; background: transparent; }
.table-card { padding: 6px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.hover tbody tr { cursor: pointer; }
.table.hover tbody tr:hover { background: var(--panel-2); }
.cell-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.bc-list { display: grid; gap: 10px; }
.bc-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; color: var(--text); }
.bc-row:hover { border-color: var(--brand-100); }
.bc-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.bc-nums { display: flex; gap: 22px; }
.bc-nums div { display: grid; text-align: right; }
.bc-nums strong { font-size: 16px; }
.bc-nums small { color: var(--muted); font-size: 11.5px; }
.progress { grid-column: 1 / -1; position: relative; height: 6px; background: var(--in); border-radius: 999px; overflow: hidden; }
.progress span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-100); border-radius: 999px; }
.progress span.read { background: var(--brand); }
.form-card { display: grid; gap: 4px; }
.form-card h4 { font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 550; margin-top: 8px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; font-weight: 500; margin: 6px 0; }
.check > input[type='checkbox'], .check > input[type='radio'] { flex: none; } /* a long label must not squeeze the box */
.cond-row { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr auto; gap: 8px; align-items: center; margin: 4px 0; }
.binding { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.binding-label { font-weight: 700; color: var(--brand-600); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .thread-head .btn.small { padding: 5px 10px; }
}
@media (max-width: 1200px) {
  .thread.with-panel { grid-template-columns: minmax(0, 1fr); }
  .thread.with-panel .panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 92vw); z-index: 40; box-shadow: var(--shadow-lg); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 76px 1fr; }
  .brand span, .workspace, .side-item span, .me-text, .side-badge { display: none; }
  .side-item { justify-content: center; position: relative; }
  .nav-count { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 16px; font-size: 10px; padding: 0 4px; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
}
.panel-close { display: none; }
@media (max-width: 1200px) {
  .panel-close { display: inline-grid; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; justify-content: space-around; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-item { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 12px; position: relative; }
  .bottom-item.active { color: var(--brand-600); }
  .bottom-item .nav-count { position: absolute; top: 0; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-thread .conv-list { display: none; }
  .inbox:not(.has-thread) .thread-empty { display: none; }
  .thread-head .back { display: inline-grid; }
  .messages { padding: 12px; }
  .page { padding: 18px 16px 28px; }
  .grid2, .cond-row, .binding { grid-template-columns: 1fr; }
  .bc-row { grid-template-columns: 1fr; }
  .bc-nums { justify-content: space-between; }
  /* An open conversation gets the whole screen, like a phone messenger: no tab bar under the composer. */
  .app.in-thread { grid-template-rows: minmax(0, 1fr); }
  .app.in-thread .bottom-nav { display: none; }
  .app.in-thread .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .thread.with-panel .panel { width: 100%; padding-top: env(safe-area-inset-top); }
  /* iPhone zooms into any field with text under 16px and stays zoomed: keep fields at 16px. */
  input:not([type='checkbox']):not([type='radio']):not(.title-input), select, textarea { font-size: 16px !important; }
  .composer-tabs { row-gap: 6px; }
  .chart svg { height: 220px; }
  .channel-select { flex: 0 1 auto; min-width: 0; max-width: 62%; text-overflow: ellipsis; }
  .window.email { max-width: 100%; }
}
/* The thread header follows its own width, not the window's: the column is narrow on a laptop with
   the customer panel open, and on a phone. Above the messages, so the snooze menu stays on top. */
.thread-head { container-type: inline-size; position: relative; z-index: 5; background: var(--panel); }
@container (max-width: 620px) {
  .thread-head .btn-text { display: none; }
  .thread-head .btn.small { padding: 7px; border-radius: 10px; }
  .thread-head .assign select { max-width: 100px; }
}
/* Narrower still: the assignee becomes a round button (initials, or a person icon when unassigned). */
@container (max-width: 500px) {
  .thread-head .who { min-width: 60px; }
  .thread-head .assign { position: relative; flex: none; width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
  .thread-head .assign select { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; opacity: 0; cursor: pointer; }
}
/* Phone thread header: back, contact (tap opens the details), assignee, actions. */
@media (max-width: 760px) {
  .thread-head { gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 4px; }
  .thread-head > .avatar { width: 34px !important; height: 34px !important; font-size: 13px !important; }
  .thread-head .who { margin-left: 4px; }
  .thread-head .icon-btn { width: 34px; height: 34px; }
}

/* ---------- feedback: toasts, skeletons, motion ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--side-bg); color: #fff; padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 550; max-width: 380px; animation: toast-in 0.18s ease-out; }
.toast.error { background: #3b1220; color: #ffd5dd; }
.toast .icon { color: #a7f3d0; }
.toast.error .icon { color: #fda4af; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  /* In a conversation the composer sits at the bottom: notices go on top. */
  .app.in-thread .toasts { bottom: auto; top: calc(64px + env(safe-area-inset-top)); }
}

.skeleton { display: grid; gap: 4px; padding: 8px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--in) 25%, var(--line) 37%, var(--in) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.thread-loading { padding: 24px; background: var(--panel); }

.btn, .icon-btn, .conv, .side-item, .tab, .menu button { transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s; }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .send-btn:active:not(:disabled) { transform: scale(0.97); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.bubble { animation: pop 0.16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bubble, .toast { animation: none; } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* login: brand hero + form, like the Kivorsa presentation */
.login-page { gap: 64px; grid-template-columns: minmax(0, 520px) minmax(0, 380px); justify-content: center; align-items: center; }
.login-hero { color: #fff; display: grid; gap: 14px; }
.login-hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.03em; font-weight: 750; }
.login-hero p { color: #c9c3e8; font-size: 16px; margin: 0; max-width: 420px; }
.hero-brand { display: flex; align-items: center; gap: 14px; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 18px; }
.grad-text { background: linear-gradient(90deg, #a78bfa, #e879f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-art { width: 220px; height: 220px; object-fit: contain; margin-top: 10px; animation: float 6s ease-in-out infinite; }
.login-brand { font-size: 22px; }
@media (max-width: 900px) {
  .login-page { grid-template-columns: minmax(0, 400px); gap: 24px; align-content: center; }
  .login-hero { text-align: center; justify-items: center; }
  .login-hero h1 { font-size: 28px; }
  .hero-brand { margin-bottom: 4px; }
  .hero-art { display: none; }
}

/* ---------- shared bits for settings, integrations, automations ---------- */
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; border: 0; background: var(--line-2); cursor: pointer; flex: none; padding: 0; transition: background-color 0.15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch.on { background: var(--brand); }
.switch.on span { transform: translateX(16px); }
.switch:disabled { opacity: 0.5; cursor: default; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.nowrap { white-space: nowrap; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--in); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
kbd { font-family: inherit; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; background: var(--panel); }
.inline-icon { display: inline-block; vertical-align: -2px; }
.link-strong { font-weight: 700; margin-left: auto; white-space: nowrap; }
.pad-sm { padding: 10px 12px; }
.danger-text, .btn.ghost.danger-text { color: var(--red); }
.table tr.dim td { opacity: 0.55; }
.table-card.flat { padding: 0; box-shadow: none; border: 0; }
.cell-stack { display: grid; line-height: 1.25; }
.cell-stack small { font-weight: 400; }
.inline-select { width: auto; padding: 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.card-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 6px 12px; }
.card-bar h4 { margin: 0; }
.card-bar > div:not(.search-box) { flex: 1; min-width: 200px; }
.card-bar p { margin: 2px 0 0; }
.table-card .card-bar { padding: 10px 10px 12px; }
.secret-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--brand-50); border: 1px dashed var(--brand); border-radius: 12px; padding: 12px; margin: 10px 0; }
.secret-box code { flex: 1; min-width: 0; background: none; font-size: 14px; font-weight: 600; color: var(--text); user-select: all; }
.secret-box p { flex-basis: 100%; margin: 0; }
.code-block { background: var(--side-bg); color: #d8d3f5; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; }
.check-result { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 13px; margin: 8px 0; }
.check-result.ok { background: var(--green-bg); color: var(--green); }
.check-result.bad { background: var(--red-bg); color: var(--red); overflow-wrap: anywhere; }
.check-result.warn { background: var(--amber-bg); color: var(--amber); }
.check-result .icon { margin-top: 1px; }
.info-card { display: grid; gap: 2px; padding: 8px 16px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.info-row:last-child { border-bottom: 0; }
.card > .info-row:first-of-type { border-top: 1px solid var(--line); }
.info-card > .info-row:first-child { border-top: 0; }
.prefix-input { display: flex; align-items: center; margin-top: 5px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); padding-left: 11px; color: var(--muted); font-size: 14px; }
.prefix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.prefix-input input { border: 0; box-shadow: none !important; padding-left: 2px; margin: 0; color: var(--text); }
.paused { opacity: 0.62; }
.paused:hover { opacity: 0.9; }

/* sidebar: lower group like the mockups (Integrations, Settings) */
.side-nav-lower { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.07); }

/* mobile "More" sheet */
.bottom-nav button.bottom-item { border: 0; background: none; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
.sheet-bg { position: fixed; inset: 0; z-index: 45; background: rgba(17, 12, 38, 0.45); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--panel); border-radius: 22px 22px 0 0; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 2px; box-shadow: var(--shadow-lg); animation: sheet-in 0.18s ease-out; }
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet .banner { border-radius: 10px; margin: 4px 0 6px; }
.sheet-item { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; border: 0; background: none; color: var(--text); font-weight: 600; font-size: 15px; text-align: left; cursor: pointer; }
.sheet-item.active { background: var(--brand-50); color: var(--brand-600); }
.sheet-item .icon { color: var(--muted); }

/* ---------- settings ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.subnav-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; background: var(--panel); border: 1px solid var(--line); }
.subnav-item:hover { color: var(--text); border-color: var(--line-2); }
.subnav-item.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, 0.25); }
.subnav-item.active .brand-mark { background: #fff; border-radius: 50%; padding: 1px; }
.settings { max-width: 1060px; margin: 0 auto; width: 100%; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.num-card { display: grid; gap: 6px; align-content: start; }
.num-head { display: flex; align-items: center; gap: 12px; }
.num-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e7f9ee; }
.num-name { font-weight: 750; font-size: 15px; }
.num-card .stats { margin: 8px 0; }
.num-card .stats dd { font-weight: 600; overflow-wrap: anywhere; }
.snippet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.snippet-card { display: grid; gap: 8px; align-content: start; }
.snippet-head { display: flex; align-items: center; gap: 4px; }
.shortcut { background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: 13px; padding: 3px 9px; }
.snippet-text { white-space: pre-wrap; font-size: 13.5px; max-height: 9em; overflow: hidden; }
.hours-card { max-width: 640px; }
.hours-grid { display: grid; gap: 4px; margin: 6px 0; }
.hours-row { display: grid; grid-template-columns: 44px 110px 1fr auto 1fr; align-items: center; gap: 10px; padding: 6px 0; min-height: 50px; }
.hours-row input[type='time'] { padding: 6px 10px; }
.hours-day { font-weight: 600; }
.hours-row.off .hours-day { color: var(--muted); }
.hours-closed { grid-column: 3 / -1; }

/* ---------- integrations ---------- */
.int-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; }
.hook-list { display: grid; gap: 10px; }
.hook { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; background: var(--panel-2); }
.hook-head { display: flex; align-items: center; gap: 12px; }
.hook-url { display: grid; gap: 3px; min-width: 0; }
.hook-url code { background: none; padding: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hook-stats { display: flex; gap: 16px; flex-wrap: wrap; }

/* website widgets */
.wd-face { display: grid; place-items: center; border-radius: 50%; flex: none; overflow: hidden; box-shadow: 0 2px 6px rgba(20, 16, 40, 0.18); line-height: 1; }
.wd-face img { width: 100%; height: 100%; object-fit: cover; }
.modal:has(.wd-editor) { width: min(1000px, 100%); }
.wd-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.wd-form > label:first-child { margin-top: 0; }
.wd-icons { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.wd-icon-choice { border: 2px solid transparent; background: none; border-radius: 50%; padding: 2px; cursor: pointer; display: grid; }
.wd-icon-choice.active { border-color: var(--brand); }
.wd-custom { margin-bottom: 4px; }
.wd-colors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.wd-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.wd-swatch.active { box-shadow: 0 0 0 2px var(--brand); }
.wd-colors input[type='color'] { width: 36px; height: 30px; padding: 2px; border-radius: 8px; cursor: pointer; }
.wd-button { display: grid; gap: 8px; }
.wd-button .grid2 { gap: 8px; }
.wd-side { position: sticky; top: 0; display: grid; gap: 8px; }
.wd-side .field-label { margin-top: 0; }
.wd-preview { position: relative; height: 430px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(var(--panel-2), var(--panel-2)) 18px 22px / 55% 12px no-repeat, linear-gradient(var(--panel-2), var(--panel-2)) 18px 46px / 80% 8px no-repeat,
    linear-gradient(var(--panel-2), var(--panel-2)) 18px 62px / 70% 8px no-repeat, linear-gradient(var(--panel-2), var(--panel-2)) 18px 78px / 74% 8px no-repeat, var(--panel); }
.wd-code { margin: 0; font-size: 12px; word-break: break-all; }
@media (max-width: 860px) {
  .wd-editor { grid-template-columns: minmax(0, 1fr); }
  .wd-side { position: static; }
}
@media (max-width: 760px) {
  /* all seven icons in one row on a phone */
  .wd-icons { gap: 2px; }
  .wd-icon-choice .wd-face { width: 30px !important; height: 30px !important; }
}
.event-grid { display: grid; gap: 2px; }
.event-grid .check { align-items: flex-start; }

/* ---------- automations ---------- */
.auto-list { display: grid; gap: 10px; }
.auto-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; transition: border-color 0.15s, opacity 0.15s; }
.auto-card:hover { border-color: var(--brand-100); }
.auto-order { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--in); color: var(--muted); font-weight: 700; font-size: 12.5px; }
.auto-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; cursor: pointer; min-width: 0; }
.auto-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.auto-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-chip .icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.flow-chip.when { background: var(--green-bg); color: var(--green); }
.flow-chip.if { background: var(--blue-bg); color: var(--blue); }
.flow-chip.then { background: var(--brand-50); color: var(--brand-600); }
.auto-side { display: grid; justify-items: end; gap: 8px; }
.auto-side .row { gap: 0; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.preset { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.preset:hover { border-color: var(--brand); transform: translateY(-1px); }
.preset strong { display: block; font-size: 13.5px; }
.preset small { color: var(--muted); font-size: 12.5px; }
.preset-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.presets-more summary { cursor: pointer; font-weight: 650; color: var(--brand-600); }
.title-input { flex: 1; min-width: 220px; font-size: 22px; font-weight: 750; letter-spacing: -0.01em; border-color: transparent; background: transparent; padding: 4px 8px; margin-left: -8px; }
.title-input:hover:not(:disabled) { border-color: var(--line-2); }
.title-input:disabled { color: var(--text); opacity: 1; }
.flow { display: grid; }
.flow-step { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.flow-step + .flow-step { margin-top: 30px; }
.flow-step + .flow-step::before { content: ''; position: absolute; left: 32px; top: -31px; height: 30px; border-left: 2px dashed var(--line-2); }
.flow-step + .flow-step::after { content: ''; position: absolute; left: 28px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--bg); }
.flow-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.flow-badge { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.flow-badge.when { background: var(--green-bg); color: var(--green); }
.flow-badge.if { background: var(--blue-bg); color: var(--blue); }
.flow-badge.then { background: var(--grad); color: #fff; }
.flow-kicker { font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.flow-title { font-weight: 700; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; gap: 3px; text-align: left; border: 1px solid var(--line-2); background: var(--panel); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); }
.choice small { color: var(--muted); font-size: 12px; }
.choice.active { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.choice:disabled { cursor: default; }
.flow-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel-2); display: grid; gap: 8px; margin: 8px 0; }
.flow-item-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.flow-item .checks { gap: 4px 16px; }
.flow-item .check { margin: 2px 0; }
.flow-item textarea { resize: vertical; }
.step-no { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.flow-step .pop-wrap { margin-top: 4px; }
.flow-step .menu { left: 0; top: 38px; }
.num-input { width: 80px; text-align: center; }
.auto-select { width: auto; min-width: 220px; }

/* ---------- composer: snippets and emoji ---------- */
.composer { position: relative; }
.pop { position: absolute; z-index: 30; left: 16px; bottom: calc(100% - 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.snippet-pop { width: min(460px, calc(100% - 32px)); padding: 6px; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.snippet-search { display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.snippet-search input { border: 0; box-shadow: none; padding: 6px 0; background: transparent; }
.snippet-opt { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.snippet-opt code { background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.snippet-opt span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snippet-opt.active { background: var(--brand-50); }
.snippet-opt.active span { color: var(--text); }
.emoji-pop { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; }
.emoji-pop button { width: 36px; height: 36px; border: 0; background: none; border-radius: 9px; font-size: 20px; cursor: pointer; }
.emoji-pop button:hover { background: var(--brand-50); }

@media (max-width: 760px) {
  .hide-sm { display: none; }
  .choice-row { grid-template-columns: 1fr; }
  .auto-card { grid-template-columns: 1fr; }
  .auto-order { display: none; }
  .auto-side { grid-auto-flow: column; justify-content: space-between; justify-items: start; align-items: center; }
  .hours-row { grid-template-columns: 44px 1fr 1fr; gap: 6px 10px; }
  .hours-day { grid-column: 2 / -1; }
  .hours-row input[type='time'] { grid-row: 2; }
  .hours-row input[type='time']:first-of-type { grid-column: 2; }
  .hours-row input[type='time']:last-of-type { grid-column: 3; }
  .hours-row > span.muted:not(.hours-closed) { display: none; }
  .hours-closed { grid-column: 2 / -1; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .subnav-item { white-space: nowrap; }
  .emoji-pop { grid-template-columns: repeat(6, 36px); }
  .table-card .card-bar { padding: 8px 6px 10px; }
  /* teammates: one block per person instead of a wide table */
  .team-table thead { display: none; }
  .team-table tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .team-table tr:last-child { border-bottom: 0; }
  .team-table td { display: block; border: 0; padding: 0; }
  .team-table td.hide-sm { display: none; }
  .team-table td.right { text-align: left; white-space: normal; }
  .team-table td.right .btn { padding-left: 0; }
  /* contacts: name and time, then phone, email, stage and tags under the name */
  .contacts-table thead { display: none; }
  .contacts-table, .contacts-table tbody { display: block; }
  .contacts-table tr { display: grid; grid-template-columns: 30px auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .contacts-table tr:last-child { border-bottom: 0; }
  .contacts-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .contacts-table .c-name { grid-area: 1 / 1 / 2 / 4; min-width: 0; }
  .contacts-table .c-name .cell-name { max-width: 100%; }
  .contacts-table .c-last { grid-area: 1 / 4; color: var(--muted); font-size: 12px; white-space: nowrap; }
  .contacts-table .c-phone { grid-area: 2 / 2 / 3 / 5; }
  .contacts-table .c-email { grid-area: 3 / 2 / 4 / 5; }
  .contacts-table .c-phone, .contacts-table .c-email { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .contacts-table .c-stage { grid-area: 4 / 2; margin-top: 4px; }
  .contacts-table .c-tags { grid-area: 4 / 3 / 5 / 5; margin-top: 4px; }
  .contacts-table .empty, .contacts-table .c-added { display: none; }
}

/* ---------- import from respond.io ---------- */
.import-prep { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.radio-group { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 6px 0; min-width: 0; }
.radio-group legend { font-size: 12px; font-weight: 650; color: var(--muted); padding: 0 4px; }
.radio-group:disabled { opacity: 0.6; }
.radio { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.radio input { width: auto; margin-top: 3px; accent-color: var(--brand); }
.radio span { display: grid; }
.radio small { color: var(--muted); font-size: 12px; font-weight: 400; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0; color: var(--text); font-size: 13.5px; font-weight: 500; }
.inline-label input { margin: 0; }
.import-steps { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; }
.import-steps li { display: grid; grid-template-columns: 20px auto auto 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.import-steps li.done { color: var(--green); }
.import-steps li.now { color: var(--text); font-weight: 650; }
.import-steps li.now .icon { color: var(--brand); }
.import-steps li.stopped { color: var(--amber); font-weight: 650; }
.progress.mini { height: 6px; max-width: 220px; }
.progress.mini span { background: var(--brand); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.import-summary { display: grid; gap: 10px; }
.import-summary h4 { margin: 6px 0 0; }
.kpi-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel-2); }
.kpi-box .kpi-value { font-size: 20px; }
.import-notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 760px) {
  .import-steps li { grid-template-columns: 20px 1fr auto; }
  .import-steps li .progress { grid-column: 2 / -1; }
}

/* ---------- email ---------- */
.section-gap { margin-top: 12px; }
.num-logo.mail { background: #fdeceb; color: #c5221f; }
.num-logo.chat { background: var(--brand-50, #f0ecff); color: var(--brand-600); }
@media (prefers-color-scheme: dark) {
  .num-logo { background: #12301f; }
  .num-logo.mail { background: #3a1717; }
  .num-logo.chat { background: #241c45; }
  .num-logo.sms { background: #10293f; }
}
.num-logo.sms { background: var(--blue-bg); color: var(--blue); }
.sms-count { white-space: nowrap; margin-right: 8px; }
.sms-count.many { color: var(--amber); }
.sms-steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.sms-steps .row, .num-card .stats dd.row { flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
.sms-steps code, .num-card .stats dd code { word-break: break-all; }
/* website chat: the assistant settings */
.assistant-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; display: grid; gap: 10px; background: var(--panel); }
.assistant-box textarea { font-family: inherit; }
.assistant-status { align-items: center; gap: 10px; }
.try-box { display: grid; gap: 6px; }
.try-reply { display: block; white-space: pre-wrap; color: var(--text); margin-bottom: 2px; }
/* website chat: where the visitor wrote from */
.chat-page { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-page a { color: inherit; }
.sync-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--muted); overflow-wrap: anywhere; }
.sync-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.sync-line.ok { color: var(--green); }
.sync-line.ok .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.sync-line.bad { color: var(--red); }
.sync-line.bad .dot { background: var(--red); }
.sync-line.wait .dot { background: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.help-box { background: var(--blue-bg); color: var(--text); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.help-box ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.choice-row.three { grid-template-columns: repeat(3, 1fr); }
.window.email { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); background: var(--blue-bg); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-input { margin-bottom: 8px; border-radius: 12px; font-weight: 600; background: var(--panel-2); }
.email-subject { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.email-subject .icon { color: var(--muted); }
.bubble.out .email-subject .icon { color: var(--brand-600); }
.email-atts { display: grid; gap: 4px; margin-top: 6px; justify-items: start; }
.email-atts img.image { max-height: 220px; }
.quoted-toggle { border: 0; background: var(--in); color: var(--muted); border-radius: 6px; padding: 0 8px; line-height: 16px; font-weight: 800; cursor: pointer; margin-top: 6px; }
.quoted-toggle:hover { color: var(--text); }
.email-quoted { white-space: pre-wrap; color: var(--muted); font-size: 12.5px; border-left: 3px solid var(--line-2); padding: 4px 0 4px 10px; margin-top: 6px; max-height: 360px; overflow: auto; }
.bubble.type-email { max-width: min(640px, 80%); }
@media (max-width: 760px) {
  .choice-row.three { grid-template-columns: 1fr; }
}

/* ---------- go-live checklist ---------- */
.golive-head { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.golive-head h4 { margin: 0; font-size: 15px; }
.golive-head p { margin: 4px 0 0; }
.golive-score { display: flex; align-items: baseline; gap: 6px; }
.golive-score strong { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.golive-score span { color: var(--muted); font-weight: 600; }
.golive-bar { grid-column: 1 / -1; height: 8px; }
.golive-stage { padding: 14px 16px 6px; }
.golive-stage-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.golive-stage-head h4 { margin: 0; flex: 1; font-size: 14.5px; }
.stage-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); font-weight: 800; font-size: 12.5px; flex: none; }
.stage-no.done { background: var(--green); color: #fff; }
.golive-items { list-style: none; margin: 0; padding: 0; }
.gl-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.gl-item:first-child { border-top: 0; }
.gl-icon { display: grid; place-items: center; height: 22px; color: var(--muted); }
.gl-item.done .gl-icon { color: var(--green); }
.gl-item.warn .gl-icon { color: var(--amber); }
.gl-item.info .gl-icon { color: var(--blue); }
.gl-check { width: 18px; height: 18px; margin: 2px 0 0 2px; cursor: pointer; }
.gl-title { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-item.done .gl-title { color: var(--muted); }
.gl-detail { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.gl-item.warn .gl-detail { color: var(--amber); }
.gl-side { display: grid; justify-items: end; gap: 6px; }
@media (max-width: 760px) {
  .gl-item { grid-template-columns: 26px minmax(0, 1fr); }
  .gl-side { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
}

/* ---------- switching channels: standby / live ---------- */
.mode-line { display: flex; align-items: center; gap: 8px 10px; padding: 8px 10px; border-radius: 12px; font-size: 13px; flex-wrap: wrap; }
.mode-line > .grow { flex: 1 1 170px; min-width: 0; }
.mode-line.standby { background: var(--amber-bg); }
.mode-line.live { background: var(--green-bg); }
.mode-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--amber); }
.live .mode-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18); }
.mode-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin: 4px 0 12px; }
.mode-banner.standby { background: var(--amber-bg); color: var(--text); }
.mode-banner.live { background: var(--green-bg); color: var(--text); }
.switch-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.pf-list { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.pf { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.pf:first-child { border-top: 0; }
.pf-icon { display: grid; place-items: center; height: 20px; }
.pf.ok .pf-icon { color: var(--green); }
.pf.warn .pf-icon { color: var(--amber); }
.pf.fail .pf-icon { color: var(--red); }
.pf.info .pf-icon { color: var(--blue); }
.pf-title { font-weight: 650; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pf-detail { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.pf.fail .pf-detail { color: var(--red); }
.confirm-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.confirm-box .check { align-items: flex-start; }
.confirm-box .check input { margin-top: 3px; }
.confirm-box .override { color: var(--red); }
.rollback { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.rollback h4 { margin-bottom: 2px; }
.switch-history { margin-top: 12px; font-size: 13px; }
.switch-history summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.switch-history ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.monitor .kpis { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kpi-box.bad { border-color: var(--red); background: var(--red-bg); }

/* ---------- status page ---------- */
.status-head { display: flex; align-items: flex-start; gap: 12px; }
.status-head.ok > .icon { color: var(--green); }
.status-head.bad { border-color: var(--red); }
.status-head.bad > .icon { color: var(--red); }
.status-head h4 { margin: 2px 0 4px; }
.status-head ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.status-grid .stats { margin: 6px 0 10px; }
.err-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.api-log .api-path code { background: none; padding: 0; white-space: nowrap; }
.api-log td { font-size: 12.5px; }
@media (max-width: 760px) {
  /* the problems get the full width; Refresh goes under them */
  .status-head { flex-wrap: wrap; }
  .status-head > .grow { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .status-head > .btn { margin-left: 34px; }
}

/* ===== Yarder: skip yellow and tarmac (overrides the Kivorsa violet) ===== */
:root {
  --brand: #2b2d2f;
  --brand-600: #17181a;
  --brand-50: #fff6cc;
  --brand-100: #ffe680;
  --yellow: #f5c400;
  --grad: linear-gradient(135deg, #f5c400 0%, #ffd84d 100%);
  --side-bg: #1f2123;
  --side-text: #c9cbce;
  --side-active: rgba(245, 196, 0, 0.16);
  --bg: #f5f5f2;
  --text: #1d1f21;
  --muted: #6b6f75;
  --line: #e8e8e3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #f5c400;
    --brand-600: #ffd84d;
    --brand-50: #3a3210;
    --brand-100: #4d420f;
    --side-bg: #111213;
    --side-bg-2: #1b1c1e;
    --bg: #161718;
    --panel: #1f2123;
    --panel-2: #25272a;
    --line: #2c2f33;
    --line-2: #383b40;
    --text: #eceef0;
    --muted: #9aa0a6;
  }
  .btn.primary, .btn.primary:hover:not(:disabled), .tab-count { color: #1d1f21; }
}
.btn.primary { box-shadow: 0 6px 16px rgba(29, 31, 33, 0.18); }
.grad-text { background: linear-gradient(90deg, #f5c400, #ffb000); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Bookings: the "To confirm" queue */
.bk-tabs { margin: 0 0 14px; }
.bk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.bk-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; border-left: 4px solid transparent; }
.bk-card.waiting { border-left-color: var(--yellow); }
.bk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bk-title { font-size: 17px; font-weight: 700; }
.bk-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; margin-top: 3px; }
.bk-price { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; }
.bk-meta { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.bk-row { display: flex; gap: 9px; align-items: flex-start; }
.bk-row .icon { flex: none; margin-top: 2px; color: var(--muted); }
.bk-row a { color: inherit; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.warn-chip { background: var(--amber-bg); color: var(--amber); }
.chip.red-chip { background: var(--red-bg); color: var(--red); }
.chip.note-chip { background: var(--note); color: var(--text); font-weight: 500; }
.bk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-confirm { flex: 1 1 140px; justify-content: center; font-size: 15px; padding-top: 11px; padding-bottom: 11px; }
.bk-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.bk-preview { margin: 14px 0 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-50); }
.bk-preview.bad { background: var(--red-bg); color: var(--red); }
@media (max-width: 720px) {
  .bk-list { grid-template-columns: 1fr; }
  .bk-form { grid-template-columns: 1fr; }
}

/* Yarder login and small fixes */
.login-page { background: radial-gradient(1100px 560px at 8% -10%, rgba(245, 196, 0, 0.22) 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(245, 196, 0, 0.12) 0%, transparent 60%), #1f2123; }
.login-hero p { color: #c9cbce; }
.bk-confirm { flex: 1 1 120px; }
.bk-actions .btn.ghost { padding-left: 10px; padding-right: 10px; }

/* Yarder: card payments on bookings */
.chip.ok-chip { background: var(--green-bg); color: var(--green); }
.bk-pay-banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bk-pay-banner p { margin: 4px 0 0; }
@media (max-width: 640px) { .bk-pay-banner { flex-direction: column; align-items: stretch; } }
.bk-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line, #e4e2dc); border-radius: 12px; cursor: pointer; }
.bk-option > span { display: flex; flex-direction: column; gap: 2px; }
.bk-option input { margin-top: 4px; }

/* ===== Yarder brand pass: the approved "skip yellow" boards (brand/righto/1 Жёлтый скип) =====
   Yellow #F5C400 for the main action, graphite #2B2D2F, ink #111315, light grey ground,
   green #16A34A for confirmed, orange #F97316 for warnings. Heavy, tight headlines. */
:root {
  --yellow: #f5c400;
  --yellow-600: #d9ad00;
  --graphite: #2b2d2f;
  --ink: #111315;
  --bg: #f2f3f5;
  --panel: #ffffff;
  --line: #e5e7ea;
  --line-2: #d9dce1;
  --text: #111315;
  --muted: #5f646b;
  --brand: #2b2d2f;
  --brand-600: #111315;
  --brand-50: #fff6cc;
  --out: #fff4c2;
  --brand-100: #ffe680;
  --green: #15803d;
  --green-bg: #e2f5e9;
  --amber: #c2410c;
  --amber-bg: #fff0e3;
  --shadow: 0 1px 2px rgba(17, 19, 21, 0.05), 0 6px 18px rgba(17, 19, 21, 0.06);
  --side-bg: #1c1d1f;
  --side-bg-2: #26282b;
  --side-text: #b9bcc1;
  --side-active: rgba(245, 196, 0, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131415; --panel: #1d1f21; --line: #2b2e32; --line-2: #383b40; --text: #eceef0; --ink: #eceef0; --muted: #9aa0a6; --green: #4ade80; --green-bg: #12301f; --amber: #fdba74; --amber-bg: #3a2414; }
}
h1, .page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; }
.page-head p.muted { margin-top: 4px; }
.card { border-radius: 16px; }

/* buttons: the main action is yellow with dark text, everywhere */
.btn.primary, .btn.primary:hover:not(:disabled) { background: var(--yellow); border-color: var(--yellow); color: #111315; box-shadow: 0 2px 0 var(--yellow-600); }
.btn.primary:hover:not(:disabled) { background: #ffd21a; }
.btn.primary:disabled { opacity: 0.55; }

/* sidebar */
.brand span { color: #fff; font-weight: 850; letter-spacing: -0.04em; }
.side-item { position: relative; }
.side-item.active { color: #fff; }
.side-item.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.side-item.active .icon { color: var(--yellow); }
.side-badge.demo { background: rgba(245, 196, 0, 0.1); color: #f5d25a; border: 1px solid rgba(245, 196, 0, 0.25); }
.nav-count { background: var(--yellow); color: #111315; }

/* tabs as a segmented control */
.bk-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 0; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); width: max-content; max-width: 100%; }
.bk-tabs .tab { font-size: 14px; padding: 8px 14px; border-radius: 10px; }
.bk-tabs .tab.active { background: var(--graphite); color: #fff; }
.bk-tabs .tab.active .tab-count { background: var(--yellow); color: #111315; }

/* booking cards */
.bk-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bk-card { padding: 18px; gap: 14px; border-left: 0; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.bk-card.waiting::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--yellow); }
.bk-head { align-items: center; gap: 14px; }
.bk-head-text { flex: 1; min-width: 0; }
.bk-thumb { width: 56px; height: 56px; border-radius: 14px; background: #eeefef; object-fit: cover; flex: none; }
.bk-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.bk-price { font-size: 24px; font-weight: 850; letter-spacing: -0.04em; }
.bk-waiting { display: inline-flex; align-items: center; gap: 6px; width: max-content; font-size: 12.5px; font-weight: 700; color: #7a5b00; background: var(--brand-50); padding: 5px 10px; border-radius: 999px; margin-top: -4px; }
.bk-meta { gap: 8px; padding: 12px 14px; background: var(--bg); border-radius: 12px; }
.bk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-actions .bk-confirm { grid-column: 1 / -1; font-size: 15.5px; padding-top: 12px; padding-bottom: 12px; }
.bk-actions .btn { justify-content: center; }
.bk-actions .btn.ghost { border: 1px solid var(--line); }
.chip.ok-chip { background: var(--green-bg); color: var(--green); }
@media (prefers-color-scheme: dark) {
  .bk-waiting { color: #f5d25a; }
  .bk-thumb { background: #2a2c2f; }
}

/* This week */
.wk-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: end; background: var(--graphite); color: #fff; border-radius: 20px; padding: 28px 30px; box-shadow: 0 14px 40px rgba(17, 19, 21, 0.18); }
.wk-kicker { color: var(--yellow); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 12.5px; margin: 0 0 6px; }
.wk-big { font-size: 40px; font-weight: 850; letter-spacing: -0.045em; line-height: 1.05; margin: 0; }
.wk-dot { color: rgba(255, 255, 255, 0.35); }
.wk-money { color: var(--yellow); }
.wk-note { color: #c9ccd1; margin: 14px 0 0; max-width: 30em; }
.wk-note strong { color: #fff; }
.wk-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 190px; }
.wk-col { display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: 4px; height: 100%; }
.wk-count { font-weight: 800; font-size: 15px; min-height: 20px; }
.wk-bar { display: flex; align-items: flex-end; width: 100%; height: 100%; }
.wk-bar i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: var(--yellow); }
.wk-bar i.none { background: rgba(255, 255, 255, 0.12); }
.wk-day { font-size: 12.5px; font-weight: 700; color: #e6e7e9; }
.wk-pence { font-size: 11.5px; color: #9ea3aa; }
.wk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wk-kpi { display: grid; gap: 4px; align-content: start; text-decoration: none; color: inherit; padding: 18px; }
.wk-kpi strong { font-size: 30px; font-weight: 850; letter-spacing: -0.04em; line-height: 1.1; }
.wk-kpi-label { font-weight: 700; font-size: 13.5px; }
.wk-kpi-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); color: var(--graphite); margin-bottom: 6px; }
.wk-kpi-icon.warn { background: var(--brand-50); color: #8a6500; }
.wk-kpi-icon.ok { background: var(--green-bg); color: var(--green); }
a.wk-kpi:hover { box-shadow: 0 0 0 2px var(--yellow), var(--shadow); }
.wk-channels { display: grid; gap: 6px; margin-top: 4px; font-size: 13.5px; }
.wk-channels span { display: flex; align-items: center; gap: 6px; }
.wk-channels b { margin-left: auto; font-size: 15px; }
.wk-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.wk-list h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.wk-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.wk-row:first-of-type { border-top: 0; }
.wk-date { display: grid; justify-items: center; background: var(--bg); border-radius: 10px; padding: 5px 0; font-size: 11.5px; color: var(--muted); }
.wk-date b { font-size: 13px; color: var(--text); }
.wk-what { display: grid; min-width: 0; }
.wk-what strong { font-size: 14.5px; }
.wk-stock { display: grid; grid-template-columns: minmax(0, 1fr) 46%; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.wk-stock:first-of-type { border-top: 0; }
.wk-stock-label { display: grid; }
.wk-meter { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.wk-meter i { display: block; height: 100%; border-radius: 999px; background: var(--graphite); }
.wk-meter i.full { background: #f97316; }
@media (prefers-color-scheme: dark) { .wk-meter i { background: #c9ccd1; } }
@media (max-width: 1100px) {
  .wk-hero { grid-template-columns: 1fr; }
  .wk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wk-two { grid-template-columns: 1fr; }
  .wk-big { font-size: 32px; }
  .wk-hero { padding: 22px 20px; }
  .wk-chart { height: 160px; gap: 6px; }
  .wk-pence { font-size: 10px; }
  .wk-kpi strong { font-size: 24px; }
}

/* phones: the yellow top bar of the mock-ups, and the tab bar */
.mobile-top { display: none; }
@media (max-width: 760px) {
  .app { grid-template-rows: auto minmax(0, 1fr) auto; }
  .mobile-top { display: flex; align-items: center; gap: 8px; background: var(--yellow); color: #111315; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .mobile-top .logo { border-radius: 8px; }
  .mt-name { font-weight: 850; font-size: 20px; letter-spacing: -0.04em; }
  .mt-support { margin-left: auto; }
  .mt-support + .mt-ws { margin-left: 8px; }
  .mt-ws { margin-left: auto; font-size: 13px; font-weight: 700; background: rgba(17, 19, 21, 0.08); padding: 4px 10px; border-radius: 999px; }
  .app.in-thread .mobile-top { display: none; }
  .bottom-item.active { color: var(--ink); }
  .bottom-item.active .icon { color: #111315; background: var(--yellow); border-radius: 10px; padding: 3px; box-sizing: content-box; }
  .page { padding-top: 16px; }
  h1, .page-head h1 { font-size: 24px; }
  .bk-tabs { width: 100%; }
  .bk-tabs .tab { flex: 1; justify-content: center; padding: 8px 6px; }
}
.mobile-top .logo { background: #1c1d1f; border-radius: 8px; padding: 3px; box-sizing: content-box; }

/* Yarder: Money */
.mn-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mn-month { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); font-weight: 700; }
.mn-month span { min-width: 128px; text-align: center; }
.mn-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mn-kpi { display: grid; gap: 2px; padding: 18px; }
.mn-kpi strong { font-size: 30px; font-weight: 850; letter-spacing: -0.04em; line-height: 1.15; }
.mn-kpi-label { font-weight: 700; font-size: 13.5px; color: var(--muted); }
.mn-kpi.good { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.mn-kpi.good strong { color: var(--yellow); }
.mn-kpi.good .muted, .mn-kpi.good .mn-kpi-label { color: #c9ccd1; }
.mn-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.mn-insight { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; }
.mn-insight p { margin: 4px 0 0; }
.mn-insight-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--bg); }
.mn-insight.money .mn-insight-icon { background: var(--green-bg); color: var(--green); }
.mn-insight.warn .mn-insight-icon { background: var(--amber-bg); color: var(--amber); }
.mn-insight.info .mn-insight-icon { background: var(--brand-50); color: #7a5b00; }
.mn-insight-jobs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.mn-table { padding: 6px 0; }
.mn-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 1.2fr 1fr 1fr 1fr minmax(0, 1.8fr); gap: 12px; align-items: center; width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.mn-row:hover { background: var(--bg); }
.mn-row-head { cursor: default; border-top: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mn-row > span { display: grid; min-width: 0; }
.mn-row .n { text-align: right; justify-items: end; }
.mn-job { display: flex !important; align-items: center; gap: 10px; }
.mn-job > span { display: grid; min-width: 0; }
.mn-thumb { width: 36px; height: 36px; border-radius: 10px; background: #eeefef; flex: none; }
.mn-inv { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.mn-margin { font-weight: 800; color: var(--green); }
.mn-margin.bad { color: var(--red); }
.mn-est { font-size: 11.5px; font-weight: 700; color: #8a6500; background: var(--brand-50); border-radius: 999px; padding: 0 7px; justify-self: end; }
.mn-docs { display: flex !important; flex-wrap: wrap; gap: 5px; }
.mn-doc { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.mn-doc.ok { background: var(--green-bg); color: var(--green); }
.mn-doc.warn { background: var(--amber-bg); color: var(--amber); }
.mn-doc.money { background: var(--graphite); color: var(--yellow); }
.mn-empty { padding: 18px; }
.mn-panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 8px; }
.mn-panel-sub { margin: -4px 0 6px; }
.mn-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.mn-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mn-line > span { display: grid; }
.mn-line b { display: grid; justify-items: end; white-space: nowrap; }
.mn-line.total { border-bottom: 0; font-weight: 800; }
.mn-src { font-size: 11px; font-weight: 700; color: var(--muted); }
.mn-src.ticket { color: var(--green); }
.mn-src.estimate { color: #8a6500; }
.mn-paid { color: var(--green); font-weight: 700; }
.mn-margin-box { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--graphite); color: #fff; }
.mn-margin-box b { font-size: 22px; color: var(--yellow); grid-row: span 2; align-self: center; }
.mn-margin-box span:last-child { font-size: 12.5px; color: #c9ccd1; }
.mn-margin-box.bad b { color: #fca5a5; }
.mn-callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 8px 0 4px; }
.mn-callout > div { display: grid; gap: 2px; font-size: 14px; }
.mn-callout.money { background: var(--green-bg); color: var(--green); }
.mn-callout.money span { color: var(--text); }
.mn-papers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mn-paper { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.mn-paper > span { display: grid; flex: 1; }
.mn-paper:hover { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--brand-50); }
.mn-ticket { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--bg); }
.mn-ticket-photo { width: 120px; border-radius: 10px; box-shadow: var(--shadow); display: block; }
.mn-ticket-read strong { display: flex; align-items: center; gap: 6px; color: var(--green); }
.mn-ticket-read dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0; font-size: 13.5px; }
.mn-ticket-read dt { color: var(--muted); }
.mn-ticket-read dd { margin: 0; font-weight: 600; }
.mn-ticket-empty p { margin: 4px 0 12px; }
.mn-ticket-empty .row { display: flex; gap: 10px; flex-wrap: wrap; }
.mn-ticket-empty label.btn { cursor: pointer; }
.mn-reading { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mn-reading .icon { animation: spin 1s linear infinite; }
@media (max-width: 1100px) {
  .mn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mn-row { grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr; }
  .mn-row > :nth-child(2), .mn-row > :nth-child(6) { display: none; }
}
@media (max-width: 760px) {
  .mn-cols, .mn-papers { grid-template-columns: 1fr; }
  .mn-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .mn-row > :nth-child(3), .mn-row > :nth-child(4) { display: none; }
  .mn-kpi strong { font-size: 24px; }
  .mn-ticket { flex-direction: column; }
  .mn-head-actions { width: 100%; }
}

/* Yarder: settings (your firm, prices, skips and tips, payments) */
.st-stack { display: grid; gap: 16px; padding-bottom: 84px; }
.st-card { padding: 22px; display: grid; gap: 14px; }
.st-card h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.st-card h3 { font-size: 14px; font-weight: 800; margin: 0 0 8px; }
.st-card > p.muted { margin: -8px 0 0; }
.st-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.st-head p { margin: 4px 0 0; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.st-field { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--text); align-content: start; }
.st-field > span:first-child { color: var(--muted); }
.st-field small { font-weight: 500; }
.st-field.bad input { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.st-wide { grid-column: span 2; }
.st-narrow { max-width: 200px; }
.st-toggle { display: flex; gap: 10px; align-items: flex-start; }
.st-toggle > span { display: grid; gap: 2px; font-size: 14px; }
.st-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.st-label { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 120px; }
.st-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.st-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.st-chip.on { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.st-chip.add { border-style: dashed; color: var(--muted); }
.st-chip:disabled { cursor: default; }
.st-x { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; opacity: 0.7; }
.st-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-inline input { width: 190px; }
.st-zones { display: flex; gap: 8px; flex-wrap: wrap; }
.st-zone { display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line-2); background: var(--panel); border-radius: 12px; padding: 9px 14px; font: inherit; font-weight: 800; font-size: 14px; color: var(--text); cursor: pointer; }
.st-zone small { font-weight: 500; font-size: 12px; color: var(--muted); }
.st-zone.on { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--brand-50); }
.st-zone.add { border-style: dashed; color: var(--muted); align-content: center; }
.st-zone-edit { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 2fr); gap: 12px 18px; align-items: start; padding: 14px; border-radius: 12px; background: var(--bg); }
.st-zone-edit .row { grid-column: 1 / -1; display: flex; gap: 10px; }
.st-copy { max-width: 220px; }
.st-matrix-wrap { overflow-x: auto; display: grid; gap: 10px; justify-items: start; }
.st-matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.st-matrix th, .st-matrix td { padding: 6px 8px; text-align: left; white-space: nowrap; }
.st-matrix thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.st-matrix tbody th { font-weight: 800; }
.st-matrix tbody tr + tr th, .st-matrix tbody tr + tr td { border-top: 1px solid var(--line); }
.st-money { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--panel); padding-left: 10px; }
.st-money i { font-style: normal; color: var(--muted); font-weight: 700; }
.st-money input { border: 0 !important; box-shadow: none !important; width: 92px; background: transparent; padding-left: 4px; }
.st-money.empty { background: var(--bg); border-style: dashed; }
.st-money:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--brand-50); }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.st-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.st-item > input:first-child { flex: 1; min-width: 0; }
.st-item.banned .st-note { flex: 1.4; min-width: 0; }
.st-permit { display: grid; grid-template-columns: minmax(160px, 1.2fr) auto auto minmax(220px, 1.5fr) auto; gap: 12px 16px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.st-permit > strong { align-self: center; }
.st-addcouncil, .st-check, .st-ask { display: flex; gap: 8px; flex-wrap: wrap; }
.st-addcouncil input { flex: 1; min-width: 220px; }
.st-check input { width: 130px; }
.st-check select { width: auto; min-width: 120px; }
.st-unit { display: inline-flex; align-items: center; gap: 8px; }
.st-unit input { width: 92px; }
.st-unit i { font-style: normal; color: var(--muted); font-weight: 600; }
.st-field > .st-money { justify-self: start; }
.st-quote { display: grid; gap: 6px; padding: 12px 14px; background: var(--bg); border-radius: 12px; max-width: 520px; }
.st-quote div { display: flex; justify-content: space-between; gap: 12px; }
.st-quote-total { border-top: 1px solid var(--line-2); padding-top: 6px; font-weight: 800; }
.st-error { color: var(--red); display: flex; gap: 6px; align-items: center; font-weight: 600; }
.st-chat { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.st-chat:empty { display: none; }
.st-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; background: var(--bg); }
.st-msg p { margin: 0; white-space: pre-wrap; }
.st-msg.user { justify-self: end; background: var(--graphite); color: #fff; border-bottom-right-radius: 4px; }
.st-msg.assistant { border-bottom-left-radius: 4px; }
.st-checks { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.st-checks li { display: flex; gap: 5px; align-items: baseline; }
.st-ask input { flex: 1; min-width: 220px; }
.st-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--graphite); color: #fff; box-shadow: 0 14px 40px rgba(17, 19, 21, 0.25); }
.st-savebar .st-error { color: #fca5a5; }
.st-savebar .btn.ghost { color: #e6e7e9; }
.st-fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.st-fleet-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.st-fleet-item img { border-radius: 10px; background: #eeefef; }
.st-fleet-item > span { display: grid; flex: 1; }
.st-fleet-item input { width: 76px; text-align: right; font-weight: 800; }
.st-tips { display: grid; gap: 8px; }
.st-tips-head, .st-tips-row { display: grid; grid-template-columns: 160px minmax(180px, 1.4fr) 150px 170px; gap: 12px; align-items: center; }
.st-tips-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.st-status { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-weight: 600; }
.st-status.ok { background: var(--green-bg); color: var(--green); }
.st-status.todo { background: var(--brand-50); color: #7a5b00; }
.st-options { display: grid; gap: 10px; }
.st-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.st-option.on { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--brand-50); }
.st-option > span { display: grid; gap: 2px; }
.st-option input { margin-top: 3px; }
@media (max-width: 760px) {
  .st-wide { grid-column: auto; }
  .st-zone-edit, .st-two { grid-template-columns: 1fr; }
  .st-permit { grid-template-columns: 1fr 1fr; }
  .st-tips-head { display: none; }
  .st-tips-row { grid-template-columns: 1fr 1fr; }
  .st-tips-row strong { grid-column: 1 / -1; }
  .st-savebar { bottom: 8px; }
  .st-msg { max-width: 92%; }
}

/* ===== Yarder: Day plan (the office's board) ===== */
.dy { grid-template-columns: minmax(0, 1fr); }
.dy > * { min-width: 0; }
.dy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dy-strip { display: flex; align-items: center; gap: 6px; }
.dy-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.dy-day { position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 4px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.dy-day b { font-size: 17px; font-weight: 800; line-height: 1.1; }
.dy-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dy-day.today .dy-wd { color: var(--yellow-600); }
.dy-day.on { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.dy-day.on .dy-wd { color: var(--yellow); }
.dy-counts { display: flex; gap: 3px; font-size: 11px; font-weight: 700; min-height: 15px; }
.dy-counts i { font-style: normal; padding: 0 5px; border-radius: 6px; }
.dy-counts i.k-delivery { background: var(--yellow); color: #111315; }
.dy-counts i.k-collection { background: var(--line); color: var(--text); }
.dy-day.on .dy-counts i.k-collection { background: #4a4d51; color: #fff; }
.dy-counts i.none { color: var(--muted); }
.dy-dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.dy-note { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: 13.5px; }
.dy-note.bad { background: var(--red-bg); color: var(--red); }
.dy-note a { color: inherit; text-decoration: underline; }
.dy-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 20px; }
.dy-empty h2 { margin: 4px 0 0; font-size: 19px; }
.dy-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 300px); gap: 14px; overflow-x: auto; align-items: start; padding-bottom: 8px; min-height: 420px; }
.dy-col { display: grid; gap: 10px; align-content: start; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 380px; transition: border-color 0.15s, box-shadow 0.15s; }
.dy-side { background: transparent; border-style: dashed; }
.dy-run.over { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--brand-50); }
.dy-col-head { display: grid; gap: 6px; }
.dy-col-head h2 { font-size: 15px; font-weight: 800; margin: 0; }
.dy-col-head p { margin: 2px 0 0; }
.dy-lorry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dy-plate { display: inline-block; background: var(--yellow); color: #111315; font-weight: 800; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; border: 1.5px solid #111315; font-size: 14px; }
.dy-driver { width: 100%; font-weight: 600; }
.dy-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; justify-self: start; }
.dy-check.ok { background: var(--green-bg); color: var(--green); }
.dy-check.bad { background: var(--red-bg); color: var(--red); }
.dy-check.warn { background: var(--amber-bg); color: var(--amber); }
.dy-check.none { background: var(--line); color: var(--muted); }
.dy-sum { margin: 0; }
.dy-sum .bad, .dy-panel .bad { color: var(--red); font-weight: 700; }
.dy-list { display: grid; gap: 8px; }
.dy-sub { display: flex; gap: 6px; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 8px 0 0; }
.dy-hint { text-align: center; padding: 24px 0; border: 1.5px dashed var(--line-2); border-radius: 12px; }
.dy-drop { height: 4px; border-radius: 4px; background: var(--yellow); }
.dy-card { position: relative; display: grid; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(17, 19, 21, 0.05); }
.dy-card[draggable='true'] { cursor: grab; }
.dy-card:hover { border-color: var(--line-2); }
.dy-card:focus-visible { outline: 3px solid var(--brand-50); }
.dy-card.k-delivery { border-left-color: var(--yellow); }
.dy-card.k-collection { border-left-color: var(--graphite); }
.dy-card.k-exchange { border-left-color: var(--blue); }
.dy-card.k-wait { border-left-color: var(--amber); }
.dy-card.k-due { border-left-color: var(--red); cursor: default; }
.dy-card.done { opacity: 0.62; }
.dy-card.done h4 { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.dy-card.failed { border-color: var(--red-bg); background: linear-gradient(0deg, var(--panel), var(--panel)), var(--red-bg); }
.dy-card h4 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.dy-card p { margin: 0; }
.dy-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dy-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dy-eta { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; display: inline-flex; gap: 3px; align-items: center; }
.dy-eta.ok { color: var(--green); }
.dy-eta.bad { color: var(--red); }
.dy-where { font-size: 13.5px; }
.dy-where b { font-weight: 700; margin-left: 4px; }
.dy-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dy-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.dy-tag.soft { color: var(--muted); }
.dy-tag.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.dy-tag.bad { background: var(--red-bg); border-color: transparent; color: var(--red); }
.dy-problem { display: flex; gap: 5px; align-items: center; color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: 4px !important; }
.dy-due-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dy-leg { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 6px 0 10px; }
.dy-leg time { font-variant-numeric: tabular-nums; font-weight: 600; }
.dy-leg.tip { color: var(--text); }
.dy-panel { display: grid; gap: 14px; }
.dy-facts { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.dy-facts dt { color: var(--muted); font-weight: 600; }
.dy-facts dd { margin: 0; }
.dy-facts select { width: auto; }
.dy-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.dy-photos img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.dy-photos .signature img { object-fit: contain; }
.dy-panel-actions, .dy-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dy-form-actions { justify-content: flex-end; }
.dy-form { display: grid; gap: 4px; padding: 12px; background: var(--bg); border-radius: 12px; }
.dy-form label { margin: 6px 0; }
.dy-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) {
  .dy .page-head { align-items: stretch; }
  .dy-actions { width: 100%; }
  .dy-actions .btn { flex: 1; }
  .dy-strip .icon-btn, .dy-strip .btn { display: none; }
  .dy-board { grid-auto-columns: 86%; scroll-snap-type: x mandatory; }
  .dy-col { scroll-snap-align: start; }
  .dy-days { grid-auto-columns: 50px; }
  .dy-facts { grid-template-columns: 1fr; gap: 2px; }
  .dy-facts dd { margin-bottom: 8px; }
}

/* ===== Yarder for drivers (/driver/): big targets, one hand, bright daylight ===== */
.drv-body { background: var(--bg); }
.drv { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr; }
.drv-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--yellow); color: #111315; }
.drv-logo { font-weight: 900; font-size: 26px; letter-spacing: -0.04em; }
.drv-logo.small { font-size: 20px; }
.drv-back { border: 0; background: rgba(17, 19, 21, 0.08); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; color: #111315; }
.drv-who { display: grid; line-height: 1.15; flex: 1; min-width: 0; }
.drv-who strong { font-size: 15px; }
.drv-who span { font-size: 12.5px; opacity: 0.75; }
.drv-sync { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; font-weight: 700; background: #111315; color: #fff; }
.drv-sync.ok { background: rgba(17, 19, 21, 0.1); color: #111315; }
.drv-sync.off { background: var(--red); }
.drv-note { margin: 10px 14px 0; padding: 10px 14px; border-radius: 12px; background: var(--green-bg); color: var(--green); font-weight: 600; }
.drv-note.bad { background: var(--red-bg); color: var(--red); }
.drv-main { display: grid; gap: 12px; align-content: start; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }
.drv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 1px 3px rgba(17, 19, 21, 0.06); }
.drv-splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; background: var(--yellow); color: #111315; }
.drv-splash h1 { margin: 0; font-size: 22px; }
.drv-splash p { max-width: 320px; margin: 0; }
.drv-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 18px; }
.drv-empty h2 { margin: 0; font-size: 19px; }
.drv-empty p { margin: 0; color: var(--muted); }
.drv-run { display: grid; gap: 10px; }
.drv-lorry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--muted); }
.drv-checked { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; }
.drv-checked.ok { background: var(--green-bg); color: var(--green); }
.drv-checked.bad { background: var(--red-bg); color: var(--red); }
.drv-checked.warn { background: var(--amber-bg); color: var(--amber); }
.drv-checkcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 2px solid var(--yellow); background: #fffbea; color: #111315; font: inherit; cursor: pointer; }
.drv-checkcard span { display: grid; flex: 1; }
.drv-checkcard small { color: var(--muted); }
.drv-job { display: grid; gap: 4px; border-left: 6px solid var(--line-2); cursor: pointer; }
.drv-job.k-delivery, .drv-head.k-delivery { border-left-color: var(--yellow); }
.drv-job.k-collection, .drv-head.k-collection { border-left-color: var(--graphite); }
.drv-job.k-exchange, .drv-head.k-exchange { border-left-color: var(--blue); }
.drv-job.k-wait, .drv-head.k-wait { border-left-color: var(--amber); }
.drv-job.next { box-shadow: 0 0 0 3px var(--yellow), 0 10px 26px rgba(17, 19, 21, 0.12); }
.drv-job.done { opacity: 0.55; }
.drv-job.failed { border-color: var(--red-bg); }
.drv-job h3 { margin: 2px 0 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.drv-job-top { display: flex; justify-content: space-between; align-items: center; }
.drv-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.drv-eta { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.drv-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 800; }
.drv-bad { color: var(--red); font-weight: 800; }
.drv-addr { margin: 0; font-size: 16px; }
.drv-addr.big { font-size: 18px; font-weight: 600; }
.drv-pc { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: 0.02em; }
.drv-meta { margin: 0; color: var(--muted); font-size: 14px; }
.drv-quick { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.drv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; }
.drv-btn.primary { background: var(--yellow); border-color: var(--yellow); color: #111315; box-shadow: 0 3px 0 var(--yellow-600); }
.drv-btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.drv-btn.ghost { background: transparent; }
.drv-btn.big { min-height: 60px; font-size: 18px; width: 100%; }
.drv-btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.drv-btn:disabled { opacity: 0.45; cursor: default; }
.drv-quick .drv-btn { flex: 1; }
.drv-leg { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 14px; color: var(--muted); font-size: 14px; }
.drv-leg span { flex: 1; display: flex; justify-content: space-between; gap: 8px; }
.drv-leg small { font-variant-numeric: tabular-nums; font-weight: 700; }
.drv-leg em { font-style: normal; }
.drv-leg.tip { color: var(--text); }
.drv-link { border: 0; background: none; color: var(--muted); text-decoration: underline; font: inherit; font-size: 14px; padding: 14px; cursor: pointer; }
.drv-head { display: grid; gap: 4px; border-left: 6px solid var(--line-2); }
.drv-head h1 { margin: 2px 0; font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.drv-facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; margin: 0; font-size: 15px; }
.drv-facts dt { color: var(--muted); font-weight: 700; }
.drv-facts dd { margin: 0; }
.drv-notes { background: #fffbea; border-radius: 8px; padding: 4px 8px; }
.drv-do { display: grid; gap: 12px; }
.drv-do h1, .drv-do h2 { margin: 0; font-size: 22px; font-weight: 900; }
.drv-field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); margin: 0; }
.drv-field input { font-size: 18px; min-height: 50px; border-radius: 12px; }
.drv-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.drv-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.drv-photos img.sig { object-fit: contain; background: #fff; }
.drv-tile { width: 84px; height: 84px; display: grid; place-content: center; justify-items: center; gap: 4px; border: 2px dashed var(--line-2); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.drv-tile.wide { width: 100%; height: 160px; font-size: 16px; }
.drv-ticket { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.drv-ok-card, .drv-bad-card { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.drv-ok-card { background: var(--green-bg); color: var(--green); border-color: transparent; }
.drv-bad-card { background: var(--red-bg); color: var(--red); border-color: transparent; }
.drv-reasons { display: grid; gap: 8px; }
.drv-reason { min-height: 52px; text-align: left; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.drv-reason.on { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.drv-sheet { position: fixed; inset: 0; z-index: 20; background: rgba(17, 19, 21, 0.5); display: grid; align-items: end; }
.drv-sheet-card { background: var(--panel); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.drv-sheet-card h2 { margin: 0; font-size: 20px; }
.drv-sigpad { width: 100%; height: 200px; border: 2px dashed var(--line-2); border-radius: 14px; background: #fff; touch-action: none; }
.drv-row { display: flex; gap: 8px; }
.drv-row .drv-btn { flex: 1; }
.drv-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.drv-checklist li { display: grid; gap: 6px; }
.drv-checkrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--green); font: inherit; text-align: left; cursor: pointer; }
.drv-checkrow span { flex: 1; color: var(--text); font-weight: 600; font-size: 15px; }
.drv-checkrow b { font-size: 13px; }
.drv-checklist li.bad .drv-checkrow { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.drv-checklist input { min-height: 46px; font-size: 16px; }

/* ===== Yarder settings: lorries and drivers ===== */
.fl-alerts { gap: 8px; }
.fl-alert { display: flex; gap: 8px; align-items: center; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.fl-alert.bad { background: var(--red-bg); color: var(--red); }
.fl-item { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.fl-item.off { opacity: 0.6; }
.fl-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fl-name { width: auto; flex: 1; min-width: 160px; max-width: 320px; border-color: transparent; background: transparent; font-weight: 600; }
.fl-name.strong { font-weight: 800; font-size: 16px; }
.fl-name:hover:not(:disabled), .fl-name:focus { border-color: var(--line-2); background: var(--panel); }
.fl-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }
.fl-due input { border-color: var(--amber); background: var(--amber-bg); }
.fl-row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fl-item .fl-row-actions { justify-content: flex-start; }
.fl-form { display: grid; gap: 2px; }
.fl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fl-link { display: grid; gap: 12px; }
.fl-link p { margin: 0; }
.fl-link code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); word-break: break-all; font-size: 13px; }
.fl-checks { width: 100%; border-collapse: collapse; font-size: 14px; }
.fl-checks th, .fl-checks td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fl-checks th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fl-checks ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.chip.bad-chip { background: var(--red-bg); color: var(--red); }

/* Yarder bookings: the lorry's visits and a skip's life on hire */
.bk-visits { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.bk-visit { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.bk-visit span { flex: 1; }
.bk-visit.done { color: var(--green); }
.bk-visit.done span { color: var(--text); }
.bk-visit.failed { color: var(--red); }
.bk-visit.hire { font-weight: 600; }
.bk-visit.hire.bad { color: var(--red); }
.bk-visit-link { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.bk-life { display: grid; gap: 6px; }
.bk-life p { margin: 0; }
.bk-life-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-life-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Yarder settings: the skip register */
.sr-sizes { display: grid; gap: 10px; }
.sr-size { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 10px; }
.sr-size.empty { border-style: dashed; }
.sr-size-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-size-head img { border-radius: 10px; background: #eeefef; }
.sr-size-name { display: grid; min-width: 110px; }
.sr-counts { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.sr-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.sr-pill.out { background: var(--yellow); color: #111315; }
.sr-pill.repair { background: var(--amber-bg); color: var(--amber); }
.sr-add { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.sr-add label { margin: 0; display: grid; gap: 4px; }
.sr-add input { width: 120px; }
.sr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sr-chip { font: inherit; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; }
.sr-chip.out { background: var(--yellow); border-color: var(--yellow); color: #111315; }
.sr-chip.repair { background: var(--amber-bg); border-color: var(--amber-bg); color: var(--amber); }
.sr-chip.retired { opacity: 0.45; text-decoration: line-through; }
.sr-chip.overdue { box-shadow: inset 0 0 0 2px var(--red); }
.sr-chip.stray { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.sr-warn { display: flex; gap: 6px; align-items: center; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-weight: 600; font-size: 13.5px; }
.sr-panel { display: grid; gap: 10px; }
.sr-panel h3 { margin: 6px 0 0; font-size: 14px; }
.sr-where { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.sr-where.out { background: #fffbea; }
.sr-where.stray { background: var(--red-bg); }
.sr-panel-row { display: flex; gap: 8px; align-items: end; }
.sr-panel-row label { flex: 1; margin: 0; display: grid; gap: 4px; }
.sr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sr-history { list-style: none; margin: 0; padding-left: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); max-height: 220px; overflow-y: auto; }
.sr-history time { font-weight: 700; color: var(--text); margin-right: 4px; }
.drv-skiprow { display: flex; gap: 8px; }
.drv-skiprow input { flex: 1; min-width: 0; }
.drv-video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #111315; }
.drv-skipno { font-size: 44px !important; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.st-tips-more { grid-column: 2 / -1; display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin: -2px 0 8px; font-size: 13px; }
.st-tips-more > input { width: 130px; }
.st-hours { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.st-hours b { color: var(--text); font-weight: 700; margin-right: 2px; }
.st-hours input { width: 96px; padding: 5px 6px; }
.st-hours select { width: auto; padding: 5px 6px; }
@media (max-width: 760px) { .st-tips-more { grid-column: 1 / -1; } }
.dy-leg.closed, .drv-leg.closed { color: var(--red); }
.dy-leg small { font-size: 11.5px; }

/* Yarder customers: the card by a conversation, and trade accounts */
.cc { display: grid; gap: 6px; }
.cc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-head h4 { display: flex; gap: 6px; align-items: center; margin: 0; }
.cc-join { width: 100%; }
.cc-stop { display: flex; gap: 6px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 13px; font-weight: 600; }
.cc-label { margin: 6px 0 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cc-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; text-decoration: none; }
.cc-row small { color: var(--muted); white-space: nowrap; }
.cc-row.warn { background: #fffbea; }
.cc-row.bad { background: var(--red-bg); }
.cc-row.bad small { color: var(--red); font-weight: 700; }
.cc-row.soft { background: transparent; padding: 3px 8px; }
.cc-money { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 0; font-size: 13px; }
.cc-money dt { color: var(--muted); }
.cc-money dd { margin: 0; font-weight: 600; text-align: right; }
.cu { display: grid; grid-template-rows: auto 1fr; height: 100%; min-height: 0; }
.cu-tabs { padding: 14px 32px 0; }
.cu-tabs .tab { text-decoration: none; }
.cu > .page { min-height: 0; }
.cu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cu-card { display: grid; gap: 6px; text-align: left; font: inherit; color: var(--text); cursor: pointer; border-left: 5px solid var(--yellow); }
.cu-card.stop { border-left-color: var(--red); }
.cu-name { font-size: 17px; font-weight: 800; }
.cu-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cu-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 20px; }
.cu-panel { display: grid; gap: 12px; }
.cu-panel h3 { margin: 6px 0 0; font-size: 15px; }
.cu-stop { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg); }
.cu-stop.on { background: var(--red-bg); }
.cu-check { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--text); font-size: 14px; }
.cu-check input { width: auto; }
.cu-reason { background: var(--panel); }
.cu-person { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cu-person > span:first-child { display: grid; flex: 1; }
.cu-add { display: flex; gap: 6px; flex-wrap: wrap; }
.cu-add input { flex: 1; min-width: 140px; }
@media (max-width: 760px) { .cu-tabs { padding: 10px 16px 0; } }

/* Yarder settings: customer messages */
.nt-quiet { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.nt-quiet input { width: 110px; }
.nt-card { gap: 10px; }
.nt-card.off { opacity: 0.7; }
.nt-head { display: flex; gap: 10px; align-items: flex-start; }
.nt-head span { display: grid; gap: 2px; }
.nt-card textarea { font: inherit; font-size: 14px; line-height: 1.45; }
.nt-fields { margin: -4px 0 0; }
.nt-preview { padding: 10px 12px; border-radius: 12px; background: var(--out); }
.nt-preview p { margin: 2px 0 0; }
.bk-photos { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-photos span { display: inline-flex; gap: 4px; align-items: center; }
.bk-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* ===== Yarder trade portal (/trade/) ===== */
.tr-body { background: var(--bg); }
.tr { min-height: 100vh; }
.tr-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--graphite); color: #fff; }
.tr-brand { display: grid; line-height: 1.2; }
.tr-brand strong { font-size: 18px; font-weight: 900; color: var(--yellow); letter-spacing: -0.02em; }
.tr-brand span { font-weight: 700; }
.tr-me { font-size: 13.5px; opacity: 0.92; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-me a { color: #fff; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.tr-main { max-width: 980px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 14px; }
.tr-splash { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; }
.tr-stop { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-weight: 600; }
.tr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tr-tile { display: grid; gap: 2px; align-content: center; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.tr-tile span { color: var(--muted); font-size: 13px; font-weight: 700; }
.tr-tile strong { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
.tr-tile small { color: var(--muted); }
.tr-tile.bad small { color: var(--red); font-weight: 700; }
.tr-book { cursor: pointer; justify-items: center; background: var(--yellow); border-color: var(--yellow); color: #111315; font: inherit; }
.tr-book strong { font-size: 17px; }
.tr-book:disabled { opacity: 0.5; cursor: default; }
.tr-tabs { justify-self: start; }
.tr-sites { display: grid; gap: 12px; }
.tr-site { display: grid; gap: 10px; }
.tr-site header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tr-site h3 { margin: 0; font-size: 17px; font-weight: 800; }
.tr-skip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); flex-wrap: wrap; }
.tr-skip img { border-radius: 8px; background: #eeefef; }
.tr-skip.bad { background: var(--red-bg); }
.tr-skip.bad b { color: var(--red); }
.tr-skip.soft { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.tr-skip-what { display: grid; gap: 2px; flex: 1; min-width: 200px; }
.tr-skip-what small { color: var(--muted); }
.tr-skip-actions { display: flex; gap: 6px; }
.tr-ok { color: var(--green) !important; display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.tr-past { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tr-past > span { display: grid; }
.tr-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 30px 16px; }
.tr-form { display: grid; gap: 2px; }
.tr-form label { margin: 6px 0; }
.tr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-quote { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); margin-top: 6px; }
.tr-quote strong { font-size: 20px; font-weight: 900; }
.tr-quote .bad { color: var(--red); font-weight: 600; }
.tr-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.tr-table-card { padding: 0; overflow-x: auto; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-table th, .tr-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tr-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tr-table td small { display: block; }
.tr-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.tr-table tr.bad b { color: var(--red); }
.tr-docs a { font-weight: 600; }
.tr-range { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tr-range .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.tr-range .chip.on { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.tr-range .btn { margin-left: auto; }
.tr-waste { display: grid; gap: 12px; }
.tr-waste-top { display: flex; gap: 24px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.tr-waste-top div { display: grid; }
.tr-waste-top span { color: var(--muted); font-size: 13px; font-weight: 700; }
.tr-waste-top strong { font-size: 24px; font-weight: 900; }
.tr-waste .muted.small { padding: 0 12px 12px; margin: 0; }
.tr-signout { justify-self: center; border: 0; background: none; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; padding: 12px; }
@media (max-width: 640px) {
  .tr-tiles { grid-template-columns: 1fr 1fr; }
  .tr-book { grid-column: 1 / -1; }
  .tr-two { grid-template-columns: 1fr; gap: 0; }
  .tr-top { padding: 12px 16px; }
}

/* ===== Yarder paperwork: permits, transfer notes, waste records ===== */
.pw-tabs { justify-self: start; }
.pw-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 18px; }
.pw-permits { display: grid; gap: 16px; }
.pw-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pw-group { display: grid; gap: 8px; }
.pw-group h2 { font-size: 16px; margin: 0; }
.pw-group > p { margin: -4px 0 0; }
.pw-card { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 5px solid var(--line-2); }
.pw-card.needed { border-left-color: var(--red); }
.pw-card.applied { border-left-color: var(--amber); }
.pw-card.granted { border-left-color: var(--green); }
.pw-card-main { display: grid; gap: 3px; min-width: 240px; flex: 1; }
.pw-council { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.pw-ok { display: inline-flex; gap: 5px; align-items: center; color: var(--green); font-weight: 600; font-size: 13px; }
.pw-flag { font-size: 13px; font-weight: 700; }
.pw-flag.bad, .pw-card .bad { color: var(--red); }
.pw-flag.warn { color: var(--amber); }
.pw-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pw-draft pre { white-space: pre-wrap; font: inherit; font-size: 13.5px; line-height: 1.5; background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; max-height: 380px; overflow-y: auto; }
.pw-form { display: grid; gap: 2px; }
.pw-past-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; text-align: left; }
.pw-past-chev { display: inline-flex; transition: transform 0.15s; }
.pw-past-chev.open { transform: rotate(180deg); }
.pw-past-list { display: grid; gap: 0; padding: 4px 16px; }
.pw-past-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pw-past-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .pw-past-row { grid-template-columns: minmax(0, 1fr) auto; } .pw-past-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; } }
.dy-tag.ok { background: var(--green-bg); border-color: transparent; color: var(--green); }
.drv-bad { color: var(--red) !important; font-weight: 700; }
.st-permit-more { grid-column: 1 / -1; display: grid; grid-template-columns: 140px minmax(200px, 1fr) minmax(240px, 2fr); gap: 10px 14px; }
@media (max-width: 760px) { .st-permit-more { grid-template-columns: 1fr; } }

/* ===== Yarder money: tabs, the job's ledger, charges to review, what is owed ===== */
.nav-count.red, .tab-count.red { background: var(--red); color: #fff; }
.mn-tabs { justify-self: start; }
.mn-jobs { display: grid; gap: 16px; }
.mn-basis { flex: 1; min-width: 200px; }
.mn-kpi.late strong { color: var(--red); }
.mn-doc.bad { background: var(--red-bg); color: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.on { background: var(--graphite); color: #fff; }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; }
.link-like { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.good { color: var(--green); }
.bad { color: var(--red); }

.mn-ledger { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mn-ledger-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: var(--panel-2); }
.mn-balance { display: grid; gap: 2px; }
.mn-balance strong { font-size: 20px; font-weight: 850; letter-spacing: -0.03em; }
.mn-ledger-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mn-docs-list, .mn-pays { display: grid; border-top: 1px solid var(--line); }
.mn-docrow, .mn-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto 90px; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 14px; }
.mn-docrow:last-child, .mn-pay:last-child { border-bottom: 0; }
.mn-docrow:hover { background: var(--panel-2); }
.mn-docrow b, .mn-pay b { text-align: right; font-variant-numeric: tabular-nums; }
.mn-docrow.credit_note b, .mn-pay.refund b { color: var(--red); }
.mn-pay.payment b { color: var(--green); }
.mn-chase { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13.5px; background: var(--amber-bg); }
.mn-chase > span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.mn-chase-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.mn-charges { margin-top: 14px; }
.mn-charges-head { display: flex; justify-content: space-between; align-items: center; }
.mn-charges-head h3 { margin: 0; }
.mn-charge { display: grid; grid-template-columns: minmax(0, 1fr) auto 80px auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mn-charge > span:first-child { display: grid; gap: 1px; }
.mn-charge b { text-align: right; }
.mn-charge.waived b { text-decoration: line-through; color: var(--muted); }
.mn-charge-status { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.mn-charge-status.approved { background: var(--green-bg); color: var(--green); }
.mn-charge-status.proposed { background: var(--amber-bg); color: var(--amber); }
.mn-charge-status.disputed { background: var(--red-bg); color: var(--red); }

.mn-form { display: grid; gap: 4px; }
.mn-form textarea { width: 100%; }
.mn-check { display: flex !important; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 500; margin: 6px 0; }
.mn-check input { width: auto; margin-top: 3px; }
.mn-letter { display: grid; gap: 12px; }
.mn-letter pre { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.55; background: var(--bg); border-radius: 12px; padding: 16px 18px; margin: 0; max-height: 52vh; overflow-y: auto; }
.mn-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted); }

/* To review */
.mr { display: grid; gap: 14px; }
.mr-list { display: grid; gap: 12px; }
.mr-hint-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.mr-hint-card > div { display: grid; flex: 1; }
.mr-card { display: grid; gap: 6px; border-left: 5px solid var(--amber); }
.mr-card.disputed { border-left-color: var(--red); }
.mr-card h3 { margin: 2px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.mr-card p { margin: 0; }
.mr-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mr-kind { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.mr-job { margin-left: auto; font-size: 13px; }
.mr-reason { font-size: 14.5px; line-height: 1.5; }
.mr-dispute { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0; padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: var(--text); font-size: 14px; }
.mr-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mr-photo { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.mr-photo img { width: 128px; height: 96px; object-fit: cover; display: block; }
.mr-hint { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--green); }
.mr-foot { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.mr-amount { display: grid; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mr-amount .st-money { width: 130px; }
.mr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mr-lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 10, 12, 0.86); display: grid; place-items: center; cursor: zoom-out; padding: 20px; }
.mr-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* Owed */
.ow { display: grid; gap: 14px; }
.ow-top { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 14px; }
.ow-aged { display: grid; gap: 10px; padding: 18px; align-content: start; }
.ow-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg); gap: 2px; }
.ow-seg.current, .ow-dot.current { background: #9ca3af; }
.ow-seg.d30, .ow-dot.d30 { background: #f5c400; }
.ow-seg.d60, .ow-dot.d60 { background: #f59e0b; }
.ow-seg.d90, .ow-dot.d90 { background: #ea580c; }
.ow-seg.older, .ow-dot.older { background: var(--red); }
.ow-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.ow-legend span { display: inline-flex; gap: 5px; align-items: center; }
.ow-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ow-bar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ow-rule { flex: 1; min-width: 220px; }
.ow-list { padding: 4px 0; }
.ow-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 0.9fr minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.ow-row:first-child { border-top: 0; }
.ow-row > span, .ow-who { display: grid; min-width: 0; }
.ow-row.late { box-shadow: inset 4px 0 0 var(--red); }
.ow-amt { text-align: right; justify-items: end; font-variant-numeric: tabular-nums; }
.ow-amt strong { font-size: 16px; }
.ow-chase { display: inline-flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ow-chase.paused { color: var(--amber); }
.ow-chase.you { color: var(--red); font-weight: 700; }
.ow-actions { display: flex !important; gap: 6px; align-items: center; justify-content: flex-end; }
.ow-menu { position: relative; }
.ow-pop { position: absolute; right: 0; top: 34px; z-index: 30; display: grid; min-width: 230px; padding: 6px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); }
.ow-pop button { display: flex; gap: 8px; align-items: center; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.ow-pop button:hover { background: var(--bg); }
.ow-credits h2 { font-size: 16px; margin: 4px 0 8px; }
.ow-alloc { display: grid; gap: 2px; margin: 6px 0; font-size: 13.5px; }
.ow-alloc > div { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.ow-alloc > div.on { background: var(--green-bg); color: var(--text); }
@media (max-width: 900px) {
  .ow-top { grid-template-columns: 1fr 1fr; }
  .ow-aged { grid-column: 1 / -1; }
  .ow-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ow-row .ow-when, .ow-row .ow-chase { grid-column: 1; }
  .ow-row .ow-amt { grid-column: 2; grid-row: 1; }
  .ow-row .ow-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .mn-charge { grid-template-columns: minmax(0, 1fr) auto; }
  .mn-docrow, .mn-pay { grid-template-columns: minmax(0, 1fr) auto; }
  .mn-docrow > span.muted, .mn-pay > span.muted { display: none; }
}
.st-toggle-row { display: flex; gap: 10px; align-items: center; }
.st-toggle-field .st-toggle-row { align-items: flex-start; }
.st-chase { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.st-chase-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
@media (max-width: 760px) { .st-chase-days { grid-template-columns: 1fr 1fr; } }
.tr-charge td { padding-top: 0 !important; border-top: 0 !important; }
.tr-charge-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-left: 14px; padding: 8px 12px; border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: 0 10px 10px 0; }
.tr-charge-in > span { display: grid; gap: 2px; }
.tr-disputed { color: var(--red); font-weight: 600; }

/* ===== Yarder paperwork: transfer notes and waste records ===== */
.rc { display: grid; gap: 14px; }
.rc-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rc-exports { display: inline-flex; gap: 6px; }
.rc-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.rc-sum b { color: var(--text); font-size: 16px; }
.rc-list { padding: 4px 0; }
.rc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 0.8fr 1.2fr 1.3fr auto 16px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 14px; }
.rc-row:first-child { border-top: 0; }
.rc-row:hover { background: var(--panel-2); }
.rc-main, .rc-col { display: grid; min-width: 0; }
.rc-main small, .rc-col small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sig { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--amber); white-space: nowrap; }
.rc-sig.ok { color: var(--green); }
.rc-keep { display: flex; gap: 6px; align-items: center; }
.rc-explain { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.rc-explain > div { display: grid; gap: 4px; }
.rc-records { display: grid; gap: 10px; }
.rc-rec { display: grid; gap: 10px; border-left: 5px solid var(--green); }
.rc-rec.draft { border-left-color: var(--red); }
.rc-rec.sent { border-left-color: var(--line-2); }
.rc-rec header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rc-status { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; background: var(--green-bg); color: var(--green); }
.rc-status.draft { background: var(--red-bg); color: var(--red); }
.rc-status.sent { background: var(--bg); color: var(--muted); }
.rc-move { display: grid; grid-template-columns: minmax(0, 1.2fr) 16px minmax(0, 1fr) 16px minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13.5px; }
.rc-move > span { display: grid; min-width: 0; }
.rc-move b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-move svg { color: var(--muted); }
.rc-what { padding-left: 10px; border-left: 1px solid var(--line); }
.rc-issues { list-style: none; margin: 0; padding: 8px 12px; border-radius: 10px; display: grid; gap: 4px; font-size: 13.5px; }
.rc-issues li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rc-issues.bad { background: var(--red-bg); color: var(--red); }
.rc-issues.warn { background: var(--amber-bg); color: #6b4a00; }
.rc-rec footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 900px) {
  .rc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rc-row .rc-col, .rc-row > svg { display: none; }
  .rc-move { grid-template-columns: 1fr 1fr; }
  .rc-move > svg { display: none; }
  .rc-what { padding-left: 0; border-left: 0; }
}

/* ===== Yarder overview: the owner's brief and questions ===== */
.ov { display: grid; gap: 12px; }
.ov-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ov-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.ov-brief { display: grid; gap: 12px; }
.ov-headline { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.45; }
.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ov-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: inherit; text-decoration: none; }
.ov-stat strong { font-size: 20px; font-weight: 850; letter-spacing: -0.03em; }
.ov-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ov-stat.warn { background: var(--amber-bg); }
.ov-stat.bad { background: var(--red-bg); }
.ov-stat.good { background: var(--graphite); }
.ov-stat.good strong { color: var(--yellow); }
.ov-stat.good span { color: #c9ccd1; }
.ov-lines { display: grid; gap: 4px; }
.ov-line { display: flex; gap: 8px; align-items: center; padding: 6px 2px; font-size: 14px; color: inherit; text-decoration: none; }
.ov-line.bad { color: var(--red); }
.ov-risks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ov-risks li a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: inherit; text-decoration: none; }
.ov-risks li.bad a { background: var(--red-bg); color: var(--red); font-weight: 600; }
.ov-risks li.warn a { background: var(--amber-bg); color: #6b4a00; }
.ov-ok { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--green); font-size: 14px; font-weight: 600; }
.ov-ask { display: grid; gap: 12px; }
.ov-ask-form { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); }
.ov-ask-form:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--brand-50); }
.ov-ask-form input { flex: 1; border: 0; background: none; font: inherit; font-size: 15px; padding: 8px 0; outline: none; min-width: 0; }
.ov-try { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ov-try .chip { background: var(--bg); color: var(--text); font-weight: 500; }
.ov-answers { display: grid; gap: 10px; }
.ov-qa { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.ov-q { margin: 0; font-weight: 700; font-size: 14px; }
.ov-a { margin: 0; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.ov-facts { display: grid; gap: 10px; margin-top: 4px; }
.ov-fact { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.ov-fact p { margin: 0; }
.ov-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; }
.ov-dl dt { color: var(--muted); }
.ov-dl dd { margin: 0; font-weight: 600; }
.ov-table-wrap { overflow-x: auto; }
.ov-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.ov-table th, .ov-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ov-table th { color: var(--muted); font-weight: 600; }
.ov-note { display: flex; gap: 6px; align-items: center; margin: 0; }
@media (max-width: 1000px) { .ov-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .ov-stats { grid-template-columns: 1fr 1fr; } }
.ov-a { display: grid; gap: 8px; white-space: normal; }
.ov-a p { margin: 0; }
.ov-a ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.ob-try { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.ob-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ob-code pre { grid-column: 1; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.ob-code button { grid-row: 1 / span 2; grid-column: 2; }
.ob-colour { display: flex; gap: 8px; align-items: center; }
.ob-colour input { width: 48px; height: 38px; padding: 2px; }
.ob-quotes { display: grid; }
.ob-quote { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ob-quote > span:first-child { display: grid; }
@media (max-width: 760px) { .ob-quote { grid-template-columns: minmax(0, 1fr) auto; } .ob-quote > :nth-child(2), .ob-quote > :nth-child(4) { grid-column: 1 / -1; } }
.ws-pages { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; }
.ws-pages a { font-weight: 600; }
.ws-dns { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); display: grid; gap: 6px; }
.ws-dns dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.ws-dns dt { color: var(--muted); }
.ws-dns dd { margin: 0; font-weight: 600; }
.ws-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ws-words { display: grid; gap: 10px; }
.ws-words textarea, .ws-area textarea, .ws-faq textarea { width: 100%; }
.ws-sub { margin: 18px 0 6px; font-size: 15px; }
.ws-faq { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.ws-faq textarea { grid-column: 1; }
.ws-faq .icon-btn { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.ws-area { margin-top: 8px; }
.ws-save { position: sticky; bottom: 12px; justify-content: flex-end; }

/* ===== Yarder marketing: reviews, the Google profile, ads ===== */
.mk-warn { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); color: #6b4a00; margin: 8px 0; flex-wrap: wrap; }
.mk-kpis { grid-template-columns: repeat(2, minmax(0, 220px)); }
.mk-list { display: grid; }
.mk-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mk-row > span:first-child { display: grid; }
.mk-status.sent { color: var(--green); font-weight: 600; font-size: 13px; }
.mk-status.skipped { color: var(--muted); font-size: 13px; }
.mk-check { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 6px; }
.mk-check li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.mk-check li.done { color: var(--green); }
.mk-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.mk-copy { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.mk-copy-label { font-weight: 700; font-size: 13px; color: var(--muted); padding-top: 4px; }
.mk-copy code, .mk-copy p { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--bg); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.mk-services { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.mk-reply { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--green-bg); display: grid; gap: 10px; justify-items: start; }
.mk-reply p { margin: 0; line-height: 1.55; }
.mk-suggest { display: grid; gap: 8px; }
.mk-sug { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 14px; }
.mk-sug.bad { border-left: 4px solid var(--red); }
.mk-sug.warn { border-left: 4px solid var(--amber); }
.mk-sug.good { border-left: 4px solid var(--green); }
.mk-table { padding: 6px 0; }
.mk-trow { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 14px; }
.mk-trow.head { border-top: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mk-trow > span:first-child { display: grid; }
.mk-trow .n { text-align: right; font-variant-numeric: tabular-nums; }
.mk-spend { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0; }
.mk-spend label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.mk-draft { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mk-draft h3 { margin: 0 0 8px; }
.mk-draft h4 { margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.mk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mk-cols ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 14px; }
@media (max-width: 760px) { .mk-copy { grid-template-columns: 1fr auto; } .mk-copy > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; } .mk-cols { grid-template-columns: 1fr; } .mk-trow { grid-template-columns: minmax(0, 1fr) auto auto; } .mk-trow > :nth-child(4), .mk-trow > :nth-child(5) { display: none; } .mk-row { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---- Your plan (Yarder on the platform) -------------------------------------------------------------------------- */
:root { --meter-ok: #2a78d6; --meter-ok-track: #cde2fb; --meter-near: #fab219; --meter-near-track: #fde9b8; --meter-over: #d03b3b; --meter-over-track: #f5d3d3; }
@media (prefers-color-scheme: dark) { :root { --meter-ok: #3987e5; --meter-ok-track: #0d366b; --meter-near-track: #4a3708; --meter-over-track: #4a1d1d; } }
.plan-banner { border-radius: var(--radius-sm); }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-now h3 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.plan-price { font-size: 15px; margin-bottom: 8px; }
.plan-price strong { font-size: 20px; }
.plan-list { margin: 10px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.minutes-big { margin: 4px 0 8px; }
.minutes-big strong { font-size: 26px; letter-spacing: -0.02em; }
.plan-meter { height: 10px; border-radius: 999px; overflow: hidden; }
.plan-meter span { display: block; height: 100%; border-radius: 999px; }
.plan-meter.ok { background: var(--meter-ok-track); } .plan-meter.ok span { background: var(--meter-ok); }
.plan-meter.near { background: var(--meter-near-track); } .plan-meter.near span { background: var(--meter-near); }
.plan-meter.over { background: var(--meter-over-track); } .plan-meter.over span { background: var(--meter-over); }
.strong-note { font-weight: 600; }
.plan-minutes .bank { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-minutes .bank p { margin: 4px 0 0; }
.plan-due { border-radius: var(--radius-sm); margin: 0 6px 10px; }
.plan-due a { margin-left: auto; font-weight: 700; color: inherit; text-decoration: underline; }
.invoices-table td.num, .invoices-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.exports-list { list-style: none; margin: 0; padding: 0 6px; }
.exports-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.danger-zone h4 { margin: 0 0 6px; }
@media (max-width: 980px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Moving in ----------------------------------------------------------------------------------------------------- */
.launch-progress { display: grid; gap: 6px; min-width: 160px; text-align: right; }
.launch-list { list-style: none; margin: 0; padding: 0 6px; }
.launch-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.launch-list li.done strong { color: var(--muted); }
.launch-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.launch-actions input[type=date] { width: auto; }
.ready-dot { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: grid; place-items: center; background: var(--in); color: var(--muted); }
.launch-list li.done .ready-dot { background: var(--green); color: #fff; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.import-check { display: grid; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); }
.import-check label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.import-check label.inline select { width: auto; margin: 0; }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.map-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 13px; }
.map-row select { margin: 0; }
.import-summary p { margin: 4px 0 0; }
.import-problems { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.import-done { border-radius: var(--radius-sm); margin: 0 6px 10px; }
.moving-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.moving-grid h4 { margin: 0 0 4px; }
.draft-note { background: var(--in); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; font-size: 13.5px; }
.draft-note ul { margin: 6px 0 8px; padding-left: 18px; }
.sandbox-table td.num, .sandbox-table th.num, .imports-table td.num, .imports-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sandbox-table td.diff { color: var(--amber); font-weight: 650; }
.sandbox-table td.same { color: var(--green); font-weight: 650; }
.error-text { color: var(--red); }
@media (max-width: 980px) { .moving-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .launch-list li { grid-template-columns: auto minmax(0, 1fr); }
  .launch-actions { grid-column: 2; justify-content: flex-start; }
  .map-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.draft-banner { flex-wrap: wrap; border-radius: var(--radius-sm); }
.draft-banner > span:first-of-type { flex: 1; min-width: 240px; }

/* ---------- the pilot: before and after, and the team's counter ---------- */
.tally { display: flex; gap: 6px; align-items: stretch; }
.tally-btn { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06); color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.tally-btn:hover { background: rgba(255, 255, 255, 0.12); }
.tally-btn:active { transform: translateY(1px); }
.tally-btn span { flex: 1; }
.tally-btn strong { font-weight: 700; white-space: nowrap; }
.tally-undo { border: 0; border-radius: 10px; padding: 0 10px; background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.tally.compact .tally-btn { flex: none; padding: 5px 9px; border-color: var(--line); background: var(--panel); font-size: 13px; }
.tally.compact .tally-undo { background: var(--in); }
.mobile-top .tally { margin-left: 8px; }
@media (max-width: 980px) {
  .side-foot .tally-btn { justify-content: center; padding: 8px 4px; }
  .side-foot .tally-btn span { display: none; }
  .side-foot .tally-btn strong { font-size: 12px; }
  .side-foot .tally-undo { display: none; }
}
.pilot-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.pilot-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; background: var(--panel-2); }
.pilot-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pilot-pair > div { display: grid; }
.pilot-pair small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pilot-pair strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.pilot-pair .delta { margin-left: auto; font-size: 13px; }
.pilot-ai { grid-template-columns: minmax(150px, max-content) 1fr; }
.pilot-toggle { align-items: flex-start; gap: 12px; flex-wrap: nowrap; }
.pilot-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.pilot-dates small { display: block; margin-top: 4px; font-weight: 400; }
.table-scroll { overflow-x: auto; }
.pilot-weeks td, .pilot-weeks th { white-space: nowrap; }
.pilot-weeks tr.current td { background: var(--in); }
.entered-mark { color: var(--amber); font-size: 11px; margin-left: 3px; }
.week-note { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (max-width: 640px) {
  .pilot-ai { grid-template-columns: 1fr; }
  .grid2.pilot-dates { grid-template-columns: 1fr; }
}

/* ---------- the checks before going live ---------- */
.prelaunch { display: grid; gap: 12px; margin-top: 16px; }
.prelaunch .card-bar { align-items: flex-start; gap: 12px; }
.pl-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; }
.pl-summary.ok { background: var(--green-bg); color: var(--green); }
.pl-summary.bad { background: var(--amber-bg); color: var(--amber); }
.pl-summary .muted { color: inherit; opacity: 0.8; }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl-item { border: 1px solid var(--line); border-radius: 10px; }
.pl-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pl-head:disabled { cursor: default; }
.pl-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--in); color: var(--muted); flex: none; }
.pl-item.ok .pl-dot { background: var(--green-bg); color: var(--green); }
.pl-item.bad .pl-dot { background: var(--red-bg); color: var(--red); }
.pl-item.wait .pl-dot { opacity: 0.5; }
.pl-body { padding: 0 12px 12px 42px; display: grid; gap: 10px; }
.pl-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.pl-checks li { display: flex; gap: 6px; align-items: center; }
.pl-checks li.ok { color: var(--green); }
.pl-checks li.bad { color: var(--red); }
.pl-transcript { display: grid; gap: 8px; font-size: 13px; }
.pl-turn { display: grid; gap: 4px; }
.pl-customer, .pl-righto { padding: 8px 10px; border-radius: 10px; }
.pl-customer { background: var(--in); justify-self: start; max-width: 85%; }
.pl-righto { background: var(--panel-2); border: 1px solid var(--line); justify-self: end; max-width: 85%; }
.pl-turn small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 640px) {
  .prelaunch .card-bar { flex-direction: column; }
  .pl-body { padding-left: 12px; }
}

/* ---------- the phone line ---------- */
.phone-line .grid2 { align-items: start; }
.phone-line label .row { gap: 8px; flex-wrap: nowrap; }
.phone-line label small { display: block; margin-top: 4px; font-weight: 400; }
.phone-facts { display: grid; gap: 10px; }
.phone-facts > div { display: grid; gap: 2px; }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice.on { border-color: var(--brand-600, var(--blue)); background: var(--panel-2); }
.choice input { margin-top: 3px; }
.choice span { display: grid; gap: 2px; }
.ring-select { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.ring-select select { width: auto; }
.kind-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; }
.kind-tab.on { background: var(--ink, #111); color: var(--panel, #fff); border-color: transparent; }
.codes { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.codes li { display: grid; gap: 4px; }
.code-row { display: flex; align-items: center; gap: 6px; }
.code-row code { font-size: 15px; padding: 6px 10px; border-radius: 8px; background: var(--in); letter-spacing: 0.02em; word-break: break-all; }
.codes-more { display: flex; gap: 14px; flex-wrap: wrap; }
.code-notes { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); font-size: 13.5px; }
.try-state { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.try-state.ok { color: var(--green); }
@media (max-width: 640px) {
  .phone-line .grid2 { grid-template-columns: 1fr; }
}
