/* Silver Moon CRM — "Midnight & Gold" (default) with an "Ivory" light theme. Gold is a placeholder until SMJ sends brand colours. */
:root {
  --bg: #090C15; --bg-glow: radial-gradient(1200px 520px at 85% -12%, rgba(217,183,110,.13), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(140,160,210,.07), transparent 60%);
  --card: rgba(255,255,255,.035); --card-2: rgba(255,255,255,.07); --solid: #121626;
  --ink: #F1EEE7; --ink-2: #D6D9E1; --muted: #A4AAB9;
  --line: rgba(217,183,110,.16); --line-2: rgba(217,183,110,.28);
  --gold: #D9B76E; --gold-2: #E9CF93; --gold-grad: linear-gradient(135deg,#E8CC8A,#B8904A); --on-gold: #1A1408;
  --silver: #C9CEDA; --track: rgba(255,255,255,.07);
  --accent: var(--gold); --accent-soft: rgba(217,183,110,.12);
  --ok: #7FD3A6; --ok-soft: rgba(127,211,166,.12);
  --warn: #F0BE8C; --warn-soft: rgba(232,168,107,.12);
  --bad: #F2948C; --bad-soft: rgba(242,148,140,.12);
  --radius: 20px; --shadow: 0 10px 40px rgba(0,0,0,.25);
  --serif: "Cormorant Garamond", Georgia, serif;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; color-scheme: dark;
}
:root[data-theme="ivory"] {
  --bg: #F6F1E6; --bg-glow: radial-gradient(1200px 500px at 85% -10%, rgba(184,144,74,.16), transparent 60%);
  --card: #FFFFFF; --card-2: #FBF7EE; --solid: #FFFFFF;
  --ink: #1B1C22; --ink-2: #3B3E48; --muted: #5C6070;
  --line: rgba(120,96,50,.18); --line-2: rgba(120,96,50,.32);
  --gold: #8C6A2C; --gold-2: #7A5B22; --silver: #5F6576; --track: #EFE8D8;
  --ok: #1F7A4D; --ok-soft: #E6F4EC; --warn: #9A5300; --warn-soft: #FDF1DF; --bad: #B3261E; --bad-soft: #FBEAE9;
  --shadow: 0 1px 2px rgba(60,40,10,.05), 0 8px 24px rgba(60,40,10,.06); color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); background-image: var(--bg-glow); background-attachment: fixed; min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
