


:root {
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100;
  --viz-5: #e87ba4; --viz-6: #008300; --viz-7: #6250d6; --viz-8: #e34948; --viz-other: #a3a29b;
  --st-good: #0ca30c; --st-warning: #fab219; --st-warning-2: #86b6ef; --st-serious: #ec835a; --st-critical: #d03b3b;
  --col: #E0A400; --col-hover: #B98700; --col-today: #7A5600;
  --grid: #ECE9E1; --axis: #CFCBC0; --tick: #7A7D84;
  --urgent: #C62828; --urgent-soft: #FDECEC; --warn-ink: #8A5A00; --warn-soft: #FFF3D1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500;
    --viz-5: #d55181; --viz-6: #008300; --viz-7: #9085e9; --viz-8: #e66767; --viz-other: #6d6c66;
    --st-warning-2: #5598e7;
    --col: #F2B705; --col-hover: #FFD043; --col-today: #FFE59A;
    --grid: #26262C; --axis: #3A3A42; --tick: #9A9CA4;
    --urgent: #FF6B6B; --urgent-soft: #3D1616; --warn-ink: #F2B705; --warn-soft: #3A3010;
  }
}
:root[data-theme="dark"] {
  --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500;
  --viz-5: #d55181; --viz-6: #008300; --viz-7: #9085e9; --viz-8: #e66767; --viz-other: #6d6c66;
  --st-warning-2: #5598e7;
  --col: #F2B705; --col-hover: #FFD043; --col-today: #FFE59A;
  --grid: #26262C; --axis: #3A3A42; --tick: #9A9CA4;
  --urgent: #FF6B6B; --urgent-soft: #3D1616; --warn-ink: #F2B705; --warn-soft: #3A3010;
}


.main { max-width: 1440px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; } .clamp-2 { -webkit-line-clamp: 2; }
.card-head h2, .card-title h2 { font-size: 15px; font-weight: 700; letter-spacing: .1px; }
.card-title { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.card-title.row { flex-direction: row; align-items: center; }
.card-title small { font-size: 12px; }
.card-title a { text-decoration: none; }
.toolbar.filters { align-items: center; }
.toolbar.filters .chips { padding-bottom: 2px; }
.range-label { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.range-box .input { width: auto; }
.table td { font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: 6px 8px; font-size: 13px; }
.prod-cell { max-width: 360px; line-height: 1.45; }
.prod-cell .qty-x { font-weight: 700; color: var(--text); }
.prod-name b { display: block; }
.prod-name .clamp-1 { max-width: 420px; }
.badge.xs { vertical-align: middle; }
@media (min-width: 720px) { .table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); } }


.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; transition: background .12s, border-color .12s, opacity .12s; }
.chip:hover { border-color: var(--gold); }
.chip-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.chip.on .chip-count { background: rgba(255,255,255,.18); color: inherit; border-color: transparent; }
.chip.is-zero:not(.on) { opacity: .55; }
.chip.is-zero .chip-count { font-weight: 500; }
.chip-count.cc-urgent { background: var(--urgent); color: #fff; border-color: var(--urgent); }
.chip-count.cc-warn { background: var(--gold); color: #111; border-color: var(--gold-strong); }
.chip-urgent:not(.on) { border-color: color-mix(in srgb, var(--urgent) 55%, var(--line)); color: var(--urgent); font-weight: 600; }
.chip-warn:not(.on) { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); font-weight: 600; }


.nav-badge.nb-urgent { background: var(--urgent); animation: nb-pulse 2s ease-in-out infinite; }
.nav-badge[data-alert-badge]:not(.nb-urgent) { background: var(--gold); color: #111; }

.bn-more:not(.nb-urgent) { background: var(--gold); color: #111; }
.bn-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; line-height: 16px; min-width: 18px; font-size: 10px; padding: 0 5px; }
.nav-dot-urgent { background: var(--urgent); right: calc(50% - 22px); }
@keyframes nb-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--urgent) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }


.alerts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px; }
.alerts.has-urgent { border-color: color-mix(in srgb, var(--urgent) 45%, var(--line)); box-shadow: inset 4px 0 0 var(--urgent), var(--shadow); }
.alerts-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.alerts-head h2 { font-size: 15px; }
.alerts-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .alerts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .alerts-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--surface-2); min-width: 0; transition: transform .12s, border-color .12s; }
.alert-item:hover { color: var(--text); border-color: var(--gold); transform: translateY(-1px); }
.alert-item.lv-urgent { background: var(--urgent-soft); border-color: color-mix(in srgb, var(--urgent) 40%, transparent); }
.alert-item.lv-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.al-ico { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--line); color: var(--text); }
.lv-urgent .al-ico { background: var(--urgent); color: #fff; animation: nb-pulse 2s ease-in-out infinite; }
.lv-warn .al-ico { background: var(--gold); color: #111; }
.lv-info .al-ico { background: var(--blue-soft); color: var(--blue); }
.al-ico.ok { background: var(--green-soft); color: var(--green); }
.al-count { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; min-width: 26px; text-align: center; }
.lv-urgent .al-count { color: var(--urgent); }
.lv-warn .al-count { color: var(--warn-ink); }
.al-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.al-title { font-weight: 650; font-size: 14px; line-height: 1.3; }
.al-hint { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-go { color: var(--muted); font-weight: 700; }
.alerts.all-clear { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; flex-wrap: wrap; }


.kpis-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .kpis-v2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis-v2 .kpi-hero { grid-column: span 2; } }
.kpis-v2 .kpi-hero { grid-column: span 2; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color .12s, transform .12s; }
.kpi-link:hover { color: inherit; border-color: var(--gold); transform: translateY(-1px); }
.kpi-title { text-transform: none; letter-spacing: 0; font-size: 13px; }
.kpi-value { font-size: 24px; line-height: 1.15; }
.kpi-value.hero { font-size: 34px; letter-spacing: -.5px; }
@media (max-width: 420px) { .kpi-value { font-size: 20px; } .kpi-value.hero { font-size: 28px; } }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; }
.kpi-sub { color: var(--muted); }
.kpi-hero { padding-right: 150px; min-height: 108px; }
.kpi-spark { position: absolute; right: 14px; bottom: 12px; }
@media (max-width: 520px) { .kpi-hero { padding-right: 14px; } .kpi-spark { position: static; margin-top: 6px; } }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 1px 6px; border-radius: 6px; }
.delta.good { color: var(--green); background: var(--green-soft); }
.delta.bad { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.delta-ctx { font-weight: 500; opacity: .8; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--col); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--col); opacity: .12; }
.spark-dot { fill: var(--col); stroke: var(--surface); stroke-width: 2; }


