/* Tokens taken from the reference dashboard: deep navy rail, one saturated blue, white cards on a cool grey field. */
:root {
  --navy-900: #081a3e; --navy-800: #0c2556; --navy-line: rgba(255,255,255,.08);
  --blue: #1d6bf3; --blue-dark: #1558d0; --blue-soft: #e8f0fe;
  --ink: #0f1e3d; --ink-2: #4a5878; --ink-3: #8390a8;
  --field: #f4f6fa; --card: #fff; --line: #e3e8f0; --line-soft: #eef1f6;
  --good: #12834f; --good-soft: #e3f6ec; --bad: #d92d3a; --bad-soft: #fde8ea; --warn: #b96a00; --warn-soft: #fff1dc; --info-soft: #e8f0fe;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--field); -webkit-font-smoothing: antialiased; }
h1:where(:not(.rte-body *)), h2:where(:not(.rte-body *)), h3:where(:not(.rte-body *)) { font-family: var(--font-heading); }
/* Element rules below carry :where(:not(.rte-body *)): inside the message editor the browser's own defaults apply, so what you see is what a mail client shows. */
h1:where(:not(.rte-body *)) { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2:where(:not(.rte-body *)) { font-size: 16px; font-weight: 600; margin: 0; }
h3:where(:not(.rte-body *)) { font-size: 14px; font-weight: 600; margin: 0; }
p:where(:not(.rte-body *)) { margin: 0; } a:where(:not(.rte-body *)) { color: var(--blue); text-decoration: none; } a:where(:not(.rte-body *)):hover { text-decoration: underline; }
small:where(:not(.rte-body *)), .muted { color: var(--ink-3); font-size: 12.5px; }
.icon { flex: none; vertical-align: -4px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #cfd8ea; padding: 18px 10px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-heading); font-size: 18px; font-weight: 600; letter-spacing: .01em; padding: 4px 14px 22px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-dark { color: var(--ink); padding: 0 0 18px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--r-sm); color: #d5ddee; font-size: 14.5px; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-group summary { list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .icon:last-child { margin-left: auto; transition: transform .15s; }
.nav-group[open] summary .icon:last-child { transform: rotate(180deg); }
.nav-group summary.active-group { color: #fff; }
.nav-sub { margin: 0 0 4px 0; padding-left: 26px; }
.nav-sub-item { padding: 7px 14px; font-size: 13.5px; }
.sidebar-card { margin-top: auto; background: rgba(40,80,170,.28); border: 1px solid var(--navy-line); border-radius: var(--r); padding: 16px 14px; color: #c9d4ea; font-size: 12.5px; display: grid; gap: 8px; }
.sidebar-card strong { color: #fff; font-size: 14px; } .sidebar-card .icon { color: #6ea8ff; }
.sidebar-card.sidebar-alert { background: rgba(197, 48, 48, .28); border-color: rgba(255, 150, 150, .4); } .sidebar-card.sidebar-alert .icon { color: #ff9c9c; }
.sidebar-card.sidebar-news { background: rgba(28, 140, 90, .28); border-color: rgba(120, 220, 170, .4); } .sidebar-card.sidebar-news .icon { color: #7fe0b0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--field); border-radius: var(--r-sm); padding: 0 12px; color: var(--ink-3); margin-right: auto; }
.search input { border: 0; background: none; padding: 10px 0; width: 100%; font: inherit; color: var(--ink); outline: none; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 8px; } .me strong { display: block; font-size: 14px; } .me small { display: block; } .me form { margin: 0; }
.content { padding: 24px; display: grid; gap: 20px; align-content: start; }

/* primitives */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
/* Breathing room between the things inside a card: headings, paragraphs, forms, tables, buttons. Grids and stats space themselves. */
.card:not(.grid):not(.stat) > * + * { margin-top: 12px; }
.card:not(.grid):not(.stat) > .card-head + * { margin-top: 0; }
.card:not(.grid):not(.stat) > h2 + p, .card:not(.grid):not(.stat) > h3 + p, .card:not(.grid):not(.stat) > h2 + .hint { margin-top: 4px; }
.card > h2 + .form-grid, .card > p + .form-grid { margin-top: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 360px; min-width: 0; } /* the title block grows; buttons and menus stay on the right */
.page-head p { color: var(--ink-2); margin-top: 4px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; } .cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 13.5px var(--font); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--field); text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-dark); }
.btn-danger { color: var(--bad); } .btn-block { width: 100%; } .btn-sm { padding: 5px 10px; font-size: 12.5px; }
.icon-btn { border: 0; background: none; color: var(--ink-2); padding: 8px; border-radius: var(--r-sm); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--field); color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 650; flex: none; }
.badge .icon { vertical-align: -2px; margin-right: 2px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--blue-dark); }
.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin: 14px 0; } .alert:first-child { margin-top: 0; } .alert:last-child { margin-bottom: 0; } .card-head + .alert, h1 + .alert, h2 + .alert, p + .alert { margin-top: 12px; } .alert-bad { background: var(--bad-soft); color: var(--bad); } .alert-info { background: var(--info-soft); color: var(--blue-dark); } .alert-good { background: var(--good-soft); color: var(--good); }
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px; }

/* forms */
label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); align-content: start; }
label[hidden], fieldset[hidden], section[hidden], form[hidden], div[hidden], span[hidden] { display: none; }
label > input, label > select, label > textarea, label > .row { align-self: start; }
/* Field help: site.js turns a label's hint into an "i" beside the label text with a bubble; without scripts the
   hint still shows as small text under the field. */
