/* Studio — soft geometric UI: airy blue-gray ground, white rounded panels,
   black pill actions with a lime accent, royal-blue hero + lavender cards. */
:root {
  --ground: #eef2f8;
  --ground-2: #e3eaf6;
  --surface: #ffffff;
  --sunk: #f3f4f8;
  --ink: #121216;
  --ink-2: #4c4f5c;
  --ink-3: #6f7280;
  --line: #e7e8ef;
  --accent: #121216;        /* primary action = black pill */
  --accent-ink: #ffffff;
  --accent-soft: #ececfb;   /* lavender */
  --lime: #d6f45f;
  --lime-ink: #121216;
  --blue: #3a55f0;
  --blue-soft: #e4e9ff;
  --lav: #dcdcfa;
  --lav-ink: #3b3a8f;
  --ok: #3d6b00;
  --ok-soft: #eefbc9;
  --warn: #8a5300;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde8e6;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 1px 2px rgba(18, 18, 40, .04), 0 12px 32px rgba(40, 52, 110, .07);
  --serif: "Outfit", "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Outfit", "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* tokens the dark theme overrides */
  --ground-top: #f4f7fc;
  --sunk-hover: #eceef4;
  --line-strong: #cfd2de;
  --solid: #121216;          /* black pill: primary buttons, active nav */
  --solid-ink: #ffffff;
  --solid-hover: #2a2a33;
  --solid-accent: #d6f45f;   /* the round arrow inside a primary button */
  --solid-accent-ink: #121216;
  --col-bg: rgba(255,255,255,.55);
  --col-line: rgba(255,255,255,.8);
  --out-ink: #a9acb8;
  --hatch-a: #e4e6ee;
  --hatch-b: #f3f4f8;
  --switch-off: #d5d8e2;
  --doc-ink: #22232b;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0e0f14;
  --ground-2: #12141b;
  --ground-top: #0b0c10;
  --surface: #181a22;
  --sunk: #222531;
  --sunk-hover: #2a2e3b;
  --ink: #eef0f5;
  --ink-2: #c2c5d1;
  --ink-3: #959aaa;
  --line: #2b2e3a;
  --line-strong: #3d4150;
  --accent-soft: #262744;
  --lav: #2f2f5c;
  --lav-ink: #cbcaff;
  --blue: #6178ff;
  --blue-soft: #1d2448;
  --ok: #b9e45c;
  --ok-soft: #26310f;
  --warn: #f3c46e;
  --warn-soft: #3a2c12;
  --bad: #ff8a80;
  --bad-soft: #3c1a18;
  --solid: #d6f45f;
  --solid-ink: #121216;
  --solid-hover: #c6e64e;
  --solid-accent: #121216;
  --solid-accent-ink: #d6f45f;
  --col-bg: rgba(24,26,34,.6);
  --col-line: rgba(255,255,255,.06);
  --out-ink: #5b5f6d;
  --hatch-a: #2a2d39;
  --hatch-b: #20232d;
  --switch-off: #3d4150;
  --doc-ink: #e4e6ee;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font: 15px/1.5 var(--sans); color: var(--ink); background: linear-gradient(160deg, var(--ground-top) 0%, var(--ground) 45%, var(--ground-2) 100%) fixed; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--sans); font-weight: 500; margin: 0; letter-spacing: -.02em; }
h1 { font-size: 38px; line-height: 1.1; font-weight: 400; }
h2 { font-size: 24px; font-weight: 400; }
h3 { font-size: 18px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); margin: 16px 0 16px 16px; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 14px; position: sticky; top: 16px; height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.brand svg { flex: none; }
.brand b { font-size: 17px; font-weight: 600; line-height: 1.1; display: block; letter-spacing: -.01em; }
.brand small { color: var(--ink-3); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a.on { background: var(--solid); color: var(--solid-ink); }
.nav .count { margin-left: auto; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; min-width: 22px; text-align: center; padding: 2px 7px; border-radius: 99px; }
.theme-toggle { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: auto; padding: 10px 14px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500; text-align: left; }
.theme-toggle:hover { background: var(--sunk); color: var(--ink); }
.theme-toggle svg { flex: none; }
.side .foot { margin-top: 8px; font-size: 12px; color: var(--ink-3); padding: 12px; background: var(--sunk); border-radius: var(--radius-sm); }
.side .foot a { color: var(--ink); font-weight: 600; }
main { padding: 32px 36px 60px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.top p { margin: 6px 0 0; color: var(--ink-3); }
.top > div > a.small { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); background: var(--surface); padding: 4px 12px 4px 4px; border-radius: 99px; margin-bottom: 10px; box-shadow: var(--shadow); }
.top > div > a.small::before { content: "‹"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); font-size: 15px; line-height: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 10px 18px; border-radius: 99px; cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); padding-right: 6px; }
.btn.primary::after { content: "↗"; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px 0 -4px 4px; border-radius: 50%; background: var(--solid-accent); color: var(--solid-accent-ink); font-size: 13px; font-weight: 700; }
.btn.primary.sm::after { width: 22px; height: 22px; font-size: 11px; margin: -2px 0 -2px 2px; }
.btn.primary:hover { background: var(--solid-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.primary.sm { padding-right: 4px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin: 0 0 6px 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; border: 1px solid transparent; background: var(--sunk); border-radius: 14px; padding: 10px 14px; outline: none; transition: border-color .15s, background .15s; }
input:hover, select:hover, textarea:hover { background: var(--sunk-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 4px var(--blue-soft); }
textarea { resize: vertical; min-height: 90px; }
textarea.code { font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; min-height: 420px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* ---------- surfaces */
.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card h3 { margin-bottom: 14px; font-size: 20px; font-weight: 500; }
.card .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card .hd h3 { margin: 0; }
.card .hd a.small { color: var(--blue); font-weight: 500; text-underline-offset: 3px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.empty { color: var(--ink-3); padding: 22px; text-align: center; background: var(--sunk); border-radius: var(--radius-sm); }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 12px 18px; margin-bottom: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--blue-soft); color: var(--blue); }

/* ---------- bento KPIs */
.kpis { display: grid; grid-template-columns: 1.35fr 1fr 1fr; grid-template-rows: auto auto; gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); text-decoration: none; color: inherit; min-height: 132px; display: flex; flex-direction: column; }
.kpi small { color: var(--ink-2); font-weight: 400; font-size: 14px; max-width: 70%; }
.kpi b { display: block; font-size: 44px; font-weight: 400; line-height: 1; margin-top: auto; padding-top: 14px; letter-spacing: -.03em; }
.kpi span { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.kpi::after { content: "↗"; position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.kpi.hero { grid-row: span 2; background: var(--blue); color: #fff; min-height: 280px; }
.kpi.hero small, .kpi.hero span { color: rgba(255,255,255,.86); }
.kpi.hero b { font-size: 76px; }
.kpi.hero::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; right: -120px; top: -150px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,.04) 70%); }
.kpi.hero > * { position: relative; }
.kpi.hero { background-image: radial-gradient(circle at 78% 115%, rgba(255,255,255,.14) 0 34%, transparent 34.2%); }
.kpi.lav { background: var(--lav) radial-gradient(rgba(59,58,143,.13) 1.2px, transparent 1.4px) 0 0 / 12px 12px; }
.kpi.lav small, .kpi.lav span { color: var(--lav-ink); }
.kpi.lime { background: var(--lime); color: #121216; }
.kpi.lime::after { background: #121216; color: var(--lime); }
.kpi.lime small, .kpi.lime span { color: #34401a; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols.detail { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }

/* ---------- lists & tables */
.list { display: flex; flex-direction: column; gap: 6px; }
.li { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--radius-sm); text-decoration: none; color: inherit; }
a.li:hover { background: var(--sunk); }
.date-chip { flex: none; width: 50px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; background: var(--accent-soft); }
.date-chip small { display: block; font-size: 10px; font-weight: 600; color: var(--lav-ink); text-transform: uppercase; letter-spacing: .08em; }
.date-chip b { font-size: 21px; font-weight: 500; line-height: 1.05; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 8px 12px; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sunk); }
tr.click:hover td:first-child { border-radius: 14px 0 0 14px; }
tr.click:hover td:last-child { border-radius: 0 14px 14px 0; }
.pill { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--lime); color: var(--lime-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.acc { background: var(--accent-soft); color: var(--lav-ink); }
.search { max-width: 300px; }

/* chip filters (lime = active, like the reference) */
select#ft, select#fs, .row select { border-radius: 99px; }

/* ---------- stage bars */
.stagebars .sb { display: grid; grid-template-columns: 128px 1fr 84px; gap: 12px; align-items: center; padding: 7px 0; text-decoration: none; color: inherit; }
.sb .bar { height: 14px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.sb .bar i { display: block; height: 100%; background: var(--lav); border-radius: 99px; min-width: 14px; }
.sb .bar i.booked { background: var(--lime); }
.sb b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- pipeline */
.pipe-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; color: var(--ink-2); }
.pipe-sum span { background: var(--surface); border-radius: 99px; padding: 8px 16px; box-shadow: var(--shadow); }
.pipe-sum span:first-child { background: var(--blue); color: rgba(255,255,255,.85); }
.pipe-sum span:first-child b { color: #fff; }
.pipe-sum span:nth-child(2) { background: var(--lime); color: #34401a; }
.pipe-sum span:nth-child(2) b { color: #121216; }
.pipe-sum b { color: var(--ink); font-size: 17px; font-weight: 600; margin-left: 4px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: start; }
.col { background: var(--col-bg); border: 1px solid var(--col-line); border-radius: var(--radius); padding: 12px; min-height: 260px; backdrop-filter: blur(6px); }
.col.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.col header { padding: 4px 6px 12px; }
.col header b { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.col header b small { background: var(--surface); color: var(--ink-2); border-radius: 99px; min-width: 26px; height: 26px; display: grid; place-items: center; font-size: 12px; }
.col header .tot { font-size: 26px; font-weight: 400; letter-spacing: -.02em; margin-top: 2px; }
.col[data-stage=signed] header .tot, .col[data-stage=retained] header .tot, .col[data-stage=paid] header .tot, .col[data-stage=completed] header .tot { display: inline-block; background: var(--lime); color: var(--lime-ink); padding: 0 10px; border-radius: 99px; font-size: 22px; }
.pcard { background: var(--surface); border-radius: 18px; padding: 14px; margin-bottom: 10px; cursor: grab; box-shadow: 0 1px 2px rgba(18,18,40,.05); display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.pcard.dragging { opacity: .4; }
.pcard .nm { font-weight: 500; }
.pcard .meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.pcard .ft { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
.pcard .val { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- contact detail */
.section-title { font-size: 13px; font-weight: 500; color: var(--ink-3); margin: 26px 0 12px; }
.section-title:first-child { margin-top: 0; }
.songs { display: grid; gap: 10px; }
.song { display: grid; grid-template-columns: 38px 240px 1fr 34px; gap: 10px; align-items: center; background: var(--accent-soft); border-radius: 18px; padding: 10px; }
.song input { background: var(--surface); }
.song .rm { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer; }
.song .rm:hover { background: var(--bad-soft); color: var(--bad); }
.add-song { margin-top: 10px; }
.song .n { width: 34px; height: 34px; border-radius: 50%; background: var(--solid); color: var(--solid-accent); display: grid; place-items: center; font-size: 15px; font-weight: 600; }
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.money div { background: var(--accent-soft); border-radius: 18px; padding: 14px 16px; }
.money div:first-child { background: var(--blue); color: #fff; }
.money div:first-child small { color: rgba(255,255,255,.85); }
.money div:nth-child(2) { background: var(--lime); color: #121216; }
.money div:nth-child(2) small { color: #34401a; }
.money small { color: var(--ink-2); font-size: 13px; }
.money b { display: block; font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.savebar { position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 2px; margin-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.hint { font-size: 13px; color: var(--ink-3); }

/* ---------- calendar (pill bands like the reference) */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.cal .dow { padding: 4px 8px 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cal .day { min-height: 112px; padding: 8px; border-radius: 16px; background: var(--sunk); min-width: 0; }
.cal .day.out { background: transparent; color: var(--out-ink); }
.cal .day.today { background: var(--blue-soft); }
.cal .day.today .dn { background: var(--blue); color: #fff; }
.cal .dn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 500; cursor: pointer; }
.cal .dn:hover { background: var(--surface); }
.ev { display: block; font-size: 12px; border-radius: 99px; padding: 3px 9px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; cursor: pointer; font-weight: 500; }
.ev.event { background: var(--lime); color: var(--lime-ink); }
.ev.event.tentative { background: var(--lav); color: var(--lav-ink); }
.ev.consult { background: var(--blue); color: #fff; }
.ev.hold { background: var(--warn-soft); color: var(--warn); }
.ev.block { background: repeating-linear-gradient(135deg, var(--hatch-a) 0 4px, var(--hatch-b) 4px 8px); color: var(--ink-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* ---------- contracts */
.doc { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px 52px; font-size: 16px; line-height: 1.7; max-width: 820px; color: var(--doc-ink); }
.doc table.ct { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 15px; line-height: 1.5; }
.doc table.ct th, .doc table.ct td { border: 1px solid var(--line-strong); padding: 9px 12px; text-align: left; vertical-align: top; white-space: normal; }
.doc table.ct th { background: var(--sunk); color: var(--ink); font-weight: 600; font-size: 14px; }
.sig-img { max-width: 320px; background: #fff; border-radius: 8px; padding: 6px; border-bottom: 1px solid var(--ink); }
.doc h2 { font-size: 30px; margin-bottom: 16px; }
.doc h3 { font-size: 18px; font-weight: 600; margin: 24px 0 6px; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
mark.missing { background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 1px 8px; font-size: 13px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; background: var(--sunk); border-radius: 99px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.chip:hover { background: var(--lime); color: var(--lime-ink); }
.tabs { display: inline-flex; gap: 4px; background: var(--surface); padding: 5px; border-radius: 99px; margin-bottom: 18px; box-shadow: var(--shadow); }
.tabs button { background: none; border: 0; padding: 8px 18px; cursor: pointer; font-weight: 500; color: var(--ink-3); border-radius: 99px; }
.tabs button.on { color: var(--lime-ink); background: var(--lime); }
.tpl-list .li { cursor: pointer; padding: 12px; }
.tpl-list .li:hover { background: var(--sunk); }
.tpl-list .li.on { background: var(--solid); color: var(--solid-ink); }
.tpl-list .li.on .muted { color: inherit; opacity: .7; }
.copy { display: flex; gap: 8px; }
.copy input { font: 12px ui-monospace, Menlo, monospace; }
.audit { font-size: 13px; color: var(--ink-2); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.audit b { font-weight: 500; color: var(--ink); }

/* ---------- inbox */
.inbox { display: grid; grid-template-columns: 350px 1fr; gap: 16px; min-height: 560px; }
.threads { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; overflow-y: auto; max-height: 74vh; display: flex; flex-direction: column; gap: 4px; }
.th { padding: 12px 14px; border-radius: 18px; cursor: pointer; }
.th:hover { background: var(--sunk); }
.th.on { background: var(--accent-soft); }
.th .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 500; }
.th.unread .who { font-weight: 600; }
.th.unread .who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.th .sub { font-size: 14px; }
.th .snip { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 74vh; min-width: 0; }
.msg { background: var(--sunk); border-radius: 20px 20px 20px 6px; padding: 12px 16px; max-width: 640px; white-space: pre-wrap; }
.msg.out { align-self: flex-end; background: var(--blue); color: #fff; border-radius: 20px 20px 6px 20px; }
.msg.out .mh { color: rgba(255,255,255,.75); }
.msg .mh { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; white-space: normal; }

/* ---------- automations */
.auto { display: grid; grid-template-columns: 1fr; gap: 12px; }
.auto .trig { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 99px; padding: 6px 8px 6px 18px; color: var(--lav-ink); font-weight: 500; }
.auto .trig input, .auto .trig select { background: var(--surface); border-radius: 99px; }
.auto .trig input[type=number] { width: 72px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--switch-off); border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch input:checked + span { background: var(--solid); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--solid-accent); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--blue-soft); }

/* ---------- integrations */
.integ { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.integ .card { margin: 0; }
.integ code { background: var(--sunk); padding: 2px 7px; border-radius: 99px; font-size: 12px; }
pre.embed { background: #121216; color: var(--lime); padding: 16px; border-radius: 18px; font-size: 12px; overflow-x: auto; white-space: pre; }
.iframe-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ground); }
.iframe-wrap iframe { display: block; width: 100%; height: 780px; border: 0; }

/* ---------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(18, 18, 40, .35); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 28px; padding: 26px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(18,18,40,.25); }
.modal h2 { margin-bottom: 16px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #121216; color: #fff; border: 1px solid var(--line); padding: 12px 20px; border-radius: 99px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
.toast::before { content: "●"; color: var(--lime); margin-right: 8px; }
.toast.err { background: var(--bad); }
.toast.err::before { color: #fff; }
.preview-email { background: var(--sunk); border-radius: 18px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi.hero { grid-row: auto; grid-column: span 2; min-height: 200px; }
  .cols, .cols.even, .cols.detail { grid-template-columns: 1fr; }
  .integ { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; margin: 12px 12px 0; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .brand { padding: 4px 8px 8px; width: 100%; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 12px; font-size: 14px; }
  .side .foot { display: none; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 30px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi.hero { grid-column: auto; }
  .kpi.hero b { font-size: 56px; }
  .grid2, .grid3, .money { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .song { grid-template-columns: 38px 1fr 34px; }
  .song input { grid-column: 2; }
  .song .rm { grid-column: 3; grid-row: 1; }
  .theme-toggle { width: auto; margin-top: 6px; padding: 7px 12px; font-size: 14px; }
  .inbox { grid-template-columns: 1fr; }
  .threads { max-height: 300px; }
  .doc { padding: 24px 20px; }
  .cal { gap: 3px; padding: 8px; }
  .cal .day { min-height: 70px; padding: 4px; border-radius: 10px; }
  .ev { font-size: 10px; padding: 1px 5px; }
}

/* round icon button (bell) */
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); }
.icon-btn i { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); border: 2px solid var(--surface); }
.kpis > .kpi:nth-child(2) { grid-column: 2; grid-row: 1; }
.kpis > .kpi:nth-child(3) { grid-column: 3; grid-row: 1; }
.kpis > .kpi:nth-child(4) { grid-column: 2; grid-row: 2; }
.kpis > .kpi:nth-child(5) { grid-column: 3; grid-row: 2; }
@media (max-width: 1100px) { .kpis > .kpi:nth-child(n) { grid-column: auto; grid-row: auto; } .kpis > .kpi.hero { grid-column: span 2; } }
@media (max-width: 760px) { .kpis > .kpi.hero { grid-column: auto; } }
