/* ---- tokens --------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f7f8fa; --ink: #161a22; --ink-2: #3f4757; --muted: #687083; --line: #e4e7ec; --line-strong: #cfd4dc;
  --accent: #256abf; --accent-solid: #256abf; --accent-hover: #1c5cab; --accent-soft: #e8f1fc;
  --ok: #0a7a3e; --ok-soft: #e6f5ec; --warn: #8a5200; --warn-soft: #fff4dc; --bad: #b42318; --bad-soft: #fdecea;
  --dot-ok: #0ca30c; --dot-warn: #e09b00; --dot-bad: #d03b3b; --dot-off: #a4abb8;
  /* chart series: validated pair (blue, orange) for this surface */
  --series-1: #2a78d6; --series-2: #eb6834; --grid: #e9ebef; --axis: #c9ced6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06); --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 12px; --radius-sm: 8px;
  --c-gmail: #d0342c; --c-whatsapp: #128c4a; --c-telegram: #1b86d1; --c-linkedin: #0a66c2; --c-phone: #6a4fd3; --c-drive: #a8730f;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1115; --surface: #171a21; --surface-2: #1d2129; --ink: #eceef2; --ink-2: #c5cad4; --muted: #99a1b1; --line: #2a2f3a; --line-strong: #3b4252;
    --accent: #7db3f2; --accent-solid: #256abf; --accent-hover: #2f78d2; --accent-soft: #17283d;
    --ok: #6fd39a; --ok-soft: #14301f; --warn: #f0b95a; --warn-soft: #382b10; --bad: #ff9088; --bad-soft: #3b1b19;
    --dot-ok: #0ca30c; --dot-warn: #fab219; --dot-bad: #e5534b; --dot-off: #5b6373;
    --series-1: #3987e5; --series-2: #d95926; --grid: #262b35; --axis: #3b4252;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
    --c-gmail: #ff8a80; --c-whatsapp: #5fd38d; --c-telegram: #6cbcf5; --c-linkedin: #74b3ef; --c-phone: #b3a3f5; --c-drive: #e6b85c;
  }
}

