/* OptimalBody CRM. Look: warm cream→sage glass UI, Urbanist, black pill navigation, color-blocked cards */
:root {
  --font: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #1C1915; --ink-2: #4E4943; --muted: #8E887E; --line: rgba(28,25,21,.08); --line-2: rgba(28,25,21,.14);
  --bg: #EDEAE3;
  --bg-a: #F3DCC3; --bg-b: #DCEADF;
  --panel: rgba(250,249,246,.66); --panel-solid: #F6F5F1; --panel-border: rgba(255,255,255,.75);
  --inset: rgba(28,25,21,.04); --field: rgba(255,255,255,.72); --chip-bg: rgba(255,255,255,.78);
  --black: #161614; --black-ink: #F5F3EE;
  --green: #2B5C4E; --green-2: #3D7262; --orange: #C6431D; --yellow: #EFC84B; --red: #D2462A; --blue: #2F6FD0; --violet: #5E5BD8;
  --on-dark: #fff; --on-yellow: #2A2416;
  --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 24px 48px -30px rgba(52,40,24,.28);
  --shadow-card: 0 18px 30px -22px rgba(20,16,10,.55);
  --r-panel: 26px; --r-card: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #F1EEE7; --ink-2: #C9C4BA; --muted: #8F8A80; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --bg: #111210; --bg-a: #2A2118; --bg-b: #142019;
  --panel: rgba(30,31,28,.7); --panel-solid: #1D1E1B; --panel-border: rgba(255,255,255,.06);
  --inset: rgba(255,255,255,.04); --field: rgba(255,255,255,.06); --chip-bg: rgba(255,255,255,.08);
  --black: #262724; --black-ink: #F1EEE7;
  --shadow: 0 24px 48px -30px rgba(0,0,0,.6);
  --shadow-card: 0 18px 30px -22px rgba(0,0,0,.8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F1EEE7; --ink-2: #C9C4BA; --muted: #8F8A80; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
    --bg: #111210; --bg-a: #2A2118; --bg-b: #142019;
    --panel: rgba(30,31,28,.7); --panel-solid: #1D1E1B; --panel-border: rgba(255,255,255,.06);
    --inset: rgba(255,255,255,.04); --field: rgba(255,255,255,.06); --chip-bg: rgba(255,255,255,.08);
    --black: #262724; --black-ink: #F1EEE7;
    --shadow: 0 24px 48px -30px rgba(0,0,0,.6);
    --shadow-card: 0 18px 30px -22px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--ink); font-size: 14px; line-height: 1.45; min-height: 100vh;
  background:
    radial-gradient(1100px 680px at -5% -10%, var(--bg-a) 0%, transparent 62%),
    radial-gradient(1100px 820px at 105% 105%, var(--bg-b) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 10px; }
::selection { background: var(--yellow); color: var(--on-yellow); }

/* ---------- shell ---------- */
.shell { max-width: 1260px; margin: 0 auto; padding: 22px 36px 120px 116px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--black); color: var(--black-ink); display: grid; place-items: center; font-weight: 700; font-size: 19px; }
.brand small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; position: relative; }
.ibtn { width: 38px; height: 38px; border-radius: 50%; background: var(--chip-bg); display: grid; place-items: center; position: relative; transition: background .15s, transform .15s; color: var(--ink); }
.ibtn:hover { background: var(--panel-solid); }
.ibtn svg { width: 17px; height: 17px; }
.ibtn.sm { width: 32px; height: 32px; } .ibtn.sm svg { width: 15px; height: 15px; }
.badge-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--bg); }
.avatar-me { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--green); color: #fff; box-shadow: 0 0 0 3px var(--chip-bg); }

.tabs { display: flex; gap: 4px; margin: 22px 0 30px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 17px; border-radius: 999px; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--ink); transition: background .15s, color .15s; }
.tab:hover { background: var(--chip-bg); }
.tab.on { background: var(--black); color: var(--black-ink); }

