:root {
  --bg: #f6f8fb; --surface: #ffffff; --text: #14202e; --muted: #556579; --line: #d5dde8;
  --accent: #0b5cad; --accent-text: #ffffff; --warn: #6b4a00; --warn-bg: #fdf0c8; --ok: #146c2e; --ok-bg: #dff3e4;
  --bad: #a31d1d; --bad-bg: #fbe3e3; --info-bg: #e3eefb; --bar: #0b2a4a; --bar-text: #eaf3ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141d; --surface: #141e2b; --text: #e6edf5; --muted: #97a8bc; --line: #2a3a4d;
    --accent: #5cb0ff; --accent-text: #06121f; --warn: #ffe08a; --warn-bg: #4a3b0a; --ok: #6fdc8c; --ok-bg: #123320;
    --bad: #ff8d8d; --bad-bg: #3a1717; --info-bg: #16304d; --bar: #08111a; --bar-text: #eaf3ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
a { color: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre { white-space: pre-wrap; word-break: break-all; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; background: var(--bar); color: var(--bar-text); padding: .6rem 1.25rem; }
.bar .brand { color: var(--bar-text); font-weight: 700; text-decoration: none; letter-spacing: .03em; }
.bar nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.bar nav a { color: var(--bar-text); text-decoration: none; padding: .35rem .75rem; border-radius: 6px; }
.bar nav a:hover { background: rgba(255,255,255,.12); }
.bar nav a[aria-current="page"] { background: rgba(255,255,255,.2); }
.bar .who { display: flex; align-items: center; gap: .75rem; margin: 0; }
.bar .who .muted { color: #b5c6da; }
.bar .btn.ghost { color: var(--bar-text); border-color: rgba(255,255,255,.4); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.card-wrap { max-width: 26rem; margin: 12vh auto 0; padding: 0 1rem; }
.card, .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.wide-card { margin-bottom: 1.25rem; }
.secret { background: var(--bg); border: 1px dashed var(--line); padding: .75rem; border-radius: 6px; margin: .5rem 0; }

.btn { display: inline-block; font: inherit; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.wide { display: block; text-align: center; }

input, select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
label { font-weight: 600; font-size: .85rem; }
.search { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.search input[name="q"] { flex: 1; min-width: 14rem; }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .75rem; margin-bottom: 1rem; }
.break { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.break form { display: grid; gap: .5rem; margin-top: .75rem; }

.notice { background: var(--info-bg); border: 1px solid var(--line); padding: .6rem .9rem; border-radius: 6px; }
.notice.err { background: var(--bad-bg); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat .n { display: block; font-size: 2rem; font-weight: 700; }
.stat .l { color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td details summary { cursor: pointer; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; margin: .5rem 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.pill { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: var(--info-bg); }
.pill.success { background: var(--ok-bg); color: var(--ok); }
.pill.failure { background: var(--bad-bg); color: var(--bad); }
.foot { text-align: center; padding: 1.5rem; font-size: .8rem; }

/* severity: label text is always shown, colour is only a reinforcement */
.pill.sev-low { background: var(--info-bg); }
.pill.sev-medium { background: #fdf0c8; color: #5c4400; }
.pill.sev-high { background: #fbdcc4; color: #7a2d00; }
.pill.sev-critical { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .pill.sev-medium { background: #4a3b0a; color: #ffe08a; }
  .pill.sev-high { background: #50260a; color: #ffb98a; }
}
.linkcard { text-decoration: none; color: inherit; display: block; }
.linkcard:hover { border-color: var(--accent); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.chart svg { width: 100%; height: auto; }
.chart .bar { fill: var(--accent); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 9px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
ul.tight { gap: .15rem; }
.num { display: inline-block; min-width: 3rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.gap { margin-top: 1.25rem; }
.stack { display: grid; gap: .5rem; max-width: 40rem; }
textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem; margin-bottom: .5rem; }
.note p { margin: .25rem 0 0; white-space: pre-wrap; }

/* brand logo */
.logo-h { margin: 0 0 .5rem; line-height: 0; }
.logo { display: block; width: 100%; max-width: 20rem; height: auto; margin: 0 auto; }
.logo-nav { display: block; height: 2.5rem; width: auto; }
.bar .brand { display: inline-flex; align-items: center; }

/* ---- Beacon additions ---- */
.logo-nav { height: 3rem; width: auto; }
.logo { max-width: 24rem; }
.subnav { display: flex; flex-wrap: wrap; gap: .25rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: .4rem 1.25rem; }
.subnav a { color: var(--text); text-decoration: none; padding: .3rem .75rem; border-radius: 6px; }
.subnav a:hover { background: var(--info-bg); }
.subnav a[aria-current="page"] { background: var(--info-bg); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pager { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem 1rem; max-width: 60rem; }
.field { display: grid; gap: .25rem; align-content: start; }
.field .help { color: var(--muted); font-size: .8rem; }
.field.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: .2rem .6rem; font-size: .85rem; }
select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.code-block { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .75rem; overflow-x: auto; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: .5rem 0 1rem; }
.bar-track { background: var(--line); border-radius: 99px; height: .6rem; overflow: hidden; min-width: 6rem; }
.bar-fill { background: var(--accent); height: 100%; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--text); background: var(--surface); }
.tabs a[aria-current="page"] { border-color: var(--accent); font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; align-items: start; }
iframe.preview { width: 100%; min-height: 24rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ==== Settings pages (providers, domains, senders, carriers, apps, status, audit) ==== */
.req { color: var(--bad); font-weight: 700; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem 1rem .75rem; margin: 0; }
fieldset legend { padding: 0 .4rem; }
fieldset .check { margin: .25rem 0; }
.field .label { font-size: .85rem; }
.field input, .field select { width: 100%; min-width: 0; }
.field input[type="checkbox"] { width: auto; }
.danger-zone { margin-top: 1.25rem; border: 1px solid var(--bad); border-radius: 10px; padding: .75rem 1.25rem; background: var(--surface); }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 700; }
.dns-rec { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.dns-rec h3, .wide-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.dns-rec pre.code-block { white-space: pre-wrap; word-break: break-all; }
td.wrapany { word-break: break-word; max-width: 32rem; }
td.num { display: table-cell; }
.switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.switch-card { background: var(--surface); border: 2px solid var(--ok); border-radius: 10px; padding: 1.25rem 1.5rem; }
.switch-card.is-paused { border-color: var(--bad); background: var(--bad-bg); }
.switch-card.is-paused .muted { color: var(--text); }
.switch-card .big-state { font-size: 2rem; font-weight: 800; margin: .25rem 0 .5rem; color: var(--ok); letter-spacing: .02em; }
.switch-card.is-paused .big-state { color: var(--bad); }
.switch-card .btn { font-weight: 700; padding: .65rem 1.25rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
@media (max-width: 40rem) {
  header.bar { padding: .5rem .75rem; }
  .wrap { padding: 1rem .75rem; }
  .subnav { padding: .4rem .5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .inline > * { flex: 1 1 100%; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: .4rem; }
  .switch-card .big-state { font-size: 1.6rem; }
}
/* ==== end Settings pages ==== */

/* ==== Messaging and device pages (messages, send, templates, groups, webhooks, suppressions, devices, me) ==== */
.wide-stack { max-width: 60rem; }
.fs { padding: .75rem 1.25rem 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.picks { margin: .5rem 0; max-height: 18rem; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; background: var(--surface); }
.inline-form { display: inline-block; margin: 0 .25rem .25rem 0; }
details > summary.btn { display: inline-block; list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.secret code { word-break: break-all; }
.pairing { border: 2px solid var(--accent); margin-bottom: 1rem; }
.paircode { font: 700 2.4rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; background: var(--bg); color: var(--text); border: 2px dashed var(--line); border-radius: 10px; padding: .6rem 1rem; margin: .5rem 0 1rem; user-select: all; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .paircode { font-size: 1.7rem; letter-spacing: .08em; }
  .fs { padding: .6rem .75rem .8rem; }
}
.field .inline { margin-bottom: 0; }
.field .inline input { flex: 1 1 14rem; width: auto; }
.card h3 { font-size: 1.02rem; margin: .6rem 0 .4rem; }
/* .sr (screen-reader-only) boxes inside a scrolling table must be positioned against it, or they widen the page */
.table-wrap { position: relative; }
/* ==== end Messaging and device pages ==== */