/* ---- base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15.5px; margin: 0; font-weight: 600; }
h3 { font-size: 13.5px; margin: 0 0 6px; font-weight: 600; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; color: var(--ink); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; } .grow { flex: 1 1 0; min-width: 0; } .wide { width: 100%; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.capitalize { display: inline-block; } .capitalize::first-letter { text-transform: uppercase; }
.icon { width: 18px; height: 18px; flex: none; }
.flip { transform: rotate(180deg); }
ul.tight { margin: 4px 0 0; padding-left: 18px; } ul.tight li { margin: 3px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
time { white-space: nowrap; }

/* ---- shell ---------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-solid); color: #fff; font-weight: 700; }
.brand-mark.big { width: 44px; height: 44px; border-radius: 13px; font-size: 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); border: 0; background: none; font: inherit; font-weight: 500; cursor: pointer; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-label { flex: 1; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-solid); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.badge.warn { background: var(--dot-warn); color: #201400; }
.badge:empty { display: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sandbox-chip { align-self: flex-start; margin-left: 8px; padding: 2px 10px; border-radius: 20px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.main { min-width: 0; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 7px 20px; font-size: 13px; font-weight: 500; text-align: center; border-bottom: 1px solid var(--line); }
#view { max-width: 1180px; margin: 0 auto; padding: 26px 28px 60px; outline: none; }
#view > * + * { margin-top: 16px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-sub { color: var(--muted); margin: 4px 0 0; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; }

/* ---- cards & layout ------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.card-hint { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.wide-left { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols.menu-left { grid-template-columns: 270px minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.subsection { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.skeleton .sk-line { height: 12px; border-radius: 6px; background: var(--line); margin: 10px 0; animation: pulse 1.2s ease-in-out infinite; }
.sk-0 { width: 38%; } .sk-1 { width: 82%; } .sk-2 { width: 64%; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton .sk-line { animation: none; } }

/* ---- controls ------------------------------------------------------------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; max-width: 100%; min-height: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type=checkbox] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent-solid); margin: 0; flex: none; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger-solid { background: #c5352b; border-color: #c5352b; color: #fff; }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .icon { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-row > .field { flex: 1 1 180px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form select { flex: none; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { width: 100%; padding-left: 34px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--line); border-radius: 10px; }
.seg { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-n { background: var(--line); border-radius: 9px; padding: 0 6px; font-size: 12px; }
.seg.on .seg-n { background: var(--accent-soft); color: var(--accent); }

/* ---- small pieces --------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill .icon { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.count { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.status.big { font-size: 14px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); flex: none; }
.status.ok .dot { background: var(--dot-ok); } .status.warn .dot { background: var(--dot-warn); } .status.bad .dot { background: var(--dot-bad); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 600; font-size: 14px; flex: none; color: var(--av); background: color-mix(in srgb, var(--av) 16%, var(--surface)); }
.avatar.lg { width: 60px; height: 60px; font-size: 21px; }
.av-0 { --av: var(--c-linkedin); } .av-1 { --av: var(--c-whatsapp); } .av-2 { --av: var(--c-phone); } .av-3 { --av: var(--c-drive); } .av-4 { --av: var(--c-gmail); } .av-5 { --av: var(--c-telegram); }
.ch { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 13%, var(--surface)); }
.ch .icon { width: 17px; height: 17px; }
.ch.sm { width: 26px; height: 26px; border-radius: 8px; } .ch.sm .icon { width: 14px; height: 14px; }
.ch.lg { width: 46px; height: 46px; border-radius: 13px; } .ch.lg .icon { width: 22px; height: 22px; }
.ch-gmail { --c: var(--c-gmail); } .ch-whatsapp { --c: var(--c-whatsapp); } .ch-telegram { --c: var(--c-telegram); }
.ch-linkedin { --c: var(--c-linkedin); } .ch-phone { --c: var(--c-phone); } .ch-drive { --c: var(--c-drive); }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.callout > .icon { margin-top: 2px; color: var(--muted); }
.callout.warn { background: var(--warn-soft); border-color: transparent; } .callout.warn > .icon { color: var(--warn); }
.callout.bad { background: var(--bad-soft); border-color: transparent; } .callout.bad > .icon { color: var(--bad); }
.callout.info { background: var(--accent-soft); border-color: transparent; } .callout.info > .icon { color: var(--accent); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 16px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--muted); margin-bottom: 4px; }
.empty-icon .icon { width: 22px; height: 22px; }
.empty-title { font-weight: 600; } .empty-text { color: var(--muted); max-width: 46ch; font-size: 13.5px; } .empty .btn { margin-top: 8px; }
.rows > * + *, .rows + .inline-form { margin-top: 0; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.rows > .row-item:first-child, .row-item.plain { border-top: 0; }
.row-item.plain { padding: 0; }
.row-main { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.row-sub { font-size: 12.5px; color: var(--muted); }
.facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.compact { gap: 4px 14px; margin: 12px 0; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 13.5px; }
details.drafts { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---- dashboard ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); transition: border-color .12s, transform .12s; }
.stat:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.stat-icon { color: var(--muted); display: grid; } .stat-icon .icon { width: 16px; height: 16px; }
.stat-value { font-size: 30px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.stat-note { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.stat-note .icon { width: 13px; height: 13px; }
.stat-note.ok { color: var(--ok); } .stat-note.warn { color: var(--warn); } .stat-note.bad { color: var(--bad); }
.attn { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.card-head + .attn, .card-head + .feed-item, .card-head + .chan-row { border-top: 0; padding-top: 2px; }
.attn-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--surface-2); color: var(--muted); }
.attn-icon.warn { background: var(--warn-soft); color: var(--warn); } .attn-icon.bad { background: var(--bad-soft); color: var(--bad); } .attn-icon.info { background: var(--accent-soft); color: var(--accent); }
.attn-main { flex: 1 1 0; min-width: 0; color: var(--ink); } .attn-main:hover { text-decoration: none; }
.attn-main:hover .attn-title { color: var(--accent); }
.attn-title { font-weight: 600; } .attn-sub { font-size: 13px; color: var(--muted); }
.attn-go { color: var(--muted); display: grid; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.feed-main { flex: 1 1 0; min-width: 0; }
.feed-excerpt { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; color: var(--muted); flex: none; }
.chan-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); }
.chan-row:hover { text-decoration: none; } .chan-row:hover .chan-name { color: var(--accent); }
.chan-name { flex: 1; font-weight: 500; }
.chan-menu .chan-row { padding: 11px 14px; }
.chan-menu .chan-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chan-menu .status { font-size: 12.5px; color: var(--muted); }
.chan-menu .chan-row:first-child { border-top: 0; }
.chan-menu .chan-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-solid); }
.onboard .steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-solid); color: #fff; font-weight: 600; font-size: 13px; }
.steps li.done::before { content: "✓"; background: var(--dot-ok); }
.steps li span { color: var(--muted); font-size: 13.5px; }

/* chart */
.viz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.s1 { background: var(--series-1); } .swatch.s2 { background: var(--series-2); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar.s1 { fill: var(--series-1); } .chart .bar.s2 { fill: var(--series-2); }
.chart .grid { stroke: var(--grid); stroke-width: 1; } .chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-lg); }
.tip-title { font-weight: 600; margin-bottom: 2px; }

