/* Design system of «ИИ-агент Ромашка». No external fonts or CDNs: works inside a closed LAN.
   Warm paper and ink with the daisy's yellow as the one signal colour: the current step,
   the active place. Borders instead of shadows, no gradients. */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f6f5f1;
  --sidebar-bg: #efede8;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: #e5e2db;
  --border-strong: #d2cec5;
  --text: #1b1a17;
  --text-2: #56524b;
  --text-3: #8a857b;
  --accent: #1b1a17;
  --accent-hover: #3a3832;
  --accent-soft: #efede7;
  --accent-text: #ffffff;
  --signal: #f0b400;
  --signal-soft: #fdf3d3;
  --signal-text: #1b1a17;
  --success: #2c7a4b;
  --success-soft: #e5f1e8;
  --warning: #a35f00;
  --warning-soft: #fbefd9;
  --danger: #bf3a2b;
  --danger-soft: #fae8e4;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--text) 75%, transparent);
  --shadow-sm: 0 1px 0 rgb(27 26 23 / 4%);
  --shadow: 0 1px 2px rgb(27 26 23 / 6%), 0 12px 32px -16px rgb(27 26 23 / 18%);

  --radius-sm: 7px;
  --radius: 9px;
  --radius-lg: 12px;
  --sidebar: 240px;
  --petal-stroke: #d6d2c9;
  --daisy-shadow: rgb(27 26 23 / 12%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --sidebar-bg: #0f0e0d;
    --surface: #1b1a17;
    --surface-2: #24231f;
    --border: #2f2d29;
    --border-strong: #423f39;
    --text: #edebe6;
    --text-2: #b8b3a9;
    --text-3: #88837a;
    --accent: #edebe6;
    --accent-hover: #ffffff;
    --accent-soft: #2a2925;
    --accent-text: #131210;
    --signal: #f2b705;
    --signal-soft: #352b0e;
    --signal-text: #131210;
    --success: #62c08a;
    --success-soft: #16261c;
    --warning: #e3a33b;
    --warning-soft: #2e2412;
    --danger: #ef7b6c;
    --danger-soft: #341b17;
    --shadow-sm: none;
    --shadow: 0 0 0 1px var(--border), 0 16px 40px -16px rgb(0 0 0 / 60%);
    --petal-stroke: #9a958b;
    --daisy-shadow: rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131210;
  --sidebar-bg: #0f0e0d;
  --surface: #1b1a17;
  --surface-2: #24231f;
  --border: #2f2d29;
  --border-strong: #423f39;
  --text: #edebe6;
  --text-2: #b8b3a9;
  --text-3: #88837a;
  --accent: #edebe6;
  --accent-hover: #ffffff;
  --accent-soft: #2a2925;
  --accent-text: #131210;
  --signal: #f2b705;
  --signal-soft: #352b0e;
  --signal-text: #131210;
  --success: #62c08a;
  --success-soft: #16261c;
  --warning: #e3a33b;
  --warning-soft: #2e2412;
  --danger: #ef7b6c;
  --danger-soft: #341b17;
  --shadow-sm: none;
  --shadow: 0 0 0 1px var(--border), 0 16px 40px -16px rgb(0 0 0 / 60%);
  --petal-stroke: #9a958b;
  --daisy-shadow: rgb(0 0 0 / 45%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
a { color: var(--text); text-decoration: none; font-weight: 520; }
a:hover { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
p a, li a, td a:not(.btn), .hint a, .small a, .kv a, .alert a {
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
p a:hover, li a:hover, td a:not(.btn):hover, .hint a:hover, .small a:hover, .kv a:hover, .alert a:hover { text-decoration-color: currentColor; }
::selection { background: var(--signal-soft); color: var(--text); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; }
h2 { font-size: 15px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.icon { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* App shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 10px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 650; font-size: 15px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: #1b1a17; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
}
.brand-mark .daisy { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 680; font-size: 15.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--text-3); }
.company-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 12px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-weight: 560; box-shadow: var(--shadow-sm);
}
.company-switch:hover { text-decoration: none; border-color: var(--border-strong); }
.company-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { padding: 16px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav-link .icon { color: var(--text-3); }
.nav-link:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 560; box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); }
.nav-link[aria-current="page"] .icon, .nav-link:hover .icon { color: var(--text); }
.nav-link .soon { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 500; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--signal); color: var(--signal-text); font-weight: 650; font-size: 11.5px; flex: none;
}
.user-chip .who { min-width: 0; }
.user-chip .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 28px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.topbar .crumbs strong { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .menu-toggle { display: none; }
.content { width: 100%; max-width: 1120px; padding: 32px 32px 48px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin-top: 6px; max-width: 70ch; color: var(--text-2); }

/* Cards and layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--text-3); margin-top: 2px; }
.card-head-wrap { flex-wrap: wrap; row-gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; color: var(--text); transition: border-color .15s; }
a.tile:hover { text-decoration: none; border-color: var(--border-strong); }
.tile .tile-title { font-weight: 600; font-size: 15px; }

/* Setup checklist */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step-dot {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border-strong); color: var(--text-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step .step-text { flex: 1; min-width: 0; }
.step.done .step-title { color: var(--text-2); }
progress.progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
progress.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 25%, var(--border-strong)); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible, .input:focus-visible, .nav-link:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled:not(.is-loading) { opacity: .5; cursor: default; pointer-events: none; }
.icon-btn { width: 34px; padding: 0; }
.btn-sm.icon-btn { width: 29px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 560; }
.field .hint { color: var(--text-3); font-size: 12.5px; }
.field .error { color: var(--danger); font-size: 12.5px; }
.text-danger { color: var(--danger); }
.field-group { display: flex; flex-direction: column; gap: 10px; }
.model-load { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: -6px; }
.model-load .hint { color: var(--text-3); font-size: 12.5px; }
.model-load .hint.text-danger { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; min-height: 36px; padding: 7px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; box-shadow: inset 0 1px 1px rgb(27 26 23 / 3%);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 140px; resize: vertical; line-height: 1.55; }
.input::placeholder { color: var(--text-3); opacity: .8; }
.input:hover { border-color: var(--text-3); }
.input:focus { border-color: var(--text); }
.field.has-error .input { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3); padding: 9px 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* Badges and alerts */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 560; white-space: nowrap; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent); }
.badge-accent { background: var(--signal-soft); color: color-mix(in srgb, var(--warning) 70%, var(--text)); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.alert-success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); color: var(--success); }
.alert-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); color: var(--danger); }
.alert-info { border-color: var(--border); background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--text-3); }
.alert-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-soft); color: var(--warning); }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; opacity: .7; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty .icon { width: 32px; height: 32px; color: var(--text-3); }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; padding-bottom: 22px; }
.auth-card .card-body { padding: 28px; }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.auth-card .lead { text-align: center; color: var(--text-3); margin-bottom: 22px; }

