
:root {
  --gold: #F2B705; --gold-strong: #D9A300; --gold-soft: #FFF4CC;
  --red: #D62828; --red-soft: #FDE8E8;
  --green: #1E8E4E; --green-soft: #E3F5EA;
  --blue: #2563EB; --blue-soft: #E6EEFD;
  --purple: #7C3AED; --gray: #8A8F98;
  --bg: #F6F5F1; --surface: #FFFFFF; --surface-2: #FAF9F6; --line: #E7E4DC;
  --text: #17171A; --muted: #6B6F76; --ink: #111111;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --radius: 12px; --radius-sm: 8px;
  --nav-w: 232px; --bottom-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold-soft: #3A3010; --red-soft: #3D1616; --green-soft: #12301F; --blue-soft: #15223F;
    --bg: #0E0E10; --surface: #17171B; --surface-2: #1D1D22; --line: #2A2A31;
    --text: #EDEDEF; --muted: #9A9CA4; --ink: #000;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --gold-soft: #3A3010; --red-soft: #3D1616; --green-soft: #12301F; --blue-soft: #15223F;
  --bg: #0E0E10; --surface: #17171B; --surface-2: #1D1D22; --line: #2A2A31;
  --text: #EDEDEF; --muted: #9A9CA4; --ink: #000;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 2px; }
a:hover { color: var(--gold-strong); }
code { font: 13px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 15px; }
p { margin: 0 0 8px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-red { color: var(--red); } .text-green { color: var(--green); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.stack-v { display: flex; flex-direction: column; gap: 14px; }
.pad { padding: 4px 12px 10px; display: block; }


.shell { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { padding: 14px 16px calc(var(--bottom-h) + 24px + env(safe-area-inset-bottom)); max-width: 1280px; width: 100%; margin: 0 auto; outline: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
  border-bottom: 2px solid var(--gold);
}
.topbar .icon-btn { color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: block; height: 36px; width: auto; flex-shrink: 0; filter: drop-shadow(0 1px 6px rgba(242,183,5,.18)); }
.sidebar .brand-logo { height: 58px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 16px; letter-spacing: .3px; } .brand-text small { color: var(--gold); font-size: 11px; letter-spacing: 2px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 40; background: var(--ink); color: #ddd;
  display: flex; flex-direction: column; padding: 16px 12px; transform: translateX(-100%); transition: transform .2s ease;
  overflow-y: auto;
}
.sidebar .brand { color: #fff; padding: 0 6px 16px; border-bottom: 1px solid #262626; margin-bottom: 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; gap: 10px; align-items: center; padding: 10px 10px; border-radius: 8px; text-decoration: none; color: #cfcfcf; }
.nav-link:hover { background: #1c1c1c; color: #fff; }
.nav-link.active { background: var(--gold); color: #111; font-weight: 600; }
.nav-ico { width: 20px; text-align: center; font-size: 16px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #262626; display: flex; flex-direction: column; gap: 10px; }
.side-foot .btn-ghost { color: #ddd; border-color: #333; }
.me { display: flex; flex-direction: column; color: #fff; padding: 0 6px; } .me small { color: #999; }
.backdrop { display: none; }
body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.5); }
body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bn-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; text-decoration: none; color: var(--muted); background: none; border: 0; cursor: pointer; }
.bn-link .nav-ico { font-size: 18px; }
.bn-link.active { color: var(--text); font-weight: 600; box-shadow: inset 0 3px 0 var(--gold); }

@media (min-width: 960px) {
  .sidebar { transform: none; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
  .topbar, .bottom-nav, .backdrop { display: none !important; }
  .main { padding: 22px 28px 40px; }
}


.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { margin-bottom: 8px; font-size: 14px; } .crumbs a { text-decoration: none; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar > .input[type="search"] { flex: 1 1 220px; }
.toolbar > * { min-width: 0; max-width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card > .card-head h2 { font-size: 15px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }


.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme="dark"] .btn-primary { background: var(--gold); color: #111; border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--gold); color: #111; border-color: var(--gold); } }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: #111; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 600; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }
.btn-danger-ghost { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn-ghost { background: transparent; }
.icon-btn { min-width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-size: 18px; display: inline-grid; place-items: center; text-decoration: none; color: inherit; }
.icon-btn:hover { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.icon-btn.danger { color: var(--red); }

.input {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; 
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
textarea.input { resize: vertical; min-height: 64px; }
.input-sm { width: auto; min-height: 38px; }
.input.num { text-align: right; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid:not(.one) { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-error { color: var(--red); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }


.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme="dark"] .chip.on { background: var(--gold); color: #111; border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--gold); color: #111; border-color: var(--gold); } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge.xs { font-size: 10px; padding: 0 6px; }
.b-ok { background: var(--green-soft); color: var(--green); }
.b-bad { background: var(--red-soft); color: var(--red); }
.b-warn { background: var(--gold-soft); color: #8A6400; }
.b-info { background: var(--blue-soft); color: var(--blue); }
.b-gold { background: var(--gold); color: #111; }
.b-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
:root[data-theme="dark"] .b-warn { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-warn { color: var(--gold); } :root:not([data-theme="light"]) .b-info { color: #8DB0FF; } }
:root[data-theme="dark"] .b-info { color: #8DB0FF; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { text-decoration: none; }
.count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 6px; }


.state { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 36px 16px; color: var(--muted); text-align: center; }
.state.boot { min-height: 60vh; }
.state-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.state.error { color: var(--red); } .state.error .state-icon { background: var(--red-soft); border-color: transparent; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.notice.warn { background: var(--gold-soft); color: inherit; border-left: 3px solid var(--gold); }
.notice.ok { background: var(--green-soft); border-left: 3px solid var(--green); }


.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.kpi-gold::before { background: var(--gold); } .kpi-red::before { background: var(--red); }
.kpi-title { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.kpi-value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.kpi-value.sm { font-size: 17px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; }
.mini small { color: var(--muted); font-size: 12px; } .mini b { font-size: 16px; font-variant-numeric: tabular-nums; }


.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; } .hbar-val small { color: var(--muted); font-weight: 400; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.hbar-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.f-gold { background: var(--gold); } .f-red { background: var(--red); } .f-green { background: var(--green); }
.f-blue { background: var(--blue); } .f-gray { background: var(--gray); } .f-purple { background: var(--purple); }
.stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; }
.stack-seg { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cols-wrap { overflow-x: auto; }
.cols { width: 100%; min-width: 280px; height: 170px; display: block; }
.cols .axis { stroke: var(--line); }
.cols .col { fill: var(--gold); } .cols .col:hover { fill: var(--gold-strong); }
.cols .col-label { fill: var(--muted); font-size: 10px; }


.chart-tip { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; max-width: min(280px, calc(100vw - 16px));
  background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.chart-tip[hidden] { display: none; }
:root[data-theme="dark"] .chart-tip { background: #2A2A31; border: 1px solid #3A3A42; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-tip { background: #2A2A31; border: 1px solid #3A3A42; } }
.tip-title { font-weight: 700; margin-bottom: 3px; color: var(--gold); }
.tip-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip-row span { opacity: .78; }
.tip-row b.tone-good { color: #5BD68E; } .tip-row b.tone-bad { color: #FF7A7A; }
.tip-foot { margin-top: 4px; opacity: .65; font-size: 11.5px; }

.vcols { position: relative; user-select: none; -webkit-user-select: none; }
.vcols-plot { position: relative; margin: 14px 0 0; border-bottom: 1px solid var(--line); touch-action: pan-y; outline: none; border-radius: 4px; }
.vcols-plot:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); }
.vcols-plot.is-clickable { cursor: pointer; }
.vcols-grid { position: absolute; inset: 0; pointer-events: none; }
.vgrid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.vgrid span { position: absolute; left: 0; top: -15px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vavg { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--blue) 55%, transparent); pointer-events: none; z-index: 1; }
.vavg span { position: absolute; right: 0; top: -15px; font-size: 10.5px; color: var(--blue); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 0 3px; border-radius: 3px; }
.vcols-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.vcol { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vcol-bar { width: 76%; max-width: 38px; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 0; transition: background .12s, opacity .12s; }
.vcol-bar.is-zero { min-height: 1px; background: var(--line); }
.vcols-plot.has-hot .vcol:not(.is-hot):not(.is-sel) .vcol-bar { opacity: .45; }
.vcol.is-hot .vcol-bar { background: var(--gold-strong); }
.vcol.is-sel .vcol-bar { background: var(--red); opacity: 1; }
.vcols-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid color-mix(in srgb, var(--text) 35%, transparent); pointer-events: none; z-index: 2; }
.vcols-cross[hidden] { display: none; }
.vcols-x { display: flex; height: 18px; overflow: hidden; }
.vx { flex: 1 1 0; min-width: 0; position: relative; }
.vx span { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.vx span.first { left: 0; transform: none; } .vx span.last { left: auto; right: 0; transform: none; }

.hbars.is-interactive .hbar { cursor: pointer; border-radius: 8px; margin: -4px -6px; padding: 4px 6px; }
.hbar { outline: none; }
.hbars.is-interactive .hbar:hover, .hbar:focus-visible { background: var(--surface-2); }
.hbar.is-sel { background: color-mix(in srgb, var(--gold) 14%, transparent) !important; box-shadow: inset 3px 0 0 var(--gold); }
.stack-seg { cursor: default; outline: none; transition: opacity .12s; }
.stack:hover .stack-seg:not(:hover) { opacity: .6; }
.stack.is-clickable .stack-seg { cursor: pointer; }

.drill { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; animation: drillIn .16s ease-out; min-width: 0; }
@keyframes drillIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.drill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.drill-head h3 { font-size: 14px; }
.drill-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-bottom: 8px; }
.drill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.drill-list li { border-top: 1px solid var(--line); }
.drill-list li:first-child { border-top: 0; }
.drill-item { display: flex; align-items: center; gap: 8px; padding: 8px 2px; text-decoration: none; min-width: 0; }
a.drill-item:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); color: inherit; }
.drill-item .di-main { flex: 1; min-width: 0; }
.drill-item .di-main b, .drill-item .di-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-item .di-main small { color: var(--muted); font-size: 12px; }
.drill-item .di-amt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.drill-item .di-amt small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.drill-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }


.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 999px; white-space: nowrap; cursor: help; font-variant-numeric: tabular-nums; outline: none; }
.d-good { background: var(--green-soft); color: var(--green); }
.d-bad { background: var(--red-soft); color: var(--red); }
.d-flat { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.kpi-delta { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.kpi-green::before { background: var(--green); } .kpi-blue::before { background: var(--blue); }


.health-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.health-ring { --p: 0; --c: var(--gold); width: 84px; height: 84px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.health-ring > div { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.health-ring b { font-size: 24px; font-variant-numeric: tabular-nums; } .health-ring small { font-size: 11px; color: var(--muted); }
.tier-0 { --c: var(--red); } .tier-1 { --c: var(--gold); } .tier-2 { --c: var(--green); } .tier-3 { --c: var(--green); }
.pillars { display: flex; flex-direction: column; }
.pillar { border-top: 1px solid var(--line); }
.pillar-btn { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; text-align: left; background: none; border: 0; padding: 10px 2px; color: inherit; font: inherit; cursor: pointer; }
.pillar-btn:hover { background: var(--surface-2); }
.pillar-name { font-weight: 650; font-size: 14px; min-width: 0; }
.pillar-name small { font-weight: 400; color: var(--muted); }
.pillar-pts { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pillar-meter { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.pillar-meter i { display: block; height: 100%; border-radius: 4px; }
.pillar-concl { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.pillar-detail { padding: 0 2px 10px; font-size: 13px; }
.th-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.th-table td { padding: 4px 6px; border-top: 1px solid var(--line); }
.th-table tr.on td { background: color-mix(in srgb, var(--gold) 16%, transparent); font-weight: 650; }
.th-table td:last-child { text-align: right; white-space: nowrap; }


.plan-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; margin: 2px 0 6px; display: flex; align-items: center; gap: 6px; }
.plan-col h3 .dot { width: 8px; height: 8px; }
.plan-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface); min-width: 0; }
.plan-item.is-zero { opacity: .62; }
.plan-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.plan-btn:disabled { cursor: default; }
.plan-count { min-width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; padding: 0 6px; }
.plan-main { flex: 1; min-width: 0; }
.plan-main b { display: block; font-size: 14px; }
.plan-main small { display: block; color: var(--muted); font-size: 12px; }
.plan-chev { color: var(--muted); transition: transform .15s; flex: none; }
.plan-item.open .plan-chev { transform: rotate(90deg); }
.plan-body { padding: 0 10px 10px; }
.c-bad { background: var(--red-soft); color: var(--red); } .c-warn { background: var(--gold-soft); color: var(--gold-strong); }
.c-info { background: var(--blue-soft); color: var(--blue); } .c-ok { background: var(--green-soft); color: var(--green); }
.c-zero { background: var(--surface-2); color: var(--muted); }


.radar-list { list-style: none; margin: 0; padding: 0; }
.radar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.radar-row:first-child { border-top: 0; }
.radar-name { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.radar-action { grid-column: 1 / -1; font-size: 13px; }
.radar-action::before { content: "→ "; color: var(--gold-strong); font-weight: 700; }
.radar-right { text-align: right; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-call { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }


.table-wrap { overflow-x: auto; margin: -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.row-low td, .table tr.row-bad td { background: color-mix(in srgb, var(--red) 7%, transparent); }
.table tr.row-warn td { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.table th.num { text-align: right; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 8px 4px; padding: 6px 10px; width: auto; background: var(--surface); }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table td[data-label=""]::before { display: none; }
  .table td > div { text-align: right; }
  .table td:first-child { text-align: left; } .table td:first-child > div { text-align: left; }
  .table td:first-child::before { display: none; }
  .table .hide-sm { display: none; }
  .table tr.row-low, .table tr.row-bad { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
}
.stock.low { color: var(--red); font-weight: 700; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }


.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }



.overlay { position: fixed; inset: 0; z-index: 160;  background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; overscroll-behavior: contain; }
.modal { background: var(--surface); width: 100%; max-height: 92vh; max-height: calc(100% - 8px - env(safe-area-inset-top)); min-height: 0; overflow: hidden; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,.3); animation: up .18s ease; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 20px; } .modal { max-width: 480px; max-height: 100%; border-radius: 16px; } .modal-wide { max-width: 760px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.modal-head { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; background: var(--surface); }
.modal-head h3 { min-width: 0; overflow-wrap: anywhere; }
.modal-head .icon-btn { flex: none; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.modal-foot .foot-start { margin-right: auto; }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); border-left: 4px solid var(--green); transition: opacity .4s, transform .4s; font-size: 14px; }
.toast.t-bad { border-left-color: var(--red); } .toast.t-warn { border-left-color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(8px); }




.conv-layout { display: grid; gap: 14px; grid-template-columns: 1fr; }
.conv-layout .thread { display: none; }
.conv-layout.has-thread .conv-side { display: none; }
.conv-layout.has-thread .thread { display: block; }
@media (min-width: 960px) {
  .conv-layout { grid-template-columns: 340px 1fr; height: calc(100vh - 120px); }
  .conv-layout .conv-side, .conv-layout.has-thread .conv-side { display: flex; }
  .conv-layout .thread { display: block; min-height: 0; }
  .thread .back { display: none; }
}
.conv-side { flex-direction: column; padding: 0; overflow: hidden; display: flex; min-height: 0; }
.conv-tools { padding: 12px 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.conv-list { overflow-y: auto; flex: 1; }
.conv-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.conv-item:hover { background: var(--surface-2); color: inherit; }
.conv-item.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.conv-item.unread b { font-weight: 800; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 6px; justify-content: space-between; min-width: 0; }
.conv-bottom .ellipsis { flex: 1; font-size: 13px; }
.thread-card { display: flex; flex-direction: column; padding: 0; height: calc(100vh - 150px - var(--bottom-h)); min-height: 420px; overflow: hidden; }

@supports (height: 100dvh) { .thread-card { height: calc(100dvh - 150px - var(--bottom-h)); } }
@media (min-width: 960px) { .thread-card { height: 100%; } }
.thread-empty { justify-content: center; }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-head .notice { flex-basis: 100%; }
.thread-title { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg-in { align-self: flex-start; } .msg-out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-in .bubble { border-bottom-left-radius: 4px; }
.msg-out .bubble { background: var(--ink); color: #fff; border-color: var(--ink); border-bottom-right-radius: 4px; }
.msg-ai .bubble { background: var(--gold-soft); color: var(--text); border-color: var(--gold); }
.msg-system .bubble { background: transparent; color: var(--muted); font-style: italic; }
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 4px; align-items: center; }
.msg-img { max-width: 220px; max-height: 260px; border-radius: 10px; display: block; margin-top: 4px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; }
.runs { display: flex; flex-direction: column; gap: 8px; }
.thread .runs { max-height: 40%; overflow-y: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.run { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.run-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.run-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.run-reply { white-space: pre-wrap; font-size: 14px; background: var(--surface-2); padding: 8px; border-radius: 6px; overflow-wrap: anywhere; }
.run-warn { color: #8A6400; font-size: 13px; } .run-err { color: var(--red); font-size: 13px; overflow-wrap: anywhere; }


.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-ico { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; }
.tl-order .tl-ico { background: var(--gold-soft); border-color: var(--gold); }
.timeline.compact .tl-ico { width: 16px; height: 16px; font-size: 10px; border: 0; background: none; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-text { white-space: pre-wrap; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 10px; }


.order-form { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .order-form { grid-template-columns: 1fr 360px; align-items: start; } .order-form-side { position: sticky; top: 20px; } }
.order-form-main, .order-form-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.picked { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; background: var(--gold-soft); border: 1px solid var(--gold); padding: 10px 12px; border-radius: var(--radius-sm); }
.pick-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pick-item { text-align: left; border: 1px solid var(--line); background: var(--surface); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.pick-item:hover { border-color: var(--gold); }
.prod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prod-tile { position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prod-tile:hover { border-color: var(--gold); }
.prod-tile.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft); }
.prod-tile.oos { opacity: .7; }
.prod-tile b { font-size: 14px; line-height: 1.3; padding-right: 26px; }
.prod-tile small { font-size: 12px; color: var(--muted); }
.prod-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-qty { position: absolute; top: 6px; right: 6px; background: var(--ink); color: var(--gold); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.lines { display: flex; flex-direction: column; margin-top: 12px; }
.line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.lines.readonly .line:first-child { border-top: 0; }
.line-name { flex: 1 1 160px; min-width: 0; }
.line-ctl { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.line-ctl .qty { width: 64px; text-align: center; }
.line-ctl .input.num { width: 120px; }
.line-ctl > b { min-width: 96px; }

@media (max-width: 480px) {
  .lines:not(.readonly) .line-ctl { display: grid; grid-template-columns: auto 64px auto 1fr auto; gap: 6px 4px; width: 100%; align-items: center; }
  .lines:not(.readonly) .line-ctl > :nth-child(4) { grid-row: 2; grid-column: 1 / 4; width: 100%; }
  .lines:not(.readonly) .line-ctl > :nth-child(5) { grid-row: 2; grid-column: 4 / 6; text-align: right; min-width: 0; }
  .lines:not(.readonly) .line-ctl > :nth-child(6) { grid-row: 1; grid-column: 5; justify-self: end; }
}
.totals { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--line); }
.tot-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: 14px; }
.tot-row.grand { font-size: 18px; font-weight: 800; padding-top: 6px; border-top: 1px dashed var(--line); }
.tot-row.muted { color: var(--muted); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 719px) {
  .action-bar { position: sticky; bottom: calc(var(--bottom-h) + 8px + env(safe-area-inset-bottom)); z-index: 10; box-shadow: var(--shadow); }
  .action-bar .btn { flex: 1 1 140px; }
}
.big-code { font-size: 15px; font-weight: 700; letter-spacing: .5px; }


.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-left: 4px solid var(--gray); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.task-bad { border-left-color: var(--red); } .task-warn { border-left-color: var(--gold); } .task-ok { border-left-color: var(--green); opacity: .8; }
.task-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-title { overflow-wrap: anywhere; }


.report-text { white-space: pre-wrap; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 0; overflow-wrap: anywhere; max-height: 70vh; overflow-y: auto; }


.slip { background: #fff; color: #111; max-width: 760px; margin: 0 auto; padding: 24px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.slip-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 3px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.slip-brand { font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.slip-head small { color: #555; }
.slip-code { text-align: right; display: flex; flex-direction: column; }
.slip-code b { font-size: 20px; }
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.slip-grid h4 { font-size: 12px; text-transform: uppercase; color: #555; margin-bottom: 4px; letter-spacing: .5px; }
.slip-grid p { margin: 0 0 2px; }
.slip-cod { font-size: 18px; }
.slip-table { width: 100%; border-collapse: collapse; }
.slip-table th, .slip-table td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
.slip-table th { background: #f1f1f1; font-size: 12px; text-transform: uppercase; }
.slip-table .num { text-align: right; }
.slip-table tfoot td { font-weight: 600; }
.slip-table tr.grand td { font-size: 16px; font-weight: 800; }
.slip-note { margin-top: 10px; padding: 8px; border: 1px dashed #999; }
.slip-foot { margin-top: 16px; font-size: 13px; }
.slip-foot .muted { color: #666; }
.slip-sign { display: flex; justify-content: space-around; margin-top: 24px; padding-bottom: 50px; font-weight: 600; }
@media (max-width: 560px) { .slip { padding: 14px; } .slip-grid { grid-template-columns: 1fr; } }
@media print {
  @page { size: A5; margin: 8mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .bottom-nav, .backdrop, .no-print, .toasts { display: none !important; }
  .main { padding: 0 !important; max-width: none; }
  .slip { border: 0; padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


.google-login:empty { display: none; }
.google-login { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gsi-btn { min-height: 44px; display: flex; justify-content: center; width: 100%; }
.login-sep { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--muted); font-size: 12px; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.staff-inactive { opacity: .55; }


.fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); z-index: 32;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: #111; border: 1px solid var(--gold-strong); font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.fab:hover { background: var(--gold-strong); }
.fab-ico { font-size: 16px; line-height: 1; }
@media (max-width: 639px) { .fab { padding: 12px; } .fab-text { display: none; } }
@media (min-width: 960px) { .fab { bottom: 20px; right: 24px; } }
body.print-mode .fab, body.nav-open .fab { display: none; }

@media (max-width: 959px) {
  body:has(.thread-card .composer) .fab { bottom: calc(var(--bottom-h) + 96px + env(safe-area-inset-bottom)); padding: 9px; opacity: .9; }
  body:has(.action-bar) .fab, body:has(.sticky-actions) .fab { bottom: calc(var(--bottom-h) + 88px + env(safe-area-inset-bottom)); }
}
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bn-link { position: relative; }
.nav-dot { position: absolute; top: 8px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.app-version { color: #777; font-size: 11px; padding: 0 6px; }
.fb-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-thumb { position: relative; width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-thumb-x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 12px; line-height: 24px; padding: 0; }
.fb-ctx summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.fb-ctx ul { margin: 6px 0; padding-left: 18px; }
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--gray); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; color: inherit; }
.fb-item:hover { border-color: var(--gold); color: inherit; }
.fb-new { border-left-color: var(--gold); } .fb-reviewing { border-left-color: var(--blue); } .fb-fixed { border-left-color: var(--green); }
.fb-need_info { border-left-color: var(--red); } .fb-wontfix { opacity: .75; }
.fb-note { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-note.full { display: block; -webkit-line-clamp: unset; overflow: visible; margin-bottom: 12px; }
.fb-reply { background: var(--green-soft); border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fb-shot { width: 140px; height: 140px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: grid; place-items: center; }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-full { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.fb-log { margin: 6px 0; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.fb-log li { margin-bottom: 4px; }

.main { padding-bottom: calc(var(--bottom-h) + 84px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .main { padding-bottom: 84px; } }
@media print { .fab { display: none !important; } }


:root {
  --paper-glow: radial-gradient(900px 520px at 100% -10%, rgba(242,183,5,.10), transparent 60%),
                radial-gradient(700px 480px at -10% 110%, rgba(214,40,40,.05), transparent 60%);
  --pattern-opacity: .07;
  --grain-opacity: .35;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper-glow: radial-gradient(900px 560px at 100% -10%, rgba(242,183,5,.09), transparent 60%),
                  radial-gradient(700px 480px at -10% 110%, rgba(214,40,40,.07), transparent 60%);
    --pattern-opacity: .05; --grain-opacity: .5;
  }
}
:root[data-theme="dark"] {
  --paper-glow: radial-gradient(900px 560px at 100% -10%, rgba(242,183,5,.09), transparent 60%),
                radial-gradient(700px 480px at -10% 110%, rgba(214,40,40,.07), transparent 60%);
  --pattern-opacity: .05; --grain-opacity: .5;
}

:root { --bg: #F5F2EA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0D0D0F; } }
:root[data-theme="dark"] { --bg: #0D0D0F; }

.content { position: relative; isolation: isolate; }
.content::before, .content::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.content::before { background: var(--paper-glow); }
.content::after {
  background-image: url("../brand/bg-pattern.svg");
  background-size: 360px 360px; opacity: var(--pattern-opacity);
}
.main { position: relative; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .42  0 0 0 0 .3  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body { position: relative; isolation: isolate; }


.sidebar {
  background:
    radial-gradient(260px 200px at 30% 0%, rgba(242,183,5,.14), transparent 70%),
    linear-gradient(180deg, #121212, #0b0b0b);
  border-right: 1px solid #1f1f1f;
}
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 6px 14px; border-bottom: 1px solid rgba(242,183,5,.18); }
.sidebar .brand .brand-text { flex-direction: row; align-items: baseline; gap: 6px; }
.sidebar .brand-text b { font-size: 17px; }
.topbar { background: linear-gradient(90deg, #0d0d0d, #1a1a1a); }
.topbar .brand-logo { height: 32px; }
.topbar .brand-text { flex-direction: row; align-items: baseline; gap: 6px; }


.login-wrap {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  color: #EDEDEF;
  background:
    radial-gradient(620px 420px at 12% 8%, rgba(242,183,5,.20), transparent 62%),
    radial-gradient(700px 520px at 92% 96%, rgba(214,40,40,.18), transparent 62%),
    radial-gradient(500px 300px at 50% 45%, rgba(242,183,5,.06), transparent 70%),
    linear-gradient(160deg, #0f0f0f 0%, #151515 50%, #1a1a1a 100%);
}
.login-wrap::before {
  content: ""; position: absolute; inset: -40px; z-index: -1; pointer-events: none;
  background-image: url("../brand/bg-pattern.svg"); background-size: 360px 360px; opacity: .13;
  transform: rotate(-6deg);
}
.login-wrap::after { 
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 1px, transparent 1px 9px);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}
.login-card {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 1px solid rgba(242,183,5,.22);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset;
  color: var(--text);
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 26px 22px 20px; color: #fff;
  background:
    radial-gradient(320px 160px at 50% 30%, rgba(242,183,5,.22), transparent 70%),
    linear-gradient(180deg, rgba(10,10,10,.92), rgba(22,22,22,.92));
  border-bottom: 2px solid var(--gold);
}
.login-logo { width: 200px; max-width: 70%; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.wordmark { margin: 8px 0 0; font-size: 26px; font-weight: 900; letter-spacing: 3px; line-height: 1.1; }
.wordmark span { color: var(--gold); } .wordmark b { color: #fff; font-weight: 900; }
.login-tagline { margin: 2px 0 0; font-size: 13px; color: #B9B9BE; }
.login-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 18px; }
.login-body > .btn-ghost { align-self: center; }
.login-foot { margin: 0; font-size: 12px; color: rgba(255,255,255,.45); text-align: center; }
@media (max-width: 420px) {
  .login-brand { padding: 22px 16px 16px; }
  .login-logo { width: 170px; }
  .wordmark { font-size: 22px; }
  .login-body { padding: 18px 18px 14px; }
}


.slip-id { display: flex; align-items: center; gap: 12px; }
.slip-logo { width: 92px; height: auto; display: block; }
@media print {
  body::before, .content::before, .content::after { display: none !important; }
  .slip-logo { width: 80px; }
}
body.print-mode .content::after { opacity: 0; }


.int-card { display: flex; flex-direction: column; gap: 12px; }
.int-card > .card-head { margin-bottom: 0; align-items: flex-start; }
.int-field { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.int-field-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.int-current { font-size: 13px; overflow-wrap: anywhere; }
.int-input-row { display: flex; gap: 6px; align-items: center; }
.int-input-row .input { flex: 1 1 auto; min-width: 0; font-size: 16px; } 
.int-input-row .btn { flex: 0 0 auto; min-height: 40px; }
.int-help summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 600; }
.int-help ol { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.int-webhook { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.int-result-box { padding: 8px 10px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.int-result-box.ok { background: var(--green-soft); color: var(--green); }
.int-result-box.bad { background: var(--red-soft); color: var(--red); }
.int-toggle { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.int-toggle .int-on { color: var(--green); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; min-height: 40px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }

.settings { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.check-row { cursor: pointer; align-items: flex-start; }
.check-row input[type=checkbox] { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--gold-strong); flex: none; }
.sticky-actions { position: sticky; bottom: calc(var(--bottom-h) + 8px + env(safe-area-inset-bottom)); z-index: 10; display: flex; justify-content: flex-end;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
@media (min-width: 960px) { .sticky-actions { bottom: 16px; } }
@media (max-width: 639px) { .sticky-actions .btn { flex: 1; } }


.last-note { display: flex; align-items: baseline; gap: 4px; margin-top: 3px; font-size: 12px; color: var(--muted); max-width: 340px; min-width: 0; text-align: left; }
.last-note .ln-ico { flex: none; }
.last-note .ln-text { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.last-note .ln-meta { flex: none; white-space: nowrap; }
@media (max-width: 719px) { .last-note { max-width: 62vw; flex-wrap: wrap; } .last-note .ln-text { white-space: normal; overflow-wrap: anywhere; } .last-note .ln-meta { white-space: normal; } }

.care-filter { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.care-filter > .chips { flex: 1 1 auto; min-width: 0; }
.care-filter-label { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); padding-bottom: 10px; }
.care-badge { display: inline-block; max-width: 100%; margin-top: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.45;
  background: var(--green-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); white-space: normal; overflow-wrap: anywhere; text-align: left; }
.care-badge b { color: var(--green); font-weight: 600; }
.care-badge.care-many { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.care-badge.care-many b { color: var(--blue); }
.care-badge.care-none { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); font-weight: 600; }
.lc-care { margin: 2px 0; }
.act-card { display: flex; flex-direction: column; gap: 10px; }
.act-card > .card-head { margin-bottom: 0; }
.act-form { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.act-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-sm { padding: 4px 10px; font-size: 12.5px; }
.act-form textarea { font-size: 16px; min-height: 64px; }
.act-next-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.act-next-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.act-next-label .input { max-width: 100%; }
.act-actions { flex-wrap: wrap; }
.act-lock { font-size: 14px; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.act-item:last-child { border-bottom: 0; }
.act-ico { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--gold-soft); border: 1px solid var(--gold); }
.act-audit .act-ico, .act-system .act-ico { background: var(--surface-2); border-color: var(--line); }
.act-status_change .act-ico { background: var(--blue-soft); border-color: var(--blue); }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.act-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.act-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.act-sep { color: var(--muted); }
.act-kind { color: var(--muted); }
.act-ref { font-size: 12px; }
.act-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.act-audit .act-text { color: var(--muted); font-size: 13px; }
.act-next { font-size: 12.5px; color: var(--blue); }
.act-next.overdue { color: var(--red); font-weight: 600; }
.act-next.done { color: var(--muted); text-decoration: line-through; }
.push-box { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 10px; overflow-wrap: anywhere; }
.push-box.ok { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--green-soft); border-color: transparent; }
.push-box.bad { background: var(--red-soft); border-color: transparent; }
.push-err { font-size: 13px; color: var(--red); }
.push-manual summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); margin-bottom: 8px; }


.lead-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.lead-filters .input { min-width: 0; max-width: 100%; }
.lead-filters select.input { width: auto; }

.lead-toolbar { display: flex; gap: 8px; align-items: center; min-width: 0; }
.lead-toolbar > .input[type="search"] { flex: 1 1 auto; width: auto; min-width: 0; }
.lead-filter-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lead-filter-btn[aria-expanded="true"] { border-color: var(--blue); }
.lead-filter-panel { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.lead-filter-panel[hidden], .lead-menu[hidden], .lead-funnel[hidden] { display: none; }
.lf-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; font-size: 12px; color: var(--muted); }
.lf-field > span { font-weight: 600; }
.lf-foot { align-items: center; }
@media (max-width: 480px) { .lead-filter-panel { flex-direction: column; align-items: stretch; } .lead-filter-panel select.input { width: 100%; } }
.page-head h1:has(.lead-info) { display: inline-flex; align-items: center; gap: 4px; }
.lead-info { font-size: 13px; width: 20px; height: 20px; }
.page-actions:has(> .lead-more-host) { position: relative; }
.lead-more-host { display: inline-block; }
.lead-more-btn { font-size: 18px; line-height: 1; padding: 4px 12px; }
.lead-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; gap: 10px; width: max-content; max-width: min(300px, calc(100vw - 32px));
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.lead-menu select.input { width: 100%; }
.lead-sum-wrap { margin-bottom: 8px; }
.lead-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 13px; color: var(--muted); }
.lead-sum b { color: var(--text); font-weight: 700; }
.lead-sum .text-red, .lead-sum .text-red b { color: var(--red); }
.lead-sum-sep { color: var(--line-strong, var(--muted)); }
.btn-link { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--blue); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.lead-sum-toggle { margin-left: auto; font-size: 13px; white-space: nowrap; }
.lead-funnel { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.lead-chiprow { display: flex; align-items: center; gap: 12px; overflow-x: auto; min-width: 0; max-width: 100%; scrollbar-width: none; margin-bottom: 6px; }
.lead-chiprow::-webkit-scrollbar { display: none; }
.lead-chiprow > div { flex: none; }
.lead-chiprow .chips { overflow: visible; flex-wrap: nowrap; padding-bottom: 4px; }
.lead-chiprow .care-filter { max-width: none; }
.lead-chiprow .care-filter-label { padding-bottom: 4px; white-space: nowrap; }
.lead-chiprow .chip { white-space: nowrap; }
.kb-col-empty { padding: 6px 8px; opacity: .8; }
.kb-col-empty .kb-head { padding: 0; gap: 8px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; min-height: 38px; }
.lead-assign select.input { min-height: 34px; }
.lead-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .lead-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lead-card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.lead-card:hover { box-shadow: var(--shadow); }
.lead-card.ls-contacting { border-left-color: var(--gold); } .lead-card.ls-caring { border-left-color: var(--gold-strong); }
.lead-card.ls-won { border-left-color: var(--green); } .lead-card.ls-lost, .lead-card.ls-junk { border-left-color: var(--gray); opacity: .9; }
.lead-card.is-overdue { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 5%, var(--surface)); }
.lc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.lc-name { font-weight: 700; text-decoration: none; color: var(--text); min-width: 0; }
.lc-line { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lc-interest { font-size: 13px; }
.lc-note { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { font-size: 12px; color: var(--muted); }
.lc-next { font-size: 12px; color: var(--blue); }
.lc-next.overdue { color: var(--red); font-weight: 600; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-width: 0; }
.kb-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; font-size: 14px; }
.kb-body { display: flex; flex-direction: column; gap: 8px; max-height: 72vh; overflow-y: auto; }
.kb-empty { text-align: center; margin: 6px 0; }
.funnel h3, .lead-funnel h3 { font-size: 14px; margin: 0 0 6px; }
.funnel-table td, .funnel-table th { padding: 6px 8px; }

@media (max-width: 480px) {
  .row:has(> input[type="date"]) { width: 100%; min-width: 0; }
  .row > input[type="date"].input-sm { flex: 1 1 0; width: 0; min-width: 0; }
}


.cx-segs .chips { flex-wrap: wrap; }
.cx-list { display: flex; flex-direction: column; gap: 8px; }
.cx-row { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.cx-row.cx-p-bad { border-left-color: var(--red); } .cx-row.cx-p-warn { border-left-color: var(--gold-strong); }
.cx-row.cx-p-gold { border-left-color: var(--gold); } .cx-row.cx-p-info { border-left-color: var(--blue); }
.cx-c { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.cx-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 2px; }
.cx-head { display: none; }
.cx-name { font-weight: 700; font-size: 15px; text-decoration: none; }
.cx-phone { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cx-tel { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-zalo { font-size: 12px; font-weight: 700; color: #0068ff; border: 1px solid color-mix(in srgb, #0068ff 40%, transparent); border-radius: 999px; padding: 0 8px; text-decoration: none; }
.cx-items { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cx-st { margin-top: 2px; }
.cx-warn { color: #a16207; font-weight: 600; }
.cx-care-note { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-next { font-size: 12.5px; color: var(--blue); } .cx-next.overdue { color: var(--red); font-weight: 700; }
.cx-action { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.35; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.cx-a-bad { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.cx-a-warn, .cx-a-gold { background: var(--gold-soft); color: #8a6100; border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.cx-a-info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.cx-a-muted { color: var(--muted); font-weight: 600; }
.cx-btns { margin-top: 6px; }
.cx-next-action { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.cx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-kpis .kpi small { display: block; overflow-wrap: anywhere; }
.cx-dup { cursor: pointer; align-items: flex-start; }
.cx-dup input { margin-top: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cx-a-warn, :root:not([data-theme="light"]) .cx-a-gold, :root:not([data-theme="light"]) .cx-warn { color: var(--gold); } }
:root[data-theme="dark"] .cx-a-warn, :root[data-theme="dark"] .cx-a-gold, :root[data-theme="dark"] .cx-warn { color: var(--gold); }
@media (min-width: 720px) { .cx-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .cx-list { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .cx-row { grid-template-columns: 1.25fr 1.45fr 1.1fr 1.25fr 1.2fr; gap: 14px; border: 0; border-left: 4px solid transparent; border-bottom: 1px solid var(--line); border-radius: 0; }
  .cx-row:last-child { border-bottom: 0; }
  .cx-head { display: grid; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding-top: 8px; padding-bottom: 8px; }
  .cx-row:not(.cx-head) .cx-lbl { display: none; }
}
@media (min-width: 560px) and (max-width: 1099px) { .cx-row { grid-template-columns: 1fr 1fr; } .cx-who, .cx-do { grid-column: 1 / -1; } }


.vnac { position: fixed; z-index: 10000; max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; }
.vnac-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.vnac-item small { color: var(--muted); }
.vnac-item.on, .vnac-item:hover { background: var(--gold-soft); }
.vnac-foot { padding: 6px 12px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); }

.vnauto { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; min-width: 0; font-size: 12.5px; }
.vnauto-btn, .vnauto-link, .vnauto-chip { font: inherit; cursor: pointer; border-radius: 999px; min-height: 28px; }
.vnauto-btn { border: 1px dashed var(--line); background: var(--surface-2); color: var(--text); padding: 2px 10px; }
.vnauto-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.vnauto-msg { flex: 1 1 100%; min-width: 0; color: var(--muted); overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.vnauto-msg:empty { display: none; }
.vnauto-link { border: 0; background: none; color: var(--gold-strong, var(--text)); text-decoration: underline; padding: 0 2px; font-weight: 600; }
.vnauto-chip { border: 1px solid var(--gold); background: var(--gold-soft); color: var(--text); padding: 2px 10px; max-width: 100%; white-space: normal; text-align: left; }
.input.vn-autofilled { box-shadow: 0 0 0 2px var(--gold); background: var(--gold-soft); transition: box-shadow .3s, background .3s; }


.pf-hm { overflow-x: auto; padding-bottom: 4px; }
.pf-hm-row { display: flex; align-items: center; gap: 3px; min-width: max-content; text-decoration: none; color: inherit; padding: 2px 0; }
a.pf-hm-row:hover .pf-hm-name { color: var(--gold-strong); text-decoration: underline; }
.pf-hm-name { width: 120px; flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); }
.pf-hm-day { width: 26px; flex: none; font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; }
.pf-hm-cell { width: 26px; height: 26px; flex: none; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-hm-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 2px; vertical-align: -2px; }
.lv0 { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.lv1 { background: color-mix(in srgb, var(--gold) 25%, var(--surface)); }
.lv2 { background: color-mix(in srgb, var(--gold) 50%, var(--surface)); }
.lv3 { background: color-mix(in srgb, var(--gold) 75%, var(--surface)); color: #111; }
.lv4 { background: var(--gold-strong); color: #111; }
.pf-hm .legend, .card .legend.small { margin-top: 8px; }
.pf-verdict { display: grid; gap: 8px; font-size: 14px; }
.pf-list { display: grid; gap: 10px; }
.pf-item { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pf-item:last-child { border-bottom: 0; }
.pf-text { margin-top: 3px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.pf-sc { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.pf-sc.is-top > span { background: var(--gold-soft); border-radius: 6px; padding: 1px 6px; font-weight: 700; justify-self: start; }
.pf-sc .delta { font-size: 11px; }
.pf-mix { display: grid; gap: 12px; }
.pf-mix-row { display: grid; gap: 4px; text-decoration: none; color: inherit; }
.pf-mix-row:hover .pf-mix-top span { color: var(--gold-strong); text-decoration: underline; }
.pf-mix-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.pf-mix-track { display: flex; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pf-mix-track > div { height: 100%; min-width: 0; }

.pf-tabs { margin-bottom: 10px; }
.pf-period { display: grid; gap: 8px; margin-bottom: 12px; }
.pf-period .chips { flex-wrap: wrap; }
.pf-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.pf-custom .input { width: auto; min-width: 0; max-width: 160px; padding: 6px 8px; }
.pf-range { font-size: 13px; color: var(--muted); }
.pf-mt-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.pf-mt { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: max-content; }
.pf-mt th, .pf-mt td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.pf-mt th { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pf-mt th:first-child, .pf-mt td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pf-mt td.hot { background: color-mix(in srgb, var(--gold) 22%, transparent); font-weight: 700; }
.pf-mt tr.pf-mt-total td { font-weight: 700; border-top: 2px solid var(--line); }
.pf-mt a { color: inherit; }
.pf-howto { margin-top: 12px; font-size: 13px; }
.pf-howto summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.pf-howto ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text); }
.pf-tenure { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pf-tenure b { color: var(--text); }
.bn-rules { display: grid; gap: 12px; }
.bn-rule { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 8px; }
.bn-rule > label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.bn-row .input { width: 140px; max-width: 100%; padding: 6px 8px; }
.bn-row .input.short { width: 70px; }
.bn-warn { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }


.lc-phone { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.lc-phone-num { font-size: 16px; font-weight: 800; letter-spacing: .3px; color: var(--text); text-decoration: none; white-space: nowrap; }
.lc-phone.big .lc-phone-num { font-size: 20px; }
.lc-phone .btn-sm { padding: 3px 10px; }
.lead-src { display: inline-flex; flex-shrink: 0; }
.lead-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, var(--green) 14%, var(--surface)); color: var(--green); text-decoration: none; white-space: nowrap; }
.lead-example { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2, #f6f6f6); padding: 8px; border-radius: 6px; max-width: 100%; overflow-x: auto; }


.src-card { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); }
.src-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.src-head b { font-size: 16px; }
.src-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.src-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 13.5px; cursor: pointer; min-height: 36px; }
.src-btn:hover { border-color: var(--gold); }
.src-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--gold); }
.src-btn.src-fb:not(.on) { font-weight: 600; }
:root[data-theme="dark"] .src-btn.on { background: var(--gold); color: #111; border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .src-btn.on { background: var(--gold); color: #111; border-color: var(--gold); } }
.cart { margin-bottom: 12px; }
.cart-empty { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.cart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--gold-soft); }
.cart-lines { margin-top: 4px; }
.cart-lines .line:first-child { border-top: 0; }
.comp-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.picker-tools { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.picker-tools .chips { padding-bottom: 2px; flex-wrap: wrap; }
.prod-sec + .prod-sec { margin-top: 14px; }
.prod-sec-title { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; }
.prod-sec-thuoc { padding-top: 10px; border-top: 1px dashed var(--line); }
.prod-sec-thuoc .prod-tile:not(.on) { background: color-mix(in srgb, var(--blue-soft, #eef3ff) 45%, var(--surface)); }
div.prod-tile { user-select: none; -webkit-tap-highlight-color: transparent; }
div.prod-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper .icon-btn { min-width: 34px; height: 32px; font-size: 16px; border-radius: 999px; }
.stepper-n { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.tile-stepper { align-self: flex-start; margin-top: 6px; }
.order-sticky { display: none; }
@media (max-width: 999px) {
  .order-sticky { display: flex; align-items: center; gap: 10px; position: sticky; bottom: calc(var(--bottom-h) + 8px + env(safe-area-inset-bottom)); z-index: 12;
    background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 8px 8px 12px; }
  .order-sticky-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
  .order-sticky-sum small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .order-sticky-sum b { font-size: 18px; font-variant-numeric: tabular-nums; }
  .order-sticky .btn { flex-shrink: 0; }
  .order-form-side .btn-block[type="submit"] { display: none; }
  body:has(.order-sticky) .fab { bottom: calc(var(--bottom-h) + 92px + env(safe-area-inset-bottom)); padding: 9px; opacity: .9; }
}
@media (max-width: 359px) { .prod-grid { grid-template-columns: 1fr; } }
.stage-ro { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 2px; }
.stage-vip { font-size: 13.5px; cursor: pointer; }


.mix-plot { width: 100%; min-height: 200px; }
.mix-svg { display: block; overflow: visible; }
.mix-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.mix-base { stroke: var(--muted); stroke-opacity: .5; }
.mix-tick, .mix-x { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
rect.mix-new, .dot.mix-new { fill: var(--blue); background: var(--blue); }
rect.mix-care, .dot.mix-care { fill: var(--green); background: var(--green); }
.mix-hit { fill: transparent; cursor: pointer; }
.mix-col:hover rect.mix-new, .mix-col:hover rect.mix-care, .mix-col:focus rect.mix-new, .mix-col:focus rect.mix-care { opacity: .8; }
.mix-col.is-sel rect.mix-new, .mix-col.is-sel rect.mix-care { stroke: var(--text); stroke-width: 1.5; }
.mix-col:focus { outline: none; }
.mix-line { fill: none; stroke: var(--gold-strong); stroke-width: 2.25; stroke-linejoin: round; pointer-events: none; }
.mix-dot { fill: var(--surface); stroke: var(--gold-strong); stroke-width: 2; pointer-events: none; }
.mix-dot.is-neg { stroke: var(--red); fill: var(--red); }
.mix-line-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--gold-strong); vertical-align: middle; margin-right: 4px; }
.mix-legend { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mix-sum { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 6px 0 10px; }
.mix-sum > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mix-sum small { color: var(--muted); font-weight: 600; font-size: 12px; }
.mix-sum b { font-size: 17px; font-variant-numeric: tabular-nums; }
.mix-sum .muted { font-size: 12px; }
.mix-sum .delta { align-self: flex-start; }
.mix-sum-profit { grid-column: span 2; }
@media (max-width: 560px) { .mix-sum-profit { grid-column: auto; } }
.tone-bad { color: var(--red); } .tone-good { color: var(--green); }


.notice.info { background: var(--blue-soft); border-left: 3px solid var(--blue); }
.addr-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.addr-verify > span { min-width: 0; }
.addr-verify .av-google:empty, .addr-verify .av-vnpost:empty { display: none; }
.maps-link { font-weight: 600; white-space: nowrap; }
.av-ok { color: var(--green); } .av-bad { color: var(--red); } .av-warn { color: var(--gold-strong); }
.addr-verify-line { margin-top: 2px; overflow-wrap: anywhere; }
.gift-slots { align-items: flex-end; }
.gift-slot { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.gift-slot.extra { flex-direction: row; align-items: center; gap: 6px; flex-wrap: wrap; }
.gift-slot select { min-width: 0; max-width: 100%; }
.cancelled-box { display: flex; flex-direction: column; gap: 4px; }
.cancel-reasons { flex-wrap: wrap; margin-bottom: 8px; }
.cancel-reasons .chip { white-space: normal; text-align: left; }
@media (max-width: 480px) { .gift-slot, .gift-slot select { width: 100%; } }



@media (max-width: 959px) { .fab { display: none !important; } }
.side-feedback { width: 100%; justify-content: center; margin-bottom: 8px; }
@media (min-width: 960px) { .side-feedback { display: none; } }

.help-intro p { margin: 0 0 6px; }
.help-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.help-guide { padding: 0; }
.help-guide > summary { list-style: none; cursor: pointer; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.help-guide > summary::-webkit-details-marker { display: none; }
.help-guide > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.help-guide[open] > summary::after { transform: rotate(180deg); }
.help-guide > :not(summary) { margin-left: 14px; margin-right: 14px; }
.help-guide > :last-child { margin-bottom: 14px; }
.help-steps { margin: 0 0 10px; padding-left: 20px; line-height: 1.55; }
.help-steps li { margin-bottom: 6px; overflow-wrap: anywhere; }
.help-note { margin: 0 0 10px; }

.staff-role-list { display: flex; flex-direction: column; gap: 10px; }
.staff-role { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; font-size: 13px; }
.staff-role small { display: block; margin-top: 2px; }


.lc-match { margin-top: 6px; padding: 8px 10px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); font-size: 13px; cursor: default; }
.lc-match-q { line-height: 1.4; }
.lc-match-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lc-drop { margin-left: auto; color: var(--muted); }
.lc-drop:hover { color: var(--red); }
.drop-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.drop-reasons .btn { min-height: 40px; }


.sale-chart, .page-chart { display: grid; gap: 10px; margin: 4px 0 8px; }
.sc-top { display: flex; align-items: baseline; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-track, .pc-track { height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.pc-track + .pc-track { margin-top: 3px; height: 8px; }
.sc-bar { height: 100%; display: flex; border-radius: 7px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; }
.pc-fill { height: 100%; border-radius: 7px; }


.kb-col-folded { max-width: 200px; }
.kb-lost-sum { display: flex; flex-direction: column; gap: 4px; padding: 2px 4px; }
.kb-lost-sum .btn { align-self: flex-start; margin-top: 6px; }
.kb-lost-fold { align-self: flex-end; }
.lead-card-closed { gap: 3px; padding: 8px 10px; background: var(--surface-2); box-shadow: none; }
.lead-card-closed .lc-name { font-weight: 600; font-size: 14px; }
.lcc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.lcc-reason { flex: none; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); white-space: nowrap; }
.lcc-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lcc-note { font-size: 12px; color: var(--muted); font-style: italic; }


.mt-panel { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.mt-help { font-size: 13px; color: var(--text); line-height: 1.45; }
.mt-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.mt-tag { flex: none; min-width: 92px; font-size: 12px; color: var(--muted); }
.mt-name { font-weight: 600; }
.mt-sub { font-size: 12px; color: var(--muted); }
.mt-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.tk-av { position: relative; }
.tk-av .tk-av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tk-av-net { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; line-height: 1; color: #fff; border: 2px solid var(--surface); }
.tk-av-z { background: #0068ff; } .tk-av-f { background: #1877f2; }
.tk-av.tk-av-sm { width: 30px; height: 30px; font-size: 12px; }
.tk-av.tk-av-sm .tk-av-net { width: 13px; height: 13px; font-size: 8px; right: -2px; bottom: -2px; }
.av-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }


.msg-att.att-template .msg-tpl-sub { white-space: normal; }
.msg-att.att-template .msg-tpl-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msg-att.att-template .msg-tpl-btn { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--surface); }


.mc-wrap { display: grid; gap: 4px; max-width: 300px; white-space: normal; }
.mc-card { background: #fff; color: #050505; border: 1px solid #dadde1; border-radius: 18px; overflow: hidden; width: 100%; max-width: 300px; text-align: left; }
.mc-img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #f0f2f5; }
.mc-bell { font-size: 30px; text-align: center; padding: 14px 0 0; }
.mc-body { padding: 10px 12px; }
.mc-title { font-weight: 700; font-size: 15px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-sub { color: #65676b; font-size: 13px; line-height: 1.35; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-btns { display: grid; }
.mc-btn { display: block; text-align: center; padding: 9px 12px; border-top: 1px solid #e4e6eb; color: #0866ff; font-weight: 600; font-size: 14px; text-decoration: none; }
a.mc-btn:hover { background: #f2f2f2; }
.mc-optin .mc-body { text-align: center; }
.mc-carousel { display: flex; gap: 8px; overflow-x: auto; max-width: min(560px, 78vw); padding-bottom: 4px; scroll-snap-type: x mandatory; }
.mc-carousel .mc-card { flex: 0 0 240px; scroll-snap-align: start; }
.mc-note { color: var(--muted); font-size: 11.5px; }
.only-media .bubble:has(.mc-wrap) { background: transparent; border: 0; padding: 0; }


.web-chat-note { padding: 10px 14px; border-top: 1px solid var(--border, #e5e7eb); background: #fff7ed; color: #9a3412; font-size: 13px; line-height: 1.45; }


.avatar.web-orb { position: relative; overflow: hidden; color: transparent; background: var(--o1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 2px 10px color-mix(in srgb, var(--o2) 45%, transparent); }
.avatar.web-orb::before { content: ''; position: absolute; inset: -30%; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--o1), var(--o2), var(--o3), var(--o4), var(--o1)); animation: webOrbSpin 7s linear infinite; }
.avatar.web-orb .web-orb-core { position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--o3) 70%, transparent), transparent 70%); filter: blur(3px); animation: webOrbPulse 3.2s ease-in-out infinite; }
.avatar.web-orb::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.9) 0 9%, rgba(255,255,255,.35) 22%, transparent 48%); }
.avatar.web-orb-sm .web-orb-core { filter: blur(2px); }
.web-orb-0 { --o1: #7c3aed; --o2: #22d3ee; --o3: #f472b6; --o4: #a78bfa; }
.web-orb-1 { --o1: #0ea5e9; --o2: #a3e635; --o3: #22d3ee; --o4: #6366f1; }
.web-orb-2 { --o1: #f97316; --o2: #f43f5e; --o3: #fde047; --o4: #fb7185; }
.web-orb-3 { --o1: #10b981; --o2: #3b82f6; --o3: #5eead4; --o4: #818cf8; }
.web-orb-4 { --o1: #ec4899; --o2: #8b5cf6; --o3: #fbbf24; --o4: #f472b6; }
.web-orb-5 { --o1: #6366f1; --o2: #ec4899; --o3: #38bdf8; --o4: #c084fc; }
.web-orb-6 { --o1: #14b8a6; --o2: #facc15; --o3: #fb923c; --o4: #34d399; }
.web-orb-7 { --o1: #3b82f6; --o2: #06b6d4; --o3: #e879f9; --o4: #60a5fa; }
@keyframes webOrbSpin { to { transform: rotate(360deg); } }
@keyframes webOrbPulse { 0%, 100% { transform: scale(.85); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .avatar.web-orb::before, .avatar.web-orb .web-orb-core { animation: none; } }


.thread-card .composer[hidden], .thread-card .hint[hidden] { display: none !important; }


.lost-view > .chips { margin-bottom: 4px; }
.lost-tip { margin: 2px 0 8px; }
.lcc-reason.lcc-remine { background: var(--gold-soft, #fdf3d7); color: var(--gold-ink, #8a6100); }
.lcc-reason.lcc-ours { background: var(--amber-soft, #fff1e0); color: var(--amber, #b45309); }
.lcc-reason.lcc-drop { background: var(--red-soft); color: var(--red); }
.lead-card-closed.is-due { border-left: 3px solid var(--gold, #d4a017); }
.lcc-remine { font-size: 12.5px; color: var(--muted); }
.lcc-remine.is-due { color: var(--gold-ink, #8a6100); font-weight: 600; }
.lcc-purge { font-size: 12px; color: var(--muted); }
.lost-pick .lost-group { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.lost-pick .lost-group:first-child { border-top: 0; padding-top: 0; }
.lost-pick .lost-group-h { font-size: 13.5px; }
.lost-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.lost-date[hidden] { display: none; }
.lost-date .input { max-width: 180px; }
.lost-pick-info { color: var(--muted); margin: 0; }