.rail { position: fixed; left: 22px; top: 50%; transform: translateY(-50%); z-index: 40; background: #121414; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 24px 40px -20px rgba(0,0,0,.6); }
.rail button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.72); transition: background .15s, color .15s; position: relative; }
.rail button:hover, .rail button.on { background: rgba(255,255,255,.1); color: #fff; }
.rail button svg { width: 18px; height: 18px; }
.rail hr { border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: 6px 10px; }
.rail [data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: #121414; color: #fff; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; }

/* ---------- page head ---------- */
.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; gap: 36px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 33px; font-weight: 500; line-height: 1.06; letter-spacing: -.025em; min-width: 150px; }
.page-title .back { margin-right: 14px; vertical-align: middle; }
.kpis { display: flex; gap: 30px; flex-wrap: wrap; align-items: center; }
.kpi { display: flex; align-items: center; gap: 12px; }
.kpi-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--chip-bg); display: grid; place-items: center; }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-v { font-size: 22px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; line-height: 1.15; }
.kpi-l { font-size: 12.5px; color: var(--muted); max-width: 170px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--chip-bg); color: var(--ink); }
.chip.green { background: var(--green); color: #fff; }
.chip.yellow { background: var(--yellow); color: var(--on-yellow); }
.chip.orange { background: var(--orange); color: #fff; }
.chip.black { background: var(--black); color: var(--black-ink); }
.chip.red { background: var(--red); color: #fff; }
.chip.soft { background: var(--inset); color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--inset); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok::before { background: var(--green-2); } .status.warn::before { background: var(--yellow); } .status.bad::before { background: var(--red); }
.status.info::before { background: var(--blue); } .status.hot::before { background: var(--orange); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--r-panel); padding: 20px 22px 22px; box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); min-width: 0; }
.panel + .panel, .grid + .panel, .panel + .grid, .grid + .grid { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 34px; }
.panel-title { font-size: 14.5px; font-weight: 500; }
.panel-sub { color: var(--muted); font-size: 12.5px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.big { font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.big-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--ink-2); font-size: 12.5px; margin: 6px 0 4px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.legend i.dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--ink); vertical-align: 3px; }
.grid { display: grid; gap: 16px; }
.grid > * { margin-top: 0 !important; }
.g-2 { grid-template-columns: 1fr 1fr; } .g-3 { grid-template-columns: repeat(3, 1fr); } .g-1-2 { grid-template-columns: 1fr 2fr; } .g-2-1 { grid-template-columns: 2fr 1fr; }
.panel.tone-green { background: var(--green); color: #fff; border-color: transparent; }
.panel.tone-green .panel-sub { color: rgba(255,255,255,.7); }
.panel.tone-green .ibtn { background: rgba(255,255,255,.12); color: #fff; }
.inset { background: var(--inset); border-radius: 16px; padding: 12px 14px; }

/* segmented control */
.seg { display: inline-flex; background: var(--inset); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--panel-solid); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------- buttons / fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 999px; background: var(--black); color: var(--black-ink); font-weight: 600; font-size: 13px; white-space: nowrap; transition: transform .12s, opacity .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--chip-bg); }
.btn.light { background: var(--chip-bg); color: var(--ink); }
.btn.white { background: #fff; color: #161614; }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s, background .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--line-2); background: var(--panel-solid); }
.input.pill { border-radius: 999px; }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; font-family: var(--font); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 36px; border-radius: 999px; min-width: 220px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.fchip { padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--chip-bg); color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.fchip b { font-weight: 600; color: var(--muted); }
.fchip.on { background: var(--black); color: var(--black-ink); }
.fchip.on b { color: rgba(255,255,255,.6); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- deal / lead cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.deal { border-radius: var(--r-card); padding: 13px 14px 13px 16px; display: flex; flex-direction: column; min-height: 150px; text-align: left; position: relative; box-shadow: var(--shadow-card); transition: transform .15s; color: #fff; min-width: 0; }
.deal:hover { transform: translateY(-2px); }
.deal.k-black { background: var(--black); color: var(--black-ink); }
.deal.k-orange { background: var(--orange); }
.deal.k-green { background: var(--green); }
.deal.k-yellow { background: var(--yellow); color: var(--on-yellow); }
.deal.k-gray { background: var(--panel-solid); color: var(--ink); }
.deal-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; opacity: .78; }
.deal-more { width: 26px; height: 26px; border-radius: 50%; border: 1px solid currentColor; opacity: .55; display: grid; place-items: center; }
.deal-more svg { width: 13px; height: 13px; }
.deal h4 { font-size: 17px; font-weight: 500; line-height: 1.2; margin-top: 8px; overflow-wrap: anywhere; }
.deal .sub { font-size: 12px; opacity: .72; margin-top: 2px; }
.deal-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.deal-v { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.deal-v small { display: block; font-size: 11px; font-weight: 500; opacity: .72; letter-spacing: 0; }
.ava { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.ava.lg { width: 44px; height: 44px; font-size: 15px; }
.ava.xl { width: 104px; height: 104px; font-size: 34px; box-shadow: 0 0 0 6px var(--chip-bg); }

/* ---------- pipeline ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--panel-border); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 420px; max-height: 70vh; transition: box-shadow .15s, background .15s; box-shadow: var(--shadow); }
.col.over { box-shadow: inset 0 0 0 2px var(--ink), var(--shadow); }
.col-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 4px 2px; }
.col-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.col-name i { width: 10px; height: 10px; border-radius: 50%; }
.col-name .n { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--inset); color: var(--muted); font-weight: 600; }
.col-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0 18px; }
.col-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.col-body > * { flex: none; }
.col .deal { min-height: 128px; cursor: grab; }
.col .deal.dragging { opacity: .4; }
.col-empty { border: 1.5px dashed var(--line-2); border-radius: var(--r-card); padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.dropzones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.dz { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 999px; background: var(--panel); border: 1.5px dashed var(--line-2); transition: background .15s, border-color .15s; }
.dz .dz-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--inset); }
.dz.won .dz-ico { background: var(--green); color: #fff; }
.dz b { font-weight: 600; font-size: 14px; display: block; }
.dz small { color: var(--muted); font-size: 12px; }
.dz .hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.dz.over { border-color: var(--ink); background: var(--panel-solid); }
.dz.won.over { border-color: var(--green); }

/* stage progress in quick view */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 4px; }
.stages div { font-size: 12px; opacity: .7; }
.stages div::before { content: ""; display: block; height: 4px; border-radius: 4px; background: currentColor; opacity: .28; margin-bottom: 8px; }
.stages div.done::before { opacity: 1; }
.stages div.cur { opacity: 1; font-weight: 600; }

/* ---------- contacts ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.person { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--r-panel); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: transform .15s; min-width: 0; }
.person:hover { transform: translateY(-2px); }
.person-top { display: flex; justify-content: space-between; align-items: flex-start; }
.star { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--inset); }
.star svg { width: 15px; height: 15px; }
.star.on { background: var(--yellow); color: var(--on-yellow); }
.person h4 { font-size: 16px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.person .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini small { display: block; font-size: 11px; color: var(--muted); }
.mini b { font-size: 13px; font-weight: 600; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.person-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.person-foot .icons { display: flex; gap: 6px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; white-space: nowrap; }
.tbl td { padding: 10px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--inset); }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.tbl .who small { display: block; color: var(--muted); font-size: 11.5px; }
.tbl .ava { box-shadow: none; }
.tbl tr.dim td { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 13px; }
.empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 9px 4px; border-radius: 12px; }
.timeline li:hover { background: var(--inset); }
.t-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--inset); color: var(--ink-2); }
.t-ico svg { width: 14px; height: 14px; }
.t-ico.green { background: var(--green); color: #fff; } .t-ico.orange { background: var(--orange); color: #fff; } .t-ico.yellow { background: var(--yellow); color: var(--on-yellow); } .t-ico.black { background: var(--black); color: var(--black-ink); } .t-ico.red { background: var(--red); color: #fff; }
.t-main { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.t-main small { display: block; color: var(--muted); font-size: 11.5px; }
.t-main .quote { margin-top: 4px; padding: 8px 12px; border-radius: 12px; background: var(--inset); white-space: pre-wrap; }
.t-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }

.kv { display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kv div:last-child { border: 0; padding-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* ---------- automations ---------- */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.step { border-radius: var(--r-card); padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; min-height: 150px; box-shadow: var(--shadow-card); transition: transform .15s, opacity .2s; color: #fff; }
.step:hover { transform: translateY(-2px); }
.step.email { background: var(--black); color: var(--black-ink); }
.step.sms { background: var(--green); }
.step.off { opacity: .45; }
.step-when { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; opacity: .78; gap: 8px; }
.step h4 { font-size: 15px; font-weight: 500; line-height: 1.25; }
.step p { font-size: 12px; opacity: .7; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.step-stats { margin-top: auto; display: flex; gap: 12px; font-size: 11.5px; opacity: .8; }
.step-stats b { font-size: 15px; font-weight: 600; display: block; opacity: 1; }
.seq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.seq-head p { color: var(--muted); font-size: 12.5px; max-width: 640px; margin-top: 2px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 18px; background: var(--yellow); color: var(--on-yellow); font-size: 13px; margin-bottom: 16px; }
.banner svg { width: 18px; height: 18px; }
.banner b { font-weight: 700; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vars button { font-size: 11.5px; padding: 4px 9px; border-radius: 999px; background: var(--inset); font-weight: 600; color: var(--ink-2); }
.vars button:hover { background: var(--yellow); color: var(--on-yellow); }
.preview-frame { width: 100%; height: 520px; border: 0; border-radius: 18px; background: #F4F6F8; }
.phone { background: var(--inset); border-radius: 22px; padding: 18px; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; }
.bubble { align-self: flex-start; max-width: 88%; background: var(--panel-solid); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 6px 16px -12px rgba(0,0,0,.4); }
.bubble.out { align-self: flex-end; background: var(--green); color: #fff; border-radius: 18px 18px 6px 18px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); }
.chart .target { stroke: var(--ink); stroke-dasharray: 6 6; stroke-width: 1.6; opacity: .85; }
.tip { position: absolute; pointer-events: none; background: var(--panel-solid); border-radius: 12px; padding: 8px 10px; font-size: 12px; box-shadow: 0 12px 28px -12px rgba(0,0,0,.35); white-space: nowrap; transform: translate(-50%, -110%); z-index: 2; }
.tip b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.tip i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.ring-wrap { display: grid; place-items: center; position: relative; margin: 8px 0; }
.ring-label { position: absolute; text-align: center; }
.ring-label b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.ring-label small { font-size: 12px; opacity: .75; }
.stackbar { display: flex; gap: 6px; height: 34px; margin: 10px 0 14px; }
.stackbar div { border-radius: 10px; min-width: 6px; transition: flex-grow .4s; }
.legend-rows { display: grid; gap: 9px; }
.legend-rows div { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.legend-rows i { width: 9px; height: 9px; border-radius: 50%; }
.legend-rows span { color: var(--muted); font-size: 12px; }
.legend-rows b { font-weight: 600; min-width: 36px; text-align: right; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; gap: 4px; font-size: 12.5px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; }
.hbar-top span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bar { height: 8px; }
.hbar .bar i { background: var(--green); }

/* ---------- feed ---------- */
.feed { display: grid; gap: 2px; }
.feed a { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 12px; font-size: 13px; }
.feed a:hover { background: var(--inset); }
.feed small { color: var(--muted); font-size: 11.5px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(236,232,224,.32); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein .2s ease both; }
:root[data-theme="dark"] .overlay { background: rgba(10,10,9,.5); }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 28px; padding: 24px 26px; background: var(--panel-solid); box-shadow: 0 40px 80px -30px rgba(0,0,0,.45); animation: pop .25s cubic-bezier(.2,.9,.3,1.2) both; position: relative; }
.modal.wide { width: min(1080px, 100%); }
.modal.tone-green { background: var(--green); color: #fff; }
.modal.tone-orange { background: var(--orange); color: #fff; }
.modal.tone-yellow { background: var(--yellow); color: var(--on-yellow); }
.modal.tone-black { background: var(--black); color: var(--black-ink); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal-x { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px currentColor; opacity: .7; }
.modal-x:hover { opacity: 1; }
.modal-x svg { width: 15px; height: 15px; }
.modal h3 { font-size: 24px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; padding-right: 40px; }
.modal .lead { font-size: 13px; opacity: .75; margin-top: 4px; }
.modal .qv-value { font-size: 40px; font-weight: 600; letter-spacing: -.02em; margin-top: 14px; line-height: 1; }
.modal .qv-box { margin-top: 16px; border-radius: 18px; padding: 12px 16px; background: rgba(255,255,255,.12); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.modal.tone-yellow .qv-box { background: rgba(0,0,0,.06); }
.modal .qv-box small { display: block; font-size: 12px; opacity: .72; }
.modal .qv-box b { font-size: 14px; font-weight: 600; }
.modal .qv-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13.5px; opacity: .92; }
.modal .qv-note svg { width: 16px; height: 16px; margin-top: 2px; }
.modal-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions.end { justify-content: flex-end; }
.btn.outline-on { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.form-grid { display: grid; gap: 12px; margin-top: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--green); }
.form-err { color: var(--red); font-size: 13px; min-height: 1em; }

.palette { width: min(560px, 100%); border-radius: 26px; background: var(--panel-solid); box-shadow: 0 40px 80px -30px rgba(0,0,0,.45); padding: 10px; align-self: start; margin-top: 12vh; animation: pop .2s ease both; }
.palette .input { border: 0; background: transparent; font-size: 17px; padding: 12px 14px; }
.palette-list { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; display: grid; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; }
.palette-list a:hover, .palette-list a.on { background: var(--inset); }
.palette-list small { color: var(--muted); }

.drop { position: absolute; top: 48px; right: 0; width: 360px; max-height: 460px; overflow-y: auto; z-index: 60; border-radius: 22px; background: var(--panel-solid); box-shadow: 0 30px 60px -24px rgba(0,0,0,.4); padding: 12px; animation: pop .18s ease both; }
.drop h5 { font-size: 13px; font-weight: 600; padding: 4px 8px 8px; }

.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; }
.toast { display: flex; align-items: center; gap: 10px; background: #161614; color: #fff; padding: 7px 7px 7px 16px; border-radius: 999px; font-size: 13px; box-shadow: 0 16px 32px -14px rgba(0,0,0,.5); animation: pop .25s ease both; max-width: calc(100vw - 32px); }
.toast svg { width: 15px; height: 15px; }
.toast.err { background: var(--red); }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { background: var(--yellow); color: #2A2416; font-weight: 700; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; }
.toast.plain { padding-right: 16px; }

.skeleton { border-radius: var(--r-panel); background: var(--panel); min-height: 160px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copy { display: flex; align-items: center; gap: 8px; background: var(--inset); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.copy span { flex: 1; min-width: 0; }

.login { max-width: 420px; margin: 12vh auto 40px; padding: 0 16px; display: grid; gap: 22px; }
.login form { display: grid; gap: 14px; padding: 28px; }
.login .page-title { margin-bottom: 6px; }
.login .btn { padding: 12px 18px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-3 { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { padding: 16px 16px 110px; }
  .rail { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); flex-direction: row; padding: 6px 10px; max-width: calc(100vw - 24px); overflow-x: auto; }
  .rail hr { border-top: 0; border-left: 1px solid rgba(255,255,255,.14); margin: 8px 4px; }
  .rail [data-tip]:hover::after { display: none; }
  .toasts { bottom: 86px; }
  .g-2, .g-3, .g-1-2, .g-2-1, .form-grid.two { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(3, 82vw); }
  .dropzones { grid-template-columns: 1fr; }
  .page-title { font-size: 28px; }
  .kpis { gap: 18px; }
  .page-actions { margin-left: 0; }
  .search .input { min-width: 0; }
  .drop { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .modal .qv-box { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
