/* CRM — refined, calm, premium. One accent (indigo), one detail (muted gold). 8px grid. */
:root {
  --sidebar: #14213d;
  --sidebar-2: #101a31;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-active: rgba(255, 255, 255, .11);
  --sidebar-text: #dfe4f0;
  --sidebar-muted: #8c97b2;
  --accent: #34419b;
  --accent-dark: #28347f;
  --accent-soft: #eef0fa;
  --gold: #b8923a;
  --gold-soft: #f6efdc;
  --ink: #171a24;
  --ink-2: #3a3f4f;
  --muted: #6b7080;
  --faint: #9aa0af;
  --line: #ececec;
  --line-2: #e2e2e0;
  --bg: #f7f7f5;
  --card: #fff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 40, .04), 0 4px 16px rgba(20, 26, 40, .04);
  --shadow-lift: 0 2px 4px rgba(20, 26, 40, .05), 0 12px 28px rgba(20, 26, 40, .08);
  --danger: #b42318;
  --ok: #1f7a4d;
  --warn: #a8610b;
  --side: 248px;
  --top: 64px;
  --t: 150ms ease;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; transition: background var(--t), border-color var(--t), box-shadow var(--t), color var(--t), transform var(--t); }
svg { max-width: 100%; }
::selection { background: #dfe3f7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side); background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 16px; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(145deg, #3d4cae, #2a3585); display: grid; place-items: center; font-weight: 700; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 0 0 1px rgba(184,146,58,.55); letter-spacing: -.02em; }
.brand strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.brand span { color: var(--sidebar-muted); font-size: 12px; }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1; }
.nav button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--sidebar-text); border-radius: 10px; padding: 9px 12px; font-weight: 500; opacity: .86;
}
.nav button svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav button:hover { background: var(--sidebar-hover); opacity: 1; }
.nav button.active { background: var(--sidebar-active); color: #fff; opacity: 1; font-weight: 600; }
.nav button.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav button.active svg { opacity: 1; color: #e7c777; }
.nav .group { margin: 20px 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--sidebar-muted); }
.side-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.side-foot button { width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.14); color: var(--sidebar-text); border-radius: 10px; padding: 8px; font-weight: 500; }
.side-foot button:hover { background: var(--sidebar-hover); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top); background: rgba(247, 247, 245, .86); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 20;
}
.search { flex: 1; max-width: 480px; position: relative; }
.search input { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 40px; transition: border-color var(--t), box-shadow var(--t); }
.search input:focus { outline: 0; border-color: #c5cae8; box-shadow: 0 0 0 4px rgba(52, 65, 155, .08); }
.search svg { position: absolute; left: 14px; top: 12px; width: 16px; height: 16px; color: var(--faint); }
.search-pop { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); max-height: 320px; overflow: auto; z-index: 30; padding: 6px; }
.search-pop button { display: block; width: 100%; text-align: left; background: #fff; border: 0; padding: 10px 12px; border-radius: 8px; }
.search-pop button:hover { background: var(--accent-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.content { padding: 32px 32px 64px; max-width: 1480px; width: 100%; }

/* ---------- type ---------- */
h1 { font-size: 24px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.025em; line-height: 1.2; }
h2 { letter-spacing: -.02em; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 72ch; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.meta, small { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .sub { margin: 4px 0 0; }

/* ---------- buttons ---------- */
.icon-btn, .btn, .btn-primary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  border-radius: 10px; border: 1px solid var(--line-2); background: #fff; padding: 8px 16px; font-weight: 550; line-height: 20px; color: var(--ink-2);
}
.btn:hover, .btn-ghost:hover, .icon-btn:hover { background: #fafaf8; border-color: #d6d6d2; }
.btn:active, .btn-primary:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(40, 52, 127, .25); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { background: rgba(20, 26, 40, .04); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f1d1ce; background: #fff; }
.btn-danger:hover { background: #fdf3f2; border-color: #e8b9b5; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 8px; }
.icon-btn { padding: 8px; }
button svg, .btn-primary svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.menu-btn { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: #efefec; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 550; color: var(--muted); font-size: 13px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,40,.1); }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); min-width: 200px; z-index: 25; padding: 6px; }
.menu-pop button { display: block; width: 100%; text-align: left; background: #fff; border: 0; padding: 8px 12px; border-radius: 8px; }
.menu-pop button:hover { background: var(--accent-soft); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card > h3:first-child { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; transition: box-shadow var(--t), transform var(--t); overflow: hidden; }
.kpi:hover { box-shadow: var(--shadow-lift); }
.kpi > span { color: var(--muted); font-size: 12px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi b { display: block; font-size: 28px; font-weight: 650; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; color: var(--muted); font-size: 12px; }
.kpi em.up { color: var(--ok); font-weight: 600; }
.kpi em.down { color: var(--danger); font-weight: 600; }
.kpi .spark { margin-top: 8px; height: 32px; width: 100%; display: block; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex-shrink: 0; }
.bar-row { display: grid; grid-template-columns: 168px 1fr 80px; gap: 12px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar-row > span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 8px; background: #f0f0ed; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 400ms ease; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 12px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; padding-top: 0; }

/* ---------- kanban ---------- */
.board { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 24px; margin: 0 -4px; align-items: flex-start; scrollbar-width: thin; }
.col { width: 280px; flex-shrink: 0; background: #efefec; border-radius: var(--radius); padding: 12px; min-height: 200px; transition: background var(--t); }
.col.over { background: #e6e8f6; }
.col header { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; font-size: 13px; font-weight: 600; }
.col header .dot { width: 9px; height: 9px; }
.col header span.sum { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.ocard { background: #fff; border: 1px solid transparent; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(20,26,40,.05), 0 2px 8px rgba(20,26,40,.04); cursor: grab; transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.ocard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); border-color: var(--line); }
.ocard strong { display: block; font-weight: 600; letter-spacing: -.01em; }
.ocard .meta { margin-top: 2px; }
.ocard .row { margin-top: 8px; justify-content: space-between; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- tables ---------- */
.tbl { padding: 8px 8px 8px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--ink); }
td { padding: 12px 16px; border-bottom: 1px solid #f3f3f1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t); }
tbody tr:hover td { background: #faf9f6; }
tr.click, td.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 550; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.ok { background: #e8f5ee; color: var(--ok); }
.pill.warn { background: #fbf1df; color: var(--warn); }
.pill.danger { background: #fbeceb; color: var(--danger); }
.pill.gray { background: #f0f0ed; color: var(--ink-2); }
.pill.gold { background: var(--gold-soft); color: #7a5e1c; }

/* ---------- forms ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select, .field input, .field select, .field textarea, input.plain {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; background: #fff; transition: border-color var(--t), box-shadow var(--t); line-height: 20px;
}
.filters input:focus, .filters select:focus, .field input:focus, .field select:focus, .field textarea:focus, input.plain:focus { outline: 0; border-color: #aeb5e0; box-shadow: 0 0 0 4px rgba(52, 65, 155, .09); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 550; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- panes / contact ---------- */
.panes { display: grid; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.panes > * { min-width: 0; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.tabs button { background: transparent; border: 0; padding: 8px 0 12px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.composer textarea { width: 100%; min-height: 140px; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; line-height: 1.5; resize: vertical; }
.composer textarea:focus { outline: 0; border-color: #aeb5e0; box-shadow: 0 0 0 4px rgba(52, 65, 155, .09); }
.thread { background: #f8f8f6; border: 1px solid #f0f0ed; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; white-space: pre-wrap; }
.avatar { width: 48px; height: 48px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 650; font-size: 16px; }

.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 0; min-height: 560px; padding: 0; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); max-height: 70vh; overflow: auto; }
.inbox-item { padding: 16px; border-bottom: 1px solid #f3f3f1; cursor: pointer; transition: background var(--t); }
.inbox-item.on, .inbox-item:hover { background: #f6f6f3; }
.inbox-item.on { box-shadow: inset 3px 0 0 var(--gold); }
.inbox > div:last-child { padding: 24px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal .dow { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 4px 8px; }
.day { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 104px; padding: 8px; cursor: pointer; transition: border-color var(--t), box-shadow var(--t); }
.day:hover { border-color: #c5cae8; box-shadow: var(--shadow); }
.day strong { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chip { display: block; font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 8px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }

.seq { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.step .dot { width: 10px; height: 10px; margin: 6px auto 0; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.step .line { width: 2px; background: var(--line-2); margin: 4px auto; min-height: 16px; }
.step > div:last-child { padding-bottom: 16px; }

.skel { background: linear-gradient(90deg, #f2f2ef 25%, #e8e8e4 37%, #f2f2ef 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 14px; margin: 8px 0; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty h3 { color: var(--ink); margin: 0 0 4px; }
.empty .ico { width: 40px; height: 40px; border-radius: 99px; background: #f0f0ed; color: var(--faint); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ico svg { width: 20px !important; height: 20px !important; }

.modal-back { position: fixed; inset: 0; background: rgba(20, 26, 40, .4); backdrop-filter: blur(3px); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 24px 64px rgba(20, 26, 40, .25); padding: 24px; max-height: 90vh; overflow: auto; }

#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--sidebar); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lift); max-width: 340px; animation: rise 150ms ease; }
.toast.ok { background: #14452f; }
.toast.err { background: #6b1f17; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.banner { background: var(--gold-soft); border: 1px solid #ecdcae; color: #6b5217; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.banner.err { background: #fbeceb; border-color: #f1d1ce; color: var(--danger); }
.banner.info { background: var(--accent-soft); border-color: #dadff3; color: var(--accent-dark); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.auth-side { background: linear-gradient(160deg, var(--sidebar) 0%, #0e1730 100%); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 36px; letter-spacing: -.035em; margin: 24px 0 16px; line-height: 1.1; font-weight: 650; }
.auth-side p { color: #b8c0d6; max-width: 40ch; }
.auth-side small { color: var(--sidebar-muted); }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; }
details.adv { margin-top: 16px; color: var(--muted); }
details.adv summary { cursor: pointer; font-size: 12px; font-weight: 550; }
details.adv .field { margin-top: 8px; }

/* ---------- KPI ---------- */
.kpi-top { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px 24px; position: relative; overflow: hidden; }
.stat .name { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; color: var(--muted); }
.stat .big { font-size: 32px; font-weight: 650; letter-spacing: -.04em; line-height: 1.15; margin: 4px 0; font-variant-numeric: tabular-nums; }
.stat .foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.stat .up { color: var(--ok); font-weight: 600; } .stat .down { color: var(--danger); font-weight: 600; }
.stat .spark { height: 36px; width: 100%; display: block; margin-top: 8px; }
.meter { height: 6px; background: #f0f0ed; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: 99px; transition: width 400ms ease; }
.funnel-row { display: grid; grid-template-columns: 148px 1fr 56px; gap: 12px; align-items: center; margin: 12px 0; font-size: 13px; }
.funnel-bar { height: 28px; background: #f3f3f0; border-radius: 8px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 8px; min-width: 4px; transition: width 400ms ease; }
.funnel-conv { grid-column: 2 / 4; font-size: 11px; color: var(--faint); margin: -8px 0 0; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: 220px; display: block; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 550; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.chip-btn:hover { border-color: #c5cae8; }
.chip-btn.on { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; align-items: end; }
.pod { text-align: center; padding: 16px; }
.pod.p1 { padding-top: 24px; padding-bottom: 24px; border-color: #ecdcae; background: linear-gradient(180deg, #fffdf6, #fff); }
.pod .medal { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; margin: 0 auto 8px; font-weight: 650; font-size: 13px; background: #f0f0ed; color: var(--ink-2); }
.pod.p1 .medal { background: var(--gold); color: #fff; }
.pod .val { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: #f0f0ed; font-size: 12px; font-weight: 600; margin-right: 12px; }
.rank.r1 { background: var(--gold); color: #fff; }
.you { font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; margin-left: 8px; }
.up-text { color: var(--ok); }
.zero { color: var(--faint); }

/* ---------- scripts / video ---------- */
.script-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.script-sec { padding: 24px; margin-bottom: 16px; }
.script-sec .head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.script-sec .num { width: 28px; height: 28px; border-radius: 99px; background: var(--gold-soft); color: #7a5e1c; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex-shrink: 0; }
.script-sec h3 { margin: 0; flex: 1; font-size: 16px; }
.script-sec p { margin: 0 0 12px; line-height: 1.65; color: var(--ink); font-size: 15px; max-width: 70ch; }
.script-sec p:last-child { margin-bottom: 0; }
.msg { background: #f8f8f6; border: 1px solid #f0f0ed; border-radius: 12px; padding: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.tip-list { margin: 0; padding: 0; list-style: none; }
.tip-list li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.tip-list li:first-child { border-top: 0; }
.tip-list li::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--gold); margin-top: 8px; flex-shrink: 0; }
.sticky-col { position: sticky; top: calc(var(--top) + 16px); }
.ref-item { padding: 20px 24px; margin-bottom: 16px; }
.ref-item h3 { margin-bottom: 4px; }
.ref-item .note { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.ref-item .msg { margin-bottom: 12px; }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .panes, .auth, .script-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .sticky-col { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 30; top: var(--top); height: calc(100vh - var(--top)); transform: translateX(-105%); transition: transform 200ms ease; box-shadow: var(--shadow-lift); }
  .sidebar .brand { display: none; }
  .sidebar.open { transform: none; }
  .topbar { z-index: 40; padding: 0 16px; gap: 8px; }
  .menu-btn { display: inline-flex; }
  .content { padding: 24px 16px 48px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 16px; } .kpi b { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; }
  .top-actions .seg { display: none; }
  .bar-row { grid-template-columns: 112px 1fr 64px; }
  .podium { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 96px 1fr 44px; }
  .card { padding: 16px; }
  .col { width: 260px; }
  .cal { gap: 4px; } .day { min-height: 64px; padding: 4px; }
  .week { grid-template-columns: 1fr; }
  .tabs { gap: 16px; overflow-x: auto; }
  h1 { font-size: 22px; }
}

/* ---------- floating KPI widget (bubble + panel + pop-out) ---------- */

.form-grid + .sub, .form-grid + p.sub { margin-top: 16px; }
.cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { min-width: 0; overflow: hidden; }
.kpi-top .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.kpi-top .seg button { white-space: nowrap; }
@media (max-width: 860px) { .kpi-top { gap: 8px; } .filters .seg { max-width: 100%; overflow-x: auto; } }

/* ---------- widget v2: always on, draggable, resizable ---------- */
@keyframes blink { 50% { opacity: .35; } }

/* pop-out: big targets */

/* ---------- recorder ---------- */
.rec .field { margin-bottom: 12px; }
.rec-main { width: 100%; margin-top: 12px; height: 48px; }
.rec-clock { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 16px; }
.rec-clock b { font-size: 40px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; font-weight: 650; }
.rec-dot { width: 12px; height: 12px; border-radius: 99px; background: var(--faint); }
.rec-dot.live { background: #d92d20; animation: blink 1.2s infinite; }
.rec-live { background: #f8f8f6; border: 1px solid #f0f0ed; border-radius: 12px; padding: 12px 16px; min-height: 96px; max-height: 180px; overflow: auto; line-height: 1.6; }
.rec-live .interim { color: var(--faint); }
.rec-item { margin-bottom: 16px; padding: 20px 24px; }
.rec-tr { margin-top: 12px; }
.rec-tr summary { cursor: pointer; font-weight: 550; color: var(--ink-2); }
.rec-tr p { background: #f8f8f6; border-radius: 12px; padding: 12px 16px; margin: 8px 0; white-space: pre-wrap; line-height: 1.6; }
mark { background: var(--gold-soft); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- stage timing ---------- */
.cad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cad-tile { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.cad-tile b { font-size: 30px; letter-spacing: -.04em; font-weight: 650; }
.cad-tile small { color: var(--muted); }
.tl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: #f6f6f3; border: 1px solid #efefea; border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.tl-chip b { font-weight: 650; color: var(--ink); margin-left: 2px; }
.tl-arrow { color: var(--faint); }
@media (max-width: 1200px) { .cad { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* pop-out window: fits 360x520, scrolls if shrunk, never overflows the page */

/* ===== Script (IUL sales script): page, floating panel, pop-out view ===== */
.sc-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sc-tools input { width: 170px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.sc-tools input:focus, .sc-q:focus { outline: 2px solid #c9cef0; border-color: var(--accent); }
.sc-fs button { padding: 6px 10px; font-weight: 650; }
.sc-wrap { --sc-fs: 15px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.sc-side { padding: 16px; position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 40px); display: flex; flex-direction: column; gap: 10px; }
.sc-q { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fbfbfa; }
.sc-jump { display: flex; align-items: center; gap: 8px; }
.sc-jump label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sc-jump select, .sp-tools select { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 12px; text-overflow: ellipsis; }
.sc-list { overflow: auto; position: relative; margin: 0 -6px; padding: 0 6px; flex: 1; min-height: 120px; }
.sc-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 6px; }
.sc-item { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.sc-item .n { min-width: 22px; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.sc-item:hover { background: #f4f4f1; }
.sc-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sc-item.on .n { color: var(--accent); }
.sc-none, .sc-empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.sc-main { padding: 24px 28px 20px; font-size: var(--sc-fs); }
.sc-hot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sc-hot b { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.sc-chip { border: 1px solid #f1d0cc; background: #fdf3f1; color: var(--danger); border-radius: 99px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; }
.sc-chip:hover { background: #fbe7e4; }
.sc-chip.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.sc-chip.ret { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-chip.ret:hover { background: var(--accent-dark); }
.sc-chip.warn { margin: 2px 4px 2px 0; }
.sc-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sc-badge { width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.sc-title { font-size: calc(var(--sc-fs) + 9px); font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin: 8px 0 12px; }
.sc-title small { color: var(--faint); font-weight: 500; font-size: .6em; margin-right: 8px; letter-spacing: 0; }
.sc-prog { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.sc-prog i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.sc-blk { margin: 0 0 14px; }
.sc-blk p { margin: 0 0 6px; font-size: var(--sc-fs); line-height: 1.55; color: var(--ink); }
.sc-blk p.q { font-weight: 650; padding-left: 1.4em; text-indent: -1.4em; }
.sc-blk p.q i { font-style: normal; color: var(--accent); margin-right: .55em; }
.sc-h { font-size: calc(var(--sc-fs) - 3px); font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
.sc-li { display: flex; gap: 12px; margin: 0 0 8px; line-height: 1.55; font-size: var(--sc-fs); }
.sc-li b { color: var(--accent); min-width: 1.2em; }
.sc-note { margin: 0 0 14px; padding: 8px 12px; background: var(--gold-soft); color: #6d5313; border-radius: 10px; font-style: italic; font-size: calc(var(--sc-fs) - 2px); line-height: 1.5; }
.sc-inobj { margin: 4px 0 14px; }
.sc-ph { color: var(--accent); font-weight: 650; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.sc-nm { color: var(--ok); font-weight: 650; }
.sc-end { margin: 18px 0 4px; color: var(--ok); font-weight: 650; }
.sc-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.sc-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 8px 14px; font-weight: 550; font-size: calc(var(--sc-fs) - 1px); color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,40,.04); }
.sc-opt i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.sc-opt:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(52,65,155,.14); transform: translateY(-1px); }
.sc-nav { display: flex; gap: 8px; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sc-nav .grow { flex: 1; }
.sc-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.sc-btn:hover:not(:disabled) { background: #f4f4f1; }
.sc-btn:disabled { opacity: .4; cursor: default; }
.sc-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 2px rgba(40,52,127,.25); }
.sc-btn.primary:hover { background: var(--accent-dark); }
@media (max-width: 860px) { .sc-wrap { grid-template-columns: 1fr; } .sc-side { position: static; max-height: 320px; } .sc-main { padding: 18px; } .sc-tools input { width: 130px; } }

/* floating panel */
.sp { position: fixed; z-index: 58; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 4px 8px rgba(20,26,40,.06), 0 24px 56px rgba(20,26,40,.2); overflow: hidden; resize: both; min-width: 300px; min-height: 320px; max-width: 96vw; max-height: 96vh; animation: rise 150ms ease; }
.sp[hidden] { display: none; }
.sp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 18px; cursor: grab; touch-action: none; user-select: none; }
.sp-title { display: flex; align-items: center; gap: 8px; }
.sp-title strong { font-size: 15px; letter-spacing: -.01em; }
.sp-inner, .kw-scriptwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sp-tools { display: flex; gap: 6px; align-items: center; padding: 2px 14px 8px; }
.sp-fs { display: flex; gap: 2px; }
.sp-fs button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.sp-fs button:hover { background: #f4f4f1; }
.sp-card { --sc-fs: 15px; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 16px 0; font-size: var(--sc-fs); border: 0; box-shadow: none; border-radius: 0; background: transparent; }
.sp-card .sc-hot { margin: 0 0 10px; padding-bottom: 10px; }
.sp-card .sc-title { font-size: calc(var(--sc-fs) + 5px); margin: 6px 0 8px; }
.sp-card .sc-prog { margin-bottom: 10px; flex: none; }
.sp-card .sc-body { flex: 1; min-height: 60px; overflow-y: auto; padding-right: 4px; }
.sp-card .sc-choices { flex: none; max-height: 38%; overflow-y: auto; padding-bottom: 6px; border-top: 1px solid var(--line); }
.sp-card .sc-choices:empty { display: none; }
.sp-card .sc-lbl { margin: 8px 0 6px; }
.sp-card .sc-opt { padding: 6px 11px; }
.sp-foot { padding: 6px 14px 12px; flex: none; }
.sp-foot .sc-nav { margin: 0; padding: 0; border: 0; }
@media (max-width: 860px) { .sp { min-width: 260px; } }

/* ===== Library ===== */
.lib-search input { width: 300px; max-width: 100%; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.lib-search input:focus { outline: 2px solid #c9cef0; border-color: var(--accent); }
.lib-up { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1.5px dashed #cfd2e6; background: linear-gradient(180deg, #fafaff, #f5f6fc); border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; transition: border-color var(--t), background var(--t); }
.lib-up.over { border-color: var(--accent); background: #eef0fa; }
.lib-up-in { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.lib-up-in span { color: var(--muted); font-size: 12.5px; }
.lib-up select { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-tab { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 550; font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.lib-tab span { background: #f0f0ec; color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lib-tab:hover { background: #f6f6f3; }
.lib-tab.on { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.lib-tab.on span { background: rgba(255,255,255,.18); color: #fff; }
.lib-list { display: grid; gap: 10px; }
.lib-doc { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); }
.lib-ico { width: 44px; height: 52px; flex: none; border-radius: 10px; background: #fdf1f0; color: #b42318; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.lib-ico svg { width: 20px !important; height: 20px !important; }
.lib-ico b { font-size: 9.5px; letter-spacing: .05em; }
.lib-ico.html { background: #eef6ff; color: #1d5fb0; }
.lib-ico.docx { background: #eef0fa; color: var(--accent); }
.lib-meta { flex: 1; min-width: 0; }
.lib-title { border: 0; background: none; padding: 0; text-align: left; font-weight: 620; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.lib-title:hover { color: var(--accent); }
.lib-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-snip { margin-top: 6px; font-size: 13px; color: var(--ink-2); background: #fbfbf9; border-left: 3px solid var(--gold); padding: 4px 10px; border-radius: 0 8px 8px 0; }
.lib-snip mark, .lib-title mark { background: #fff0b8; border-radius: 3px; }
.lib-act { display: flex; gap: 6px; flex: none; }
.lib-empty { color: var(--muted); padding: 40px 12px; text-align: center; }
.lib-modal { position: fixed; inset: 0; z-index: 90; background: rgba(15,20,35,.55); display: grid; place-items: center; padding: 3vh 3vw; backdrop-filter: blur(2px); }
.lib-modal-card { width: min(1100px, 100%); height: 100%; background: #fff; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.lib-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lib-modal-head div:first-child { display: flex; flex-direction: column; min-width: 0; }
.lib-modal-head strong { font-size: 16px; letter-spacing: -.01em; }
.lib-modal-head span { color: var(--muted); font-size: 12.5px; }
.lib-modal-body { flex: 1; min-height: 0; background: #f2f2ef; display: flex; }
.lib-frame { flex: 1; border: 0; width: 100%; height: 100%; background: #fff; }
.lib-text { flex: 1; overflow: auto; padding: 24px 32px; background: #fff; white-space: pre-wrap; line-height: 1.65; font-size: 14.5px; }
@media (max-width: 860px) { .lib-doc { flex-wrap: wrap; } .lib-act { width: 100%; } .lib-search input { width: 100%; } .lib-modal { padding: 0; } .lib-modal-card { border-radius: 0; } }

/* ---------- Academy ---------- */
.ac-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ac-tab { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 7px 16px; font-weight: 550; font-size: 13px; color: var(--ink-2); }
.ac-tab:hover { background: #f6f6f3; }
.ac-tab.on { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.ac-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 48px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; }
.ac-empty strong { color: var(--ink); font-size: 15px; }
.ac-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; padding: 18px 24px; background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%); }
.ac-hero h3 { margin: 0 0 2px; } .ac-hero .sub { margin: 0; }
.ac-ring { flex: none; } .ac-ring-t { font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ac-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .15s, box-shadow .15s; }
.ac-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,26,40,.1); }
.ac-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ac-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 26px; }
.ac-card h3 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.01em; }
.ac-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ac-meta { font-size: 12.5px; color: var(--muted); padding: 6px 0 4px; }
.ac-card .btn { align-self: flex-start; }
.ac-badge { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; background: var(--gold-soft); color: #8a5a00; border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.ac-course { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.ac-sumbtn { display: none; }
.ac-side { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.ac-back { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 2px 0 12px; }
.ac-side-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ac-side-head strong { display: block; line-height: 1.25; } .ac-side-head span { font-size: 12px; color: var(--muted); }
.ac-mod { padding: 8px 0 4px; }
.ac-mod-t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 4px; }
.ac-it { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 9px; padding: 7px 8px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.ac-it:hover { background: #f4f4f1; } .ac-it.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ac-it > span:not(.ac-chk) { flex: 1; min-width: 0; } .ac-it em { font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ac-it.quiz > span:not(.ac-chk)::before { content: "❓ "; }
.ac-chk { width: 18px; height: 18px; min-width: 18px; flex: none; border-radius: 99px; border: 1.6px solid var(--line-2); display: grid; place-items: center; color: #fff; margin-top: 1px; }
.ac-chk.on { background: var(--ok); border-color: var(--ok); }
.ac-main { padding: 28px 32px; min-width: 0; }
.ac-crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ac-title { margin: 0 0 16px; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.ac-video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0f1220; margin-bottom: 20px; }
.ac-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ac-body { font-size: 15px; line-height: 1.65; max-width: 78ch; color: var(--ink); }
.ac-body h3, .ac-body h4, .ac-body h2 { margin: 22px 0 8px; letter-spacing: -.01em; }
.ac-body h3 { font-size: 16px; } .ac-body h4 { font-size: 14.5px; }
.ac-body p { margin: 0 0 12px; } .ac-body ul, .ac-body ol { margin: 0 0 14px; padding-left: 22px; } .ac-body li { margin: 3px 0; }
.ac-body blockquote { margin: 0 0 14px; padding: 10px 16px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.ac-body blockquote p:last-child { margin-bottom: 0; }
.ac-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ac-body code { background: #f0f0ec; padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.ac-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.ac-pre { background: #14182a; color: #e8eaf6; border-radius: 12px; padding: 16px 18px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: auto; margin: 0 0 14px; white-space: pre; }
.ac-tablewrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ac-table, .ac-team { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
.ac-table th, .ac-team th { text-align: left; background: #f7f7f4; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ac-table td, .ac-team td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.ac-table tr:last-child td, .ac-team tr:last-child td { border-bottom: 0; }
.ac-table td:first-child { font-weight: 600; white-space: nowrap; }
.ac-attach { display: flex; align-items: center; gap: 14px; margin: 22px 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfa; }
.ac-attach strong { display: block; } .ac-attach span { font-size: 12.5px; color: var(--muted); }
.ac-attach-ico { width: 40px; height: 46px; border-radius: 9px; background: #fdf1f0; color: #b42318; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.ac-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.btn[disabled] { opacity: .45; cursor: default; }
.ac-q { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; background: #fff; }
.ac-q.ok { border-color: #bfe3cc; background: #f7fcf9; } .ac-q.bad { border-color: #f1c4c0; background: #fffafa; }
.ac-q-t { font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.ac-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; line-height: 1.4; }
.ac-opt:hover { background: #f6f6f3; } .ac-opt input { margin-top: 3px; accent-color: var(--accent); }
.ac-opt.right { background: #e8f6ee; border-color: #bfe3cc; } .ac-opt.wrong { background: #fdeceb; border-color: #f1c4c0; }
.ac-why { margin-top: 8px; font-size: 13px; color: var(--muted); padding: 8px 12px; background: #f7f7f4; border-radius: 10px; }
.ac-result { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 14px; margin: 8px 0 18px; }
.ac-result strong { font-size: 30px; letter-spacing: -.02em; } .ac-result.pass { background: #e8f6ee; color: #146c3a; } .ac-result.fail { background: #fdeceb; color: #a1281d; }
.ac-teamcard { padding: 0; overflow: hidden; } .ac-teamcard .ac-tablewrap { border: 0; border-radius: 0; margin: 0; }
.ac-team { min-width: 880px; } .ac-team th { white-space: normal; min-width: 110px; vertical-align: bottom; }
.ac-team td { vertical-align: middle; white-space: nowrap; } .ac-role { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.ac-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; }
.ac-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; } .ac-bar i.full { background: var(--ok); }
.ac-pct { font-size: 12px; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.ac-note { margin: 0; padding: 10px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.ed { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-tree { padding: 14px; max-height: calc(100vh - 160px); overflow: auto; position: sticky; top: 16px; }
.ed-add { display: flex; gap: 6px; padding: 4px 0 6px 14px; } .ed-add.top { padding: 0 0 10px; }
.ed-add button:not(.btn) { border: 1px dashed var(--line-2); background: none; border-radius: 8px; padding: 3px 9px; font-size: 12px; color: var(--accent); font-weight: 600; }
.ed-course { margin-bottom: 14px; } .ed-mod { margin-left: 10px; }
.ed-row { display: flex; align-items: center; border-radius: 9px; } .ed-row > button:first-child { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 6px 8px; font-size: 13px; line-height: 1.3; }
.ed-row.les { margin-left: 14px; } .ed-row.les > button:first-child { font-size: 12.5px; color: var(--ink-2); }
.ed-row:hover { background: #f4f4f1; } .ed-row.on { background: var(--accent-soft); } .ed-row.on > button:first-child { color: var(--accent); font-weight: 600; }
.ed-mv { display: none; gap: 2px; padding-right: 4px; } .ed-row:hover .ed-mv, .ed-row.on .ed-mv { display: inline-flex; }
.ed-mv button { border: 0; background: none; font-size: 10px; color: var(--muted); padding: 2px 4px; }
.ed-form { padding: 24px 28px; } .ed-form h3 { margin: 0 0 14px; }
.ed-form .field { margin-bottom: 14px; } .ed-form .field > span { font-size: 12px; color: var(--muted); font-weight: 550; }
.ed-form textarea { resize: vertical; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; line-height: 1.5; } .ed-form textarea.mono { font: 12.5px/1.5 ui-monospace, Menlo, monospace; }
.ed-form input, .ed-form select { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.ed-check { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.ed-actions { display: flex; gap: 10px; align-items: center; } .ed-msg { font-size: 13px; color: var(--ok); } .ed-msg.bad { color: var(--danger); }
@media (max-width: 960px) {
  .ac-course, .ed { grid-template-columns: 1fr; }
  .ac-sidewrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
  .ac-sumbtn { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; background: none; padding: 13px 16px; font-weight: 600; font-size: 14px; }
  .ac-sidewrap:not(.open) .ac-side { display: none; }
  .ac-side { position: static; max-height: 60vh; border: 0; box-shadow: none; border-top: 1px solid var(--line); border-radius: 0; }
  .ac-main { padding: 20px 16px; } .ed-tree { position: static; max-height: 40vh; } .ed-form { padding: 18px 16px; }
  .ac-title { font-size: 20px; } .ac-foot .btn { flex: 1 1 100%; } .ac-hero { padding: 16px; }
}

/* ---------- cleanup pass: spacing, tables, mobile ---------- */
.grid-2 > *, .grid-3 > *, .panes > * { min-width: 0; }
.grid-2.even { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.tbl td.num, .tbl th.num { white-space: nowrap; }
.tbl table { min-width: 420px; }
.tbl td:first-child { min-width: 0; }
.empty { padding: 40px 16px; font-size: 13.5px; line-height: 1.5; }
.empty strong { color: var(--ink); display: block; margin-bottom: 2px; font-size: 14.5px; }
.page-head h1 { margin: 0; }
.lib-list { grid-template-columns: minmax(0, 1fr); }
.lib-sub, .lib-title { overflow-wrap: anywhere; }
.ac-card, .ac-main, .ed-form { min-width: 0; }
@media (max-width: 1200px) {
  .grid-2, .grid-3, .panes, .script-grid, .grid-2.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .page-head { gap: 12px; margin-bottom: 18px; align-items: stretch; }
  .page-head .grow { flex-basis: 100%; }
  .page-head > :not(.grow) { max-width: 100%; }
  .lib-search { width: 100%; } .lib-search input { width: 100%; }
  .ac-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; padding-bottom: 2px; } .ac-tab { white-space: nowrap; }
  .lib-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -16px; padding-right: 16px; } .lib-tab { white-space: nowrap; }
  .lib-meta { flex-basis: calc(100% - 70px); }
  .tbl table { min-width: 460px; }
  .card { padding: 18px; }
}
.ac-main { scroll-margin-top: 72px; }
.ac-side { top: 64px; max-height: calc(100vh - 80px); }
.ed-tree { top: 64px; max-height: calc(100vh - 80px); }
@media (max-width: 960px) { .ac-side, .ed-tree { top: auto; } .ac-side { max-height: 60vh; } .ed-tree { max-height: 40vh; } }
.grid-2.even .tbl td:first-child { white-space: nowrap; }
body { overflow-x: clip; }

/* ===== Script reader v2: one calm reading column ===== */
.sc-wrap { grid-template-columns: 290px minmax(0, 1fr); }
.sc-wrap.noindex { grid-template-columns: minmax(0, 1fr); }
.sc-wrap.noindex .sc-side { display: none; }
.sc-main { padding: 36px 40px 28px; }
.sc-col { max-width: 68ch; margin: 0 auto; font-size: var(--sc-fs); }
.sc-main .sc-col { max-width: calc(68ch * var(--sc-fs) / 19px + 6ch); }
.sc-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.sc-seg { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.sc-seg i { height: 6px; border-radius: 6px; background: var(--line); }
.sc-seg i.done { background: #aab2e3; } .sc-seg i.on { background: var(--accent); }
.sc-steps > span { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; color: var(--muted); }
.sc-eyebrow { text-transform: uppercase; letter-spacing: .07em; font-size: 12px; color: var(--accent); font-weight: 700; margin-top: 4px; }
.sc-title { font-size: calc(var(--sc-fs) * 1.5); line-height: 1.2; margin: 6px 0 22px; letter-spacing: -.025em; }
.sc-hot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 14px; background: #fdf6f4; border: 1px solid #f4dcd7; border-radius: 12px; }
.sc-hot label { font-size: 12px; font-weight: 700; color: var(--danger); white-space: nowrap; }
.sc-hot select { flex: 1; min-width: 160px; padding: 7px 10px; border: 1px solid #f0cfc9; border-radius: 9px; background: #fff; font-size: 13.5px; font-weight: 550; }
.sc-who { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; margin: 8px 0 8px; }
.sc-who.agent { background: var(--accent-soft); color: var(--accent); } .sc-who.agent::before { content: "🎙"; }
.sc-who.client { background: var(--gold-soft); color: #7a5600; margin-top: 26px; } .sc-who.client::before { content: "👤"; }
.sc-blk.sc-say { border-left: 4px solid var(--accent); padding: 4px 0 4px 20px; margin: 0 0 10px; }
.sc-blk p { font-size: var(--sc-fs); line-height: 1.6; margin: 0 0 12px; }
.sc-blk p.s { color: var(--ink); }
.sc-blk p.q { font-weight: 650; background: linear-gradient(transparent 0, #fff6d6 0); background: #fff8dd; border-radius: 10px; padding: 8px 14px 8px 2.1em; text-indent: -1.6em; margin-left: -4px; }
.sc-blk p.q i { color: #b07a00; }
.sc-h { font-size: .8em; letter-spacing: .1em; color: var(--ink-2); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.sc-li { font-size: var(--sc-fs); line-height: 1.55; gap: 14px; margin: 0 0 10px; }
.sc-li:not(.num) b { color: var(--accent); font-size: 1.2em; line-height: 1.3; min-width: .8em; }
.sc-li.num b { width: 1.7em; height: 1.7em; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: .8em; flex: none; margin-top: .1em; }
.sc-note { display: block; font-style: normal; font-size: .82em; background: #f4f4f1; color: var(--ink-2); border-radius: 12px; padding: 10px 16px; margin: 6px 0 16px; line-height: 1.5; }
.sc-note b { display: block; font-size: .78em; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sc-opts { display: grid; gap: 10px; }
.sc-opt { width: 100%; padding: 14px 18px; font-size: calc(var(--sc-fs) * .9); border-radius: 14px; text-align: left; justify-content: flex-start; border-width: 1.5px; }
.sc-opt i { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; flex: none; }
.sc-nav { margin-top: 32px; padding-top: 20px; gap: 12px; }
.sc-btn.big { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.sc-btn.primary.big { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; max-width: 65%; text-align: right; }
.sc-btn.primary.big span { font-size: 16px; } .sc-btn.primary.big small { font-size: 11.5px; font-weight: 500; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sc-grp { margin-bottom: 4px; } .sc-grp > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 10px 8px; border-radius: 8px; }
.sc-grp > summary::-webkit-details-marker { display: none; } .sc-grp > summary::before { content: "▸"; margin-right: 4px; color: var(--faint); } .sc-grp[open] > summary::before { content: "▾"; }
.sc-grp > summary:hover { background: #f4f4f1; } .sc-grp > summary em { font-style: normal; color: var(--faint); margin-left: auto; font-weight: 600; }
.sc-focus { position: fixed; inset: 0; z-index: 90; background: #12162b; color: #f2f3fb; display: flex; flex-direction: column; --sc-fs: 26px; }
.sc-focus-bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sc-focus-bar .btn, .sc-focus-bar .seg button { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); } .sc-focus-bar .seg { background: transparent; border-color: rgba(255,255,255,.18); }
.sc-focus-scroll { flex: 1; overflow: auto; } .sc-focus .sc-main { background: none; border: 0; box-shadow: none; padding: 40px 24px; }
.sc-focus .sc-col { max-width: 30em; }
.sc-focus .sc-title, .sc-focus .sc-blk p, .sc-focus .sc-li, .sc-focus .sc-h { color: #fff; }
.sc-focus .sc-blk p.q { background: rgba(255,220,100,.14); } .sc-focus .sc-blk p.q i { color: #ffd45e; }
.sc-focus .sc-blk.sc-say { border-color: #8f9aff; } .sc-focus .sc-who.agent { background: rgba(143,154,255,.2); color: #c9cfff; }
.sc-focus .sc-eyebrow, .sc-focus .sc-steps > span { color: #aab2e3; } .sc-focus .sc-seg i { background: rgba(255,255,255,.14); } .sc-focus .sc-seg i.done { background: #5e6bd0; } .sc-focus .sc-seg i.on { background: #aab2ff; }
.sc-focus .sc-note { background: rgba(255,255,255,.08); color: #d6d9ee; } .sc-focus .sc-hot { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.sc-focus .sc-opt { background: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.2); } .sc-focus .sc-opt i { background: rgba(255,255,255,.14); color: #fff; }
.sc-focus .sc-who.client { background: rgba(255,255,255,.12); color: #dfe3ff; }
.sc-focus-foot { padding: 14px 24px 22px; border-top: 1px solid rgba(255,255,255,.1); } .sc-focus .sc-nav { margin: 0; padding: 0; border: 0; max-width: 30em; margin: 0 auto; }
.sc-focus .sc-btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); } .sc-focus .sc-btn.primary { background: #5e6bd0; border-color: #5e6bd0; }
.sp-card .sc-col { max-width: none; } .sp-card .sc-title { font-size: calc(var(--sc-fs) * 1.3); margin: 4px 0 12px; } .sp-card .sc-steps { margin-bottom: 10px; }
.sp-card .sc-btn.big { padding: 10px 14px; font-size: 13.5px; } .sp-card .sc-opt { padding: 10px 14px; font-size: var(--sc-fs); } .sp-card .sc-hot { padding: 6px 10px; margin-bottom: 10px; }
.sp-card .sc-blk.sc-say { padding-left: 14px; } .sp-card .sc-who.client { margin-top: 12px; }
@media (max-width: 860px) { .sc-main { padding: 22px 18px; } .sc-btn.primary.big { max-width: 100%; } .sc-nav { flex-wrap: wrap; } .sc-nav .grow { display: none; } .sc-btn.big { flex: 1; } .sc-title { font-size: calc(var(--sc-fs) * 1.3); } }
.sc-focus .sc-hot select { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); } .sc-focus .sc-hot select option { color: #111; }
.sc-focus .sc-btn.primary small { color: #fff; opacity: .9; }
.sc-blk p.q { margin-left: 0; }
@media (max-width: 860px) { .sc-wrap, .sc-wrap.noindex { grid-template-columns: minmax(0, 1fr); } .sc-side { max-height: 260px; overflow: auto; position: static; } .sc-tools input { flex: 1 1 140px; min-width: 0; } }

/* ===== Leaderboard tab, widget tabs ===== */
.rank-sum { margin-bottom: 24px; } .rank-top { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.rank-top .rk { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #fafaf8; border-radius: 12px; font-size: 13.5px; }
.card.flat { box-shadow: none; border: 0; padding: 0; }

/* ===== Folders & square tiles (Academia + Biblioteca) ===== */
.ac-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.ac-tile { display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: left; padding: 12px 12px 14px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; font: inherit; color: inherit; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ac-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(30,40,100,.12); border-color: #c9cef0; }
.ac-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ac-tile strong { font-size: 14.5px; line-height: 1.3; margin-top: 10px; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ac-tile em { font-style: normal; font-size: 12px; color: var(--muted); }
.ac-media { aspect-ratio: 1 / 1; width: 100%; border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden; background: #f6f6f3; }
.ac-media.lgo { background: #fff; border: 1px solid var(--line); padding: 16%; } .ac-media.lgo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ac-media.lgo.dark { background: #1a1e36; border-color: #1a1e36; }
.ac-media.tint { background: linear-gradient(145deg, hsl(var(--h) 70% 96%), hsl(var(--h) 60% 88%)); color: hsl(var(--h) 45% 38%); }
.ac-media.tint svg { width: 56px; height: 56px; } .ac-media .emo { font-size: clamp(34px, 5vw, 52px); font-style: normal; line-height: 1; }
.ac-media.doc { background: linear-gradient(160deg, #fbfbf9, #f0f0ec); color: #5b6070; }
.ac-media.doc svg { width: 54px; height: 54px; margin-top: -14px; }
.ac-media.doc i { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; padding: 3px 10px; border-radius: 99px; color: #fff; background: #6b7280; }
.ac-media.doc.pdf i { background: #d64545; } .ac-media.doc.pdf { color: #c44; }
.ac-media.doc.html i, .ac-media.doc.docx i { background: #3b6fd6; } .ac-media.doc.html, .ac-media.doc.docx { color: #3b6fd6; }
.ac-media.doc.video i { background: #e08a1e; } .ac-media.doc.video { color: #d9801a; }
.ac-media.doc.lesson i { background: #7a5ea8; } .ac-media.doc.lesson { color: #7a5ea8; }
.ac-media.doc.quiz i { background: #1f7a4d; } .ac-media.doc.quiz { color: #1f7a4d; }
.ac-tick { position: absolute; top: 20px; right: 20px; width: 24px; height: 24px; border-radius: 99px; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ac-pbar { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 8px; } .ac-pbar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; } .ac-pbar i.full { background: var(--ok); }
.ac-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; margin: 0 0 14px; color: var(--muted); }
.ac-crumbs button { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 550; } .ac-crumbs button:hover { text-decoration: underline; }
.ac-crumbs i { font-style: normal; color: var(--faint); } .ac-crumbs span { color: var(--ink); font-weight: 600; }
.ac-fhead { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; } .ac-fhead h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.ac-fprog { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.ac-lesson { max-width: 820px; margin: 0 auto; padding: 32px 40px; } .ac-lesson .ac-title { margin-top: 0; }
.ac-hero.card { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
@media (max-width: 640px) { .ac-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .ac-fhead { flex-wrap: wrap; } .ac-lesson { padding: 20px 18px; } .ac-tile strong { font-size: 13.5px; } }
.ed-mod { margin-left: 12px; }

.ac-media.mosaic { background: #fff; border: 1px solid var(--line); padding: 10%; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8%; place-items: center; }
.ac-media.mosaic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ac-tile .ac-media.tint svg { width: 72px !important; height: 72px !important; } .ac-tile .ac-media.doc svg { width: 68px !important; height: 68px !important; }
.ac-fhead { align-items: flex-start; } @media (max-width: 640px) { .ac-fhead .btn { align-self: flex-start; } }
.lib-tile .lib-snip { font-size: 11.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.lib-tile mark, .ac-tile mark { background: #ffe9a8; border-radius: 3px; }
.lib-up input[data-lib-sub] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; min-width: 170px; }

/* ===== Compañías ===== */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.car-tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; padding: 16px; transition: transform .15s, box-shadow .15s; }
.car-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(30,40,100,.12); }
.car-logo { display: grid; place-items: center; height: 92px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px 22px; }
.car-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.car-mono { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 20px; }
.car-name { font-weight: 650; font-size: 16px; margin-top: 12px; letter-spacing: -.01em; } .car-count { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.car-m { margin: 0; display: grid; gap: 0; } .car-m > div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.car-m dt { color: var(--muted); } .car-m dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; } .car-m .tot dd { color: var(--accent); font-size: 15px; }
.car-hd { display: flex; align-items: center; gap: 16px; flex: 1; } .car-hd .car-logo { width: 150px; height: 70px; padding: 8px 14px; }
.car-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.car-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; } .car-stat span { font-size: 12.5px; color: var(--muted); } .car-stat b { font-size: 28px; letter-spacing: -.03em; } .car-stat em { font-style: normal; font-size: 12px; color: var(--faint); }
.car-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }
@media (max-width: 640px) { .car-hd .car-logo { width: 110px; } .car-grid { grid-template-columns: 1fr; } }
.car-logo { overflow: hidden; } .car-logo img { max-height: 62px; width: auto; max-width: 100%; } .car-hd .car-logo img { max-height: 46px; }

/* Guion: no yellow highlights or underlines on lines (Yesed, Nov 13) */
.sc-blk p.q { background: none !important; padding: 0 0 0 1.5em !important; text-indent: -1.5em !important; margin-left: 0 !important; font-weight: 500 !important; border-radius: 0; text-decoration: none; }
.sc-blk p.q i { color: var(--accent) !important; }
.sc-blk p, .sc-blk p *, .sc-li, .sc-li * { text-decoration: none !important; }
.sc-who.client { background: var(--accent-soft) !important; color: var(--accent) !important; }
.sc-note { background: #f1f2f6 !important; color: var(--ink-2) !important; font-style: normal; }
.sc-focus .sc-blk p.q i { color: #aab2ff !important; } .sc-focus .sc-note { background: rgba(255,255,255,.08) !important; color: #d6d9ee !important; }

/* Cómo rebatir: fixed reminder above the objection dropdown (reader, pop-out, focus) */
.sc-how { margin: 0 0 10px; padding: 12px 16px; background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; color: var(--ink); }
.sc-how strong { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--accent); }
.sc-how p { margin: 0 0 4px; font-size: 14px; line-height: 1.5; } .sc-how p:last-child { margin-bottom: 0; }
.sp-card .sc-how { padding: 10px 12px; } .sp-card .sc-how p { font-size: 14px; }
.sc-focus .sc-how { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); border-left-color: #aab2ff; color: #eceefb; } .sc-focus .sc-how strong { color: #aab2ff; }

/* ---------- KPI widget v3 (legible, same tokens as Academia / Compañías) ---------- */
@keyframes kwpulse { 0% { box-shadow: 0 0 0 0 rgba(52,65,155,.5), var(--shadow-lift); transform: scale(1); } 40% { transform: scale(1.08); } 100% { box-shadow: 0 0 0 20px rgba(52,65,155,0), var(--shadow-lift); transform: scale(1); } }
.kw[hidden] { display: none; }
.kw { position: fixed; right: 24px; bottom: 24px; z-index: 35; font-family: Inter, system-ui, sans-serif; color: var(--ink); }
.kw.kw-docked { position: fixed; }
.kw button { font-weight: 650; }
.kw-closed { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.kw-bubble { position: relative; width: 112px; height: 112px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; display: grid; place-content: center; justify-items: center; gap: 0; color: #fff; background: conic-gradient(#fff calc(var(--p, 0) * 1%), rgba(255,255,255,.28) 0); box-shadow: var(--shadow-lift); touch-action: none; }
.kw-bubble::before { content: ""; position: absolute; inset: 7px; border-radius: 99px; background: linear-gradient(160deg, var(--accent), var(--accent-dark)); }
.kw-bubble > * { position: relative; }
.kw-bubble b { font-size: 36px; line-height: 1; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kw-bubble small { font-size: 13px; font-weight: 600; margin-top: 4px; opacity: .95; }
.kw-bubble.hit::before { background: linear-gradient(160deg, #26a06b, var(--ok)); }
.kw-bubble.pulse { animation: kwpulse .6s; }
.kw-bubble:hover { transform: translateY(-2px); }
.kw-plus { position: absolute; top: -6px; right: -6px; width: 40px; height: 40px; border-radius: 99px; background: var(--gold); color: #fff; font-size: 17px; font-weight: 800; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20,26,40,.25); z-index: 2; }
.kw-hint { font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 12px; box-shadow: var(--shadow); white-space: nowrap; }
.kw-bubrow { display: flex; gap: 8px; align-items: center; }
.kw-openbtn { height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--accent); font-size: 14px; box-shadow: var(--shadow); }
.kw-openbtn:hover { background: var(--accent-soft); }
.kw-sbtn { width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); display: grid; place-items: center; padding: 0; box-shadow: var(--shadow); }
.kw-sbtn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.kw-sbtn svg { width: 20px !important; height: 20px !important; }
.kw-recpill { display: inline-flex; align-items: center; gap: 6px; background: #d92d20; color: #fff; border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.kw-recpill i { width: 8px; height: 8px; border-radius: 99px; background: #fff; animation: blink 1.2s infinite; }
.kw-recpill.sm { font-size: 12px; }
/* panel */
.kw-panel { width: 400px; max-width: calc(100vw - 32px); min-width: 340px; background: #fff; border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; overflow: hidden; resize: both; max-height: calc(100vh - 32px); }
.kw-pop .kw-panel { width: 100vw; max-width: none; min-width: 0; height: 100vh; max-height: none; border: 0; border-radius: 0; box-shadow: none; resize: none; }
.kw-popbody { margin: 0; background: #fff; overflow: hidden; }
.kw-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: grab; flex: none; }
.kw-pop .kw-head { cursor: default; }
.kw-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.kw-title strong { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.kw-logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 15px; }
.kw-tools { display: flex; gap: 6px; }
.kw-ico { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.kw-ico:hover, .kw-ico.on { background: var(--accent-soft); color: var(--accent); border-color: #d9dcf1; }
.kw-ico.recording { background: #d92d20; border-color: #d92d20; color: #fff; }
.kw-ico svg { width: 20px !important; height: 20px !important; }
.kw-tabs { display: flex; gap: 6px; padding: 10px 16px 0; flex: none; }
.kw-tabs button { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 15px; }
.kw-tabs button:hover { background: var(--accent-soft); }
.kw-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.kw-body { padding: 14px 16px 16px; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.kw-hero { border: 1px solid var(--line-2); border-radius: 16px; padding: 16px; background: linear-gradient(180deg, #fff, var(--accent-soft)); }
.kw-hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.kw-hero-top em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--muted); }
.kw-hero-num { font-size: 64px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.kw-hero-num.hit, .kw-tnum.hit { color: var(--ok); }
.kw-meter { height: 10px; border-radius: 99px; background: #e9eaf3; overflow: hidden; }
.kw-meter i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--accent)); transition: width .3s; }
.kw-hero-btns { display: grid; grid-template-columns: 84px 1fr; gap: 10px; margin-top: 14px; }
.kw-minus { height: 56px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 18px; }
.kw-minus:hover { background: #f3f3f0; }
.kw-addbtn { height: 56px; border-radius: 14px; border: 0; background: var(--accent); color: #fff; font-size: 19px; box-shadow: 0 2px 6px rgba(40,52,127,.3); }
.kw-addbtn:hover { background: var(--accent-dark); }
.kw-addbtn:active { transform: scale(.98); }
.kw-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kw-tile { border: 1px solid var(--line-2); border-radius: 16px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kw-tname { font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.kw-tnum { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kw-tgoal { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.kw-tbtns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 6px; margin-top: 8px; }
.kw-tbtns button { height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 16px; }
.kw-tbtns button.plus { background: var(--accent-soft); color: var(--accent); border-color: #d9dcf1; }
.kw-tbtns button.plus:hover { background: var(--accent); color: #fff; }
.kw-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); text-align: center; flex: none; }
.kw-foot.err { width: 100%; border: 0; background: #fbeceb; color: var(--danger); cursor: pointer; }
.kw-foot small { display: block; font-weight: 500; }
.kw-empty { text-align: center; padding: 20px 8px; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); font-size: 15px; }
.kw-empty strong { font-size: 17px; color: var(--ink); }
.kw-empty p { margin: 0; }
.kw-chip { border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--accent); box-shadow: var(--shadow); }
.kw-recwrap { padding: 14px 16px; overflow: auto; flex: 1; min-height: 0; }
.kw-scriptwrap { padding: 0 8px 8px; }
.kw-minidial { display: grid; grid-template-columns: 64px 1fr 150px; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; flex: none; }
.kw-minidial .kw-minus, .kw-minidial .kw-addbtn { height: 48px; font-size: 16px; }
.kw-md-num { text-align: center; font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }
.kw-md-num small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
/* leaderboard inside the widget (logic unchanged, styling aligned) */
.kw-rank { display: flex; flex-direction: column; gap: 10px; }
.kw-rank .seg { max-width: 100%; overflow-x: auto; }
.kw-rank .seg button { font-size: 14px; padding: 8px 12px; white-space: nowrap; }
.kw-board { display: flex; flex-direction: column; gap: 6px; }
.kw-lrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 15px; }
.kw-lrow.me { background: var(--accent-soft); border-color: #d9dcf1; }
.kw-lrow b { font-weight: 650; overflow-wrap: anywhere; }
.kw-lrow strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.kw-lrow .rank { width: 28px; height: 28px; border-radius: 99px; background: #efefec; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.kw-lrow .rank.r1 { background: var(--gold-soft); color: #7a5600; }
.kw-lrow .you { font-size: 12px; font-weight: 700; color: var(--accent); background: #fff; border-radius: 99px; padding: 1px 8px; }
.kw-more { border: 1px solid var(--line-2); background: #fff; border-radius: 12px; height: 44px; font-size: 15px; color: var(--accent); }
@media (max-width: 860px) { .kw { right: 12px; bottom: 12px; } .kw-panel { width: min(380px, calc(100vw - 24px)); } [data-kw=pop] { display: none; } }

/* ---------- Llamadas ---------- */
.cl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.cl-stat { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.cl-stat span { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.cl-stat b { font-size: 44px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cl-stat.accent b { color: var(--accent); }
.cl-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cl-side { display: flex; flex-direction: column; gap: 24px; }
.cl-lead { padding: 28px; }
.cl-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cl-lead h2 { margin: 4px 0 2px; font-size: 32px; font-weight: 750; letter-spacing: -.02em; }
.cl-phone { font-size: 20px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.cl-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 20px 0; }
.cl-info div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.cl-info span { font-size: 13px; color: var(--muted); font-weight: 600; }
.cl-info b { font-size: 15.5px; font-weight: 650; }
.cl-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 14px; background: var(--accent-soft); border: 1px solid #d9dcf1; margin-bottom: 16px; }
.cl-band.live { background: #fff; border-color: #f3c6c1; box-shadow: 0 0 0 3px #fbeceb; }
.cl-bl { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cl-time { font-size: 44px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cl-rec { display: inline-flex; align-items: center; gap: 8px; background: #d92d20; color: #fff; border-radius: 99px; padding: 6px 14px; font-size: 15px; font-weight: 700; }
.cl-rec i { width: 10px; height: 10px; border-radius: 99px; background: #fff; animation: blink 1.2s infinite; }
.cl-rec.done { background: #e8f5ee; color: var(--ok); }
.cl-err { margin-bottom: 12px; font-size: 14.5px; }
.cl-switch { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; margin-bottom: 16px; }
.cl-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cl-sw { width: 48px; height: 28px; border-radius: 99px; background: #cfd1d9; position: relative; flex: none; transition: background var(--t); }
.cl-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t); }
.cl-switch input:checked + .cl-sw { background: var(--accent); }
.cl-switch input:checked + .cl-sw::after { transform: translateX(20px); }
.cl-switch input:disabled + .cl-sw { opacity: .6; }
.cl-swt strong { display: block; font-size: 16px; }
.cl-swt small { font-size: 14px; color: var(--ink-2); }
.cl-ctl { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cl-start { height: 64px; border-radius: 16px; border: 0; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 4px 12px rgba(40,52,127,.3); }
.cl-start:hover { background: var(--accent-dark); }
.cl-start svg { width: 26px !important; height: 26px !important; }
.cl-end { height: 60px; border-radius: 16px; border: 0; background: #d92d20; color: #fff; font-size: 19px; font-weight: 700; }
.cl-end.ghost { background: #fff; color: var(--danger); border: 1px solid #f0cfc9; height: 48px; font-size: 15px; }
.cl-dial { text-align: center; font-size: 15px; font-weight: 600; }
.cl-notes textarea { font-size: 15px; width: 100%; }
.cl-outs-h { font-size: 15px; font-weight: 700; margin: 8px 0 10px; color: var(--ink); }
.cl-outs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cl-out { min-height: 56px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 16px; font-weight: 650; padding: 8px 12px; }
.cl-out:hover { background: var(--accent-soft); border-color: #cdd2ee; }
.cl-out.ok { background: #e8f5ee; border-color: #bfe3cf; color: #145c39; }
.cl-out.gold { background: var(--gold-soft); border-color: #e7d6a8; color: #6d5313; }
.cl-out.danger { color: var(--danger); background: #fff; border-color: #f0cfc9; }
.cl-out:disabled { opacity: .5; }
.cl-hist { margin-top: 24px; }
.cl-empty { text-align: center; padding: 56px 24px; }
.cl-eico { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.cl-eico svg { width: 30px !important; height: 30px !important; }
.cl-queue h3, .cl-log h3 { margin: 0 0 12px; font-size: 18px; }
.cl-qlist { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.cl-q { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; width: 100%; }
.cl-q:hover:not(:disabled) { background: var(--accent-soft); }
.cl-q.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px #dfe3f7; }
.cl-q:disabled { opacity: .7; cursor: default; }
.cl-av { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.cl-qn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-qn b { font-size: 16px; font-weight: 650; }
.cl-qn small { font-size: 14px; color: var(--ink-2); }
.cl-none { font-size: 15px; color: var(--ink-2); margin: 8px 0; }
.cl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cl-row:first-of-type { border-top: 0; }
.cl-rl { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.cl-rl b { font-size: 16px; }
.cl-rl span { font-size: 14px; color: var(--ink-2); }
.cl-rl em { font-style: normal; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.cl-pill { display: inline-flex; border-radius: 99px; padding: 4px 12px; font-size: 14px; font-weight: 650; background: #efefec; color: var(--ink-2); white-space: nowrap; }
.cl-pill.ok { background: #e8f5ee; color: #145c39; } .cl-pill.gold { background: var(--gold-soft); color: #6d5313; } .cl-pill.danger { background: #fbeceb; color: var(--danger); }
.cl-play { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--accent); }
.cl-audio { flex-basis: 100%; }
@media (max-width: 1100px) { .cl-grid { grid-template-columns: 1fr; } .cl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cl-outs { grid-template-columns: 1fr 1fr; } .cl-lead { padding: 20px; } .cl-time { font-size: 36px; } }
/* recordings: kind chips + badges */
.rec-chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rec-chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 8px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.rec-chip b { margin-left: 6px; color: var(--muted); font-weight: 650; }
.rec-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; } .rec-chip.on b { color: #dfe3ff; }
.rec-badge { display: inline-block; margin-right: 8px; border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: #efefec; color: var(--ink-2); vertical-align: 1px; }
.rec-badge.call { background: var(--accent-soft); color: var(--accent); }
.rec-callbusy { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #f3c6c1; background: #fff; border-radius: 14px; margin-bottom: 12px; font-size: 14.5px; }
.rec-callbusy strong { display: block; font-size: 15.5px; } .rec-callbusy span:not(.rec-dot) { color: var(--ink-2); }
/* Academia: documents inside folders */
.ac-up { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: #fff; margin-bottom: 20px; }
.ac-up.over { border-color: var(--accent); background: var(--accent-soft); }
.ac-up strong { display: block; font-size: 15.5px; } .ac-up span { font-size: 14px; color: var(--ink-2); }
.ac-up .btn { cursor: pointer; flex: none; }
.ac-search { margin: 0 0 20px; } .ac-search input { width: 100%; height: 48px; font-size: 16px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; }
.ac-tile small { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.lib-move { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; } .lib-move select { height: 36px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 8px; max-width: 220px; }
/* pop-out / floating script: the whole card scrolls so the reading area is never squeezed */
.sp-card { overflow-y: auto; }
.sp-card .sc-body { flex: none; overflow: visible; min-height: 0; padding-right: 0; }
.sp-card .sc-choices { position: static; max-height: none; overflow: visible; padding-top: 10px; margin-top: 8px; padding-bottom: 16px; }
.sp-card .sc-how { padding: 8px 12px; margin-bottom: 8px; } .sp-card .sc-how strong { font-size: 14.5px; margin-bottom: 2px; } .sp-card .sc-how p { line-height: 1.4; margin-bottom: 3px; }
.kw-pop .kw-hero { padding: 12px 14px; } .kw-pop .kw-hero-num { font-size: 52px; margin: 2px 0 8px; } .kw-pop .kw-hero-btns { margin-top: 10px; }
.kw-pop .kw-hero-btns .kw-minus, .kw-pop .kw-hero-btns .kw-addbtn { height: 50px; }
.kw-pop .kw-body { gap: 10px; padding: 10px 14px 12px; } .kw-pop .kw-tile { padding: 10px; } .kw-pop .kw-tnum { font-size: 28px; } .kw-pop .kw-tbtns { margin-top: 4px; } .kw-pop .kw-tbtns button { height: 38px; }
.kw-pop .kw-head { padding: 10px 14px; } .kw-pop .kw-tabs { padding: 8px 14px 0; } .kw-pop .kw-tabs button { height: 40px; }

/* WhatsApp buttons (green) + contact picker */
.btn-wa { background: #25a244; border-color: #25a244; color: #fff; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.btn-wa:hover:not(:disabled) { background: #1d8a38; border-color: #1d8a38; }
.btn-wa svg { width: 16px !important; height: 16px !important; flex: none; }
.btn-wa:disabled { background: #e3e5e8; border-color: #e3e5e8; color: #7b8190; cursor: not-allowed; }
.wa-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; padding: 14px 18px; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; }
.wa-pick label { font-size: 15px; font-weight: 700; }
.wa-pick select { height: 40px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 10px; min-width: 240px; font-size: 15px; }
.wa-hint { font-size: 14px; color: var(--ink-2); flex-basis: 100%; }

/* ============ Visual pass: calm, spacious, one accent ============ */
:root { --bg: #f6f7f9; --line: #e8eaef; --line-2: #dcdfe6; --muted: #5f6678; --faint: #8a91a2; --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .03); --shadow-lift: 0 4px 10px rgba(16, 24, 40, .05), 0 16px 32px rgba(16, 24, 40, .07); }
body { letter-spacing: -.003em; font-size: 15px; line-height: 1.55; text-rendering: optimizeLegibility; }
.topbar { background: rgba(246, 247, 249, .88); border-bottom-color: var(--line); padding: 0 40px; }
.search input { border-radius: 12px; height: 42px; border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.content { padding: 40px 40px 80px; max-width: 1520px; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
h3 { font-size: 16px; font-weight: 650; }
.sub { font-size: 15px; margin-bottom: 28px; line-height: 1.55; }
.page-head { margin-bottom: 28px; gap: 20px; }
.eyebrow { letter-spacing: .08em; font-size: 12px; }
.meta, small { font-size: 13px; }
/* sidebar: quieter, one accent */
.nav { padding: 8px 14px; gap: 3px; }
.nav button { border-radius: 10px; }
.nav button.active { background: rgba(255, 255, 255, .1); }
.nav button.active::before { background: #8e9bff; left: -14px; }
.nav button.active svg { color: #c4ccff; }
.nav .group { font-size: 12px; letter-spacing: .08em; margin: 26px 14px 10px; }
.nav button svg { opacity: .75; stroke-width: 1.6; }
/* cards */
.card { border-color: var(--line); padding: 28px; box-shadow: var(--shadow); }
.kpis, .stat-grid { gap: 20px; margin-bottom: 28px; }
.kpi, .stat { padding: 24px 28px; }
.kpi > span, .stat .name { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi b { font-size: 32px; font-weight: 700; letter-spacing: -.04em; }
.kpi em, .stat .foot { font-size: 13px; }
.stat .big { font-size: 34px; font-weight: 700; }
/* tables: calmer */
.tbl { padding: 10px 12px; }
th { font-size: 12px; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line); }
td { padding: 16px 18px; border-bottom: 1px solid #f0f1f4; font-size: 15px; }
tbody tr:hover td { background: #f8f9fc; }
tbody tr:hover td:first-child { border-radius: 10px 0 0 10px; } tbody tr:hover td:last-child { border-radius: 0 10px 10px 0; }
/* pills: restrained */
.pill { padding: 3px 10px; font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.pill.gray { background: #f1f2f5; color: #444b5c; }
.pill.gold { background: #f1f2f5; color: #444b5c; }
/* buttons & inputs */
.btn, .btn-primary, .btn-ghost, .btn-danger, .icon-btn { border-radius: 10px; padding: 9px 18px; font-size: 14.5px; border-color: var(--line-2); }
.btn:hover, .icon-btn:hover { background: #f8f9fb; border-color: #cdd1db; }
.btn-primary { box-shadow: 0 1px 2px rgba(40, 52, 127, .2); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 9px; }
.seg { background: #eceef2; border-color: transparent; padding: 3px; border-radius: 12px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 14px; }
.filters { gap: 10px; margin-bottom: 20px; }
.filters input, .filters select, .field input, .field select, .field textarea, input.plain { border-radius: 10px; border-color: var(--line-2); }
/* kanban */
.board { gap: 20px; }
.col { background: #eef0f4; padding: 14px; }
.col header { font-size: 14px; padding: 6px 8px 14px; }
.ocard { border-radius: 14px; padding: 14px 16px; border-color: #eceef2; }
/* banners: one calm tone */
.banner { background: #f4f5fa; border-color: #e1e4f2; color: #3a4170; border-radius: 14px; padding: 14px 18px; }
.banner.err { background: #fbeceb; border-color: #f1d1ce; color: var(--danger); }
/* empty states */
.empty { padding: 56px 24px; font-size: 15px; color: var(--muted); }
.empty .ico { width: 52px; height: 52px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.empty .ico svg { width: 24px !important; height: 24px !important; }
.empty strong, .empty h3 { font-size: 16px; }
.feed li { padding: 14px 0; }
.bar { height: 8px; background: #eef0f4; }
/* floating bubble label readable */
.kw-bubble small { opacity: 1; color: #fff; font-weight: 700; font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
@media (max-width: 760px) { .content { padding: 24px 16px 72px; } .topbar { padding: 0 16px; } h1 { font-size: 24px; } .card { padding: 20px; } }

/* ===== Seguimiento ===== */
.fu { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.fu-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fu-chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fu-chip b { color: var(--muted); margin-left: 4px; } .fu-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; } .fu-chip.on b { color: #dfe3ff; }
.fu-list { display: flex; flex-direction: column; gap: 10px; }
.fu-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 5px solid #c9ced9; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.fu-item.overdue { border-left-color: #d92d20; } .fu-item.today { border-left-color: #f59e0b; } .fu-item.upcoming { border-left-color: #9aa3b5; }
.fu-item:hover { border-color: #cdd1db; } .fu-item.on { outline: 2px solid var(--accent); outline-offset: -1px; }
.fu-name { font-weight: 700; font-size: 16px; } .fu-meta { grid-column: 1; font-size: 14px; color: var(--muted); }
.fu-when { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; justify-content: center; } .fu-when em { font-style: normal; font-size: 13px; color: var(--muted); }
.fu-pane { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; min-height: 260px; position: sticky; top: 88px; }
.fu-dhead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; } .fu-dhead > div { flex: 1; min-width: 0; } .fu-dhead h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.fu-sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.fu-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.fu-info div { background: #f6f7f9; border-radius: 12px; padding: 10px 12px; } .fu-info span { display: block; font-size: 12.5px; color: var(--muted); } .fu-info b { font-size: 15px; }
.fu-lab { display: block; font-size: 14px; font-weight: 700; margin: 4px 0 6px; }
#fu-step { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 12px; font-size: 15px; background: #fff; }
.fu-msg { margin-top: 12px; background: #f6f7f9; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.fu-gap { margin-top: 10px; background: #fbf1df; color: #7a5200; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.fu-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.fu-btn { height: 54px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; font-size: 16px; font-weight: 700; color: var(--ink); }
.fu-btn:hover:not(:disabled) { background: #f6f7f9; } .fu-btn:disabled { opacity: .45; cursor: not-allowed; }
.fu-wa { background: #25a244; border-color: #25a244; color: #fff; } .fu-wa:hover:not(:disabled) { background: #1d8a38; }
.fu-go { background: var(--accent); border-color: var(--accent); color: #fff; } .fu-go:hover { background: var(--accent-dark); }
.fu-foot { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.fu-back { display: none; border: 0; background: none; color: var(--accent); font-size: 16px; font-weight: 700; padding: 6px 0 14px; }
@media (max-width: 900px) {
  .fu { grid-template-columns: 1fr; } .fu.has-sel .fu-list { display: none; } .fu:not(.has-sel) .fu-pane { display: none; }
  .fu-pane { position: static; padding: 18px; } .fu-back { display: block; }
  .fu-actions { grid-template-columns: 1fr; } .fu-btn { height: 60px; font-size: 17px; }
}

/* Seguimiento: tabs + Plantillas */
.fu-tabs { margin-bottom: 18px; }
.fu-tplbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 8px; box-shadow: var(--shadow); }
.fu-tplbar label { font-weight: 700; font-size: 15px; } .fu-tplbar select { height: 44px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 12px; min-width: 260px; font-size: 15px; }
.fu-hint { flex-basis: 100%; font-size: 13.5px; color: var(--muted); }
.fu-gh { margin: 26px 0 12px; font-size: 17px; }
.fu-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.fu-tpl { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fu-tt { font-weight: 700; font-size: 16px; } .fu-tpl .fu-msg { margin-top: 0; font-size: 15px; flex: 1; }
.fu-actions.two { grid-template-columns: 1fr 1fr; margin-top: 4px; }
@media (max-width: 900px) { .fu-tgrid { grid-template-columns: 1fr; } .fu-actions.two { grid-template-columns: 1fr; } .fu-tplbar select { min-width: 0; width: 100%; } }

/* Guion: locked layout. The page does not scroll while reading; the index and the content pane are fixed-height and scroll on their own. */
@media (min-width: 861px) {
  .sc-wrap { --sc-h: calc(100vh - var(--top) - 190px); height: var(--sc-h); min-height: 440px; align-items: stretch; }
  .sc-wrap .sc-side { position: static; max-height: none; height: 100%; min-height: 0; }
  .sc-wrap > .sc-main { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
}

/* Seguimiento: secuencia (borrador, campos del caso, llamada) */
.fu-draft { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #fff3d6; color: #8a5d00; border: 1px solid #f0d89a; border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.fu-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.fu-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.fu-fields input { height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font-size: 15px; font-weight: 400; min-width: 0; }
.fu-check { margin: 0; padding-left: 20px; display: grid; gap: 10px; } .fu-check li { line-height: 1.5; }
.fu-remind { margin-top: 10px; padding: 12px 14px; background: #eef2ff; border: 1px solid #c9d2ff; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: #2b3a8c; }
.fu-actions.one { grid-template-columns: 1fr; }
@media (max-width: 900px) { .fu-fields { grid-template-columns: 1fr; } }

/* ===== Guion UI v2: one white rounded card (tab page + modal) ===== */
.gv-wrap { --sc-h: calc(100vh - var(--top) - 120px); height: var(--sc-h); min-height: 440px; max-width: 900px; margin: 0 auto; }
.gv-card { --sc-fs: 19px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 2px rgba(20,24,40,.06), 0 18px 48px rgba(20,24,40,.10); height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; font-size: var(--sc-fs); }
.gv-wrap, .gv-modal { --sc-fs: 19px; }
.gv-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px 6px; }
.gv-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 750; flex: 1; }
.gv-x { border: 0; background: #f2f2ef; width: 36px; height: 36px; border-radius: 50%; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.gv-x:hover { background: #e8e8e4; }
.gv-bar { display: flex; gap: 10px; align-items: center; padding: 10px 28px 16px; border-bottom: 1px solid var(--line); }
.gv-sel { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--ink); }
.gv-btn { height: 42px; padding: 0 18px; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; font-size: 15px; font-weight: 650; color: var(--ink); cursor: pointer; white-space: nowrap; }
.gv-btn:hover:not(:disabled) { background: #f6f6f3; } .gv-btn.on { background: var(--accent-soft); border-color: #c9cef0; color: var(--accent); } .gv-btn:disabled { opacity: .4; cursor: default; }
.gv-btn.big { height: 48px; font-size: 16px; padding: 0 22px; }
.gv-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px 18px; scrollbar-gutter: stable; }
.gv-step { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.gv-title { margin: 0 0 18px; font-size: calc(var(--sc-fs) * 1.55); line-height: 1.15; letter-spacing: -.025em; font-weight: 780; }
.gv-lines { display: grid; gap: 12px; }
.gv-line { margin: 0; display: flex; gap: 12px; font-size: calc(var(--sc-fs) * 1.08); line-height: 1.5; color: var(--ink); }
.gv-line i { font-style: normal; color: var(--muted); flex: none; font-weight: 600; }
.gv-h { font-size: 12.5px; font-weight: 750; letter-spacing: .07em; color: var(--muted); margin: 10px 0 0; }
.gv-li { display: flex; gap: 12px; font-size: calc(var(--sc-fs) * 1.02); line-height: 1.5; } .gv-li b { min-width: 22px; color: var(--muted); }
.gv-note { background: #f5f5f2; border-radius: 12px; padding: 10px 14px; color: var(--ink-2); font-size: calc(var(--sc-fs) * .9); line-height: 1.45; }
.gv-note b { display: block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.gv-card .sc-ph { color: #8d93a1; background: none; padding: 0; border: 0; font-weight: 500; }
.gv-card .sc-nm { color: var(--accent); font-weight: 700; background: none; }
.gv-sec { margin-top: 26px; }
.gv-lab { font-size: 14px; font-weight: 750; color: var(--ink-2); margin-bottom: 10px; }
.gv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.gv-pill { border: 0; background: var(--bg); color: var(--fg); border-radius: 99px; padding: 8px 16px; font-size: 14.5px; font-weight: 650; cursor: pointer; transition: transform .08s, filter .12s; }
.gv-pill:hover { filter: brightness(.96); } .gv-pill:active { transform: scale(.97); } .gv-pill.on { box-shadow: inset 0 0 0 2px var(--fg); }
.gv-pill.ret { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.gv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .gv-grid.one { grid-template-columns: 1fr; }
.gv-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: var(--bg); color: var(--fg); border-radius: 16px; padding: 16px 18px; min-height: 60px; font-size: calc(var(--sc-fs) * .92); font-weight: 700; cursor: pointer; transition: transform .08s, filter .12s; }
.gv-opt b { font-size: 24px; line-height: 1; opacity: .75; } .gv-opt:hover { filter: brightness(.96); } .gv-opt:active { transform: scale(.985); }
.gv-foot { display: flex; gap: 10px; padding: 14px 28px 20px; border-top: 1px solid var(--line); background: #fff; }
.gv-list .sc-grp summary { font-weight: 700; }
.gv-modal { position: fixed; inset: 0; z-index: 200; background: rgba(18,22,36,.45); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(2px); }
.gv-modal .gv-card { width: min(860px, 100%); height: min(88vh, 900px); }
.gv-open { margin-right: 4px; } .gv-open svg { width: 18px !important; height: 18px !important; }
@media (max-width: 860px) {
  .gv-wrap { max-width: none; } .gv-card { border-radius: 20px; }
  .gv-head { padding: 16px 16px 4px; } .gv-bar { padding: 8px 16px 12px; } .gv-body { padding: 16px; } .gv-foot { padding: 10px 16px 14px; }
  .gv-grid { grid-template-columns: 1fr; } .gv-foot .gv-btn { flex: 1; }
  .gv-modal { padding: 0; } .gv-modal .gv-card { width: 100%; height: 100%; border-radius: 0; }
}

/* ---- WhatsApp control center (Seguimiento > Envío automático) and client thread ---- */
.wc { display: block; }
.wc-banner { border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; border: 1px solid transparent; }
.wc-banner.test { background: #fbf1df; border-color: #f0dcae; color: #6b4a0b; }
.wc-banner.live { background: #e8f5ee; border-color: #bfe3cf; color: #1d5a3b; }
.wc-banner.optout { background: #fbeceb; border-color: #f2c6c3; color: #8a2a24; }
.wc-err { background: #fbeceb; color: #8a2a24; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.wc-sub { align-items: center; }
.wc-sub .fu-chip b { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; margin-left: 6px; font-size: 12px; }
.wc-sub .fu-chip.on b { background: #fff; color: var(--accent); }
.wc-refresh { margin-left: auto; }
.wc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.wc-card, .wc-q, .wc-tpl, .wc-log, .wc-sim { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.wc-card h3 { margin: 0 0 8px; }
.wc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wc-row:last-of-type { border-bottom: 0; }
.wc-sub-t { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.wc-switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: #f1f2f5; border-radius: 99px; padding: 4px 12px 4px 4px; font-weight: 650; font-size: 14px; color: var(--ink-2); min-width: 78px; flex: none; }
.wc-switch i { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: block; transition: transform .15s; }
.wc-switch.on { background: var(--accent); border-color: var(--accent); color: #fff; flex-direction: row-reverse; padding: 4px 4px 4px 12px; }
.wc-switch:disabled { opacity: .5; cursor: not-allowed; }
.wc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.wc-stats div { background: #f6f7f9; border-radius: 14px; padding: 12px; }
.wc-stats b { display: block; font-size: 24px; letter-spacing: -.02em; } .wc-stats span { font-size: 12.5px; color: var(--muted); }
.wc-qlist, .wc-loglist { display: grid; gap: 12px; }
.wc-qh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.wc-note { background: #f6f7f9; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: var(--ink-2); margin: 8px 0; }
.wc-note.big { margin-bottom: 14px; padding: 12px 16px; }
.wc-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wc-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .wc-vars span { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 2px 8px; font-size: 12.5px; }
.wc-tpl { margin-bottom: 12px; }
.wc-opts { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: grid; gap: 10px; }
.wc-chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; } .wc-chk input { margin-top: 4px; }
.wc-prop { background: #fbf1df; color: #6b4a0b; border-radius: 8px; padding: 1px 8px; font-style: normal; font-size: 12.5px; margin-left: 6px; }
.wc-fld { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 8px 0; }
.wc-fld input, .wc-fld select { height: 42px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; font-size: 15px; font-weight: 400; background: #fff; width: 100%; }
.wc-log.in { border-left: 4px solid #8aa0e6; } .wc-log.out { border-left: 4px solid #cfd3dc; }
.wc-logh { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.wc-logb { margin-top: 6px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.wc-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #596072; background: #f1f2f5; border-radius: 99px; padding: 2px 10px; }
.wc-st i { font-style: normal; letter-spacing: -2px; } .wc-st em { font-style: normal; font-weight: 400; color: var(--faint); margin-left: 2px; }
.wc-st.read { background: #e7f0fd; color: #1a63c7; } .wc-st.failed { background: #fbeceb; color: #a8332b; } .wc-st.received { background: #eef0fa; color: var(--accent); }
.wc-thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; max-height: 520px; overflow: auto; padding: 4px; }
.wc-bub { max-width: 82%; border-radius: 16px; padding: 10px 14px; }
.wc-bub.out { align-self: flex-end; background: #e3f4e8; border-bottom-right-radius: 4px; } .wc-bub.in { align-self: flex-start; background: #f1f2f5; border-bottom-left-radius: 4px; }
.wc-bt { white-space: pre-wrap; font-size: 14.5px; } .wc-bm { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wc-sim { margin-top: 12px; }
@media (max-width: 860px) { .wc-grid { grid-template-columns: 1fr; } .wc-bub { max-width: 94%; } .wc-card, .wc-q, .wc-tpl, .wc-log { padding: 14px; } .wc-row { align-items: flex-start; } }

/* ---- Instalar KPI ---- */
.ik-btn { display: inline-flex; align-items: center; gap: 6px; }
.ik-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.ik-note { background: #f6f7f9; border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--ink-2); margin-top: 12px; }
.ik-ok { background: #e8f5ee; color: #1d5a3b; border-radius: 12px; padding: 10px 14px; font-size: 14.5px; font-weight: 600; }

/* KPI-only app shell (kpi.html) */
.ko { min-height: 100vh; background: var(--bg, #f6f7f9); }
.ko-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--sidebar, #14213d); color: #fff; position: sticky; top: 0; z-index: 20; }
.ko-bar .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.ko-bar .grow { flex: 1; } .ko-bar .btn { height: 36px; }
.ko .content { padding: 24px 20px 60px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 860px) { .ko .content { padding: 16px 12px 40px; } }
.panes .tabs { gap: 18px; flex-wrap: wrap; row-gap: 0; }
.panes .tabs button { white-space: nowrap; }
#wc-logq { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px; font-size: 15px; background: #fff; }
.wc-thread { max-height: none; overflow: visible; }