/* ---- contacts ------------------------------------------------------------- */
.person { display: grid; grid-template-columns: 38px minmax(180px, 1.5fr) 132px minmax(0, 1.2fr) 170px 18px; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.person:first-child { border-top: 0; }
.person:hover { background: var(--surface-2); text-decoration: none; }
.person-name { font-weight: 600; } .person-sub { font-size: 13px; color: var(--muted); }
.person-channels, .person-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.person-last { font-size: 13px; color: var(--muted); text-align: right; }
.person-go { color: var(--line-strong); }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hero-main { flex: 1 1 240px; min-width: 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* compose */
.channel-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-tab { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.channel-tab:hover { border-color: var(--muted); }
.channel-tab.on { border-color: var(--accent-solid); background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent-solid); }
.channel-tab.dim:not(.on) { opacity: .6; }
.compose { display: flex; flex-direction: column; gap: 12px; }
.compose .card-head { margin-bottom: 0; }
.compose-hint { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.compose-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.compose-foot .muted { display: inline-flex; align-items: center; gap: 6px; } .compose-foot .muted .icon { width: 15px; height: 15px; }
.attach { display: flex; flex-direction: column; gap: 6px; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-day { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.tl-day::before, .tl-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tl { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; }
.tl.outbound { align-self: flex-end; flex-direction: row-reverse; }
.tl.system { align-self: center; max-width: 100%; width: 100%; }
.bubble { flex: 1 1 auto; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 13px; display: flex; flex-direction: column; gap: 6px; }
.tl.outbound .bubble { background: var(--accent-soft); border-color: transparent; border-radius: 14px 4px 14px 14px; }
.tl.system .bubble { background: none; border-style: dashed; border-radius: 12px; }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.tl-time { margin-left: auto; }
.tl-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl .btn-row { margin-top: 2px; }

/* tasks */
.task { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.card-head + .task, .card-hint + .task { border-top: 0; }
.task.closed .task-title { color: var(--muted); text-decoration: line-through; }
.task-title { font-weight: 500; }
.tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; cursor: pointer; flex: none; padding: 0; }
.tick .icon { width: 13px; height: 13px; }
.tick:hover { border-color: var(--dot-ok); color: var(--dot-ok); }
.tick.static { cursor: default; color: var(--muted); border-color: var(--line); }
.tick.static.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* review queue, outbox, integrations */
.review-card { display: flex; flex-direction: column; gap: 12px; }
.quote { border-left: 3px solid var(--line-strong); padding: 4px 12px; color: var(--ink-2); font-size: 13.5px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.out-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--line); }
.out-item:first-child { border-top: 0; }
.out-item .callout { margin-top: 8px; }
.out-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.int-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.cap { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; }
.cap h3 { display: flex; align-items: center; gap: 7px; } .cap h3 .icon { width: 15px; height: 15px; color: var(--muted); }
.cap h3:not(:first-child) { margin-top: 12px; }
.cap p { margin: 0 0 4px; }
.perm-list { display: flex; flex-direction: column; gap: 8px; }

/* ---- dialogs -------------------------------------------------------------- */
dialog { width: min(680px, 94vw); max-height: 92vh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 0; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 14, 22, .5); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* Keep the decision buttons in view however long the dialog is. */
#dialog .dialog-actions { position: sticky; bottom: 0; margin: 4px -20px -20px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); }
dialog.ask { width: min(440px, 92vw); }
.ask-form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.ask-form h2 { font-size: 17px; }
.review-to { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.review-addr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.review-mode { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.review-msg { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 14px; }
.review-subject { font-weight: 600; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.review-block h3 { margin-bottom: 2px; }
.manual { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: min(560px, 92vw); box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.error { background: #b42318; color: #fff; }

/* ---- small screens -------------------------------------------------------- */
@media (max-width: 980px) {
  .cols, .cols.wide-left, .cols.menu-left { grid-template-columns: minmax(0, 1fr); }
  .person { grid-template-columns: 38px minmax(0, 1fr) 18px; }
  .person-channels, .person-tags, .person-last { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0 6px 0 2px; } .brand-name, .sandbox-chip { display: none; }
  .nav { flex-direction: row; } .nav-item { width: auto; padding: 8px; } .nav-label { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; }
  #view { padding: 16px 14px 48px; }
  .tl { max-width: 100%; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .facts dd { margin-bottom: 8px; }
}