.viz-block { display: flex; flex-direction: column; gap: 8px; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.viz-summary { display: flex; gap: 18px; flex-wrap: wrap; }
.viz-stat { display: flex; flex-direction: column; }
.viz-stat small { color: var(--muted); font-size: 12px; }
.viz-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.viz-stat b .muted { font-weight: 500; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.viz { position: relative; width: 100%; min-height: 200px; }
.viz-svg { display: block; overflow: visible; touch-action: pan-y; }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-base { stroke: var(--axis); stroke-width: 1; }
.viz-tick, .viz-xlabel { fill: var(--tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-xlabel.is-today { fill: var(--text); font-weight: 700; }
.viz-col { fill: var(--col); transition: fill .1s, opacity .1s; }
.viz-col.is-today { fill: var(--col-today); }
.viz-svg:hover .viz-col:not(.is-hover) { opacity: .55; }
.viz-col.is-hover { fill: var(--col-hover); }
.viz-avg { stroke: var(--text); stroke-width: 1; stroke-dasharray: 4 4; opacity: .35; }
.viz-avg-label { fill: var(--muted); font-size: 11px; font-weight: 600; }
.viz-peak { fill: var(--text); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12px; min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
:root[data-theme="dark"] .viz-tip { background: #2A2A31; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viz-tip { background: #2A2A31; } }
.viz-tip.on { opacity: 1; }
.viz-tip-title { font-weight: 700; margin-bottom: 4px; color: var(--gold); }
.viz-tip-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.viz-tip-row b { font-variant-numeric: tabular-nums; margin-left: 12px; }
.viz-sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.viz-table summary { cursor: pointer; font-size: 12px; color: var(--muted); width: fit-content; }
.viz-table .table-wrap { max-height: 280px; overflow-y: auto; margin-top: 6px; }
.viz-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }


.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-ring { position: relative; width: 168px; height: 168px; flex-shrink: 0; margin: 0 auto; }
.donut-svg { width: 100%; height: 100%; display: block; }
.donut-track { fill: none; stroke: var(--surface-2); }
.donut-seg { fill: none; transition: opacity .12s; cursor: pointer; }
.donut-seg.dim, .donut-li.dim { opacity: .3; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center b { font-size: 20px; font-variant-numeric: tabular-nums; }
.donut-center small { color: var(--muted); font-size: 12px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.donut-li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; transition: opacity .12s, background .12s; outline: none; }
.donut-li:hover, .donut-li:focus-visible { background: var(--surface-2); }
.donut-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.donut-name small { color: var(--muted); font-weight: 400; font-size: 12px; }
.donut-val { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.donut-val b { font-size: 14px; } .donut-val small { color: var(--muted); font-size: 12px; }


.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: flex; gap: 10px; align-items: flex-start; }
.rank-no { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); margin-top: 1px; }
.rank-no.top { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rank-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rank-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: inherit; text-decoration: none; }
.rank-val { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-val b { font-size: 14px; } .rank-val small { color: var(--muted); font-size: 12px; }
.rank-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rank-fill { height: 100%; background: var(--col); border-radius: 0 3px 3px 0; }


.segwrap { display: flex; flex-direction: column; gap: 12px; }
.segbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface); }
.segbar-seg { min-width: 4px; height: 100%; }
.segbar-seg:first-child { border-radius: 7px 0 0 7px; } .segbar-seg:last-child { border-radius: 0 7px 7px 0; }
.segbar-seg:only-child { border-radius: 7px; }
.seg-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.seg-item { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; min-width: 0; }
a.seg-item:hover { background: var(--surface-2); color: var(--text); }
.seg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-item b { font-variant-numeric: tabular-nums; }
.seg-item small { color: var(--muted); font-size: 12px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }


.quiet-empty { display: flex; gap: 12px; align-items: flex-start; padding: 6px 2px; }
.quiet-empty p { margin: 2px 0 0; }
.quiet-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--gold-soft); color: var(--warn-ink); font-size: 16px; }
.ai-more { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.ai-more b { color: var(--text); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .nav-badge.nb-urgent, .lv-urgent .al-ico { animation: none; } }
@media print { .alerts { display: none !important; } }


.viz-col.is-ctx { fill: var(--col); opacity: .32; }
.viz-svg:hover .viz-col.is-ctx:not(.is-hover) { opacity: .2; }
.viz-cap { fill: var(--text); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-cap.is-ctx { fill: var(--muted); font-weight: 500; }
.viz-xlabel.is-focus { fill: var(--text); font-weight: 700; }
.viz-sw.ctx { background: var(--col); opacity: .32; }
.viz-legend-note small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.viz-legend-note { justify-content: flex-end; }


.brand-link { text-decoration: none; color: inherit; cursor: pointer; border-radius: 10px; }
.brand-link:hover { color: inherit; }
.sidebar .brand-link:hover .brand-logo, .topbar .brand-link:hover .brand-logo { filter: drop-shadow(0 1px 10px rgba(242,183,5,.45)); }
.sidebar .brand-link { color: #fff; }
.topbar .brand-link { color: #fff; }


@media (max-width: 560px) {
  .rank-top { flex-wrap: wrap; row-gap: 0; }
  .rank-name { white-space: normal; flex: 1 1 100%; }
  .rank-val { width: 100%; }
  .kpi:not(.kpi-hero) .delta-ctx { display: none; }
  .kpi:not(.kpi-hero) .kpi-sub { flex-basis: 100%; }
  .viz-summary { gap: 12px; }
  .viz-head { align-items: flex-start; }
  .alert-item { padding: 10px; }
  .al-hint { white-space: normal; }
}


.viz-col.is-pinned { fill: var(--col-hover); }
.viz-col.is-ctx.is-pinned { opacity: .7; }
.viz-svg:hover .viz-col.is-pinned:not(.is-hover) { opacity: .85; }
.viz-svg:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 6px; }
.viz-detail { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.viz-detail-head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.viz-pin { font-size: 12px; }
.viz-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.viz-detail-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.viz-detail-grid small { color: var(--muted); font-size: 12px; }
.viz-detail-grid b { font-size: 18px; font-variant-numeric: tabular-nums; }
.viz-detail-grid .delta { align-self: flex-start; font-size: 11px; }
.viz-detail-go { align-items: flex-end; }
@media (max-width: 640px) { .viz-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .viz-detail-go { grid-column: span 2; align-items: stretch; } .viz-detail-go .btn { width: 100%; } }
.live-note { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.viz-svg:focus:not(:focus-visible) { outline: none; }


.fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .fin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .fin-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi-strong .kpi-value { font-size: 28px; }
.kpi-red .kpi-value { color: var(--red); }
.stack-v.tight { gap: 8px; }
.notice { border: 1px solid var(--line); background: var(--surface-2); }

.statement { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.st-row { display: grid; grid-template-columns: 1fr 56px minmax(110px, auto); gap: 8px; align-items: baseline; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.st-row:last-child { border-bottom: 0; }
.st-label { min-width: 0; display: flex; flex-direction: column; }
.st-label a { text-decoration: none; }
.st-hint { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.st-auto { color: var(--warn-ink); font-size: 12px; }
.st-pct { color: var(--muted); font-size: 12px; text-align: right; }
.st-val { text-align: right; white-space: nowrap; font-weight: 600; }
.st-indent .st-label { padding-left: 14px; }
.st-indent .st-val { font-weight: 500; }
.st-head { font-weight: 700; }
.st-head .st-val { font-weight: 800; font-size: 15px; }
.st-subtotal { background: var(--surface-2); border-radius: 6px; border-bottom: 0; margin: 2px 0; font-weight: 700; }
.st-subtotal-soft { font-weight: 600; color: var(--muted); }
.st-total { margin-top: 6px; padding: 10px 8px; border-radius: 8px; border: 0; background: var(--green-soft); font-weight: 800; }
.st-total .st-val { font-size: 18px; color: var(--green); }
.st-total.is-neg { background: var(--red-soft); }
.st-total.is-neg .st-val { color: var(--red); }
.st-section { margin-top: 10px; padding: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.st-empty { padding: 6px 18px; color: var(--muted); font-size: 13px; font-style: italic; }

.table.months td { vertical-align: middle; }
.pbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pbar-track { position: relative; flex: 1; min-width: 60px; max-width: 160px; height: 8px; background: var(--surface-2); border-radius: 4px; }
.pbar-track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.pbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.pbar-fill.pos { left: 50%; background: var(--st-good); }
.pbar-fill.neg { right: 50%; background: var(--st-critical); }
.pbar b { min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }

.ledger { display: flex; flex-direction: column; }
.led-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.led-row:last-child { border-bottom: 0; }
.led-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 6px 0; border-radius: 8px; background: var(--surface-2); }
.led-date b { font-size: 14px; } .led-date small { color: var(--muted); font-size: 11px; }
.led-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.led-reason { font-weight: 600; overflow-wrap: anywhere; }
.led-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.led-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.led-amt b { font-size: 15px; white-space: nowrap; }
.led-in .led-amt b { color: var(--green); }
.icon-btn.sm { min-width: 30px; height: 30px; font-size: 14px; }
@media (max-width: 560px) { .led-row { grid-template-columns: 48px 1fr; } .led-amt { grid-column: 2; flex-direction: row; justify-content: space-between; align-items: center; } }

.fin-form .seg-lg { width: 100%; }
.seg-lg .seg-btn { flex: 1; padding: 10px; font-size: 15px; }
.fin-form .money-in { font-size: 20px; font-weight: 700; }
.cat-hint { display: block; margin-top: 4px; }

.led-group { background: color-mix(in srgb, var(--gold-soft) 45%, transparent); border-radius: 8px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.st-auto { font-size: 11px; font-weight: 500; }


.kpi-sub-warn { display: block; margin-top: 4px; color: var(--warn-ink, #8a5a00); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi-sub-warn { color: #f2c46d; } }
:root[data-theme="dark"] .kpi-sub-warn { color: #f2c46d; }


.imp { display: flex; flex-direction: column; gap: 10px; }
.imp ol { margin: 0; padding-left: 18px; color: var(--muted); }
.imp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 6px 0; }
.imp-kpis > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.imp-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.imp-kpis small { color: var(--muted); font-size: 12px; }
.imp-list summary { cursor: pointer; font-weight: 600; font-size: 13px; margin: 6px 0; }
.imp-list ul { margin: 0; padding-left: 18px; font-size: 13px; max-height: 220px; overflow: auto; overflow-wrap: anywhere; }


.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.view-chips { margin-top: 6px; }
.conv-panel { display: none; padding: 0; overflow: auto; min-height: 0; }
.conv-panel.open { display: block; position: fixed; inset: 0 0 0 auto; width: min(380px, 100vw); z-index: 60; border-radius: 0; box-shadow: var(--shadow); }
.panel-inner { padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.panel-close { position: absolute; right: 8px; top: 8px; }
.panel-head { display: flex; gap: 12px; align-items: center; }
.panel-rows { display: flex; flex-direction: column; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.panel-inner h4 { margin: 6px 0 0; font-size: 14px; }
.panel-orders { display: flex; flex-direction: column; gap: 6px; }
.panel-order { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.panel-order:hover { border-color: var(--gold); }
@media (min-width: 1280px) {
  .conv-layout.with-panel.has-thread { grid-template-columns: 320px minmax(0, 1fr) 320px; }
  .conv-layout.with-panel.has-thread .conv-panel { display: block; position: static; width: auto; box-shadow: none; border-radius: var(--radius); }
  .conv-panel .panel-close, .panel-toggle { display: none; }
}
.composer-v2 { flex-direction: column; align-items: stretch; gap: 6px; }
.composer-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer-row textarea { flex: 1; }
.suggest-imgs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.img-tile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.img-tile:hover { border-color: var(--gold); }
.img-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.img-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.qr-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.qr-item { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.qr-item:hover { border-color: var(--gold); }
.qr-edit { display: grid; gap: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }


.day-chips { margin: 4px 0 10px; }
.day-group { margin-bottom: 14px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px 6px; font-size: 15px; }
.draft-box { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 10px; background: var(--gold-soft, #fff8e1); overflow-wrap: anywhere; }
.draft-box .btn { align-self: flex-start; margin-top: 4px; }
.lc-draft { font-size: 12.5px; font-weight: 600; color: var(--gold-strong, #8a6d00); }


.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 10px; }
.seg-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.seg-card:hover { border-color: var(--gold); }
.seg-card.on { border-color: var(--gold-strong, #b8860b); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.seg-card.urgent .seg-count { background: var(--red); color: #fff; }
.seg-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.seg-count { font-variant-numeric: tabular-nums; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.care-saved { margin-bottom: 8px; }
.care-filters { margin-bottom: 10px; }
.care-filters select.input-sm, .care-filters input.input-sm { max-width: 220px; }
.care-script { padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 6px; font-size: 13.5px; margin-bottom: 10px; }
.care-list { display: flex; flex-direction: column; gap: 8px; }
.care-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.care-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.care-name { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.care-phone { font-weight: 600; }
.care-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 260px; }
@media (max-width: 640px) { .care-row { flex-direction: column; } .care-actions { justify-content: flex-start; max-width: none; } }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 55vh; overflow: auto; }

.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }
.filter-grid.more { padding-top: 10px; border-top: 1px dashed var(--line); }
.rf { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rf-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rf-inputs { display: inline-flex; align-items: center; gap: 4px; }
.input-xs { width: 70px; padding: 4px 6px; min-height: 30px; }
.care-row { flex-direction: column; align-items: stretch; }
.care-row.is-bad { border-left: 4px solid var(--red); }
.care-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.care-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .care-cols { grid-template-columns: 1fr; gap: 6px; } }
.care-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.deliv-days { color: var(--blue, #2563eb); }
.text-gold { color: var(--gold-strong, #8a6d00); font-weight: 600; }
.care-actions { justify-content: flex-start; max-width: none; }
.care-orders { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.care-order { color: inherit; text-decoration: none; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }


.is-refreshing { opacity: .65; transition: opacity .15s; pointer-events: none; }
.care-row.is-done { opacity: .7; border-color: var(--green, #16a34a); }
.care-done { font-size: 13px; color: var(--green, #15803d); padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--green, #16a34a) 10%, transparent); }


.page-chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.page-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap; }
.page-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--gold)); }
.page-chip.on { border-color: var(--pc, var(--gold)); background: color-mix(in srgb, var(--pc, var(--gold)) 14%, var(--surface)); font-weight: 700; }
.page-chip .chip-count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.page-chip .page-ai { font-size: 11px; font-weight: 700; color: var(--pc, var(--gold)); }
.page-ai-row .page-tag { min-width: 170px; max-width: none; font-size: 12px; padding: 4px 8px; }
.page-tag { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); }
.conv-item { border-left: 3px solid var(--pc, transparent); }


.msgs { gap: 2px; padding: 14px 16px; background: var(--surface-2); }
.msg { flex-direction: row; gap: 8px; max-width: 76%; margin-top: 10px; }
.msg.cont { margin-top: 2px; }
.msg-out { flex-direction: row; }
.msg-body { display: flex; flex-direction: column; min-width: 0; }
.msg-out .msg-body { align-items: flex-end; }
.msg-av { width: 30px; flex: none; align-self: flex-end; }
.msg-av .avatar { font-size: 12px; }
.bubble { font-size: 14.5px; line-height: 1.5; color: var(--text); padding: 9px 13px; border-radius: 16px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.bubble strong { font-weight: 700; }
.msg-customer .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-staff .bubble { background: #2563eb; border-color: #2563eb; color: #fff; border-bottom-right-radius: 5px; }
.msg-ai .bubble { background: color-mix(in srgb, var(--gold) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--text); border-bottom-right-radius: 5px; }
.msg-system .bubble { background: color-mix(in srgb, #64748b 13%, var(--surface)); border: 1px solid color-mix(in srgb, #64748b 30%, transparent); color: var(--text); font-style: normal; border-bottom-right-radius: 5px; }
.msg.cont .bubble { border-radius: 16px; }
.msg-who { font-size: 11.5px; font-weight: 700; margin: 0 4px 3px; color: var(--muted); }
.msg-ai .msg-who { color: #a16207; } .msg-staff .msg-who { color: #2563eb; } .msg-system .msg-who { color: #475569; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 2px 6px 0; }
.msg.cont .msg-meta { display: none; }
.msg:hover .msg-meta { display: flex; }
.msg-staff .msg-file { color: #fff; }
.msg-day { align-self: center; margin: 14px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.msg-day span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }
.collab { display: flex; align-items: center; gap: 10px; width: 100%; flex-basis: 100%; margin-top: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid; }
.collab > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.collab b { font-size: 13.5px; } .collab small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.collab-ico { font-size: 18px; width: 22px; text-align: center; }
.collab-ai { background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.collab-staff { background: color-mix(in srgb, #2563eb 8%, var(--surface)); border-color: color-mix(in srgb, #2563eb 35%, transparent); }
.collab-human { background: color-mix(in srgb, var(--red) 9%, var(--surface)); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.collab-human .collab-ico, .collab-human b { color: var(--red); }
.thread-head { flex-wrap: wrap; }


.msg-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; word-break: break-all; }
.msg-customer .msg-link, .msg-ai .msg-link, .msg-system .msg-link { color: #1d4ed8; }
.msg-media { display: block; margin-top: 4px; }
.msg-media .msg-img { max-width: 260px; max-height: 300px; border-radius: 12px; display: block; border: 1px solid var(--line); background: var(--surface); }
.msg-media.is-sticker .msg-img { max-width: 110px; max-height: 110px; border: 0; background: transparent; }
.msg-video { max-width: 280px; max-height: 320px; border-radius: 12px; display: block; background: #000; }
.msg-att-open { font-size: 12px; display: inline-block; margin-top: 3px; }
.msg.only-media .bubble { background: transparent !important; border: 0 !important; padding: 0; box-shadow: none; }
.msg-att { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px; min-width: 220px; max-width: 320px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text) !important; text-decoration: none; font-style: normal; }
.msg-att:first-child { margin-top: 0; }
a.msg-att:hover { border-color: #2563eb; }
.msg-att-ico { font-size: 22px; width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); }
.msg-att-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.msg-att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.msg-att-main small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.msg-att-main b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-att-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-att-main audio { width: 220px; height: 32px; margin-top: 4px; }
.msg-att-go { font-size: 12px; font-weight: 700; color: #2563eb; white-space: nowrap; }
.att-ad_click .msg-att-ico { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); }
.msg-unknown { font-size: 13px; color: var(--muted); font-style: italic; }
.msg-event { align-self: center; margin: 10px 0 2px; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 90%; }
.msg-event span { display: inline-block; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 999px; padding: 4px 12px; }
.msg-event a { font-weight: 700; }


.btn-xs { padding: 2px 8px; font-size: 12px; min-height: 0; line-height: 1.5; border-radius: 6px; }
.ident { display: flex; flex-direction: column; gap: 12px; }
.ident-sec { display: flex; flex-direction: column; gap: 6px; }
.ident-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.acc-row, .dup-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.acc-main, .dup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.acc-main .row { min-width: 0; }
.acc-links { display: flex; gap: 4px; }
.phone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.phone-row:last-child { border-bottom: 0; }
.phone-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.phone-src { flex-basis: 100%; font-size: 11.5px; }
.dup-box { padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.dup-main small { color: var(--muted); font-size: 12px; } .dup-why { color: #a16207 !important; font-weight: 600; }
.merge-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.ident-wrap { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--surface); }
.ident-wrap > summary { cursor: pointer; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ident-wrap[open] > summary { margin-bottom: 8px; }
.ident-compact .acc-row, .ident-compact .dup-row { padding: 4px 6px; }
.chip-count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700; }


.care-board { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
@media (min-width: 1100px) { .care-board { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.bd-card { padding: 14px; }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.bd-head h3 { margin: 0; font-size: 16px; }
.bd-row { display: flex; flex-direction: column; gap: 12px; }
.bd-gt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.bd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.bd-tiles-wide { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.bd-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; min-height: 74px; }
.bd-tile:hover { border-color: var(--gold); }
.bd-tile.on { outline: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.bd-n { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bd-l { font-size: 13px; font-weight: 700; }
.bd-sub { font-size: 11px; color: var(--muted); }
.bd-tile.tone-bad .bd-n { color: var(--red); } .bd-tile.tone-warn .bd-n { color: #b45309; }
.bd-tile.tone-info .bd-n { color: #2563eb; } .bd-tile.tone-ok .bd-n { color: #15803d; } .bd-tile.tone-gold .bd-n { color: #a16207; }
.bd-staff { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.bd-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.care-sec-title { margin: 6px 0 2px; font-size: 16px; }
.nr-badge { margin-top: 4px; font-size: 12.5px; font-weight: 700; color: #b45309; }
.nr-badge.hot { color: var(--red); }
.nr-badge small { font-weight: 500; color: var(--muted); }
.text-ok { color: #15803d; }


.f-cogs { background: var(--viz-1); } .f-opex { background: var(--viz-2); }
.vcols-stack .vcol-bar { position: relative; overflow: hidden; background: var(--viz-2); }
.vcols-stack .vcol-cogs { position: absolute; left: 0; right: 0; bottom: 0; background: var(--viz-1); pointer-events: none; }
.vcols-stack .vcol.is-hot .vcol-bar { background: var(--viz-2); filter: brightness(1.12); }
.vcols-stack .vcol.is-sel .vcol-bar { background: var(--viz-2); box-shadow: 0 0 0 2px var(--red); }
.vcols-stack .vcol-bar.is-zero { background: var(--line); }
.fin-legend { font-size: 12.5px; }
.fin-mix { min-width: 0; }
.fin-mix-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.fin-missing { display: block; margin-top: 4px; overflow-wrap: anywhere; }


.img-tile { position: relative; }
.img-tile.picked { outline: 3px solid var(--gold); outline-offset: -3px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.img-cell { position: relative; display: flex; }
.img-cell > .img-tile { flex: 1; min-width: 0; }
.img-del { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--red); font-weight: 800; font-size: 13px; cursor: pointer; display: grid; place-items: center; opacity: .85; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.img-del:hover { opacity: 1; background: var(--red); color: #fff; border-color: var(--red); }
.pick-no { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.attach-strip { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-top: 1px dashed var(--line); }
.attach-strip.on { display: flex; }
.attach-item { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.attach-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; }
.hidden { display: none !important; }

.kb-area { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; min-height: 50vh; }


.btn-chat { gap: 6px; font-weight: 600; border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.btn-chat:hover { background: color-mix(in srgb, var(--blue) 14%, var(--surface)); border-color: var(--blue); }
.btn-chat-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-chat-primary:hover { background: color-mix(in srgb, var(--blue) 85%, #000); color: #fff; }
.btn-chat.is-waiting:not(.btn-chat-primary) { border-color: var(--red); }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.chat-slot:empty { display: none; }
.chat-slot { display: inline-flex; }

.acc-chat { flex-wrap: wrap; border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.acc-chat.is-waiting { border-color: var(--red); background: color-mix(in srgb, var(--red) 5%, var(--surface)); }
.acc-chat .acc-main { min-width: 150px; }
.acc-last { font-size: 13px; color: var(--text); max-width: 100%; }
.acc-wait { color: var(--red); }
.acc-chat .acc-links { align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .acc-chat .acc-links { flex-basis: 100%; }
  .acc-chat .acc-links .btn-chat { flex: 1; min-height: 40px; }
}

.chatpop { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 70; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 32px rgba(0,0,0,.18); outline: none; }
.chatpop[hidden], .chat-bubbles[hidden], .chatpop-thread[hidden], .chatpop-tabs[hidden] { display: none !important; }
.chatpop-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--ink); color: #fff; }
.chatpop-bar .chatpop-name { flex: 1; min-width: 0; font-size: 15px; }
.chatpop-bar .icon-btn { color: #fff; }
.chatpop-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.chatpop-bar .btn:hover { background: rgba(255,255,255,.12); }
.chatpop-bar .chatpop-close { font-weight: 700; border-color: var(--gold); color: var(--gold); }
.chatpop-tabs { display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface-2); scrollbar-width: thin; }
.chatpop-tab { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.chatpop-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.chatpop-tab.on { border-color: var(--pc); box-shadow: inset 0 0 0 1px var(--pc); font-weight: 700; }
.chatpop-tab .chat-badge { height: 18px; font-size: 10.5px; }
.chatpop-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chatpop-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.chatpop .thread-card { height: auto; flex: 1; min-height: 0; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.chatpop .thread-head { padding: 8px 10px; }
.chatpop .panel-toggle { display: inline-flex; }
.chatpop .conv-panel { display: none; }
.chatpop .conv-panel.open { display: block; position: absolute; inset: 0; width: auto; z-index: 5; border-radius: 0; }
.chatpop .conv-panel .panel-close { display: inline-grid; z-index: 1; }
.chatpop .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) {
  .chatpop { width: 100vw; border-left: 0; box-shadow: none; }
  html.chatpop-on, html.chatpop-on body { overflow: hidden; }
  .chatpop .chatpop-full { display: none; }
  .chatpop .thread-head .row.gap.wrap { gap: 4px; }
  .chatpop .collab { margin-top: 4px; padding: 6px 10px; }
  .chatpop .collab small { display: none; } 
}
@supports (height: 100dvh) { .chatpop { height: 100dvh; bottom: auto; } }

.chat-bubbles { position: fixed; right: 14px; bottom: calc(var(--bottom-h) + 84px + env(safe-area-inset-bottom)); z-index: 65; display: flex; flex-direction: column-reverse; gap: 10px; align-items: flex-end; }
.chat-bubble { position: relative; }
.chat-bubble-open { position: relative; display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; cursor: pointer; flex-direction: row-reverse; }
.chat-bubble-open .avatar { box-shadow: 0 4px 14px rgba(0,0,0,.28); border: 2px solid var(--surface); }
.chat-bubble.has-new .chat-bubble-open .avatar { border-color: var(--red); animation: chatpulse 1.6s ease-in-out infinite; }
@keyframes chatpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 25%, transparent); } }
.chat-bubble-open .chat-badge { position: absolute; top: -4px; right: -4px; }
.chat-bubble-draft { position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #111; font-size: 11px; display: grid; place-items: center; }
.chat-bubble-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transform: translateX(6px); transition: opacity .15s, transform .15s; pointer-events: none; }
.chat-bubble-open:hover .chat-bubble-name, .chat-bubble-open:focus-visible .chat-bubble-name { opacity: 1; transform: none; }
.chat-bubble-x { position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 11px; cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .15s; }
.chat-bubble:hover .chat-bubble-x, .chat-bubble:focus-within .chat-bubble-x { opacity: 1; }
@media (hover: none) { .chat-bubble-x { opacity: 1; } }

.kpis-main .kpi { padding: 14px 16px; }
.kpis-main .kpi-value { font-size: 26px; }
.kpis-sub { gap: 8px; }
.kpis-sub .kpi { padding: 9px 12px; box-shadow: none; }
.kpis-sub .kpi-value { font-size: 18px; }
.kpis-sub .kpi-title { font-size: 11px; }
@media (min-width: 720px) { .kpis-sub { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.chart-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 2px 0 10px; font-size: 13px; }
.chart-sum .cs-big { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-ok { margin: 4px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }


.page-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--muted)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pc, var(--muted)) 22%, transparent); }
.conv-top { justify-content: flex-start; }
.conv-top b.ellipsis { flex: 1; min-width: 0; }
.conv-top .nowrap { white-space: nowrap; flex: none; }
.page-chip .pname { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-mini { flex: none; font-size: 10.5px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 6px; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.who-mini.who-gold { color: var(--gold-strong, #8a6d00); background: color-mix(in srgb, var(--gold) 14%, transparent); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.who-mini.who-info { color: #2563eb; background: color-mix(in srgb, #2563eb 10%, transparent); border-color: color-mix(in srgb, #2563eb 30%, transparent); }
.who-mini.who-warn { color: #b45309; background: color-mix(in srgb, #f59e0b 14%, transparent); border-color: color-mix(in srgb, #f59e0b 40%, transparent); }
.who-mini.who-bad { color: #fff; background: var(--red, #dc2626); border-color: var(--red, #dc2626); }
.conv-bottom { gap: 4px; }
.ad-box { padding: 8px 10px; border-radius: 8px; border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); display: flex; flex-direction: column; gap: 2px; }
.suggest-row { align-items: center; justify-content: space-between; margin-bottom: 8px; }
.adp-row { display: grid; grid-template-columns: 1fr minmax(160px, 260px); gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.adp-row .adp-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .adp-row { grid-template-columns: 1fr; }
  .page-chip .pname { max-width: 80px; }
}


.close-badge { flex: none; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 999px; background: var(--green); color: #fff; white-space: nowrap; }
.close-badge.done { background: var(--green-soft); color: var(--green); font-weight: 600; }
.closed-chip-row { margin: 6px 0 2px; }
.closed-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.closed-chip.has { border-color: var(--green); color: var(--green); }
.closed-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.closed-chip .chip-count { background: var(--green); color: #fff; }
.closed-chip.on .chip-count { background: #fff; color: var(--green); }
.close-banner { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--green-soft); border: 1px solid var(--green); color: var(--text); }
.close-banner.done { border-color: var(--line); background: var(--surface-2); }
.close-banner .cb-ico { font-size: 20px; flex: none; }
.close-banner .cb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.close-banner .cb-text small { color: var(--muted); }
.close-banner .btn { flex: none; }
@media (max-width: 480px) {
  
  .close-banner { padding: 6px 8px; gap: 8px; }
  .close-banner .cb-ico { font-size: 16px; }
  .close-banner .cb-text b { font-size: 13px; line-height: 1.3; }
  .close-banner .cb-text small { display: none; }
}


.prefill-banner, .prefill-exist { margin-bottom: 12px; }
.prefill-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.prefill-list li { overflow-wrap: anywhere; }


.confirm-sheet { display: flex; flex-direction: column; gap: 12px; }
.confirm-sheet .cs-sec h4 { margin: 0 0 8px; font-size: 14px; }
.confirm-sheet .input.invalid { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.confirm-sheet .issue-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.confirm-sheet .cs-items { margin: 0; padding-left: 0; list-style: none; font-size: 14px; }
.confirm-sheet .cs-items li { padding: 2px 0; overflow-wrap: anywhere; }
.send-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.send-kv dt { color: var(--muted); }
.send-kv dd { margin: 0; overflow-wrap: anywhere; }
.cs-foot { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cs-foot .row { justify-content: flex-end; }
.cs-foot .push-why { text-align: right; }
.vn-check .notice { margin: 0; }
.text-warn { color: var(--gold-strong); }
.wrap-any { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
@media (max-width: 639px) {
  .modal.modal-sheet { max-height: 100%; height: 100%; border-radius: 0; }   
  .overlay:has(.modal-sheet) { padding: 0; }
  .cs-foot .row { flex-direction: column-reverse; align-items: stretch; }
  .cs-foot .row .btn { width: 100%; justify-content: center; }
  .cs-foot .push-why { text-align: left; }
  .send-kv { grid-template-columns: 1fr; gap: 0 0; }
  .send-kv dd { margin-bottom: 6px; }
}
.push-result { border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--line); margin: 6px 0; }
.push-result.ok { background: var(--green-soft); border-color: var(--green); }
.push-result.bad { background: var(--red-soft); border-color: var(--red); }
.push-result .pr-title { font-weight: 700; overflow-wrap: anywhere; }
.push-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.push-pill.ok { background: var(--green-soft); color: var(--green); }
.push-pill.bad { background: var(--red-soft); color: var(--red); }
.push-pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }


.order-form .input.invalid { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.addr-hint { display: block; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.addr-hint:empty { display: none; }
.addr-hint.ok { color: var(--green); }
.addr-hint.bad { color: var(--red); }
.order-vn-check { margin-top: 10px; }
.order-vn-check .notice { margin: 0; }
.order-vn-check .issue-list { margin: 4px 0 0; padding-left: 18px; }
.ship-opts { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.ship-opts > summary { cursor: pointer; list-style-position: inside; overflow-wrap: anywhere; }
.send-why { margin-top: 6px; font-size: 12px; overflow-wrap: anywhere; }
.send-why:empty { display: none; }
.send-row { align-items: center; }
@media (max-width: 480px) {
  .send-row .btn-primary { flex: 1 1 100%; }
  .ship-opts .form-grid { grid-template-columns: 1fr; }
}


.tone-good { color: var(--green); }
.kpi-x { gap: 3px; }
.kpi-x .kpi-value.tone-bad { color: var(--red); }
.kbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); margin: 8px 0 4px; gap: 2px; }
.kbar > i { display: block; height: 100%; min-width: 3px; }
.kbar > i:first-child { border-radius: 5px 0 0 5px; } .kbar > i:last-child { border-radius: 0 5px 5px 0; }
.kleg { display: grid; gap: 3px; font-size: 12.5px; }
.kleg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 8px; align-items: baseline; }
.kleg-name { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kleg-name .dot { width: 8px; height: 8px; flex: none; }
.kleg-row b { font-variant-numeric: tabular-nums; font-weight: 650; }
.kleg-row small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-foot2 { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
@media (min-width: 720px) and (max-width: 1180px) { .kpis-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.dc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; width: 100%; }
.dc-headline { margin: 2px 0 10px; font-size: 14.5px; line-height: 1.5; }
.dc-headline b { font-variant-numeric: tabular-nums; }
.dc-plot { width: 100%; min-height: 200px; }
.dc-svg { display: block; overflow: visible; }
.dc-grid { stroke: var(--line); }
.dc-base { stroke: var(--muted); stroke-opacity: .55; }
.dc-tick, .dc-x { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dc-bar { transition: opacity .12s; }
.dc-rev { fill: var(--gold); } .dc-ord { fill: var(--blue); } .dc-pos { fill: var(--green); } .dc-neg { fill: var(--red); }
.dc-hit { fill: transparent; cursor: pointer; }
.dc-col:focus { outline: none; }
.dc-col:hover .dc-bar, .dc-col:focus .dc-bar { opacity: .8; }
.dc-col.is-sel .dc-bar { stroke: var(--text); stroke-width: 1.5; }
.dc-avg { stroke: var(--text); stroke-opacity: .55; stroke-dasharray: 5 4; stroke-width: 1.25; pointer-events: none; }
.dc-avg-lbl { font-size: 11px; font-weight: 650; fill: var(--text); fill-opacity: .7; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.dc-best, .dc-worst { font-size: 11.5px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; font-variant-numeric: tabular-nums; }
.dc-worst { fill: var(--red); }
.dc-area { fill: var(--gold); fill-opacity: .14; }
.dc-line-cur { fill: none; stroke: var(--gold-strong); stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; }
.dc-line-prev { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; stroke-linejoin: round; }
.dc-dot-cur { fill: var(--gold-strong); stroke: var(--surface); stroke-width: 2; }
.dc-dot-prev { fill: var(--muted); stroke: var(--surface); stroke-width: 2; }
.dc-lbl-cur, .dc-lbl-prev { font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; font-variant-numeric: tabular-nums; }
.dc-lbl-cur { fill: var(--text); } .dc-lbl-prev { fill: var(--muted); }
.dc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; }
.dc-legend .dot { width: 9px; height: 9px; border-radius: 2px; }
.dc-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 2px; }
.dc-key-avg { border-top: 1.5px dashed var(--text); opacity: .6; }
.dc-key-cur { border-top: 3px solid var(--gold-strong); }
.dc-key-prev { border-top: 2px dashed var(--muted); }


.dc-c-cogs { fill: var(--gray); background: var(--gray); }
.dc-c-ship { fill: var(--blue); background: var(--blue); }
.dc-c-ads { fill: var(--purple); background: var(--purple); }
.dc-c-other { fill: var(--gold); background: var(--gold); }
.dc-c-profit { fill: var(--green); background: var(--green); }
.dc-c-loss { fill: var(--red); background: var(--red); }


.kpis-single { gap: 8px; }
.kpis-single .kpi { padding: 10px 12px; box-shadow: none; gap: 1px; }
.kpis-single .kpi-title { font-size: 12px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.kpis-single .kpi-value { font-size: 20px; }
.kpis-single .kpi-value.tone-bad { color: var(--red); }
.kpis-single .kpi-sub { font-size: 11.5px; overflow-wrap: anywhere; }
.kpis-single .kpi-delta { font-size: 11px; min-height: 16px; }
.kpis-single .kpi-delta > span:last-child:not(.delta) { overflow-wrap: anywhere; }
.kpi-info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; line-height: 1; color: var(--muted); cursor: help; flex: none; }
.kpi-info:hover, .kpi-info:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }
@media (max-width: 420px) { .kpis-single .kpi { padding: 8px 10px; } .kpis-single .kpi-value { font-size: 17px; } }

.closer-row { margin-top: 8px; }
.closer-row .field { margin: 0; }


.tot-gifts { display: grid; gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 4px 0; }
.tot-gifts-title { font-size: 13px; font-weight: 600; }
.tot-gifts .gift-slots { display: grid; gap: 6px; }
.tot-gifts .gift-slot { display: grid; gap: 2px; }
.tot-gifts select { width: 100%; }


.fb-quick { margin-top: 8px; }
.fb-item { transition: opacity .18s, transform .18s; }
.fb-item.fb-gone { opacity: 0; transform: translateX(12px); }


@media (min-width: 721px) { .thread-more-btn { display: none; } .thread-secondary { display: flex; } }
@media (max-width: 720px) {
  .thread-head { padding: 6px 8px; gap: 6px; }
  .thread-head .avatar { width: 30px !important; height: 30px !important; min-width: 30px !important; font-size: 13px; }
  .thread-head .back { width: 30px; height: 30px; }
  .thread-title { min-width: 0; }
  .thread-title b { font-size: 15px; }
  .thread-title small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .thread-primary .btn { min-height: 32px; padding: 3px 10px; font-size: 13px; }
  .thread-secondary { display: none; flex-basis: 100%; gap: 6px; }
  .thread-head.more-open .thread-secondary { display: flex; }
  .thread-secondary .btn { min-height: 32px; padding: 3px 10px; font-size: 13px; }
  .collab { margin-top: 2px; padding: 4px 8px; gap: 8px; border-radius: 8px; }
  .collab small { display: none; }
  .collab b { font-size: 12.5px; }
  .collab-ico { font-size: 14px; width: 16px; }
  .collab .btn { min-height: 28px; padding: 2px 10px; font-size: 12.5px; }
  .msgs { padding: 8px 10px; }
  .composer { padding: 6px 8px; gap: 6px; }
  .composer-tools { flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .composer-tools::-webkit-scrollbar { display: none; }
  .composer-tools .btn { min-height: 30px; padding: 2px 10px; font-size: 12.5px; white-space: nowrap; flex: none; }
  .composer-row { gap: 6px; }
  
  .composer-row textarea, .composer textarea { min-height: 40px; max-height: 120px; padding: 8px 10px; font-size: 16px; line-height: 1.35; min-width: 0; }
  .composer-row .btn { min-height: 40px; padding: 0 14px; }
  .thread-card > .hint { display: none; }
}


@media (max-width: 720px) {
  .thread-card { max-width: 100%; min-width: 0; overflow: hidden; }
  .composer, .composer-row, .composer-tools { min-width: 0; max-width: 100%; }
  .composer-row .btn { flex: none; }
  .msgs { overflow-x: hidden; }
  .msgs .msg-img, .msg-media .msg-img { max-width: min(260px, 100%); height: auto; }
  body:has(.thread-card .composer) .fab { display: none; }
  body:has(.composer textarea:focus) .bottom-nav { display: none; }
  input.input, select.input, textarea.input { font-size: 16px; }
}


@media (max-width: 720px) {
  .thread-card.kb-open { min-height: 0; margin-bottom: 0; }
  .thread-card.kb-open .collab { display: none; }
}


@media (max-width: 720px) {
  .thread-card.kb-open { position: fixed; z-index: 150; margin: 0; max-width: none; min-height: 0; border-radius: 0; border: 0; box-shadow: none; }
  .thread-card.kb-open .collab, .thread-card.kb-open > .hint { display: none; }
  .thread-card.kb-open .composer { padding-bottom: 6px; }
  html.chat-typing, html.chat-typing body { overflow: hidden; overscroll-behavior: none; }
  html.chat-typing .bottom-nav, html.chat-typing .fab { display: none; }
}

.dc-head > .dc-modes { min-width: 0; max-width: 100%; }

.badge-wrap .badge { white-space: normal; display: inline; line-height: 1.7; }

.ls-sum { line-height: 1.6; }
.ls-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; overflow-x: hidden; }
.ls-item { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ls-item.ls-pending { border-color: var(--warn, #d97706); }
.ls-item.ls-off { opacity: .6; }
.ls-sit { font-weight: 600; overflow-wrap: anywhere; }
.ls-ans { white-space: pre-wrap; overflow-wrap: anywhere; }
.ls-actions { margin-top: 4px; }


.collab { padding: 6px 10px; gap: 8px; }
.collab > .collab-t { flex-direction: row; align-items: center; gap: 6px; }
.collab > .collab-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collab .xp-i { flex-shrink: 0; }

.bn-link .bn-badge:not(.hidden) ~ .nav-dot { display: none; }