label > .hint { order: 10; }
.label-line { display: inline-flex; align-items: center; gap: 6px; }
.info { position: relative; display: inline-flex; }
.info-btn { width: 18px; height: 18px; border: 0; padding: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.info-btn svg { width: 16px; height: 16px; display: block; }
.info.open .info-btn { color: var(--blue); }
.info-bubble { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: max-content; max-width: min(320px, 80vw); padding: 8px 11px; border-radius: 8px; background: var(--navy-900, #0f1b33); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; box-shadow: 0 8px 24px rgba(15, 27, 51, .18); white-space: normal; }
.info-bubble::before { content: ""; position: absolute; left: 4px; top: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: var(--navy-900, #0f1b33); }
.info-bubble code { background: rgba(255,255,255,.14); color: #fff; }
.info.open .info-bubble { display: block; }
.score-info .badge { cursor: pointer; border: 0; font: inherit; font-weight: 700; min-width: 34px; text-align: center; }
.score-info .info-bubble { width: 300px; } .score-info .info-bubble strong { display: block; margin-bottom: 2px; } .score-info .muted-light { display: block; opacity: .75; font-size: 11.5px; margin-bottom: 6px; }
.score-info .info-bubble ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
.info-bubble.info-bubble-fixed { position: fixed; left: auto; top: auto; z-index: 80; } .info-bubble.info-bubble-fixed::before { left: 12px; }   /* click to open, click again / outside / Escape to close; no hover */
input, select, textarea { font: 14px var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; width: 100%; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; } textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); font-size: 14px; padding: 6px 0; }
label.check + label.check { margin-top: 2px; }
label.check input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; } .form-grid .full { grid-column: 1 / -1; }
.hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }

/* tables */
.table-wrap { overflow-x: auto; }
table:where(:not(.rte-body *)) { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th:where(:not(.rte-body *)) { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-2); background: var(--field); padding: 10px 12px; white-space: nowrap; }
th:where(:not(.rte-body *)):first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } th:where(:not(.rte-body *)):last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
td:where(:not(.rte-body *)) { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; } tr:last-child td:where(:not(.rte-body *)) { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #fafbfd; }
td .who { display: flex; align-items: center; gap: 10px; font-weight: 600; } .num { text-align: right; font-variant-numeric: tabular-nums; }

/* dashboard */
.dash { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat { display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; aspect-ratio: 1; box-sizing: border-box; }
.stat b { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.delta { font-weight: 650; font-size: 13px; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta .icon { vertical-align: -3px; }
.tint-email { background: var(--blue-soft); color: var(--blue); } .tint-sms { background: #e3f6ea; color: #18924f; } .tint-push { background: #efe9fc; color: #6a3fd0; }
.tint-blue { background: var(--blue-soft); color: var(--blue); } .tint-purple { background: #efe9fc; color: #6a3fd0; } .tint-green { background: #18924f; color: #fff; } .tint-orange { background: #f6902c; color: #fff; }
.chart text { font: 11px var(--font); fill: var(--ink-3); }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; } .legend { display: grid; gap: 12px; flex: 1; min-width: 190px; font-size: 13.5px; }
.legend div { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; } .dot { width: 10px; height: 10px; border-radius: 50%; }
.feed { display: grid; } .feed-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); } .feed-item:last-child { border: 0; }
.feed-item > div { min-width: 0; } .feed-item strong { font-size: 13px; display: block; } .feed-item > div > span { color: var(--ink-2); font-size: 13px; display: block; }
.list-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); } .list-row:last-child { border: 0; } .list-row > div { flex: 1; }
.list-row.done span { text-decoration: line-through; color: var(--ink-3); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.quick a { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; } .quick a:hover { text-decoration: none; border-color: var(--blue); }
.quick a > div { min-width: 0; flex: 1; } .quick strong { display: block; font-size: 13px; } .quick small { display: block; } .quick a > .icon:last-child { flex: none; color: var(--ink-3); }
.mini-stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 0; } .mini-stats div { padding: 0 16px; border-left: 1px solid var(--line-soft); } .mini-stats div:first-child { border: 0; padding-left: 0; }
.mini-stats b { font-size: 20px; display: block; font-variant-numeric: tabular-nums; }

/* kanban, inbox, builders */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px,1fr)); gap: 12px; overflow-x: auto; }
.kanban-col { background: #eaeef5; border-radius: var(--r); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 200px; }
.kanban-col header { display: flex; justify-content: space-between; font-weight: 650; font-size: 13px; padding: 2px 4px 4px; border-top: 3px solid; border-radius: 2px; padding-top: 8px; }
.inbox { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 260px); min-height: 420px; padding: 0; overflow: hidden; }
.card > .inbox { margin: 0 -20px -18px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; }
.thread-item { display: block; text-decoration: none; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 12px 16px; cursor: pointer; font: inherit; color: inherit; }
.thread-item.active { background: var(--blue-soft); } .thread-item p { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-width: 0; } .thread header { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.bubbles { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.bubble { max-width: 70%; padding: 9px 13px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.out { align-self: flex-end; background: var(--blue); color: #fff; border-color: var(--blue); } .bubble small { display: block; margin-top: 3px; opacity: .75; color: inherit; font-size: 11px; }
.bubble.failed { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-soft); }
.composer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); } .composer textarea { min-height: 44px; height: 44px; }
.step { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; border-left: 3px solid var(--blue); }
.step-slot { width: var(--control-h); min-width: var(--control-h); height: var(--control-h); flex: none; display: inline-grid; place-items: center; padding: 0; margin: 0; } /* the variant trash icon and the matching blank on variant A: same box, so Preview / Edit line up */
.step-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; } .step-when input, .step-when select { width: auto; } .step-when input[type=number] { width: 72px; }
.cond { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .tab { border: 0; text-decoration: none; background: none; padding: 10px 14px; font: 600 13.5px var(--font); color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--blue); border-color: var(--blue); }
.tabs-select { display: none; width: 100%; margin-bottom: 16px; font-weight: 600; }   /* the tabs as a dropdown on small screens */
code:where(:not(.rte-body *)), .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--field); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
pre.snippet { background: var(--navy-900); color: #dbe6ff; padding: 14px; border-radius: var(--r-sm); overflow-x: auto; font: 12.5px/1.5 ui-monospace, Consolas, monospace; margin: 0; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,26,62,.45); display: grid; place-items: start center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border-radius: var(--r-lg); width: min(560px, 100%); box-shadow: 0 24px 60px -12px rgba(8,26,62,.4); }
.modal-wide { width: min(820px, 100%); } .modal header, .modal footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.modal footer { justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); } .modal-body { padding: 4px 20px 20px; display: grid; gap: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); padding: 20px; }
.login-card { background: var(--card); border-radius: var(--r-lg); padding: 32px; width: min(380px, 100%); display: grid; gap: 16px; } .login-card h1 { font-size: 22px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bad); color: #fff; padding: 10px 20px; z-index: 100; } #blazor-error-ui a { color: #fff; text-decoration: underline; }