h1 { font-family: var(--serif); font-size: 40px; line-height: 1.05; margin: 0; font-weight: 600; letter-spacing: .005em; }
h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 12px; font-weight: 600; }
h2 .small, h2 .muted { font-family: Manrope, sans-serif; font-size: 12px !important; letter-spacing: .02em; }
h3 { font-size: 12px; margin: 0 0 8px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .16em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-weight: 700; letter-spacing: .05em; color: var(--gold); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hide { display: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes halo { 0%,100% { box-shadow: 0 0 0 0 rgba(217,183,110,0); } 50% { box-shadow: 0 0 28px 2px rgba(217,183,110,.28); } }
@keyframes glow { 0%,100% { box-shadow: 0 0 0 0 rgba(232,168,107,0); } 50% { box-shadow: 0 0 22px 0 rgba(232,168,107,.25); } }
@keyframes sweep { from { width: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* layout: slim icon rail + top bar */
.app { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 0; height: 100vh; }
.brand { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; margin-bottom: 16px; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { position: relative; width: 58px; height: 56px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; transition: background .2s, color .2s; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--gold); }
.nav a.on::before { content: ""; position: absolute; left: -15px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--gold-grad); }
.nav svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { position: absolute; top: 4px; right: 4px; background: var(--gold-grad); color: var(--on-gold); border-radius: 999px; font-size: 10px; padding: 0 6px; line-height: 17px; font-weight: 800; }
.side .me { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; text-align: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--gold); }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 36px 0; flex-wrap: wrap; }
.gsearch { flex: 1 1 320px; max-width: 540px; position: relative; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.gsearch input { border: 0; background: transparent; padding: 0; height: 100%; outline: none; color: var(--ink); }
.gsearch input:focus { outline: none; }
.gsearch kbd { font: 600 11px Manrope, sans-serif; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.gsearch svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.gresults { position: absolute; left: 0; right: 0; top: 52px; background: var(--solid); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 45; max-height: 60vh; overflow: auto; }
.gresults a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.gresults a:hover, .gresults a.on { background: var(--accent-soft); }
.iconbtn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { color: var(--gold); border-color: var(--line-2); }
.iconbtn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.main { padding: 26px 36px 90px; max-width: 1400px; width: 100%; min-width: 0; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.card, .kpi { min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.top .eyebrow { font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.top .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-dot.on { background: #4FC98B; box-shadow: 0 0 0 3px rgba(79,201,139,.18); }

/* cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; cursor: default; animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.kpi[data-go] { cursor: pointer; }
.kpi .v { font-family: var(--serif); font-size: 48px; font-weight: 600; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; order: -1; }
.kpi { display: flex; flex-direction: column; }
.kpi.alert { border-color: var(--gold); animation: rise .6s both, halo 3.2s ease-in-out infinite; }
.kpi.alert .v { color: var(--gold); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
.who b { display: block; font-weight: 700; }
.who span { color: var(--muted); font-size: 12.5px; }

/* chips and moon-phase badges */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: transparent; color: var(--silver); border: 1px solid var(--line); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px 3px 6px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--ink-2); }
.moon { width: 16px; height: 16px; flex: none; }
.moon circle { fill: none; stroke: currentColor; stroke-opacity: .55; stroke-width: 1.2; }
.moon path { fill: currentColor; }
.s-won { color: var(--gold); border-color: var(--line-2); }
.s-lost { color: var(--muted); opacity: .85; }
.flag { background: var(--warn-soft); color: var(--warn); border-color: rgba(232,168,107,.45); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--accent-soft); border-color: var(--line-2); color: var(--gold); }

/* forms and buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .15s, border-color .2s; }
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gold-grad); border-color: transparent; color: var(--on-gold); }
.btn.primary:hover { filter: brightness(1.06); color: var(--on-gold); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
select option { background: var(--solid); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(217,183,110,.25); border-color: var(--gold); }
textarea { resize: vertical; min-height: 84px; }
label.f { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .full { grid-column: 1 / -1; }
.inline-select { width: auto; padding: 8px 10px; font-size: 13px; }
.search { max-width: 300px; }

/* lead page */
.lead-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lead-head h1 { font-size: 38px; }
.contact { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.stepper { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 4px; }
.stepper button { flex: 1 1 100px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.08); background: var(--card); padding: 11px 14px; border-radius: 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--muted); transition: transform .15s, border-color .2s; }
:root[data-theme="ivory"] .stepper button { border-color: var(--line); }
.stepper button:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stepper button .moon { width: 22px; height: 22px; }
.stepper button.done { background: var(--accent-soft); border-color: var(--line-2); color: var(--gold-2); }
.stepper button.on { background: var(--gold-grad); border-color: transparent; color: var(--on-gold); }
.stepper button.lost.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.timeline { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 16px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 80%; border-radius: 18px; padding: 12px 15px; font-size: 14px; word-wrap: break-word; animation: rise .5s both; }
.msg .body { white-space: pre-wrap; line-height: 1.5; }
.msg.in { background: var(--card-2); border: 1px solid rgba(255,255,255,.08); align-self: flex-start; border-bottom-left-radius: 5px; }
:root[data-theme="ivory"] .msg.in { border-color: var(--line); }
.msg.out { background: var(--accent-soft); border: 1px solid var(--line-2); align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.note { background: transparent; border: 1px dashed var(--line-2); align-self: center; max-width: 92%; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 7px; letter-spacing: .03em; white-space: normal; }
.msg .subj { font-weight: 700; margin-bottom: 4px; }
.msg.failed { border-color: var(--bad); }
.compose { border: 1px solid var(--line-2); border-radius: 18px; padding: 12px; background: var(--card); }
.compose .tabs { margin-bottom: 8px; }
.compose textarea { border: 0; background: transparent; padding: 6px 4px; min-height: 74px; }
.compose textarea:focus { outline: none; }
.compose input { margin-bottom: 4px; }
.fu { display: flex; flex-direction: column; }
.fu div { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; color: var(--muted); }
.fu div::before { content: ""; width: 12px; height: 12px; margin-left: 5px; border-radius: 50%; border: 1px solid var(--silver); opacity: .6; }
.fu b { color: var(--ink); font-weight: 700; }
.fu .sent::before { background: var(--gold); border-color: var(--gold); opacity: 1; }
.fu .sent span { color: var(--gold-2); }
.fu .pending::before { border-color: var(--gold); opacity: 1; }
.fu .stopped { opacity: .7; }
.fu .failed span { color: var(--bad); }
.reply-box { border: 1px solid rgba(232,168,107,.45); background: var(--warn-soft); border-radius: 14px; padding: 13px 16px; margin-bottom: 16px; animation: glow 3s ease-in-out infinite; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 96px; height: 66px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.hist { font-size: 13px; color: var(--ink-2); display: grid; gap: 7px; }

/* bars */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 26px 110px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; }
.bars.plain .bar { grid-template-columns: 130px 1fr 30px; }
.bar .moon { width: 24px; height: 24px; color: var(--silver); }
.bar i { display: block; height: 7px; border-radius: 99px; background: linear-gradient(90deg,#7F879A,#D8DCE5); animation: sweep 1.3s cubic-bezier(.2,.7,.2,1) both; }
.bar.won i { background: var(--gold-grad); }
.bar.won .moon { color: var(--gold); }
.bar .track { background: var(--track); border-radius: 99px; }

/* pipeline board */
.board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { flex: 1 0 220px; min-width: 220px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); padding: 14px 12px 16px; transition: border-color .2s, background .2s; }
.col.over { border-color: var(--gold); background: var(--accent-soft); }
.col.won { border-color: var(--line-2); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.col-head .moon { width: 26px; height: 26px; color: var(--silver); }
.col.won .col-head .moon { color: var(--gold); }
.col-head h2 { margin: 0; flex: 1; font-size: 23px; }
.col-head .n { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--card-2); color: var(--silver); }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kcard { border-radius: 16px; border: 1px solid var(--line); background: var(--card-2); padding: 13px 14px 11px; cursor: grab; transition: transform .2s, border-color .2s, opacity .2s; animation: rise .5s both; }
.kcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kcard.dragging { opacity: .45; }
.kcard.locked { cursor: pointer; }
.kcard .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kcard b { display: block; font-size: 15px; }
.kcard .what { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.ini { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--silver); }

/* task cards */
.tasks { display: grid; gap: 12px; }
.task { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--ink); animation: rise .5s both; transition: transform .2s, border-color .2s; }
.task:hover { transform: translateY(-2px); border-color: var(--line-2); color: var(--ink); }
.task .ti { flex: 0 0 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--gold); }
.task .ti svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task .tb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task .tk { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.task b { font-size: 16px; }
.task .ta { flex: none; }
.task.k-reply { border-color: rgba(232,168,107,.5); background: linear-gradient(150deg, var(--warn-soft), transparent); }
.task.k-reply .ti { background: var(--warn-soft); color: var(--warn); }
.task.k-reply .tk { color: var(--warn); }
.task.k-checkin .ti { background: var(--card-2); color: var(--silver); }
.task.k-checkin .tk { color: var(--muted); }

/* files on a lead */
.files { display: grid; gap: 8px; margin-top: 10px; }
.file { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.file:hover { border-color: var(--line-2); color: var(--ink); }
.file .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ft { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 4px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--gold); border: 1px solid var(--line-2); }
.share-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.share-row:first-of-type { border-top: 0; }
.share-row svg { color: var(--gold); }
.share-row .opened { color: var(--ok); font-weight: 700; }

/* catalogues */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cat { border: 1px solid var(--line); border-radius: 22px; background: var(--card); overflow: hidden; animation: rise .5s both; transition: transform .2s, border-color .2s; display: flex; flex-direction: column; }
.cat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.cat .cover { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; margin: 0; cursor: pointer; background: linear-gradient(150deg, rgba(217,183,110,.18), rgba(140,150,180,.08)); overflow: hidden; }
.cat .cover img, .cat .cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat .cover .play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.4); }
.cat .cover .play::after { content: ""; position: absolute; left: 21px; top: 16px; border-left: 16px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.pdfcover { position: absolute; inset: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--solid); display: flex; flex-direction: column; justify-content: space-between; padding: 16px; text-align: left; box-shadow: var(--shadow); }
.pdfcover .ft { align-self: flex-start; }
.pdfcover .pt { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.cat .chip.auto { position: absolute; left: 10px; top: 10px; background: var(--gold-grad); color: var(--on-gold); border: 0; font-weight: 700; }
.cat-b { padding: 14px 16px 16px; }
.cat-b b { font-size: 15.5px; }
.modal.xl { width: min(1100px, 100%) !important; }
.viewer { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 14px; background: #111; display: block; object-fit: contain; }
iframe.viewer { background: #fff; }
.pick { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.pick-row:hover, .pick-row.on, .pick-row:has(input:checked) { border-color: var(--gold); background: var(--accent-soft); }
.pick-row input { width: auto; }
.progress { height: 6px; border-radius: 6px; background: var(--track); overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .2s; }
.powered { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.login .powered img { height: 30px; width: auto; padding: 0; border: 0; border-radius: 0; opacity: .85; }
.login .powered .pw-light { display: none; }
:root[data-theme="ivory"] .login .powered .pw-light { display: block; }
:root[data-theme="ivory"] .login .powered .pw-dark { display: none; }
.powered span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.login { flex-direction: column; }

/* capture */
.card-rows { display: grid; gap: 10px; margin-top: 12px; }
.card-row { display: grid; grid-template-columns: 128px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.card-row img { width: 128px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.card-row .fl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card-row input { padding: 8px 10px; font-size: 13px; }
.grid-input td { padding: 3px; border-bottom: 0; }
.grid-input input { padding: 8px 10px; font-size: 13px; border-radius: 10px; min-width: 110px; }
.chan { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.chan:first-child { border-top: 0; }
.chan .n { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .6; flex: none; }
.dot.ok { background: #4FC98B; opacity: 1; }
.code { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* empty, toast, modal, login */
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--solid); color: var(--ink); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 14px; font-size: 13px; box-shadow: var(--shadow); max-width: 380px; animation: rise .3s ease; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.backdrop { position: fixed; inset: 0; background: rgba(5,7,12,.6); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--solid); border: 1px solid var(--line-2); border-radius: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: rise .3s both; }
.modal h2 { font-size: 28px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 34px 32px; background: var(--solid); text-align: left; }
.login img { width: 54px; height: 54px; padding: 10px; border: 1px solid var(--gold); border-radius: 50%; }
.login h1 { font-size: 40px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.demo { position: fixed; left: 108px; bottom: 16px; background: var(--solid); border: 1px dashed var(--line-2); border-radius: 14px; padding: 8px 10px; display: flex; gap: 6px; align-items: center; z-index: 30; font-size: 12px; box-shadow: var(--shadow); }
.demo b { color: var(--gold); }
.demo select { width: auto; padding: 5px 8px; font-size: 12px; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 8px 10px; z-index: 35; border-right: 0; border-top: 1px solid var(--line); background: var(--solid); }
  .side .brand, .side .me { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { width: auto; flex: 1; height: 54px; }
  .nav a.on::before { display: none; }
  .topbar { padding: 14px 14px 0; flex-wrap: nowrap; gap: 8px; }
  .gsearch { flex: 1 1 0; min-width: 0; padding: 0 12px; }
  .gsearch kbd, .avatar, .btn .lbl { display: none; }
  .topbar .row { flex-wrap: nowrap; gap: 8px; }
  #gnew { width: 46px; padding: 0; justify-content: center; }
  .task { padding: 14px; gap: 12px; }
  .task .ta { display: none; }
  .main { padding: 20px 14px 150px; }
  h1 { font-size: 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 38px; }
  .g2, .g3, .lead-layout, .form { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 1fr; }
  .card-row .fl { grid-template-columns: 1fr 1fr; }
  .demo { left: 10px; right: 10px; bottom: 80px; flex-wrap: wrap; }
  .demo span.muted { display: none; }
  #toasts { left: 10px; right: 10px; bottom: 130px; }
  .msg { max-width: 92%; }
}
