/* Support Layer — agent console + help center. BKS palette, Inter. */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --navy: #24547F; --navy-d: #0B3656; --charcoal: #342F33; --brass: #D49B24;
  --bg: #F7F8FA; --surface: #FFFFFF; --surface-2: #F9FAFB; --line: #E4E7EC; --line-2: #D0D5DD;
  --text: #16191D; --muted: #5F6873; --faint: #8A929C;
  --accent: var(--navy); --accent-soft: #E6EEF6; --accent-text: #FFFFFF;
  --ok: #1F7A4D; --ok-soft: #E3F3EA; --warn: #9A6400; --warn-soft: #FBF0D9; --bad: #B42318; --bad-soft: #FDE8E6;
  --note: #FFF7E0; --note-line: #EBCB76;
  --side: #0B3656; --side-text: #C9D6E3; --side-active: #164A75;
  --radius: 10px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --row-hover: #F5F8FB; --navy-soft-line: #C7D7E8;
  --k-blue: #24547F; --k-brass: #C08514; --k-purple: #6E4FB8; --k-green: #1F8A63; --k-grey: #8A929C; --k-red: #D92D20; --k-orange: #E8890C;
  --shadow-l: 0 12px 32px rgba(16, 24, 40, .18);
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1419; --surface: #161C23; --surface-2: #1B222B; --line: #28313C; --line-2: #36414E;
    --text: #E6EAEF; --muted: #A3ADB8; --faint: #7C8794;
    --accent: #5B9BD5; --accent-soft: #1A2C3D; --accent-text: #0B1520;
    --ok: #4CC38A; --ok-soft: #12291F; --warn: #E2B04A; --warn-soft: #2B2412; --bad: #F2726A; --bad-soft: #321716;
    --note: #2A2414; --note-line: #6B5520;
    --side: #0A1622; --side-text: #A9B8C7; --side-active: #15293C; --row-hover: #1D2530; --navy-soft-line: #2B4560;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-l: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
svg[aria-hidden] { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.mt { margin-top: 10px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 14px 10px; overflow-y: auto; }
.brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; }
.brandmark .mark { width: 32px; height: 32px; border-radius: 7px; background: var(--brass); color: var(--navy-d); display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.brandmark .name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.brandmark .sub { font-size: 11px; color: var(--side-text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7F96AD; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); color: var(--side-text); font-weight: 500; }
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--brass); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .1); padding: 0 7px; border-radius: 10px; min-width: 22px; text-align: center; }
.nav .count.hot { background: var(--brass); color: var(--navy-d); font-weight: 700; }
.side .me { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.side .me .who { min-width: 0; flex: 1; }
.side .me .who b { display: block; color: #fff; font-weight: 600; font-size: 13px; }
.side .me button { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 4px; border-radius: 4px; }
.side .me button:hover { color: #fff; background: var(--side-active); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.top .menu { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input[type=search] { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-l); max-height: 70vh; overflow: auto; padding: 6px; }
.search-results h4 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.search-results a { display: flex; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.demo-bar { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); padding: 6px 20px; font-size: 12px; display: flex; gap: 12px; align-items: center; }
.demo-bar button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }
.view { padding: 20px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=url], input[type=datetime-local], input[type=number], input[type=color], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); min-width: 0;
}
input[type=color] { padding: 2px; height: 34px; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card > .bd { padding: 16px; }
.card > .bd.flush { padding: 0; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 14px 16px; }
.tile .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.tile.alert .n { color: var(--bad); }
a.tile { color: var(--text); }
a.tile:hover { text-decoration: none; border-color: var(--line-2); }
.dash { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dash .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; font-size: 13px; }
.bar .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; width: 0; }
.bar .num { text-align: right; color: var(--muted); }

