/* 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: #F4F5F7; --surface: #FFFFFF; --surface-2: #F8F9FB; --line: #E2E5EA; --line-2: #D0D5DD;
  --text: #1E2329; --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: 8px; --radius-s: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --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;
    --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=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 .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; }
.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; }

/* ---------- 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; }
.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); }