@media (max-width: 1200px) { .dash { grid-template-columns: 1fr; } .quick { grid-template-columns: repeat(2, 1fr); } .stats { grid-template-columns: repeat(2, 1fr); } .mini-stats { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } }
.hamburger, .sidebar-close, .sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  /* Off-canvas sidebar behind a hamburger */
  .shell { grid-template-columns: 1fr; }
  .hamburger { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100vh; transform: translateX(-100%); transition: transform .22s ease; z-index: 60; overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open { transform: none; }
  .sidebar-close { display: inline-grid; position: absolute; top: 12px; right: 10px; color: #cfd8ea; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 30, 61, .45); z-index: 55; }
  .sidebar-backdrop[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  .sidebar-card { display: none; }
  .brand { padding-right: 44px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .company-switch summary { max-width: 46vw; padding: 4px 8px 4px 4px; }
  .company-switch .co-name { font-size: 14px; }
  .co-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .me div { display: none; }
  .content { padding: 14px; gap: 14px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head > div:first-child { flex: 0 0 auto; }
  .page-head h1 { font-size: 22px; }
  .page-head .row { flex-wrap: wrap; }
  .cols-2, .cols-3, .form-grid, .stats, .quick, .dash, .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox .thread-list { max-height: 40vh; overflow-y: auto; }
  .cond { grid-template-columns: 1fr 1fr; }
  .filters { align-items: center; } .filters input { flex: 1 1 200px; width: auto; min-width: 0 !important; } .filters select, .filters .btn { flex: 1 1 100%; width: 100%; } .filters .help-btn { flex: 0 0 auto; }
  .pager { flex-direction: column; align-items: stretch; } .pager > span { flex-wrap: wrap; margin-left: 0; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .step-when { gap: 6px; } .step-when input[type=number] { width: 60px; }
  .tabs:has(+ .tabs-select) { display: none; } .tabs-select { display: block; }
  .date-range { flex-wrap: wrap; }
  .bulk-bar { flex-wrap: wrap; }
  dialog.help-box { width: 96vw; }
  .login-card { padding: 24px 18px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr !important; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .cond { grid-template-columns: 1fr; }
  .company-switch .co-name { display: none; }
  .company-switch summary { max-width: none; }
}
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* row names are real links so rows work with the keyboard and open in new tabs */
.row-link { color: inherit; text-decoration: none; font-weight: inherit; } .row-link:hover, .row-link:focus-visible { color: var(--blue); text-decoration: underline; }

/* MVC: add/edit screens are pages (not modals), and a few elements became links or forms */
.form-page { max-width: 780px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.form-actions.form-page { margin-top: 14px; }
.page-head form, .form-actions form, td form { margin: 0; }
form.list-row { margin: 0; }
.pre { white-space: pre-wrap; overflow: auto; max-height: 320px; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12.5px; margin: 0; }

/* company tick-list in the campaign editor */
fieldset.checks { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.checks legend { font-weight: 600; font-size: 13px; color: var(--ink-2, #4a5878); padding: 0; margin-bottom: 6px; }
.checks-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

a.thread-item:focus-visible, a.tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.preview-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* company switcher in the topbar */
.company-switch { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-2, #4a5878); }
.company-switch select { width: auto; max-width: 240px; font-weight: 600; }

tr.done td { opacity: .6; }
.login { align-content: center; gap: 12px; }

/* company logo, top-left */
.brand { line-height: 1.2; }
.brand-logo img { max-height: 44px; max-width: 170px; object-fit: contain; display: block; }

.date-range input[type=date] { width: auto; }

.bar { height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; display: inline-block; width: 70%; vertical-align: middle; margin-right: 6px; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

.pager { justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager form { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; }

/* help lightbox */
.help-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--blue); font-weight: 700; font-size: 13px; line-height: 1; cursor: pointer; vertical-align: middle; display: inline-grid; place-items: center; }
.help-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
dialog.help-box { border: 0; border-radius: 14px; padding: 0; width: min(640px, 92vw); box-shadow: 0 24px 60px rgba(15, 30, 61, .35); }
dialog.help-box::backdrop { background: rgba(15, 30, 61, .45); }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.help-head h2 { margin: 0; font-size: 17px; }
.help-body { padding: 12px 20px 20px; font-size: 14px; line-height: 1.55; color: var(--ink-2, #4a5878); }
.help-body p { margin: 0 0 10px; } .help-body ul { margin: 0 0 10px 18px; padding: 0; } .help-body code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }
.help-inline { margin: 8px 0; }
.group-pick { display: grid; gap: 6px; } .group-pick input[hidden] { display: none; }
.group-pick:has(option[value="__new__"]:checked) input[hidden] { display: block; } /* the name box opens even before site.js runs */
.help-tabs .tabs { margin: 0 0 12px; } .help-tabs .tab { padding: 8px 12px; } .help-pane[hidden] { display: none; }
.help-pane table td:first-child { white-space: nowrap; }
form.grid, section.card.grid { align-content: start; }

/* company switcher: button → panel with search on top, list in the middle, Manage companies pinned at the bottom */
.company-switch { position: relative; margin: 0; }
.company-switch summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600; max-width: 280px; }
.company-switch summary::-webkit-details-marker { display: none; }
.company-switch summary:hover, .company-switch[open] summary { border-color: var(--blue); }
.company-switch .co-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-mark { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.co-logo { height: 28px; max-width: 80px; object-fit: contain; border-radius: 6px; background: #0f1e3d; padding: 2px 6px; flex: none; }
.co-icon { width: 28px; height: 28px; object-fit: cover; border-radius: 7px; flex: none; border: 1px solid var(--line); background: #fff; }
.co-panel { position: absolute; top: calc(100% + 6px); right: 0; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 48px rgba(15, 30, 61, .22); display: flex; flex-direction: column; overflow: hidden; z-index: 50; }
.co-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2, #4a5878); }
.co-search input { border: 0; padding: 4px 0; box-shadow: none; background: transparent; }
.co-search input:focus { outline: none; box-shadow: none; }
.co-list { margin: 0; max-height: 320px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.co-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font: inherit; color: var(--ink); }
.co-item:hover, .co-item:focus-visible { background: #eef3fd; outline: none; }
.co-item.active { background: #e6efff; font-weight: 600; }
.co-item > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-item > .icon:last-child { color: var(--blue); flex: none; } .co-mark .icon { color: #fff; }
.co-empty { margin: 8px 10px; }
.co-manage { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); background: #fafbfd; color: var(--ink); font-weight: 600; text-decoration: none; }
.co-manage:hover { background: #eef3fd; text-decoration: none; }

.bulk-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 8px 12px; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; }
.bulk-bar .check { margin: 0; }

.sent-context { border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; margin: 0 0 10px; }
.sent-context summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
.sent-context ul { list-style: none; margin: 0; padding: 0 14px 10px; max-height: 220px; overflow-y: auto; display: grid; gap: 8px; font-size: 13px; }
.sent-context li { padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

/* one control height everywhere: inputs, selects and buttons line up in a row */
:root { --control-h: 38px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, .btn, .icon-btn, .help-btn { box-sizing: border-box; min-height: var(--control-h); }
.btn-sm { min-height: var(--control-h); padding: 6px 12px; }
.icon-btn { min-width: var(--control-h); }
.help-btn { min-height: 22px; }
.pager .btn-sm { min-height: 30px; padding: 4px 9px; }
.co-item, .co-manage, .company-switch summary { min-height: 0; }
.step-when { align-items: center; } .step-when .icon-btn { margin-left: 4px; }
textarea { box-sizing: border-box; }

.topbar-spacer { flex: 1; }

/* Icon circles: always a true circle with the glyph dead centre, whatever the surrounding list's text rules say. */
.stat-icon, .stat .stat-icon, .feed-item .stat-icon, .quick .stat-icon, .who .stat-icon { display: grid; place-items: center; line-height: 0; padding: 0; flex: none; }
.stat-icon .icon { vertical-align: 0; display: block; margin: 0; }

.help-body table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; } .help-body td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
dialog.help-box { width: min(820px, 94vw); max-height: 90vh; overflow: auto; }
.help-body code { white-space: nowrap; }

/* media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.media-thumb { display: grid; place-items: center; height: 150px; background: repeating-conic-gradient(#f2f4f8 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.media-thumb img { max-width: 100%; max-height: 150px; object-fit: contain; }
.media-file { text-align: center; color: var(--ink-2, #4a5878); font-size: 12px; }
.media-meta { padding: 10px; display: grid; gap: 8px; }
.media-meta small { color: var(--ink-2, #4a5878); overflow-wrap: anywhere; }

.group-row td { background: #f4f6fb; font-weight: 700; padding: 8px 12px; border-top: 1px solid var(--line); } .group-row a { color: var(--ink); text-decoration: none; }
.check input[type=radio] { width: auto; flex: none; min-height: 0; }

.bar { height: 8px; background: var(--field); border-radius: 4px; overflow: hidden; } .bar span { display: block; height: 100%; border-radius: 4px; }

.powered-by { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 16px; }

.brand-wordmark { display: flex; justify-content: center; margin: 4px 0 18px; } .brand-wordmark img { max-width: 260px; width: 100%; height: auto; }
.admin-tag { color: #c9d4ea; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: -6px 0 10px 14px; }

/* ---- email editor (TinyMCE-style) ---- */
.rte { border: 1px solid var(--line); border-radius: var(--r); background: #fff; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; background: #f7f8fa; border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.rte-group { display: flex; align-items: center; gap: 2px; }
.rte-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.rte-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #222f3e; cursor: pointer; padding: 0; position: relative; }
.rte-btn:hover { background: #e9edf3; }
.rte-btn.active { background: #dbe8ff; color: var(--blue); border-color: #c5d9ff; }
.rte-btn:disabled { opacity: .4; cursor: default; }
.rte-select { height: 32px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #222f3e; font: inherit; font-size: 13px; padding: 0 6px; cursor: pointer; }
.rte-select:hover { background: #e9edf3; }
.rte-tags-host { position: relative; display: inline-flex; }
.rte-tags-btn { display: inline-flex; align-items: center; width: auto; padding: 0 10px 0 8px; gap: 6px; font: 600 13px var(--font); }
.rte-tags { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; width: min(560px, 92vw); max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .14); padding: 8px; display: grid; gap: 8px; text-align: left; }
.rte-tags[hidden] { display: none; }
.rte-tag-group { display: grid; gap: 2px; } .rte-tag-group > strong { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px 2px; }
.rte-tag { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 12px; align-items: baseline; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 6px; text-align: left; cursor: pointer; font: 13px var(--font); color: var(--ink); }
.rte-tag:hover { background: var(--field); } .rte-tag code { font-size: 12.5px; white-space: nowrap; } .rte-tag span { color: var(--ink-2); }
.rte-colorbtn input, .rte-tagbtn select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rte-colorbtn::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 4px; height: 3px; border-radius: 2px; background: currentColor; }
.rte-frame { display: block; width: 100%; min-height: 360px; height: 60vh; border: 0; background: #fff; } /* the message as its own document: its styles apply, the app's never do */
.rte-full .rte-frame { height: calc(100vh - 92px); }
.rte-body { min-height: 360px; max-height: 70vh; overflow: auto; padding: 8px; outline: 0; font-family: "Times New Roman", Times, serif; font-size: 16px; line-height: normal; color: #000; } /* the browser defaults a mail client (and the preview) starts from; fonts and sizes set with the toolbar travel as inline styles */
.rte-body:focus { box-shadow: inset 0 0 0 2px #dbe8ff; }
/* Inside the editor nothing from the app's stylesheet applies (the element rules above exclude .rte-body), so
   headings, paragraphs and tables sit exactly as a mail client lays them out from the HTML. */
.rte-body img { max-width: 100%; height: auto; }
.rte-body td, .rte-body th { outline: 1px dashed #d1d5db; outline-offset: -1px; } /* an outline takes no space, so the layout is unchanged */
.rte-main { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.rte-split .rte-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rte-split .rte-code { border-left: 1px solid var(--line); }
/* The source: a transparent textarea over a <pre> that carries the colors; identical font, padding and wrapping keep them aligned. */
.rte-code { position: relative; min-height: 360px; max-height: 70vh; background: #0f172a; overflow: hidden; display: grid; }
.rte-code .rte-source, .rte-code .rte-colored { grid-area: 1 / 1; margin: 0; min-height: 360px; max-height: 70vh; overflow: auto; padding: 14px 16px; border: 0; border-radius: 0; resize: none; font: 13px/1.55 ui-monospace, Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; tab-size: 2; }
.rte-code .rte-source { background: transparent; color: transparent; caret-color: #e2e8f0; outline: 0; z-index: 1; }
.rte-code .rte-source::selection { background: rgba(96, 165, 250, .35); }
.rte-code .rte-colored { color: #e2e8f0; pointer-events: none; }
.rte-colored .c-punct { color: #94a3b8; } .rte-colored .c-tag { color: #7dd3fc; } .rte-colored .c-attr { color: #fbbf24; } .rte-colored .c-val { color: #86efac; }
.rte-colored .c-comment { color: #64748b; font-style: italic; } .rte-colored .c-doctype { color: #64748b; } .rte-colored .c-merge { color: #f9a8d4; font-weight: 600; }
.rte-colored .rte-hl { background: rgba(96, 165, 250, .22); color: inherit; outline: 1px solid rgba(96, 165, 250, .6); border-radius: 3px; }
.rte-body [data-rte-picked] { outline: 2px solid var(--blue) !important; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.rte-status { display: flex; justify-content: space-between; gap: 12px; padding: 4px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: #f7f8fa; border-radius: 0 0 var(--r) var(--r); }
.rte-full { position: fixed; inset: 0; z-index: 60; border-radius: 0; } .rte-full .rte-body, .rte-full .rte-code, .rte-full .rte-code .rte-source, .rte-full .rte-code .rte-colored { max-height: none; }
.rte-full .rte-main { min-height: 0; } .rte-full .rte-body, .rte-full .rte-code { height: calc(100vh - 92px); }
body.rte-lock { overflow: hidden; }
.label-text { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

.login-card-wide { width: min(760px, 100%); }
.demo-side { color: #c9d4ea; max-width: 360px; line-height: 1.7; } .demo-side h2 { color: #fff; margin: 0 0 8px; } .demo-side ul { margin: 0; padding-left: 18px; }
.demo-wrap { display: flex; gap: 48px; align-items: flex-start; justify-content: center; flex-wrap: wrap; width: min(1100px, 100%); }

dl.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; } dl.kv dt { color: var(--muted); font-size: 13px; } dl.kv dd { margin: 0; }

.btn .count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--field); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1; }
.btn.btn-primary .count { background: rgba(255,255,255,.25); color: #fff; }

/* ---- "More" menu: a details/summary dropdown, no JS needed to open; site.js closes it on outside clicks ---- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; } .menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--field); }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .12); padding: 6px; z-index: 30; display: grid; }
.menu-items a, .menu-items button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.menu-items a:hover, .menu-items button:hover { background: var(--field); }
.push-opt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; } .push-opt summary { cursor: pointer; } .push-opt[open] summary { margin-bottom: 8px; }
.prefs-card { width: min(460px, 100%); } .prefs-form { display: grid; gap: 14px; }
.prefs-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: 14px; cursor: pointer; } .prefs-row input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
/* ---- web push allow-box builder (Settings → Web push) ---- */
.push-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; } .push-fields { align-content: start; }
@media (max-width: 1100px) { .push-builder { grid-template-columns: 1fr; } }
.push-preview { position: relative; height: 340px; border: 1px solid var(--line); border-radius: 10px; background: #eef1f6; overflow: hidden; }
.push-preview-page { position: absolute; inset: 0; padding: 26px 28px; display: grid; gap: 12px; align-content: start; }
.push-preview-page span { display: block; height: 12px; border-radius: 6px; background: #dfe4ec; }
.push-preview-page span:first-child { height: 26px; width: 40%; }
/* the same look as the SDK's own box, positioned inside the preview instead of the viewport */
.push-preview .wfcpush { position: absolute; z-index: 2; font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #1f2937; box-sizing: border-box; }
.push-preview .wfcpush * { box-sizing: border-box; }
.push-preview .wfcpush-banner { left: 0; right: 0; background: #fff; box-shadow: 0 -4px 24px rgba(0,0,0,.08); padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.push-preview .wfcpush-banner.at-bottom { bottom: 0; border-top: 1px solid #e5e7eb; } .push-preview .wfcpush-banner.at-top { top: 0; border-bottom: 1px solid #e5e7eb; }
.push-preview .wfcpush-card { width: min(340px, calc(100% - 40px)); background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.14); padding: 18px; }
.push-preview .wfcpush-bell { width: 52px; height: 52px; border-radius: 50%; border: 0; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: grid; place-items: center; }
.push-preview .wfcpush-bell svg { width: 24px; height: 24px; }
.push-preview .wfcpush-icon { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.push-preview .wfcpush-text { flex: 1; min-width: 160px; } .push-preview .wfcpush-title { font-weight: 700; margin: 0 0 2px; } .push-preview .wfcpush-msg { margin: 0; color: #4b5563; }
.push-preview .wfcpush-actions { display: flex; gap: 8px; margin-top: 12px; } .push-preview .wfcpush-banner .wfcpush-actions { margin: 0; }
.push-preview .wfcpush-allow { border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; } .push-preview .wfcpush-later { background: transparent; color: #4b5563; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 14px; }
.push-preview .wfcpush-native { position: absolute; left: 12px; top: 12px; width: 330px; background: #fff; border: 1px solid #cfd6e0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 12px 14px; font: 13px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #1f2937; }
.push-preview .wfcpush-native b { display: block; margin-bottom: 8px; } .push-preview .wfcpush-native span { display: inline-block; border: 1px solid #cfd6e0; border-radius: 6px; padding: 5px 12px; margin-right: 6px; }
.push-preview .wfcpush-hint { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #6b7280; }
/* ---- hosted landing pages ---- */
.lp-card { width: min(520px, 100%); } .lp-logo { max-height: 56px; max-width: 220px; object-fit: contain; display: block; margin-bottom: 4px; }
.lp-company { margin: 0; font-family: var(--font-heading); font-weight: 600; color: var(--ink-2); }
.lp-btn { background: var(--lp, var(--blue)); border-color: var(--lp, var(--blue)); } .lp-btn:hover { filter: brightness(.92); }
/* ---- deliverability chart ---- */
.deliv-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0 0; }
.deliv-day { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; position: relative; }
.deliv-bar { width: 100%; background: var(--blue-soft); border-radius: 3px 3px 0 0; }
.deliv-mark { width: 6px; height: 6px; border-radius: 50%; position: absolute; top: 0; } .deliv-mark.bounce { background: var(--warn); left: calc(50% - 7px); } .deliv-mark.complaint { background: #6a3fd0; left: calc(50% + 1px); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--good-soft); color: var(--good); }
/* A button that was pressed and is waiting on the server: locked, and its icon replaced by a spinner. */
.btn[data-busy].is-busy, button.is-busy { pointer-events: none; opacity: .75; }
.is-busy .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-busy .icon { animation-duration: 2s; } }
[data-live-region][aria-busy="true"] { opacity: .6; transition: opacity .15s; }

/* Text-styled button (the "Resubscribe now" link on the unsubscribe page is a POST). */
.btn-link { background: none; border: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }
.btn-link:hover { color: var(--ink); }
.login-card [data-unsubscribe-feedback] .check { margin: 0; }

/* Media picker lightbox: a grid of thumbnails from the library (its own classes; .media-grid belongs to the Media page). */
dialog.media-picker { width: min(760px, 94vw); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.picker-tile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.picker-tile:hover, .picker-tile:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); outline: 0; }
.picker-tile img { width: 100%; height: 90px; object-fit: contain; background: #f4f5f7; border-radius: 4px; }
.picker-tile span { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.picker-tile small { color: var(--muted, #6b7280); display: block; }

/* ---- Support: tickets and the knowledge base ---- */
.support-thread { display: grid; gap: 12px; }
.support-msg { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--card); max-width: 860px; }
.support-msg.from-support { background: var(--blue-soft); border-color: #cfe0fc; }
.support-msg-head { font-size: 12.5px; margin-bottom: 6px; } .support-msg-head strong { color: var(--ink); }
.support-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.kb-hero { background: linear-gradient(135deg, #0f1e3d 0%, #1d4ed8 60%, #1d6bf3 100%); color: #fff; border-radius: var(--r-lg); padding: 44px 24px 36px; text-align: center; margin-bottom: 20px; }
.kb-hero h2 { font: 700 28px/1.2 var(--font-head, var(--font)); margin: 0 0 18px; color: #fff; }
.kb-search { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 8px 6px 18px; max-width: 720px; margin: 0 auto; color: var(--ink-3); box-shadow: 0 12px 30px rgba(15, 30, 61, .25); }
.kb-search input { border: 0; background: none; padding: 10px 0; width: 100%; font: 15px var(--font); color: var(--ink); outline: none; }
.kb-search .btn { border-radius: 999px; }
.kb-search-sm { box-shadow: none; border: 1px solid var(--line); padding: 2px 8px 2px 12px; min-width: 260px; margin: 0; }
.kb-search-sm input { padding: 7px 0; font-size: 13.5px; }
.kb-hero-hint { margin: 14px 0 0; color: rgba(255,255,255,.8); font-size: 13px; } .kb-hero-hint a { color: #fff; text-decoration: underline; }
.kb-section { font-size: 15px; margin: 0 0 12px; color: var(--ink-2); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kb-tile { display: grid; gap: 6px; justify-items: center; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 14px; color: var(--ink); text-decoration: none; }
.kb-tile:hover, .kb-tile.active { border-color: var(--blue); text-decoration: none; box-shadow: 0 6px 20px rgba(29, 107, 243, .12); }
.kb-tile-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.kb-tile strong { font-size: 13.5px; } .kb-tile small { color: var(--ink-3); }
.kb-list { display: grid; }
.kb-item { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.kb-item:last-child { border-bottom: 0; } .kb-item:hover strong { color: var(--blue); } .kb-item:hover { text-decoration: none; }
.kb-item strong { font-size: 14px; } .kb-item > span:not(.kb-cat) { color: var(--ink-2); font-size: 13px; }
.kb-cat { font-size: 11.5px; font-weight: 600; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .02em; }
.kb-crumbs { font-size: 13px; color: var(--ink-3); margin: 0 0 4px !important; }
.kb-article { line-height: 1.6; font-size: 14.5px; }
.kb-article h2 { font-size: 20px; margin: 22px 0 8px; } .kb-article h3 { font-size: 16px; margin: 18px 0 6px; } .kb-article h4 { font-size: 14.5px; margin: 14px 0 4px; }
.kb-article h2:first-child { margin-top: 0; }
.kb-article p { margin: 0 0 12px; } .kb-article ul, .kb-article ol { margin: 0 0 12px; padding-left: 22px; } .kb-article li { margin: 4px 0; }
.kb-article code { background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.kb-article pre { background: #0f1e3d; color: #e6edf7; padding: 12px 14px; border-radius: var(--r-sm); overflow-x: auto; font-size: 13px; } .kb-article pre code { background: none; border: 0; padding: 0; color: inherit; }
.kb-article blockquote { border-left: 3px solid var(--line); margin: 0 0 12px; padding: 4px 14px; color: var(--ink-2); }
.kb-article hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kb-related { margin: 0; padding-left: 18px; line-height: 1.8; }
@media (max-width: 900px) { .kb-hero { padding: 28px 16px 24px; } .kb-hero h2 { font-size: 22px; } .kb-search .btn { display: none; } }