/* ---------- lists & tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table .subj { font-weight: 500; }
.table .subj small { display: block; font-weight: 400; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li a.row-link { color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); }
.st { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-new { background: var(--brass); color: #2B1E00; }
.st-open { background: var(--bad-soft); color: var(--bad); }
.st-pending { background: var(--accent-soft); color: var(--accent); }
.st-hold { background: var(--surface-2); color: var(--charcoal); border: 1px solid var(--line-2); }
.st-solved, .st-closed { background: var(--ok-soft); color: var(--ok); }
@media (prefers-color-scheme: dark) { .st-hold { color: var(--muted); } }
.pri { font-size: 12px; font-weight: 600; white-space: nowrap; }
.pri-urgent { color: var(--bad); }
.pri-high { color: var(--warn); }
.pri-normal { color: var(--muted); font-weight: 500; }
.pri-low { color: var(--faint); font-weight: 500; }
.sla { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sla.late { color: var(--bad); }
.sla.soon { color: var(--warn); }
.sla.ok { color: var(--muted); font-weight: 500; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); flex: none; }
.av.s { width: 22px; height: 22px; font-size: 10px; }
.av.c { background: var(--warn-soft); color: var(--warn); }

/* ---------- tickets ---------- */
.queue { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.views { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.views a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: var(--radius-s); color: var(--text); font-weight: 500; }
.views a:hover { background: var(--surface); text-decoration: none; }
.views a.active { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.views a .n { color: var(--faint); font-weight: 500; }
.views a.sg { color: var(--bad); }
.views-h { padding: 12px 10px 4px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.views a .chip.dot { padding: 0; margin-right: 6px; border: 0; background: none; }
.views .views-select { display: none; }
.toolbar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }

.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ticket .head { margin-bottom: 12px; }
.ticket .head .ref { color: var(--faint); font-weight: 600; }
.ticket .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); font-size: 13px; margin-bottom: 12px; border: 1px solid; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner.guard { background: var(--accent-soft); border-color: var(--line-2); color: var(--text); }
.banner.restricted { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 500; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.msg.internal { background: var(--note); border-color: var(--note-line); }
.msg.agent { border-left: 3px solid var(--accent); }
.msg .mh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg .mh .who { font-weight: 600; }
.msg .mh .when { color: var(--faint); font-size: 12px; margin-left: auto; white-space: nowrap; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .body.redacted { color: var(--faint); font-style: italic; }
.msg .foot { margin-top: 6px; font-size: 12px; color: var(--faint); display: flex; gap: 10px; align-items: center; }
.msg .foot button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
.msg .foot button:hover { color: var(--bad); }
.composer { margin-top: 16px; }
.composer .tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.composer .tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.composer .tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.composer .tabs button.on.note { color: var(--warn); border-bottom-color: var(--warn); }
.composer textarea { border: 0; border-radius: 0; min-height: 120px; padding: 12px 14px; background: transparent; }
.composer.note textarea { background: var(--note); }
.composer textarea:focus { outline: none; }
.composer .actions { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.composer .actions select { width: auto; max-width: 200px; }
.props .bd { display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.wide { grid-template-columns: max-content 1fr; column-gap: 16px; }
.events { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.events li { padding: 4px 0; display: flex; gap: 6px; }
.events li .t { margin-left: auto; color: var(--faint); white-space: nowrap; }

/* ---------- CRM ---------- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--muted); }
.timeline .ico svg { width: 15px; height: 15px; }
.timeline .done { text-decoration: line-through; color: var(--faint); }
.add-activity { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.add-activity .row select { width: auto; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 200px; display: flex; flex-direction: column; }
.lane .lh { padding: 10px 12px; display: flex; align-items: center; gap: 6px; font-weight: 600; border-bottom: 1px solid var(--line); }
.lane .lh .n { color: var(--faint); font-weight: 500; }
.lane.won .lh { color: var(--ok); }
.lane.lost .lh { color: var(--faint); }
.lane .cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lane.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.deal:hover { border-color: var(--line-2); }
.deal .dn { font-weight: 600; margin-bottom: 4px; }
.deal .dm { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.deal select { margin-top: 8px; font-size: 12px; padding: 3px 6px; }
.deal.dragging { opacity: .5; }

/* ---------- KB ---------- */
.kb { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor textarea { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.prose { line-height: 1.65; overflow-wrap: anywhere; }
.prose h1 { font-size: 24px; margin: 0 0 12px; }
.prose h2 { font-size: 18px; margin: 20px 0 8px; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 4px; font-size: .92em; }
.kb-media { margin: 4px 0 16px; }
.kb-media img, .kb-media video { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.kb-media video { width: 100%; max-height: 70vh; background: #000; }
.kb-media figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.kb-media.missing::before { content: 'This file isn’t available.'; display: block; padding: 16px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.kb-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.kb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-bar { margin-top: 6px; gap: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.media-thumb { aspect-ratio: 16 / 10; background: var(--surface-2); border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.upload-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.upload-progress progress { flex: 1; height: 10px; }

/* ---------- help center (themed per brand: --p-primary, --p-dark, --p-accent, data-font) ---------- */
.portal { --p-primary: #24547F; --p-dark: #0B3656; --p-accent: #D49B24; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.portal a:not(.btn) { color: var(--p-primary); }
.portal .btn.primary { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.portal :focus-visible { outline-color: var(--p-accent); }
.portal[data-font=space-grotesk] h1, .portal[data-font=space-grotesk] h2, .portal[data-font=space-grotesk] h3, .portal[data-font=space-grotesk] .wordmark { font-family: 'Space Grotesk', var(--font); letter-spacing: -.02em; }
@media (prefers-color-scheme: dark) { .portal a:not(.btn) { color: color-mix(in srgb, var(--p-primary) 55%, white); } }
.portal-top { background: var(--p-dark); color: #fff; }
.portal-top .in { max-width: 960px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 12px; }
.portal-top a { color: #fff !important; }
.portal-top a.btn { color: var(--charcoal) !important; background: #fff; border-color: #fff; }
.lockup { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none !important; }
.lockup .wordmark { font-weight: 700; font-size: 20px; color: #fff; }
.lockup .logo { max-height: 34px; max-width: 220px; object-fit: contain; }
.lockup .byline { font-size: 11px; color: rgba(255, 255, 255, .72); display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; }
.lockup .mini { font-size: 8px; font-weight: 700; letter-spacing: .04em; background: #D49B24; color: #0B3656; border-radius: 3px; padding: 1px 3px; }
.portal-hero { background: linear-gradient(160deg, var(--p-dark), var(--p-primary)); color: #fff; padding: 44px 20px 60px; text-align: center; }
.portal-hero h1 { font-size: 32px; margin-bottom: 8px; }
.portal-hero p { color: rgba(255, 255, 255, .8); margin: 0 auto; max-width: 560px; }
.portal-hero .search { margin: 22px auto 0; max-width: 560px; }
.portal-hero .search input[type=search] { padding: 12px 14px 12px 38px; font-size: 15px; border: 0; background: #fff; color: #1E2329; box-shadow: 0 0 0 4px color-mix(in srgb, var(--p-accent) 35%, transparent); }
.portal-body { max-width: 960px; width: 100%; margin: -30px auto 0; padding: 0 20px 48px; position: relative; flex: 1; }
.portal-body.flat { margin-top: 24px; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cats .card { border-top: 3px solid var(--p-accent); }
.cats .card .bd a { display: block; padding: 4px 0; }
a.rel { display: block; padding: 4px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0 12px; }
.portal-foot { text-align: center; color: var(--faint); font-size: 12px; padding: 24px; }
.preview-bar { background: var(--charcoal); color: #E9E6E8; font-size: 12px; display: flex; align-items: center; gap: 8px; padding: 6px 16px; flex-wrap: wrap; }
.preview-bar svg { width: 14px; height: 14px; }
.preview-bar button { background: transparent; color: #E9E6E8; border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: 12px; }
.preview-bar button.on { background: #fff; color: var(--charcoal); border-color: #fff; }
.portal .preview-bar a { color: #E9E6E8 !important; }

/* ---------- modal, toast, sign-in ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11, 20, 32, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-l); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal .mhd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.modal .mbd { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .mft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal .err { color: var(--bad); font-size: 13px; min-height: 0; }
.x { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; margin-left: auto; border-radius: 4px; font-size: 18px; line-height: 1; }
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--charcoal); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); box-shadow: var(--shadow-l); font-size: 13px; max-width: 360px; }
.toast.bad { background: var(--bad); }
.signin { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy-d), var(--navy)); }
.signin .card { width: 100%; max-width: 440px; }
.signin .card .bd { padding: 24px; }
.persona { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.persona:hover { border-color: var(--accent); background: var(--accent-soft); }
.persona .badges { margin-left: auto; display: flex; gap: 4px; }
.keybox { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tabs-h { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs-h a { padding: 8px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-h a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-h a:hover { text-decoration: none; color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ticket, .profile { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .side { transform: none; box-shadow: var(--shadow-l); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .top { padding: 8px 12px; }
  .top .menu { display: inline-flex; }
  .top .new-label { display: none; }
  .view { padding: 14px 12px; }
  .queue, .kb { grid-template-columns: 1fr; }
  .views { position: static; }
  .views a { display: none; }
  .views .views-select { display: block; }
  .grid2, .grid3, .editor { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .table td, .table th { padding: 8px; }
}

/* ---------- brand rows, theme preview, platform ---------- */
.swatch { width: 18px; height: 18px; border-radius: 5px; background: var(--c, var(--accent)); flex: none; border: 1px solid var(--line-2); }
.theme-preview { --p-dark: #0B3656; --p-primary: #24547F; --p-accent: #D49B24; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-preview .tp-top { background: var(--p-dark); color: #fff; padding: 10px 14px; display: flex; align-items: baseline; gap: 10px; }
.theme-preview .tp-mark img { max-height: 26px; max-width: 180px; vertical-align: middle; }
.theme-preview .tp-word { font-weight: 700; font-size: 17px; }
.theme-preview .tp-by { font-size: 11px; opacity: .75; }
.theme-preview .tp-hero { background: linear-gradient(160deg, var(--p-dark), var(--p-primary)); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.theme-preview .tp-title { font-size: 20px; }
.theme-preview .tp-text { font-size: 13px; opacity: .85; }
.theme-preview .tp-btn { background: #fff; color: var(--p-primary); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-accent) 50%, transparent); }
.theme-preview[data-font=space-grotesk] .tp-word, .theme-preview[data-font=space-grotesk] .tp-title { font-family: 'Space Grotesk', var(--font); }
.platform .side { background: #1F1B1E; }
.platform .nav a.active, .platform .nav a:hover { background: #342F33; }
.brandmark .mark.op { background: #E9E6E8; color: #1F1B1E; }
.op-bar { background: #342F33; color: #E9E6E8; font-size: 12px; padding: 6px 20px; display: flex; align-items: center; gap: 8px; }
.platform-signin { background: linear-gradient(160deg, #1F1B1E, #342F33); }
.persona.op { border-style: dashed; }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .grid4 { grid-template-columns: 1fr; } }
fieldset.plain { border: 0; padding: 0; margin: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 6px; }
.stack > .check { display: flex; }
.chip-check { border: 1px solid var(--line-2); border-radius: 14px; padding: 3px 10px; }
.signin .brandmark { color: var(--text); padding-left: 0; }
.signin .brandmark .name { color: var(--text); font-size: 16px; }
.signin .brandmark .sub { color: var(--muted); }

/* Platform → Updates */
.rel-row { align-items: flex-start; }
.rel-row details { margin-top: 6px; }
pre.notes { white-space: pre-wrap; font: inherit; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 8px; max-height: 260px; overflow: auto; margin: 6px 0 0; }

/* Notifications */
.top .bell { position: relative; }
.top .bell .count { position: absolute; top: 2px; right: 2px; font-size: 10px; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--navy); color: #fff; text-align: center; }
.top .bell .count.hot { background: var(--bad); }
.list.notif li { gap: 10px; }
.list.notif li.unread a { font-weight: 600; }
.list.notif li.urgent { background: var(--bad-soft); }
.chip.hot { background: var(--bad); color: #fff; border-color: transparent; }
.signin .err { color: var(--bad); font-size: 13px; }
.signin .ok { color: var(--good, #1F7A4D); font-size: 13px; }

/* Settings: records to add at the registrar, access grid */
.records { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.records th, .records td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.records td code { word-break: break-all; }
.records .ok { color: var(--ok); font-weight: 600; }
.records .wait { color: var(--warn); font-weight: 600; }
.access-grid { display: grid; grid-template-columns: max-content repeat(3, max-content); gap: 6px 14px; align-items: center; font-size: 13px; }
.access-grid .h { color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 6px; }
.status-dot.ok { background: var(--ok); }
.status-dot.bad { background: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.copy { cursor: copy; }

/* Mail area */
.mail-tabs a .n { margin-left: 6px; font-size: 11px; color: var(--faint); }
.mail-tabs a .n.hot { color: var(--accent); font-weight: 700; }
tr.unread td b, tr.unread .subj { font-weight: 700; }
.w-check { width: 28px; }
pre.mail-body { max-height: 360px; }
.from-cell small { display: block; }
.modal select[data-act] { width: auto; max-width: 100%; }
.ret-form { align-items: flex-end; border-top: 1px solid var(--line); }
.ret-form .field input { width: 110px; }
.warn-text { display: block; color: var(--warn); font-size: 12px; }

/* AI */
.btn.ai { border-color: var(--accent); color: var(--accent); }
.ai-actions { gap: 6px; }
.banner.ai-banner { background: var(--accent-soft); border-color: transparent; align-items: center; gap: 10px; }
.ai-answer { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; }

/* Chat (console) */
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.switch input { width: 36px; height: 20px; appearance: none; background: var(--line-2); border-radius: 10px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 18px; }
.chat-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: 1fr; } }
.chat-group { margin: 0; padding: 10px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chat-list li.on { background: var(--accent-soft); }
.chat-list li.concern b { color: var(--bad); }
.chat-pane { display: flex; flex-direction: column; min-height: 520px; }
.chat-pane .banner { margin: 10px 14px 0; }
.chat-msgs { flex: 1; overflow-y: auto; max-height: 60vh; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cmsg { max-width: 78%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.cmsg .who { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.cmsg .body { white-space: pre-wrap; }
.cmsg.agent { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.cmsg.bot { background: var(--surface); }
.cmsg.system { align-self: center; background: none; border: 0; font-size: 12px; color: var(--muted); padding: 2px; }
.chat-compose { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; }

/* Chat (help-center widget) */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 50; }
.chat-bubble { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; color: #fff; background: var(--p-primary); box-shadow: var(--shadow-l); }
.chat-bubble svg { width: 20px; height: 20px; }
.chat-panel { width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-l); overflow: hidden; border: 1px solid var(--line); }
.chat-panel header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: #fff; background: var(--p-primary); }
.chat-panel header .small { opacity: .85; }
.chat-panel header .x { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; }
.chat-panel .chat-msgs { max-height: none; }
.chat-panel .cmsg.me { align-self: flex-end; background: var(--p-primary); color: #fff; border-color: transparent; }
.chat-panel .cmsg .links { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.chat-actions { display: flex; gap: 6px; padding: 6px 14px; flex-wrap: wrap; }
.chat-leave { display: grid; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--line); }
.chat-panel .chat-compose { padding: 8px 10px; }
.chat-panel .chat-compose .btn svg { width: 16px; height: 16px; }
.chat-note { padding: 0 14px 8px; }
@media (max-width: 480px) { .chat-widget { right: 8px; bottom: 8px; } }
.chat-panel .chat-compose textarea { height: 42px; min-height: 42px; }
.chat-panel .chat-compose .btn { width: 44px; padding: 0; justify-content: center; }

/* ---------- social (v3.13) ---------- */
.chip.pf { font-weight: 600; border-color: transparent; color: #fff; }
.chip.pf-facebook { background: #1877F2; }
.chip.pf-instagram { background: #C13584; }
.chip.pf-linkedin { background: #0A66C2; }
.chip.pf-x { background: #111; }
.social-items li { align-items: flex-start; }
.social-items li.concern { background: var(--bad-soft); }
.social-text { margin: 4px 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip.cat-question { background: var(--accent-soft); color: var(--accent); }
.chip.cat-complaint { background: var(--warn-soft); color: var(--warn); }
.chip.cat-praise { background: var(--ok-soft); color: var(--ok); }
.chip.cat-concern { background: var(--bad); color: #fff; border-color: transparent; }
.chip.cat-concern svg { width: 12px; height: 12px; }
.chip.post-pending, .cal-p.post-pending { background: var(--warn-soft); color: var(--warn); }
.chip.post-scheduled, .cal-p.post-scheduled { background: var(--accent-soft); color: var(--accent); }
.chip.post-posted, .cal-p.post-posted { background: var(--ok-soft); color: var(--ok); }
.chip.post-partial, .chip.post-failed, .chip.post-rejected, .cal-p.post-partial, .cal-p.post-failed, .cal-p.post-rejected { background: var(--bad-soft); color: var(--bad); }
.social-accounts { display: flex; flex-wrap: wrap; gap: 8px; }
.social-acc { display: inline-flex; align-items: center; gap: 6px; }
.count-left { color: var(--faint); font-variant-numeric: tabular-nums; }
.count-left.over, [data-xleft].over { color: var(--bad); font-weight: 700; }
.social-quote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--line-2); background: var(--surface-2); white-space: pre-wrap; }
.danger-text { color: var(--bad); }
.social-note { margin-top: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-h { padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 92px; padding: 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--surface-2); color: var(--faint); }
.cal-d.today .cal-n { background: var(--accent); color: var(--accent-text); border-radius: 10px; padding: 0 6px; align-self: flex-start; }
.cal-n { font-size: 12px; font-weight: 600; }
.cal-p { border: 0; border-radius: 4px; padding: 2px 5px; font: inherit; font-size: 11px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); color: var(--text); }
@media (max-width: 700px) { .cal-d { min-height: 60px; } .cal-p { font-size: 10px; } }
label.field > small { display: block; margin-top: 3px; }
.social-set select { width: auto; max-width: 260px; }
.social-set .list li .grow { min-width: 0; }

/* ---------- attachments and the requester's page (v3.14) ---------- */
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.file { display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-width: 220px; }
.file:not(.img) { flex-direction: row; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); max-width: 100%; }
.file a { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.file a svg { width: 14px; height: 14px; flex: none; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); cursor: zoom-in; width: 200px; height: 130px; overflow: hidden; display: grid; place-items: center; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.thumb.missing { cursor: default; }
.thumb.missing::after { content: 'File no longer available'; font-size: 12px; color: var(--faint); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.files-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.attach-btn { cursor: pointer; }
.attach-btn svg { width: 15px; height: 15px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; max-width: 280px; }
.file-chip.up { opacity: .7; }
.file-chip small { color: var(--faint); }
.file-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; }
.composer-files { padding: 6px 12px 0; }
.req-link { align-items: center; }
.req-link svg { width: 14px; height: 14px; }
.card.narrow { max-width: 560px; margin: 0 auto; }
.request { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 0 auto; }
.request h1 { margin: 4px 0 8px; }
.rmsg.team { border-left: 3px solid var(--p-primary, var(--accent)); }
.rmsg.you { margin-left: 32px; }
.rbody { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.my-req { margin-right: 12px; }
@media (max-width: 700px) { .rmsg.you { margin-left: 0; } .thumb { width: 150px; height: 100px; } }
.file.img .link-btn { align-self: flex-start; }

/* ---------- two-step sign-in (v3.15) ---------- */
.code-input { font-size: 20px; letter-spacing: .15em; font-variant-numeric: tabular-nums; max-width: 220px; }
.mfa-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.qr { display: block; width: max-content; margin-top: 8px; background: #fff; padding: 8px; border-radius: var(--radius-s); border: 1px solid var(--line); display: inline-block; }
.qr img { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.keybox.recovery { font-size: 15px; line-height: 1.8; columns: 2; }
.ok-text { color: var(--ok); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ok-text svg, .chip svg { width: 13px; height: 13px; }
.signin .card.wide { max-width: 520px; }
.warn-text.inline { display: inline; }

/* ---------- CRM lists (v3.16) ---------- */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.list-card { color: var(--text); }
.list-card:hover { text-decoration: none; border-color: var(--accent); }
.n-big { font-size: 22px; font-weight: 700; }
.w-rank { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.list-table td { vertical-align: middle; }
.list-table select { width: auto; }
.row-actions .btn { padding: 2px 8px; }
.field-row { margin-bottom: 6px; }
.field-row input[type=text] { flex: 1 1 180px; width: auto; }
.field-row select { width: auto; }
.list.pick li.on { background: var(--accent-soft); }
.imp-table { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.imp-table .warn-text { margin-top: 2px; }

/* ---------- Get help (internal support) ---------- */
.support { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .support { grid-template-columns: 1fr; } }
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.thread .msg { padding: 10px 0; border-bottom: 1px solid var(--line); }
.thread .msg:last-child { border-bottom: 0; }
.thread .msg.mine { padding-left: 12px; border-left: 3px solid var(--line); }
.kb-ventures { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.kb-ventures a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.kb-ventures a.on { background: var(--surface); box-shadow: var(--shadow); border-color: var(--accent); color: var(--accent); }
.kb-ventures a:hover { text-decoration: none; background: var(--surface); }
.kb-ventures .chip.dot { padding: 0; margin-right: 6px; border: 0; background: none; }

/* ---------- bulk ticket actions ---------- */
.table th.sel, .table td.sel { width: 32px; padding-right: 0; }
.table td.sel input, .table th.sel input { width: 16px; height: 16px; cursor: pointer; }
.table tr.picked td { background: var(--surface-2); }
.bulk-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.bulk-bar select, .bulk-bar input { font-size: 13px; padding: 4px 6px; width: auto; max-width: 180px; flex: 0 0 auto; min-height: 0; }
.bulk-bar input { width: 110px; }

/* ---------- "a new version is out" ---------- */
.update-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.bulk-hint { padding: 6px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* push notifications (v3.23) */
.push-box { border-top: 1px solid var(--line, #e5e7eb); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.push-box .small-h { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 6px; }
.push-box .row .btn { width: auto; }
.list.compact li { padding: 4px 0; display: flex; align-items: center; gap: 8px; }

/* Settings → Lists (v3.24) */
.table.choices td { padding: 4px 6px; vertical-align: middle; }
.table.choices td:first-child { width: 100%; }
.table.choices input[type=text] { width: 100%; }
.table.choices .btn { width: auto; }

/* Install app (v3.24.1) */
.side .side-install { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: inherit; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.side .side-install:hover { background: rgba(255, 255, 255, .12); }
.side .side-install.hidden { display: none; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Analytics (v3.25) */
h2.sect { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 10px; }
.achart { width: 100%; height: auto; display: block; }
.achart .grid { stroke: var(--line, #e5e7eb); stroke-width: 1; }
.achart .ax { font-size: 11px; fill: var(--muted, #6b7280); }
.achart .l1 { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.achart .l2 { fill: none; stroke: #D49B24; stroke-width: 2; stroke-dasharray: 4 3; stroke-linejoin: round; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend i.k1 { background: var(--accent); }
.legend i.k2 { background: #D49B24; margin-left: 8px; }
.table th.num, .table td.num { text-align: right; }

.jsonbox { max-height: 60vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.45; white-space: pre; }

/* Activity (v3.27) */
.warn-row td { background: var(--warn-soft); }
.warn-text { color: var(--warn); font-weight: 600; }
.table.activity td { vertical-align: top; }
.table.activity .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sec-devices { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sec-devices .small-h { font-size: 14px; margin: 6px 0 0; }
.sec-devices .btn { width: auto; }
.table.compact td { padding: 5px 8px; }
.banner.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--text); }

/* ---------- v3.28: CRM build-out and marketing ---------- */
.bar.wide { grid-template-columns: 110px 1fr 32px 80px; }
.bar .fill.good { background: var(--good, #2f7d4f); }
.bar .fill.off { background: var(--faint); }
.cols { margin: 0; }
.cols svg { width: 100%; height: auto; display: block; }
.cols .col { fill: var(--accent); }
.cols .axis { fill: var(--faint); font-size: 10px; }
.cols .val { fill: var(--muted); font-size: 10px; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; gap: 6px; }
.rule select, .rule input { width: auto; flex: 1 1 150px; max-width: 240px; }
.rule .grow { flex: 0 0 auto; margin-left: auto; }
.inline-select { width: auto; display: inline-block; margin: 0 4px; }
#aud label.check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#aud label.check select { width: auto; flex: 0 1 280px; }
input.narrow { width: 90px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.problems svg, .tl-filter svg { width: 14px; height: 14px; vertical-align: -2px; }
.tl-filter { padding: 8px 16px; border-bottom: 1px solid var(--line); gap: 6px; }
.tl-filter .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); }
.tl-filter .chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.timeline li.restricted .ico { color: var(--bad); }
.email-preview { max-height: 640px; overflow: auto; background: #f4f5f7; border-radius: 0 0 var(--radius) var(--radius); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
#cpform fieldset, fieldset.card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin: 0; }
#cpform legend, fieldset.card legend { font-weight: 600; padding: 0 4px; }
.indent { padding-left: 24px; gap: 10px; }
.chip.sending, .chip.scheduled { background: var(--accent-soft); color: var(--accent); }
.chip.cancelled { color: var(--faint); }
.table-wrap { overflow-x: auto; }
.table-wrap select { max-width: 220px; }

/* ---------- v3.29: CRM workflow ---------- */
.show-m { display: none; }
@media (max-width: 860px) { .show-m { display: revert; } .board .show-m { display: block; width: 100%; } }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
.pad { padding: 10px 16px; margin: 0; }
.stack-s { display: flex; flex-direction: column; gap: 4px; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.good { background: var(--ok-soft); color: var(--ok); }
.tile.warn .n { color: var(--warn); }
.crumbs { margin: 4px 0 -4px; color: var(--muted); }
.mt { margin-top: 8px; }

/* list pages */
.saved-views { padding: 10px 16px 0; gap: 6px; }
.saved-views .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); }
.saved-views .chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.saved-views .chip svg { width: 12px; height: 12px; vertical-align: -1px; }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; background: var(--accent-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.crm-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.crm-table th.sortable:hover { color: var(--text); }
.crm-table th.sorted { color: var(--accent); }
.crm-table th .arrow { font-size: 11px; }
.crm-table th.sel, .crm-table td.sel { width: 34px; padding-right: 0; }
.crm-table tr.selected td { background: var(--accent-soft); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.total td { border-top: 2px solid var(--line-2); font-weight: 600; }
.colpick li { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* click-to-edit details */
dl.editable dd.ed { cursor: pointer; border-radius: var(--radius-s); margin: -3px -6px; padding: 3px 6px; display: flex; gap: 6px; align-items: flex-start; min-height: 26px; }
dl.editable dd.ed:hover, dl.editable dd.ed:focus-visible { background: var(--surface-2); }
dl.editable dd .iv { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
dl.editable dd .pen { opacity: 0; color: var(--faint); }
dl.editable dd .pen svg { width: 13px; height: 13px; }
dl.editable dd.ed:hover .pen, dl.editable dd.ed:focus-visible .pen { opacity: 1; }
dl.editable dd.editing { background: none; padding: 0; margin: -2px 0; }
dl.editable dd.editing input, dl.editable dd.editing select, dl.editable dd.editing textarea { width: 100%; padding: 4px 8px; }
dl.editable dd.saving { opacity: .6; }

/* next step */
.card.next .bd { gap: 10px; align-items: center; }
.card.next.missing { border-color: var(--warn); background: var(--warn-soft); }
.card.next.late { border-color: var(--bad); }

/* pipeline board */
.lane .lp { padding: 0 12px 6px; margin-top: -4px; }
.lane-empty { border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 18px 8px; text-align: center; }
.board.dragging .lane { transition: background .1s; }
.board.dragging .lane.over { background: var(--accent-soft); }
.deal.dragging { opacity: .45; }
.deal:hover { border-color: var(--line-2); }
.deal .dnext { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 6px; min-width: 0; }
.deal .dnext svg { width: 13px; height: 13px; flex: none; }
.deal .dnext.none { color: var(--warn); }
.deal .dnext.late { color: var(--bad); }
.deal .dflag { font-size: 11px; color: var(--warn); margin-top: 4px; }
.deal.stale { border-left: 3px solid var(--warn); }
.stagebar { display: flex; gap: 2px; margin: 4px 0 14px; overflow-x: auto; }
.stagebar button { flex: 1; min-width: 90px; border: 0; padding: 8px 10px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: var(--radius-s) 0 0 var(--radius-s); }
.stagebar button.past { background: var(--accent-soft); color: var(--accent); }
.stagebar button.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.stagebar button.on.won { background: var(--ok); color: #fff; }
.stagebar button.on.lost { background: var(--faint); color: #fff; }
.stagebar button:hover:not(.on) { background: var(--line); color: var(--text); }
.table.lines input, .table.lines select { padding: 4px 6px; }
.table.lines td { vertical-align: top; }
.h2in { font-size: 16px; font-weight: 600; border: 1px solid transparent; background: none; padding: 2px 6px; max-width: 260px; }
.h2in:hover, .h2in:focus { border-color: var(--line-2); background: var(--surface); }

/* My day and tasks */
.list.acts li { align-items: flex-start; }
.list.acts li.done .linkish { text-decoration: line-through; color: var(--faint); }
.list.acts .ico svg { width: 16px; height: 16px; color: var(--muted); }
.list.acts .snooze { opacity: 0; display: flex; gap: 2px; }
.list.acts li:hover .snooze, .list.acts li:focus-within .snooze { opacity: 1; }
@media (hover: none) { .list.acts .snooze { opacity: 1; } }
.list.acts svg { width: 13px; height: 13px; vertical-align: -2px; }
.timeline li.future .ico { background: var(--accent-soft); color: var(--accent); }
.add-activity .when { margin-top: 4px; }
.grid3.followup { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* calendar */
.calendar { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(108px, auto); }
.cal-day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .dn { color: var(--faint); }
.cal-day .dn { font-size: 12px; font-weight: 600; padding: 2px 4px; align-self: flex-start; border-radius: 10px; }
.cal-day.today .dn { background: var(--accent); color: var(--accent-text); }
.ev { display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 2px 6px; font: inherit; font-size: 12px; line-height: 1.35; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); }
.ev .t { font-weight: 600; }
.ev.task { background: var(--surface-2); color: var(--text); border-left: 3px solid var(--accent); }
.ev.call { background: var(--ok-soft); color: var(--ok); }
.ev.done { opacity: .5; text-decoration: line-through; }
.ev.late { border-left-color: var(--bad); color: var(--bad); }
.ev.deal { background: var(--warn-soft); color: var(--warn); }
.ev svg { width: 11px; height: 11px; vertical-align: -1px; }
.cal-day .more { border: 0; background: none; color: var(--muted); text-align: left; padding: 0 6px; cursor: pointer; }
.agenda-day { align-items: flex-start; }
.agenda-day .ad { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.agenda-day .ad b { font-size: 20px; color: var(--text); line-height: 1.1; }
.agenda-day .ad.today b { color: var(--accent); }
.agenda-day .ev { white-space: normal; }

/* ---------- v3.29.1: Settings on phones ---------- */
.brand-row .grow { min-width: 0; }
.brand-row code { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  /* Wide tables scroll inside their card instead of widening the page. */
  .card .bd.flush { overflow-x: auto; }
  /* Inputs and pickers inside edit tables keep a usable width. */
  .table td input[type=text], .table td input:not([type]) { min-width: 120px; }
  .table td input[type=number] { min-width: 64px; }
  .table td select { min-width: 110px; }
  .brand-row { flex-wrap: wrap; }
  .brand-row .grow { flex: 1 1 calc(100% - 40px); }
  .brand-row .btn { margin-top: 2px; }
  .filters-m { flex-wrap: wrap; width: 100%; }
  .filters-m select { flex: 1 1 30%; min-width: 0; }
}
@media (max-width: 640px) {
  /* Tables marked cards-m: one card per row, labels from data-label. */
  table.cards-m, table.cards-m tbody { display: block; width: 100%; }
  table.cards-m thead { display: none; }
  table.cards-m tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.cards-m td { display: block; border: 0; padding: 0; text-align: left; }
  table.cards-m td.hide-m { display: none; }
  table.cards-m td.full { flex-basis: 100%; }
  table.cards-m td.b-m { font-weight: 600; }
  table.cards-m td[data-label] { display: flex; align-items: center; gap: 6px; }
  table.cards-m td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 400; }
  table.cards-m td select { min-width: 0; }
  table.cards-m td.subj small { display: block; }
  .card .bd.flush:has(> table.cards-m) { overflow-x: visible; }
}
@media (max-width: 860px) {
  .table-wrap { overflow-x: auto; max-width: 100%; }
  .card .hd:has(.filters-m) { flex-wrap: wrap; }
  .filters-m { flex-basis: 100%; }
  .card .hd .h2in { flex: 1 1 140px; max-width: none; min-width: 0; }
  .card .hd:has(.h2in) { flex-wrap: wrap; gap: 6px 10px; }
}

/* ---------- v3.30: Settings navigation ---------- */
.settings-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 4px 4px 16px 0; }
.sn-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }
.sn-head h1 { font-size: 20px; margin: 0; }
.sn-find { width: 100%; margin-bottom: 14px; }
.sn-group { margin-bottom: 14px; }
.sn-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.settings-nav a[data-sec] { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); color: var(--muted); font-weight: 500; font-size: 14px; }
.settings-nav a[data-sec] svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.settings-nav a[data-sec]:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.settings-nav a[data-sec].on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-nav a[data-sec].on svg { opacity: 1; }
.settings-head .back { display: none; font-size: 13px; }
.settings-head .sub { margin-top: 2px; }
.settings-index { display: none; }
.si-row { display: flex; align-items: center; gap: 14px; width: 100%; color: var(--text); padding: 4px 0; }
.si-row:hover { text-decoration: none; }
.si-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.si-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.si-ico svg { width: 19px; height: 19px; }
.si-list li { padding: 10px 16px; }
.si-list li:active { background: var(--surface-2); }
@media (max-width: 860px) {
  .settings-shell { display: block; }
  .settings-nav { display: none; }
  .settings-index { display: flex; flex-direction: column; gap: 14px; }
  .settings-head .back { display: inline-block; margin-bottom: 4px; padding: 6px 0; }
}

/* ---------- v3.30: the "Crisp" look (denser, easier to scan, phone tab bar) ---------- */
h1 { font-size: 20px; font-weight: 600; }
.page-head { margin-bottom: 14px; }
.page-head .sub { font-size: 13px; }
.view { padding: 20px 24px; max-width: 1320px; }

/* top bar: page name on the left, search in the middle, actions on the right */
.top { padding: 8px 20px; gap: 12px; min-height: 56px; }
.top .crumb { font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; }
.top .crumb .faint { font-weight: 500; }
.top .end { flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.top .search { flex: 0 1 480px; max-width: 480px; }
.search input[type=search] { height: 38px; padding: 0 64px 0 36px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.search input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.search svg { left: 12px; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.search-results { padding: 6px; border-radius: var(--radius); }
.search-results a { align-items: center; padding: 7px 10px; border-radius: 6px; }
.search-results a svg { width: 15px; height: 15px; color: var(--muted); }
.search-results h4 { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.top .btn.primary { background: var(--navy-d); border-color: var(--navy-d); }
.top .bell, .top .menu { width: 38px; height: 38px; justify-content: center; padding: 0; }

/* sidebar (navy stays) */
.side { padding: 12px 10px; }
.nav a { padding: 7px 10px; border-radius: 7px; font-size: 14px; }
.nav a.active { box-shadow: none; background: var(--side-active); font-weight: 600; }
.nav .label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: #8FA6BF; padding: 12px 10px 4px; }

/* controls */
.btn { padding: 7px 12px; border-radius: var(--radius-s); line-height: 1.3; }
.btn.small { padding: 4px 9px; border-radius: 7px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=url], input[type=datetime-local], input[type=number], select, textarea { border-radius: var(--radius-s); padding: 7px 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { border-radius: var(--radius-s); }

/* cards */
.card { box-shadow: var(--shadow); }
.card > .hd { padding: 10px 14px; min-height: 46px; }
.card > .hd h2 { font-size: 14px; }
.card > .bd { padding: 14px; }

/* number strip: one card, thin dividers, label over the number */
.tiles { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 18px; }
.tiles > .tile { border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 12px 16px; }
.tile .n { font-size: 24px; font-weight: 600; line-height: 1.2; }
.tile .l { font-size: 12px; }
a.tile:hover { background: var(--row-hover); }

/* tables */
.table th { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); padding: 8px 12px; background: var(--surface-2); }
.table td { padding: 9px 12px; border-bottom-color: #EEF0F3; }
.table tr.click:hover td { background: var(--row-hover); }
.table .ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .table td { border-bottom-color: var(--line); } }

/* status, priority, type */
.st { border-radius: 6px; padding: 2px 8px; }
.st-new { background: var(--accent-soft); color: #164A75; }
.st-open { background: #FFF6E0; color: #7A5300; }
.st-pending { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .st-new { color: var(--accent); } .st-open { background: var(--warn-soft); color: var(--warn); } }
.pri { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; }
.pri::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--k-grey); flex: none; }
.pri-urgent { color: var(--bad); font-weight: 600; }
.pri-urgent::before { background: var(--k-red); }
.pri-high::before { background: var(--k-orange); }
.pri-high { color: var(--text); }
.pri-normal { color: var(--muted); }
.pri-low::before { background: #C4CAD3; }
.chip { border-radius: 6px; }
.kd { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kd::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--kc, var(--k-grey)); flex: none; }
.k-coach, .k-club, .k-customer { --kc: var(--k-blue); --kb: #E6EEF6; --kt: #164A75; }
.k-organizer, .k-tournament { --kc: var(--k-brass); --kb: #FBF0D9; --kt: #7A5300; }
.k-prospect, .k-league { --kc: var(--k-purple); --kb: #EFEAF8; --kt: #5B3F99; }
.k-guardian, .k-partner { --kc: var(--k-green); --kb: #E3F4EE; --kt: #17634A; }
.k-investor { --kc: #B5487A; --kb: #F8E6EF; --kt: #8A2C57; }
.k-vendor, .k-tester, .k-other { --kc: var(--k-grey); --kb: #EEF1F5; --kt: #4A5562; }
.av.kav { background: var(--kb, var(--accent-soft)); color: var(--kt, var(--accent)); }
@media (prefers-color-scheme: dark) { .av.kav { background: var(--surface-2); color: var(--kc, var(--accent)); } }
.due { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.due.late { color: var(--bad); }
.due.today { color: #8A4B00; }
@media (prefers-color-scheme: dark) { .due.today { color: var(--warn); } }

/* list pages: filter chips, toolbar, navy bulk bar */
.saved-views { padding: 10px 14px 0; }
.saved-views .chip { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; }
.saved-views .chip.on { border: 1px solid var(--navy-soft-line); }
.toolbar { padding: 10px 14px; gap: 8px; align-items: center; }
.toolbar input[type=search], .toolbar select { height: 34px; padding-top: 0; padding-bottom: 0; }
.bulkbar, .bulk-bar { background: var(--navy-d); color: #fff; border-color: var(--navy-d); box-shadow: none; }
.bulkbar .btn, .bulk-bar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .32); }
.bulkbar .btn:hover, .bulk-bar .btn:hover { background: rgba(255, 255, 255, .1); }
.bulkbar .btn.danger, .bulk-bar .btn.danger { color: #FFC9C4; border-color: rgba(255, 180, 170, .5); }
.bulk-bar select, .bulk-bar input { color: var(--text); }
.crm-table tr.selected td { background: #F0F5FA; }
@media (prefers-color-scheme: dark) { .crm-table tr.selected td { background: var(--accent-soft); } }
.crm-table .nm { display: flex; align-items: center; gap: 8px; }
.crm-table .nm b { font-weight: 600; }

/* Home */
.home-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home-head h1 { flex: 1; }
.home-head .when { color: var(--muted); font-size: 13px; }
.filt { display: flex; gap: 6px; flex-wrap: wrap; }
.filt button { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; }
.filt button.on { background: var(--accent-soft); color: var(--navy-d); border-color: var(--navy-soft-line); font-weight: 500; }
@media (prefers-color-scheme: dark) { .filt button.on { color: var(--accent); } }
.attn td.subj { max-width: 380px; }
.attn td.subj .s { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.attn td.subj a { color: var(--text); display: flex; align-items: baseline; min-width: 0; }
.attn td.subj a:hover { text-decoration: none; }
.attn tr.click:hover .s { color: var(--accent); }
.stackbar { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; margin: 4px 0 12px; background: var(--surface-2); }
.stackbar span { min-width: 4px; background: var(--kc, var(--accent)); }
.legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend-grid > span { display: flex; align-items: center; gap: 7px; }
.legend-grid i { width: 10px; height: 10px; border-radius: 3px; background: var(--kc, var(--accent)); flex: none; }
.legend-grid b { margin-left: auto; color: var(--text); font-weight: 600; }
.pv { font-size: 20px; font-weight: 600; color: var(--navy-d); }
@media (prefers-color-scheme: dark) { .pv { color: var(--text); } }
.s1 { --kc: #9DB8D6; } .s2 { --kc: #6E97C2; } .s3 { --kc: #3F73A8; } .s4 { --kc: #24547F; } .s5 { --kc: #173E61; } .s6 { --kc: #0B3656; }
.s-won { --kc: var(--ok); } .s-lost { --kc: #C4CAD3; }

/* phone tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 8px 12px 10px; gap: 8px 6px; }
  .top .crumb { font-size: 17px; flex: 1 1 auto; order: 1; }
  .top .end { flex: 0 0 auto; order: 2; }
  .top .menu { display: none; }
  .top .search { order: 3; flex: 1 1 100%; max-width: none; }
  .search input[type=search] { height: 44px; font-size: 16px; }
  .search kbd { display: none; }
  .top .mark-m { display: inline-grid; order: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--navy-d); color: #F2C66B; place-items: center; font-weight: 700; font-size: 11px; flex: none; }
  .view { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; font: inherit; font-size: 11px; font-weight: 500; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--navy-d); font-weight: 600; }
  @media (prefers-color-scheme: dark) { .tabbar .on { color: var(--accent); } }
  .tabbar .count { position: absolute; top: 4px; left: calc(50% + 6px); font-size: 10px; font-weight: 700; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--k-red); color: #fff; }
  .update-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-head .when { display: none; }
}
@media (min-width: 861px) { .top .mark-m { display: none; } }
@media (max-width: 640px) {
  table.crm-table.cards-m tr { padding: 10px 14px; gap: 2px 10px; }
  table.crm-table.cards-m td.m-main { flex: 1 1 calc(100% - 44px); font-size: 15px; }
  table.crm-table.cards-m td.m-sub { font-size: 13px; color: var(--muted); }
  table.crm-table.cards-m td.m-sub:empty { display: none; }
  table.crm-table.cards-m td.sel { order: 0; }
  table.crm-table.cards-m td.m-hide { display: none; }
  table.crm-table.cards-m .nm .av { width: 34px; height: 34px; font-size: 12px; }
  table.attn.cards-m td.subj { flex-basis: 100%; max-width: none; }
  table.attn.cards-m td.subj .s { white-space: normal; }
}
table.attn { table-layout: fixed; min-width: 620px; }
table.attn th:nth-child(1) { width: 96px; }
table.attn th:nth-child(3) { width: 150px; }
table.attn th:nth-child(4) { width: 82px; }
table.attn th:nth-child(5) { width: 150px; }
table.attn td.subj { max-width: none; }
table.attn td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; }
.crm-table .nm { white-space: nowrap; }
@media (max-width: 640px) { table.attn { table-layout: auto; min-width: 0; } table.attn th { width: auto; } }
@media (max-width: 860px) {
  .top .crumb { visibility: hidden; }
  .tabbar .count { background: var(--navy-d); }
  .tabbar .count[data-count=overdueTasks], .tabbar .count[data-count=safeguarding] { background: var(--k-red); }
  .card > .hd:has(.filt) { flex-wrap: wrap; row-gap: 8px; }
  .card > .hd .filt { order: 3; flex-basis: 100%; }
}
@media (max-width: 640px) {
  table.attn.cards-m td.subj { order: -1; }
  table.attn.cards-m td.num { margin-left: auto; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
  .toolbar select { flex: 1 1 40%; min-width: 0; }
  .page-head .btn:not(.primary) { padding: 4px 9px; font-size: 13px; }
}
.bulk-bar[hidden], .bulkbar[hidden] { display: none; }
.search-results a svg { position: static; transform: none; width: 15px; height: 15px; }

/* ---------- v3.30.1: tickets in the Crisp look ---------- */
.kd[data-c]::before { background: var(--c); }
.views { gap: 1px; }
.views a { padding: 7px 10px; border-radius: 7px; font-size: 14px; }
.views a:hover { background: var(--row-hover); }
.views a.active { background: var(--accent-soft); box-shadow: none; color: var(--navy-d); font-weight: 600; }
.views a.active .n { color: var(--navy-d); }
@media (prefers-color-scheme: dark) { .views a.active, .views a.active .n { color: var(--accent); } }
.views-h { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.bulk-hint { padding: 7px 14px; display: flex; align-items: center; gap: 6px; }
table.tq { table-layout: fixed; min-width: 880px; }
table.tq th.sel { width: 36px; }
table.tq th.c-type { width: 112px; }
table.tq th.c-pri { width: 96px; }
table.tq th.c-st { width: 84px; }
table.tq th.c-who { width: 116px; }
table.tq th.c-upd { width: 88px; }
table.tq th.c-sla { width: 150px; }
table.tq td { vertical-align: top; }
table.tq td.subj .tl { display: flex; align-items: baseline; gap: 6px; color: var(--text); min-width: 0; }
table.tq td.subj .tl:hover { text-decoration: none; }
table.tq td.subj .tl:hover .s { color: var(--accent); }
table.tq td.subj .s { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
table.tq td.subj .ref { margin-right: 0; flex: none; }
table.tq td.subj small { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
table.tq small .chip.dot { border: 0; background: none; padding: 0; font-size: 12px; }
table.tq .lock svg { width: 13px; height: 13px; color: var(--bad); }
table.tq td.sgt { color: var(--bad); font-weight: 600; }
table.tq tr.picked td { background: #F0F5FA; }
@media (prefers-color-scheme: dark) { table.tq tr.picked td { background: var(--accent-soft); } }
@media (max-width: 640px) {
  table.tq { table-layout: auto; min-width: 0; }
  table.tq.cards-m td.subj { order: 1; flex: 1 1 calc(100% - 40px); }
  table.tq.cards-m td.sel { order: 0; }
  table.tq.cards-m td:not(.subj):not(.sel) { order: 2; }
  table.tq.cards-m td.c-sla { margin-left: auto; }
  table.tq.cards-m.has-sel td:not(.subj):not(.sel):first-of-type { margin-left: 40px; }
}

/* one ticket */
.ticket .head h1 { font-size: 20px; margin: 6px 0 2px; }
.t-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.t-ref .ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.msg { border-radius: var(--radius); padding: 12px 14px; }
.msg.agent { border-left: 1px solid #DCE6F0; border-color: #DCE6F0; background: #F7FAFD; }
@media (prefers-color-scheme: dark) { .msg.agent { background: var(--surface-2); border-color: var(--line-2); } }
.msg .mh { gap: 8px; }
.composer { overflow: hidden; }
.props .bd { gap: 8px; }
.props .grid2 { display: contents; }
.props label.field { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
.props label.field > span { margin: 0; font-weight: 500; font-size: 13px; }
.props select, .props input[type=text] { height: 34px; padding-top: 0; padding-bottom: 0; }
.ticket aside > .btn.danger { align-self: flex-start; }
.chip.draft, .chip.sent, .chip.sending, .chip.scheduled, .chip.cancelled { border: 0; font-weight: 600; padding: 2px 8px; }
.chip.sent { background: var(--ok-soft); color: var(--ok); }
.chip.draft { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.ticket .thread .msg { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.ticket .thread .msg.agent { border-color: #DCE6F0; }
.ticket .thread .msg.internal { border-color: var(--note-line); }
@media (prefers-color-scheme: dark) { .ticket .thread .msg.agent { border-color: var(--line-2); } }
table.tq th.c-type { width: 96px; }
table.tq th.c-pri { width: 88px; }
table.tq th.c-st { width: 78px; }
table.tq th.c-who { width: 104px; }
table.tq th.c-upd { width: 80px; }
table.tq th.c-sla { width: 136px; }
table.tq { min-width: 820px; }
.queue > * { min-width: 0; }
@media (max-width: 860px) { .views .views-h { display: none; } }
@media (max-width: 640px) { table.tq.cards-m td.subj { flex-basis: calc(100% - 56px); } table.tq.cards-m tr { column-gap: 12px; } }
table.tq td.subj .s { min-width: 0; flex: 1 1 auto; }
@media (max-width: 860px) { .bulk-hint.hide-m { display: none; } }
@media (max-width: 640px) { table.tq.cards-m td { min-width: 0; } }
@media (max-width: 640px) { table.tq { min-width: 0; table-layout: auto; } table.tq th { width: auto; } }

/* ---------- v3.31: email editor ---------- */
.mk-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mk-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 88px); overflow: auto; }
@media (max-width: 1180px) { .mk-ed { grid-template-columns: 1fr; } .mk-side { position: static; max-height: none; } }
.mk-pv .email-preview { max-height: none; }
.email-preview { transition: width .15s; }
.email-preview.phone { width: 375px; max-width: 100%; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.email-subj { padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.email-subj:empty { display: none; }
.ready-n { display: flex; align-items: baseline; gap: 8px; }
.ready-n b { font-size: 22px; font-weight: 600; }
.fmt-help summary { cursor: pointer; color: var(--muted); }
.fmt-help ul { position: absolute; right: 14px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 10px 14px; max-width: 420px; }
.card > .hd { position: relative; }
.seg.seg-s button { padding: 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.seg.seg-s button svg { width: 14px; height: 14px; }
.blk-list { display: flex; flex-direction: column; }
.blk { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.blk:focus-within { border-color: var(--navy-soft-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.blk-hd { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; font-size: 13px; color: var(--muted); }
.blk-hd b { color: var(--text); font-weight: 600; }
.blk-hd svg { width: 15px; height: 15px; }
.blk-hd .btn { padding: 4px 6px; }
.blk-bd { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.blk-h { font-size: 20px; font-weight: 600; }
.blk-h.m { font-size: 16px; }
.blk-tools { gap: 2px; }
.blk-tools .btn { padding: 4px 7px; }
.blk-tools select { width: auto; height: 30px; padding: 0 8px; font-size: 13px; margin-left: 6px; }
.blk-bd textarea { min-height: 0; }
.blk-opts { gap: 8px; }
.blk-line { border: 0; border-top: 1px solid var(--line-2); margin: 8px 0; }
.blk-img { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px dashed var(--line-2); border-radius: var(--radius-s); }
.blk-img img { max-height: 96px; max-width: 200px; border-radius: 6px; background: var(--surface-2); }
.blk-img.empty-img { justify-content: space-between; }
.blk-add { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 28px; padding: 4px 0; }
.blk-add.end { justify-content: flex-start; padding: 12px 0 0; }
.blk-add .btn svg { width: 14px; height: 14px; }
.blk-plus { width: 26px; height: 26px; border-radius: 13px; border: 1px dashed var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: .55; }
.blk-plus:hover, .blk-plus:focus-visible { opacity: 1; color: var(--accent); border-color: var(--accent); }
.blk-plus svg { width: 14px; height: 14px; }
.tpl-pick { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.tpl-opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.tpl-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tpl-opt span { display: flex; flex-direction: column; }
.tpl-opt small { color: var(--muted); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.img-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.img-pick { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; background: var(--surface-2); cursor: pointer; }
.img-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-pick:hover, .img-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.img-item figcaption { padding: 4px 4px 4px 8px; }

/* ---------- v3.31.1: the Crisp look everywhere else ---------- */
.page-head .btn.danger { border-color: transparent; }
.page-head .btn.danger:hover { background: var(--bad-soft); }
.settings-main .card > .bd.flush, .settings-main .card > .bd { overflow-x: auto; }
.support > * { min-width: 0; }
.support .card > .hd input[type=search] { min-width: 0; flex: 1 1 160px; max-width: 260px; }
table.mailt td.from-cell { width: 220px; }
table.mailt td.subj small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
@media (max-width: 640px) {
  table.mailt.cards-m td.from-cell { flex: 1 1 calc(100% - 100px); width: auto; }
  table.mailt.cards-m td.subj { order: 3; flex-basis: 100%; }
  table.mailt.cards-m td.subj small { max-width: none; white-space: normal; }
  .tiles > :last-child:nth-child(odd) { grid-column: span 2; }
  .support .card > .hd { flex-wrap: wrap; }
  .support .card > .hd input[type=search] { max-width: none; flex-basis: 100%; }
}
.d-block { display: block; }
.sales-card .row { gap: 10px; align-items: center; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.seg a.btn { border: 0; border-radius: 0; padding: 6px 12px; }
.seg a.btn + a.btn { border-left: 1px solid var(--line-2); }
.seg a.btn.on { background: var(--accent-soft); color: var(--accent); }
.warn-t { color: var(--warn); }
.notice { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-s); padding: 8px 12px; }
.notice svg { flex: none; margin-top: 2px; }
.imap td { vertical-align: top; }
.imap select { max-width: 240px; }
.imap .nf { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.imap .nf.hidden { display: none; }
.imap .nf input { flex: 1 1 140px; min-width: 0; }
.imap .nf select { flex: 0 0 auto; }
.imap tr.faint td { color: var(--faint); }