/* Login: the daisy, the name and the form in one centred column; what the agent does
   below it as tiles */
.auth-login {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: clamp(40px, 6vh, 64px); padding: clamp(28px, 6vh, 64px) 16px 40px;
  background: var(--bg);
}
.auth-stack { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.auth-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-kicker {
  margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--text-3);
}
.auth-title {
  margin: 6px 0 4px; font-size: clamp(38px, 7vw, 52px); line-height: 1.05; font-weight: 750; letter-spacing: -0.04em; color: var(--text);
}
.slogan { font-size: 18px; font-weight: 560; color: var(--text-2); }
.slogan strong { color: var(--success); font-weight: 750; }
.auth-main { width: 100%; }
.auth-login .auth-card { max-width: none; }
.auth-login .auth-card .card {
  box-shadow: var(--shadow);
}
.auth-login .auth-card .card-body { padding: 30px 30px 32px; }

.daisy-stage-hero { width: 172px; gap: 0; }
.daisy-stage-hero .daisy-say {
  position: absolute; left: 78%; top: 6%; min-height: 0; padding: 5px 12px; white-space: nowrap;
  font-size: 15px; font-weight: 650; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; box-shadow: var(--shadow-sm);
}
.daisy-stage-hero .daisy-say:empty { visibility: hidden; }
.daisy-stage-hero .daisy-say.won {
  font-size: 17px; color: var(--success); background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

.auth-features { width: 100%; max-width: 1120px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-lead { max-width: 560px; text-align: center; font-size: 17px; font-weight: 600; line-height: 1.45; color: var(--text); }
.features { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.features li {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg);
  background: transparent; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0; padding: 14px 2px 0;
}
.features li > .icon { flex: none; width: 20px; height: 20px; color: var(--text); }
.features strong { display: block; font-weight: 640; margin-bottom: 3px; }
.features span { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.auth-version { font-size: 12px; color: var(--text-3); }
@media (max-width: 1080px) {
  .features { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
}
@media (max-width: 560px) {
  .auth-login { gap: 36px; padding-top: 24px; }
  .auth-stack { gap: 22px; }
  .daisy-stage-hero { width: 128px; }
  .auth-login .auth-card .card-body { padding: 24px 20px 26px; }
  .features li { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 2px 0; }
}

/* Sign-in and sign-up: tabs, VK ID / Yandex ID buttons, the small header of inner pages */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
}
.auth-tabs a {
  display: block; padding: 8px 10px; border-radius: 9px; text-align: center;
  font-weight: 600; font-size: 14px; color: var(--text-2);
}
.auth-tabs a:hover { color: var(--text); text-decoration: none; }
.auth-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-row { margin-top: -2px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-3); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-providers { display: flex; flex-direction: column; gap: 10px; }
.auth-providers-inline { flex-direction: row; flex-wrap: wrap; }
.btn-provider { gap: 10px; font-weight: 600; }
.provider-mark { width: 20px; height: 20px; flex: none; }
.card-head h2 .provider-mark { vertical-align: -4px; margin-right: 4px; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.auth-icon .icon { width: 24px; height: 24px; }
.auth-icon .provider-mark { width: 30px; height: 30px; }
.auth-card .lead strong { color: var(--text); overflow-wrap: anywhere; }
.auth-compact { gap: 28px; }
.auth-compact .auth-hero { padding-top: 4px; }
.auth-home { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.auth-home:hover { text-decoration: none; }
.daisy-stage.daisy-stage-mini { width: 40px; }
.auth-home-name { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.input-static { display: flex; align-items: center; background: var(--surface-2); color: var(--text-2); overflow-wrap: anywhere; }

/* Platform administration */
.impersonation {
  display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  font-size: 14px;
}
.impersonation > span { flex: 1; min-width: 0; color: var(--text); }
.impersonation form { flex: none; }
a.user-chip { color: var(--text); border-radius: var(--radius-sm); }
a.user-chip:hover, a.user-chip[aria-current="page"] { background: var(--surface-2); text-decoration: none; }
a.stat { color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mb-2 { margin-bottom: 16px; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.action-list { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-tight { gap: 12px; }
.identity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.identity-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.identity-list .provider-mark { width: 28px; height: 28px; }
.steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.copy-line { margin-top: 4px; }
.copy-line code, .steps code {
  display: inline-block; max-width: 100%; padding: 3px 7px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px;
  overflow-wrap: anywhere; user-select: all;
}
@media (max-width: 960px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .impersonation { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .impersonation > span { flex-basis: 100%; }
  .impersonation > .icon { display: none; }
}

/* Daisy: logo, «купит — не купит» animation, loading indicator */
.daisy { display: block; overflow: visible; }
.daisy .petal { fill: #fff; stroke: var(--petal-stroke); stroke-width: 1.2; }
.brand-mark .daisy .petal { stroke: none; }
.daisy .daisy-core { fill: #f59e0b; }
.daisy .daisy-core-light { fill: #fcd34d; }
.daisy-stage { position: relative; width: 240px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.daisy-hero { width: 100%; height: auto; filter: drop-shadow(0 10px 18px var(--daisy-shadow)); }
.daisy-hero .petal {
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform .75s cubic-bezier(.3, .7, .3, 1), opacity .75s ease-in;
}
.daisy-hero g:nth-of-type(2n) .petal.plucked { transform: translateY(-34px) rotate(-38deg) scale(.8); }
.daisy-hero .petal.plucked { transform: translateY(-34px) rotate(38deg) scale(.8); opacity: 0; }
.daisy-hero .petal.last { fill: color-mix(in srgb, var(--success) 22%, #fff); stroke: var(--success); stroke-width: 1.6; animation: daisy-glow 1.2s ease-in-out infinite alternate; }
.daisy-say { min-height: 30px; font-size: 20px; font-weight: 700; color: var(--text-2); letter-spacing: -0.01em; }
.daisy-say.pop { animation: daisy-pop .35s ease-out; }
.daisy-say.won { color: var(--success); font-size: 24px; }
.daisy-spin { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.daisy-spin .petal { fill: currentColor; stroke: none; opacity: .2; animation: daisy-spin 1.3s linear infinite; }
.daisy-spin .daisy-core-light { display: none; }
.badge .daisy-spin { width: 13px; height: 13px; }
.empty .daisy-spin { width: 32px; height: 32px; color: var(--text-2); }
.daisy-spin g:nth-of-type(1) .petal { animation-delay: -1.2s; }
.daisy-spin g:nth-of-type(2) .petal { animation-delay: -1.1s; }
.daisy-spin g:nth-of-type(3) .petal { animation-delay: -1s; }
.daisy-spin g:nth-of-type(4) .petal { animation-delay: -.9s; }
.daisy-spin g:nth-of-type(5) .petal { animation-delay: -.8s; }
.daisy-spin g:nth-of-type(6) .petal { animation-delay: -.7s; }
.daisy-spin g:nth-of-type(7) .petal { animation-delay: -.6s; }
.daisy-spin g:nth-of-type(8) .petal { animation-delay: -.5s; }
.daisy-spin g:nth-of-type(9) .petal { animation-delay: -.4s; }
.daisy-spin g:nth-of-type(10) .petal { animation-delay: -.3s; }
.daisy-spin g:nth-of-type(11) .petal { animation-delay: -.2s; }
.daisy-spin g:nth-of-type(12) .petal { animation-delay: -.1s; }
.daisy-spin g:nth-of-type(13) .petal { animation-delay: 0s; }
@keyframes daisy-spin { 0% { opacity: 1; } 70%, 100% { opacity: .2; } }
@keyframes daisy-pop { from { transform: scale(.8); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes daisy-glow { from { filter: none; } to { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--success) 70%, transparent)); } }

/* Buttons waiting for the server */
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .icon { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Dashboard hero */
.hero { display: flex; align-items: center; gap: 28px; padding: 22px 28px; margin-bottom: 16px; }
.hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-text h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.035em; }
.hero-kicker { font-size: 13px; font-weight: 500; color: var(--text-3); }
.hero-status { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; color: var(--text-2); }
.hero-ready .hero-status { color: var(--success); font-weight: 560; }
.daisy-stage-sm { width: 150px; flex: none; }
.daisy-stage-sm .daisy-say { min-height: 26px; font-size: 16px; }
.daisy-stage-sm .daisy-say.won { font-size: 19px; }
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; gap: 12px; padding: 20px 16px; }
  .hero-status { justify-content: center; }
  .daisy-stage-sm { width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .daisy-hero .petal, .daisy-say.pop, .daisy-hero .petal.last { transition: none; animation: none; }
  .daisy-spin .petal { animation-duration: 3s; }
}

/* Responsive */
.show-sm { display: none; }
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / 35%); z-index: 10; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; align-items: stretch; }
  .table th, .table td { padding: 10px 14px; }
  .table-stack td { display: block; }
  .table-stack td:not(:last-child) { border-bottom: 0; padding-bottom: 2px; }
  .table-stack td.text-right { text-align: left; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
}

/* Navigation helpers (no inline styles: CSP style-src 'self') */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-button { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.nav-link[aria-disabled="true"] { cursor: default; opacity: .7; }
.nav-link[aria-disabled="true"]:hover { background: none; color: var(--text-2); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.w-full { width: 100%; }
.max-640 { max-width: 640px; }
.inline { display: inline; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Connections: status lists, radio cards, chips */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--text-3); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.radio-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 500; }
.radio-card:has(input:checked) { border-color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--text); }
.radio-card input { accent-color: var(--accent); }
.field-label { font-weight: 560; font-size: 14px; margin-bottom: 8px; }
.pipeline { padding: 14px 20px; border-top: 1px solid var(--border); }
.pipeline:first-child { border-top: 0; }
.pipeline-name { font-weight: 560; margin-bottom: 8px; }
.stage-success { background: var(--success-soft); color: var(--success); }
.stage-failure { background: var(--danger-soft); color: var(--danger); }
.alert-inline { margin: 0 20px 16px; }
details.more summary { cursor: pointer; color: var(--text); font-weight: 520; font-size: 14px; }
details.more[open] summary { margin-bottom: 12px; }
[data-provider-only][hidden] { display: none; }
@media (max-width: 640px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .kv dd { margin-bottom: 8px; } }

/* Knowledge base */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12.5px; color: var(--text-3); }
.file-input { padding: 6px; cursor: pointer; }
.file-input::file-selector-button { margin-right: 12px; height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 560; cursor: pointer; }
.source-title { font-weight: 560; overflow-wrap: anywhere; }
.source-off .source-title { color: var(--text-3); text-decoration: line-through; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pager { display: flex; justify-content: center; gap: 6px; padding: 14px; border-top: 1px solid var(--border); }
.chunk { padding: 14px 20px; border-top: 1px solid var(--border); }
.chunk:first-child { border-top: 0; }
.chunk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--text-3); font-size: 12.5px; }
.chunk-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--text-2); max-height: 15em; overflow: auto; }
.chunk:target { background: var(--signal-soft); }
.answer { line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.cite { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; margin: 0 1px; border-radius: 5px; background: var(--signal-soft); color: var(--text); font-size: 11.5px; font-weight: 600; vertical-align: 1px; text-decoration: none; }
.cite:hover { text-decoration: none; background: var(--accent); color: var(--accent-text); }
.search-row { display: flex; gap: 10px; }
.search-row .input { flex: 1; }
@media (max-width: 640px) { .search-row { flex-direction: column; } }

/* Site scan report */
.url-cell { min-width: 0; overflow-wrap: anywhere; }
.url-cell .mono { font-size: 12px; }

/* Open lines: dialogs */
.chat { display: flex; flex-direction: column; gap: 4px; max-height: 72vh; overflow-y: auto; padding: 4px 6px 10px; }
.bubble { max-width: min(640px, 85%); padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.bubble-customer { align-self: flex-start; }
.bubble-assistant, .bubble-manager { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.bubble-manager { background: var(--warning-soft); }
.bubble-system { align-self: center; background: transparent; border-style: dashed; font-size: 13px; color: var(--text-2); }
.bubble-deleted .bubble-text { text-decoration: line-through; color: var(--text-3); }
.chat-day { align-self: center; margin: 14px 0 8px; color: var(--text-3); font-size: 11.5px; font-weight: 550; }
.message { display: flex; align-items: flex-start; gap: 10px; margin: 5px 0; }
.message-avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 700;
}
.message-body { max-width: min(680px, 78%); min-width: 0; }
.message-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; }
.message-author { font-size: 13px; font-weight: 650; }
.message-role { color: var(--text-3); font-size: 11px; }
.message-time { margin-left: auto; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.message-text {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px;
  background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55;
}
.message-assistant .message-body, .message-manager .message-body { margin-left: auto; }
.message-assistant .message-head, .message-manager .message-head { flex-direction: row-reverse; }
.message-assistant .message-time, .message-manager .message-time { margin-left: 0; margin-right: auto; }
.message-assistant .message-text { background: var(--accent-soft); border-color: transparent; border-radius: 16px 4px 16px 16px; }
.message-manager .message-text { background: var(--warning-soft); border-color: transparent; border-radius: 16px 4px 16px 16px; }
.message-assistant .message-avatar { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.message-manager .message-avatar { background: var(--warning-soft); border-color: transparent; }
.message-system { display: block; max-width: 88%; margin: 10px auto; text-align: center; }
.message-system .message-head { justify-content: center; margin-bottom: 0; }
.message-system .message-author, .message-system .message-role { font-weight: 400; }
.message-system .message-time { margin-left: 0; }
.message-system .message-text { padding: 0; border: 0; background: transparent; color: var(--text-3); font-size: 12px; }
.message-meta { margin-top: 5px; color: var(--text-3); font-size: 11.5px; }
.message-meta summary { cursor: pointer; user-select: none; }
.message-meta > *:not(summary) { margin-top: 5px; }
.message-deleted .message-text { text-decoration: line-through; color: var(--text-3); }
@media (max-width: 640px) {
  .chat { max-height: 68vh; }
  .message { gap: 7px; }
  .message-avatar { width: 27px; height: 27px; font-size: 11px; }
  .message-body { max-width: 88%; }
  .message-head { gap: 2px 6px; }
  .message-role { display: none; }
  .message-time { font-size: 10px; }
  .message-text { padding: 9px 11px; font-size: 14px; }
}
.bubble-head { margin-bottom: 4px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.text-warning { color: var(--warning); }
.plain-list { margin: 0; padding-left: 18px; }
.steps-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.input-sm { width: auto; padding: 4px 8px; font-size: 13px; }
.actions-end { justify-content: flex-end; }
.table tr[aria-current="true"] td { background: var(--signal-soft); }
.input[type="color"] { width: 88px; height: 40px; padding: 4px; cursor: pointer; }

/* Results */
.funnel { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.funnel-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 96px; align-items: center; gap: 16px; }
.funnel-label { font-weight: 560; }
.progress.funnel-bar { height: 10px; }
.funnel-value { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .funnel-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; } .progress.funnel-bar { grid-column: 1 / -1; grid-row: 2; } }
.stage-track { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stage-track li { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 560; background: var(--surface-2); color: var(--text-3); }
.stage-track li.done { background: var(--success-soft); color: var(--success); }
.stage-track li[aria-current="step"] { background: var(--signal); color: var(--signal-text); }

/* Widget check: a mock page of the company's site with the real widget over it. */
.grid-test { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; margin-top: 16px; }
.demo-site { overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.demo-bar span { margin-left: 8px; padding: 2px 10px; border-radius: 99px; background: var(--surface); color: var(--text-3); }
.demo-page { padding: 20px 22px 40px; display: flex; flex-direction: column; gap: 22px; }
.demo-nav { display: flex; flex-wrap: wrap; gap: 18px; align-items: baseline; color: var(--text-3); }
.demo-nav strong { color: var(--text); margin-right: auto; font-size: 16px; }
.demo-hero { padding: 26px 22px; border-radius: var(--radius); background: var(--surface-2); }
.demo-hero h2 { margin: 0 0 8px; font-size: 22px; }
.demo-hero p { margin: 0; color: var(--text-2); }
.demo-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.demo-card { display: flex; flex-direction: column; gap: 4px; }
.demo-img { aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 6px; }
.demo-text { min-height: 60vh; color: var(--text-2); }
.test-dialogs { list-style: none; margin: 0; padding: 0; }
.test-dialogs li { display: flex; flex-direction: column; gap: 2px; padding: 10px 20px; border-top: 1px solid var(--border); }
.test-dialogs li:first-child { border-top: 0; }
@media (max-width: 960px) { .grid-test { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .demo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Bot check on the open lines page. */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li > svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.check-list li.done > svg { color: var(--success); }
.check-list li.todo > svg { color: var(--warning); }
.check-list li.todo { color: var(--text); }
.check-list li.done { color: var(--text-2); }

/* Client simulator: a messenger chat where the admin writes as a customer. */
.sim-kinds { margin-bottom: 4px; }
.sim {
  --sim-bg: #f1f3f5; --sim-head: var(--surface); --sim-head-text: var(--text); --sim-in: #ffffff; --sim-out: #dcf1ff;
  --sim-text: #1f2328; --sim-accent: #2f6fde;
  display: flex; flex-direction: column; height: min(640px, 75vh); min-height: 420px; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--sim-bg); box-shadow: var(--shadow-sm);
}
.sim-avito { --sim-bg: #f2f1f0; --sim-out: #d9f2ff; --sim-accent: #00aaff; }
.sim-telegram { --sim-bg: #e6ebee; --sim-head: #517da2; --sim-head-text: #fff; --sim-out: #effdde; --sim-accent: #3390ec; }
.sim-vk { --sim-bg: #edeef0; --sim-out: #cce4ff; --sim-accent: #0077ff; }
.sim-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--sim-head); color: var(--sim-head-text); border-bottom: 1px solid var(--border); }
.sim-telegram .sim-head { border-bottom-color: transparent; }
.sim-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sim-accent); color: #fff; font-weight: 650; text-transform: uppercase; }
.sim-name { font-weight: 620; line-height: 1.2; }
.sim-sub { font-size: 12.5px; opacity: .75; }
.sim-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.sim-empty { margin: auto; max-width: 320px; text-align: center; color: #6b7280; font-size: 13.5px; }
.sim-msg { max-width: 78%; padding: 7px 11px 5px; border-radius: 14px; background: var(--sim-in); color: var(--sim-text); box-shadow: 0 1px 1px rgb(0 0 0 / .06); white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-msg.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.sim-msg.out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--sim-out); }
.sim-msg .who { display: block; font-size: 12px; font-weight: 620; color: var(--sim-accent); }
.sim-msg time { display: block; text-align: right; font-size: 11px; color: #8a9099; margin-top: 2px; }
.sim-typing { display: flex; gap: 4px; align-self: flex-start; margin: 0 14px 8px; padding: 10px 12px; border-radius: 14px; background: var(--sim-in); }
.sim-typing[hidden], .sim-note[hidden], .sim-error[hidden] { display: none; }
.sim-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa1a9; animation: sim-dot 1.2s infinite ease-in-out; }
.sim-typing span:nth-child(2) { animation-delay: .15s; }
.sim-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sim-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.sim-note, .sim-error { margin: 0 14px 8px; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; }
.sim-note { background: #fff7e0; color: #7a5200; }
.sim-error { background: #fdecec; color: #b42318; }
.sim-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #e3e5e8; }
.sim-compose textarea { flex: 1; resize: none; max-height: 120px; padding: 8px 12px; border: 1px solid #d5d8dc; border-radius: 18px; background: #fff; color: #1f2328; font: inherit; line-height: 1.4; }
.sim-compose textarea:focus { outline: 2px solid color-mix(in srgb, var(--sim-accent) 50%, transparent); outline-offset: 0; }
.sim-compose button { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--sim-accent); color: #fff; cursor: pointer; }
.sim-compose button:disabled { opacity: .5; cursor: default; }
@media (max-width: 560px) { .sim { height: 70vh; min-height: 360px; } .sim-msg { max-width: 88%; } }

/* A window over the page (the portal's goods to choose from) */
dialog.modal {
  width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 920px); padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text); box-shadow: 0 24px 60px rgb(15 23 42 / 28%);
}
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgb(15 23 42 / 45%); }
.modal-box { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head p { margin-top: 4px; color: var(--text-2); }
.modal-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px 36px; text-align: center; }
.modal-loading .daisy-stage { margin-bottom: 4px; }
.modal-list { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.modal-tools .input { flex: 1; min-width: 180px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal [hidden] { display: none !important; }
.pick-list { list-style: none; margin: 0; padding: 6px 12px 10px; overflow-y: auto; flex: 1; min-height: 120px; }
.pick-section { padding: 12px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.pick-item label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.pick-item label:hover { background: var(--surface-2); }
.pick-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.pick-name { overflow-wrap: anywhere; }
.pick-price { white-space: nowrap; color: var(--text-2); font-size: 14px; }
.pick-meta { grid-column: 2 / 4; font-size: 12.5px; color: var(--text-3); }
.pick-item input:checked ~ .pick-name { font-weight: 560; }
@media (max-width: 640px) {
  .modal-head, .modal-tools, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .pick-item label { grid-template-columns: auto minmax(0, 1fr); }
  .pick-price { grid-column: 2; }
  .pick-meta { grid-column: 2; }
  .modal-tools .input { flex-basis: 100%; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot [data-pick-count] { flex-basis: 100%; }
  .modal-foot .btn-primary { flex: 1; }
}
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 56px; z-index: 4; }
.bulk-bar [hidden] { display: none !important; }
.table .col-check { width: 1%; padding-right: 0; }
.col-check input { display: block; width: 16px; height: 16px; accent-color: var(--accent); }
.table tr:has(input[data-bulk-item]:checked) td { background: var(--signal-soft); }
@media (max-width: 640px) {
  .bulk-bar { padding-left: 16px; padding-right: 16px; }
  .bulk-bar [data-bulk-count] { flex: 1 1 0; min-width: 0; }
  .bulk-bar [data-action="bulk-everything"] { order: 3; padding-left: 0; }
}

/* Launch route: the dashboard list and the line on every page */
.route-steps { list-style: none; margin: 0; padding: 0; }
.step.current { background: color-mix(in srgb, var(--signal-soft) 55%, var(--surface)); box-shadow: inset 3px 0 0 var(--signal); }
.step.current .step-dot { background: var(--signal); border-color: var(--signal); color: var(--signal-text); }
.step.skipped .step-title, .step.skipped .step-dot { opacity: .6; }
.step-todo { margin-top: 6px; color: var(--text-2); }
.step-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.step.current { flex-wrap: wrap; align-items: flex-start; }
.step.current .step-dot { margin-top: 1px; }
.step.current .step-text { flex-basis: calc(100% - 40px); }
.step.current .step-actions { width: 100%; justify-content: flex-start; padding-left: 40px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.line-item { padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.line-item:last-child { border-bottom: 0; }
.stack-tight { gap: 8px; }
.link-button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 520; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link-button:hover { text-decoration-color: currentColor; }
.hero-actions { margin-top: 8px; }
.route-line {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 18px;
  margin-bottom: 20px; padding: 14px 16px 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
}
.route-line.is-here { border-color: color-mix(in srgb, var(--signal) 45%, var(--border)); background: color-mix(in srgb, var(--signal-soft) 50%, var(--surface)); }
.route-dots { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.route-dots li { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.route-dots li.done { background: var(--success); }
.route-dots li.skipped { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.route-dots li.current { background: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 30%, transparent); }
.route-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.route-kicker .icon { width: 14px; height: 14px; color: var(--success); }
.route-line.is-here .route-kicker { color: color-mix(in srgb, var(--warning) 80%, var(--text)); }
.route-title { margin-top: 2px; font-weight: 650; }
.route-todo { margin-top: 2px; color: var(--text-2); font-size: 13.5px; }
.route-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
@media (max-width: 640px) {
  .route-line { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .route-dots { flex-direction: row; }
  .route-actions { justify-content: flex-start; }
  .step { flex-wrap: wrap; }
  .step-actions { width: 100%; justify-content: flex-start; padding-left: 40px; }
}
