/* Hand-written, self-contained theme (light default + dark toggle). Deliberately not a framework:
   lxcpanel's borrowed compiled Tailwind is purge-stripped, so any class it
   happens not to contain renders as nothing at all, silently. */

/* LIGHT is the default theme. Dark is opt-in via the header toggle, which
   stamps data-theme="dark" on <html> and persists the choice.
   prefers-color-scheme is deliberately NOT honoured: light is the product's
   main look, so a dark OS setting shouldn't silently override it. */
:root {
  --bg: #f2f4f3;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f2;
  --border: #dfe6e1;
  --border-soft: #eaefeb;
  --text: #12211a;
  --muted: #6b7d73;
  --faint: #93a49a;
  --accent: #17864a;
  --accent-2: #0f6c3a;
  --accent-dim: rgba(23, 134, 74, .10);
  --btn-fg: #ffffff;
  --ok: #17864a;
  --ok-dim: rgba(23, 134, 74, .12);
  --warn: #a9711a;
  --warn-dim: rgba(169, 113, 26, .13);
  --err: #c2453f;
  --err-dim: rgba(194, 69, 63, .10);
  --code-fg: #0f6c3a;
  --shadow: 0 1px 2px rgba(18, 33, 26, .04), 0 8px 26px rgba(18, 33, 26, .06);
  --radius: 12px;
}

:root[data-theme="dark"] {
  --bg: #0b1310;
  --bg-2: #101a16;
  --surface: #14201b;
  --surface-2: #1a2822;
  --border: #24382e;
  --border-soft: #1d2d26;
  --text: #e6f1ea;
  --muted: #8ca89a;
  --faint: #63786d;
  --accent: #3ecf7f;
  --accent-2: #2fb46b;
  --accent-dim: rgba(62, 207, 127, .13);
  --btn-fg: #042414;
  --ok: #3ecf7f;
  --ok-dim: rgba(62, 207, 127, .14);
  --warn: #e0a63c;
  --warn-dim: rgba(224, 166, 60, .13);
  --err: #ef6b6b;
  --err-dim: rgba(239, 107, 107, .13);
  --code-fg: #9fe8c8;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ── top bar ─────────────────────────────────────────────────────────── */
.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 26px; height: 56px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15.5px; color: var(--text); }
.brand .ghosticon { width: 22px; height: 22px; flex: 0 0 22px; }
.brand .tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim); padding: 2px 7px; border-radius: 5px;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--accent-dim); color: var(--accent); }
.topbar .spacer { margin-left: auto; }
.usermenu {
  display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 13px;
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  background: linear-gradient(135deg, var(--accent-2) 0%, #2d6f8a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

/* ── layout ──────────────────────────────────────────────────────────── */
.shell { max-width: 1200px; margin: 0 auto; padding: 24px 22px 60px; display: flex; gap: 24px; }
.sidebar { width: 210px; flex: 0 0 210px; }
.content { flex: 1; min-width: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 22px 60px; }
.wrap-narrow { max-width: 420px; margin: 0 auto; padding: 56px 22px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; }
  .nav a span { display: none; }
}

/* ── sidebar ─────────────────────────────────────────────────────────── */
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a.active { background: var(--surface); color: var(--text); }
.side-nav .count {
  margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border-radius: 5px; padding: 1px 7px;
}
.side-nav a.active .count { color: var(--accent); background: var(--accent-dim); }

/* ── headings ────────────────────────────────────────────────────────── */
h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 0 0 16px; letter-spacing: -.015em; }
h3 { font-size: 15px; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.section { margin-bottom: 26px; }
.section > h2 { display: flex; align-items: center; gap: 10px; }

/* ── cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .spacer { margin-left: auto; }

.deploys { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

/* Status-tinted deployment cards. Tints come from the theme's own *-dim
   tokens so they read correctly in both light and dark. */
.site-card { position: relative; overflow: hidden; }
.site-card.is-active { border-color: var(--ok); }
.site-card.is-busy {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-dim) 0%, var(--surface) 65%);
}
.site-card.is-error {
  border-color: var(--err);
  background: linear-gradient(160deg, var(--err-dim) 0%, var(--surface) 65%);
}
.site-card h3 { font-size: 15.5px; word-break: break-all; }
.site-meta { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; display: grid; gap: 4px; }
.site-meta b { color: var(--text); font-weight: 600; }
.site-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }

/* ── status pills ────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill-ok { background: var(--ok-dim); color: var(--ok); }
.pill-busy { background: var(--accent-dim); color: var(--accent); }
.pill-warn { background: var(--warn-dim); color: var(--warn); }
.pill-err { background: var(--err-dim); color: var(--err); }

/* ── progress bar (provisioning cards) ───────────────────────────────── */
.bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .4s ease; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; font-family: inherit;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--btn-fg);
}
.btn:hover { background: var(--accent-2); color: var(--btn-fg); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--border-soft); color: var(--text); }
.btn-danger { background: var(--err-dim); color: var(--err); border-color: rgba(239,107,107,.35); }
.btn-danger:hover { background: rgba(239,107,107,.22); color: var(--err); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── forms ───────────────────────────────────────────────────────────── */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 9px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input::placeholder { color: var(--faint); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field { margin-bottom: 15px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* The inline "create site" row from the dashboard design. */
.createrow { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.createrow .field { margin-bottom: 0; }
.split { display: flex; }
.split input { border-radius: 8px 0 0 8px; border-right: 0; min-width: 0; }
.split .suffix {
  display: flex; align-items: center; padding: 0 11px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 0 8px 8px 0; white-space: nowrap;
}

.choice { display: grid; gap: 9px; margin-bottom: 16px; }
.choice label {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  font-weight: 500; color: var(--text); margin: 0;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice .t { font-weight: 650; font-size: 13.5px; display: block; color: var(--text); }
.choice .d { font-size: 12px; color: var(--muted); }

/* ── overview / stats ────────────────────────────────────────────────── */
.overview { display: grid; gap: 22px; grid-template-columns: minmax(180px, 260px) 1fr; align-items: start; }
@media (max-width: 720px) { .overview { grid-template-columns: 1fr; } }
.stat { margin-bottom: 16px; }
.stat .k { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.stat .v { font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 2px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart { width: 100%; height: 130px; display: block; }

/* ── steps (build progress) ──────────────────────────────────────────── */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.steps li:first-child { border-top: 0; }
.steps .dot {
  flex: 0 0 18px; height: 18px; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--border); background: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--btn-fg);
}
.steps .s-done .dot { background: var(--ok); border-color: var(--ok); }
.steps .s-running .dot { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps .s-failed .dot { background: var(--err); border-color: var(--err); }
.steps .s-skipped .dot { background: var(--surface-2); border-color: var(--border); }
@keyframes spin { to { transform: rotate(360deg); } }
.steps .lbl { font-weight: 600; font-size: 13.5px; }
.steps .det { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.steps .s-pending .lbl { color: var(--muted); font-weight: 500; }

/* ── notices ─────────────────────────────────────────────────────────── */
.notice { padding: 11px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.notice-err { background: var(--err-dim); border-color: rgba(239,107,107,.3); color: var(--err); }
.notice-warn { background: var(--warn-dim); border-color: rgba(224,166,60,.3); color: var(--warn); }
.notice-info { background: var(--accent-dim); border-color: rgba(63,200,200,.3); color: var(--accent-2); }

/* ── tables ──────────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: var(--surface-2); color: var(--code-fg);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-soft);
}
/* .dnsbox is the same key/value list; both names are used across views. */
.kv, .dnsbox { display: grid; gap: 8px; margin-top: 10px; }
.kv div, .dnsbox div { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.kv span, .dnsbox span { color: var(--muted); min-width: 66px; font-size: 12px; }

/* ── marketing / landing ─────────────────────────────────────────────── */
.hero {
  background: radial-gradient(1100px 380px at 20% -10%, rgba(63,200,200,.16), transparent 70%), var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  padding: 64px 0 54px;
}
.hero .wrap { padding-top: 0; padding-bottom: 0; }
.hero h1 { font-size: 36px; line-height: 1.15; margin-bottom: 14px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 0 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid .card h3 { margin-bottom: 8px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 16px; }
.stack-form { display: inline; }
footer { border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; padding: 18px 0; margin-top: 20px; }

/* ── theme toggle ────────────────────────────────────────────────────── */
.themebtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 9px;
}
.themebtn:hover { color: var(--text); border-color: var(--accent); }
.themebtn svg { width: 17px; height: 17px; }
/* Show the icon for the mode the click will switch TO. */
.themebtn .i-moon { display: block; }
.themebtn .i-sun  { display: none; }
.themebtn.is-dark .i-moon { display: none; }
.themebtn.is-dark .i-sun  { display: block; }

/* ── site management page ────────────────────────────────────────────── */
.managehead {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.managehead-title { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.managehead h1 { font-size: 21px; margin: 0; letter-spacing: -.02em; word-break: break-all; }
.managehead-ip { font-size: 12.5px; color: var(--muted); }
.managehead .row { margin-left: auto; }

.managegrid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
@media (max-width: 900px) { .managegrid { grid-template-columns: 1fr; } }

/* resource monitors */
.monitors { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .monitors { grid-template-columns: 1fr; } }
.mon-k { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.mon-v { font-size: 22px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.mon-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.spark { width: 100%; height: 36px; margin-top: 8px; display: block; color: var(--accent); }
.mon:nth-child(2) .spark { color: #7c9cf5; }
.mon:nth-child(3) .spark { color: var(--ok); }

/* configuration column */
.cfggrid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .cfggrid { grid-template-columns: 1fr; } }
.cfgbox {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 11px; font-size: 13.5px; word-break: break-all;
}

/* toggle switch */
.switch {
  width: 42px; height: 23px; border-radius: 999px; padding: 0; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--muted); transition: transform .15s ease, background .15s ease;
}
.switch.is-on { background: var(--warn-dim); border-color: var(--warn); }
.switch.is-on .knob { transform: translateX(19px); background: var(--warn); }

/* terminal */
.termgrid { display: grid; gap: 16px; grid-template-columns: 1fr 250px; }
@media (max-width: 800px) { .termgrid { grid-template-columns: 1fr; } }
.terminal {
  background: #0b1219; border: 1px solid #1d2d3c; border-radius: 10px; overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #111c27; border-bottom: 1px solid #1d2d3c;
  font-size: 11.5px; color: #8ea6b8; font-weight: 600;
}
.terminal pre {
  margin: 0; padding: 12px; height: 260px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.55; color: #9fe8c8; white-space: pre-wrap; word-break: break-word;
}
.logtab.is-on { border-color: var(--accent); color: var(--accent); }

/* danger zone */
.danger {
  border: 1px solid var(--err); border-radius: 10px; padding: 12px;
  background: var(--err-dim);
}
.danger-title { font-size: 11.5px; font-weight: 700; color: var(--err); letter-spacing: .03em; }
.danger details > summary { list-style: none; margin-top: 8px; }
.danger details > summary::-webkit-details-marker { display: none; }
.danger input[type=text] { margin-top: 8px; font-size: 12.5px; }
details > summary { cursor: pointer; }
/* Keep "537 MB / 1.50 GB" on one line — it wrapped mid-value at narrow widths. */
.mon-v { white-space: nowrap; }
.mon-sub { white-space: nowrap; }

/* ── framed app shell ────────────────────────────────────────────────────
   The whole panel sits in one rounded card on a soft page, with the
   navigation inside it rather than as a separate top bar. */
.appframe {
  /* Wide displays were leaving huge margins at 1180px. Track the viewport but
     stop short of edge-to-edge, which makes long table rows hard to scan. */
  max-width: min(1680px, 94vw);
  margin: 18px auto 22px; padding: 0;
}
.appcard {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  display: flex;
  /* Fill the screen instead of floating as a short island with dead space
     underneath it on a tall monitor. */
  min-height: calc(100vh - 76px);
}
.appnav {
  width: 208px; flex: 0 0 208px; border-right: 1px solid var(--border-soft);
  padding: 18px 14px; display: flex; flex-direction: column; background: var(--surface);
}
.appmain { flex: 1; min-width: 0; padding: 24px 30px 30px; background: var(--surface); }
@media (max-width: 820px) {
  .appcard { flex-direction: column; }
  .appnav { width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--border-soft); }
}

.applogo { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15.5px;
  color: var(--text); padding: 4px 8px 18px; }
.applogo svg { width: 21px; height: 21px; color: var(--accent); }
.applogo .tag { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim); padding: 2px 6px; border-radius: 5px; }

.appnav nav { display: flex; flex-direction: column; gap: 2px; }
.appnav nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.appnav nav a svg { width: 16px; height: 16px; flex: 0 0 16px; }
.appnav nav a:hover { background: var(--surface-2); color: var(--text); }
.appnav nav a.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.appnav nav a .count {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border-radius: 5px; padding: 1px 6px;
}
/* Themed token, not a hardcoded white: 55%-white behind accent-green is fine on
   the light theme but in dark mode it renders as a near-solid pale block with
   the digit lost inside it, on every visit to Overview and Sites. */
.appnav nav a.active .count { color: var(--accent); background: var(--bg-2); }
.appnav .navfoot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.appnav .who { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: 13px; }

/* page header inside the frame */
.pagehead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { font-size: 21px; margin: 0; letter-spacing: -.02em; }
.pagehead .spacer { margin-left: auto; }

/* ── stat cards row ─────────────────────────────────────────────────────── */
.statrow {
  display: grid; gap: 16px; margin-bottom: 24px;
  /* auto-fit, not a fixed count: the dashboard shows four or five tiles and the
     billing pages three. A hardcoded `repeat(4, 1fr)` silently reflowed
     whichever page it was not written for. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
@media (max-width: 900px) { .statrow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .statrow { grid-template-columns: 1fr; } }
.statcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; min-height: 92px; display: flex; flex-direction: column;
}
.statcard .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.statcard .v { font-size: 25px; font-weight: 680; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.statcard .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.statcard .spark { height: 34px; margin-top: auto; color: var(--accent); }

/* ── deployments row ────────────────────────────────────────────────────── */
.deployrow { display: grid; gap: 18px; grid-template-columns: minmax(280px, 340px) 1fr; align-items: stretch; }
@media (max-width: 900px) { .deployrow { grid-template-columns: 1fr; } }
.sitecard { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.sitecard h3 { font-size: 16px; word-break: break-all; }
.sitecard .meta { font-size: 13px; color: var(--muted); margin-top: 10px; display: grid; gap: 3px; }
.sitecard .meta b { color: var(--text); font-weight: 620; }

/* telemetry chart */
.telecard { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface);
  display: flex; flex-direction: column; }
.telecard .telewrap { flex: 1; }
.telewrap { position: relative; }
.tele { width: 100%; height: 260px; display: block; }
.tele .grid { stroke: var(--border-soft); stroke-width: 1; }
.tele .axis { fill: var(--muted); font-size: 10px; }
.tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s ease;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; min-width: 132px;
}
.tip .row { justify-content: space-between; gap: 12px; }
.tip .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.tip b { font-weight: 650; }
.framefoot { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 0; }

/* ── billing & support ───────────────────────────────────────────────────
   `input[type=number]` and `textarea` had no styling because nothing used
   them until the plan editor and the ticket composer; without this they fall
   back to the browser default and look pasted in from another site. */
input[type=number], textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
textarea:focus, input[type=number]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

/* An archived plan stays listed — invoices still point at it — but reads as
   inactive rather than as something you can still sell. */
.is-archived { opacity: .5; }

/* Ticket thread. Staff replies are tinted so a customer can tell at a glance
   which messages are ours, and internal notes are unmistakably different from
   anything the customer will ever see. */
.msg { padding: 14px 0; border-top: 1px solid var(--border-soft); }
.msg:first-child { border-top: 0; padding-top: 4px; }
.msg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 13px; }
.msg-staff { background: var(--accent-dim); border-radius: 10px; padding: 14px 14px; margin: 8px 0; border-top: 0; }
.msg-internal { background: var(--warn-dim); border-radius: 10px; padding: 14px; margin: 8px 0; border-top: 0; }
/* pre-wrap, not <br> substitution: the body is escaped by EJS and must stay
   escaped, so the line breaks have to come from CSS. */
.msgbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.62; }

/* ── billing: balance, funds, invoices, add-ons ──────────────────────────── */

/* Sub-navigation under a top-level sidebar entry. Indented to sit under the
   parent's label rather than its icon, so the hierarchy reads at a glance. */
.subnav { display: grid; gap: 1px; margin: 2px 0 6px 34px; }
.subnav a {
  display: block; padding: 6px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
}
.subnav a:hover { background: var(--surface-2); color: var(--text); }
.subnav a.active { color: var(--accent); font-weight: 600; }

.balancecard {
  border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--surface); padding: 18px 20px; margin-bottom: 16px;
}
.balancecard-v { font-size: 34px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }

.fundsgrid { display: grid; gap: 14px; grid-template-columns: 1.4fr 1fr; align-items: start; }
.paygrid   { display: grid; gap: 14px; grid-template-columns: 1.5fr 1fr; align-items: start; }
@media (max-width: 860px) {
  .fundsgrid, .paygrid { grid-template-columns: 1fr; }
}

/* Preset deposit amounts. These only fill the amount field — the field stays
   the single source of the number, so there is never a preset and a typed
   value disagreeing about what is being charged. */
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 16px; border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Capped rather than 1fr: in manual mode there is only ONE method, and an
   auto-fit column would stretch that single tile across the whole card. */
.methodrow { display: flex; gap: 8px; flex-wrap: wrap; }
.methodrow .method { flex: 1 1 140px; max-width: 220px; }
.method {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 14px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2);
}
.method.is-on { border-color: var(--accent); background: var(--accent-dim); }
.method-i { font-size: 20px; }
.method-n { font-size: 13px; font-weight: 600; }
.method-d { font-size: 11.5px; color: var(--muted); }

.sumtotal {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border);
  font-size: 17px; font-weight: 660;
}

/* Radio-style method picker on the pay screen. The whole row is the label so
   the hit target matches what it looks like. */
.paymethod {
  display: flex; align-items: center; gap: 11px; margin-bottom: 8px;
  padding: 12px 13px; border-radius: 10px; font-weight: 400;
  border: 1px solid var(--border); background: var(--bg-2); cursor: pointer;
}
.paymethod:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.paymethod.is-off { opacity: .55; cursor: not-allowed; }
.paymethod input { accent-color: var(--accent); margin: 0; }
.paymethod-i { font-size: 18px; }
.paymethod-n { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.paymethod-d { display: block; font-size: 12px; color: var(--muted); }

.amt-in  { color: var(--ok); }
.amt-out { color: var(--muted); }

/* Add-ons marketplace */
.addongrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.addon {
  display: flex; flex-direction: column;
  border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--surface); padding: 15px 16px;
}
/* Not merely faded — an add-on the panel cannot deliver must not read as a
   thing you could buy if you looked harder. */
.addon.is-soon { opacity: .6; }
.addon-head { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 6px; }
.addon-i { font-size: 17px; }
.addon-d { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; flex: 1; }
.addon-foot { display: flex; align-items: center; gap: 8px; }
.addon-p {
  font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
}
.addon-list { margin-top: 10px; border-top: 1px solid var(--border-soft); }
.addon-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 12.5px; border-bottom: 1px solid var(--border-soft);
}
.addon-row:last-child { border-bottom: 0; }

.factlist { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.65; }
.factlist li { margin-bottom: 8px; color: var(--muted); }
.factlist b { color: var(--text); }

/* An invoice is a document people print. Strip the app chrome so a saved PDF is
   the invoice rather than a screenshot of the panel. */
@media print {
  .appnav, .noprint, .framefoot { display: none !important; }
  .appframe, .appcard, .appmain { margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; }
  .card { border-color: #ddd; break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* ── traffic chart ───────────────────────────────────────────────────────
   Hand-rolled SVG rather than a charting library: this project ships zero
   native dependencies so a deploy stays a plain rsync, and one bar chart does
   not justify breaking that. */
.tchartwrap { width: 100%; overflow: hidden; }
/* Long stat subtitles were spilling past the card edge on narrow viewports. */
.statcard .mon-sub, .statcard .mon-k { overflow-wrap: anywhere; }
.tchart { width: 100%; height: 200px; display: block; }
.tbar { fill: var(--accent); opacity: .75; transition: opacity .1s ease; }
.tbar:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   MARKETING HOME PAGE  (.mk)
   Everything below is scoped to body.mk, which only the signed-out landing
   page carries. The signed-in product keeps its emerald palette untouched —
   a marketing refresh should not repaint the panel behind the login.
   ═══════════════════════════════════════════════════════════════════════ */

body.mk {
  --mk-blue: #2f6bf0;
  --mk-blue-2: #1d51d4;
  --mk-purple: #7b3fe4;
  --mk-sky: #38a9f0;
  --mk-green: #22b07d;

  --mk-ink: #101a2c;
  --mk-body: #5b6880;
  --mk-line: #e3e8f2;
  --mk-panel: #ffffff;
  --mk-page: #ffffff;
  --mk-alt: #f5f7fc;
  --mk-hero-a: #eaf0fe;
  --mk-hero-b: #f6f4ff;
  --mk-shadow: 0 1px 2px rgba(16, 26, 44, .05), 0 12px 34px rgba(16, 26, 44, .08);
  --mk-shadow-lg: 0 20px 54px rgba(47, 107, 240, .22);

  --mk-art-screen-a: #f7f9ff;
  --mk-art-screen-b: #eef3ff;
  --mk-art-lid-a: #ffffff;
  --mk-art-lid-b: #eef2fb;
  --mk-art-line: #d3dbec;
  --mk-art-side: #eaf0fd;
  --mk-art-onside: #7d93c4;
  --mk-art-ink: #2b3a55;
  --mk-art-panel: #f4f7ff;
  --mk-art-book: #f0b23c;

  background: var(--mk-page);
  color: var(--mk-body);
}

:root[data-theme="dark"] body.mk {
  --mk-ink: #eaf0fb;
  --mk-body: #9fb0c9;
  --mk-line: #22314a;
  --mk-panel: #121c2e;
  --mk-page: #0a1120;
  --mk-alt: #0e1729;
  --mk-hero-a: #101c36;
  --mk-hero-b: #16143063;
  --mk-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .34);
  --mk-shadow-lg: 0 20px 54px rgba(47, 107, 240, .3);

  --mk-art-screen-a: #16233c;
  --mk-art-screen-b: #101a2e;
  --mk-art-lid-a: #1b2942;
  --mk-art-lid-b: #131f34;
  --mk-art-line: #2c3d5c;
  --mk-art-side: #1a2740;
  --mk-art-onside: #7d93c4;
  --mk-art-ink: #cfdcf3;
  --mk-art-panel: #16223a;
}

body.mk a { color: var(--mk-blue); }
body.mk a:hover { color: var(--mk-blue-2); }

.mk-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mk-narrow { max-width: 780px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.mk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid transparent; border-radius: 9px;
  padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.mk-btn:hover { transform: translateY(-1px); }
.mk-btn-sm { padding: 7px 15px; font-size: 13.5px; border-radius: 8px; }
.mk-btn-lg { padding: 14px 26px; font-size: 15.5px; }
.mk-btn-block { width: 100%; }

/* Every button colour is scoped under body.mk deliberately. `body.mk a` above
   has specificity (0,1,2) and would otherwise BEAT a bare `.mk-btn-primary`
   (0,1,0) — which painted the label blue on a blue fill and made the text
   invisible. Keep the `body.mk ` prefix on anything setting button colour. */
body.mk .mk-btn-primary { background: var(--mk-blue); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 240, .26); }
body.mk .mk-btn-primary:hover { background: var(--mk-blue-2); color: #fff; }

body.mk .mk-btn-outline { background: transparent; color: var(--mk-blue); border-color: #c3d3f7; }
body.mk .mk-btn-outline:hover { background: rgba(47, 107, 240, .07); color: var(--mk-blue-2); }
:root[data-theme="dark"] body.mk .mk-btn-outline { border-color: #2f4468; }

/* On the gradient pricing card and the closing band, where the surface is
   already saturated: white pill, coloured text. */
body.mk .mk-btn-onfeat { background: #fff; color: var(--mk-blue-2); }
body.mk .mk-btn-onfeat:hover { background: #f2f6ff; color: var(--mk-blue-2); }
body.mk .mk-btn-ghostwhite { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); }
body.mk .mk-btn-ghostwhite:hover { background: rgba(255, 255, 255, .24); color: #fff; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.mk-topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--mk-page) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--mk-line);
}
.mk-topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 66px; display: flex; align-items: center; gap: 22px;
}
.mk-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--mk-ink); }
.mk-brand:hover { color: var(--mk-ink); }
.mk-brandmark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--mk-purple), var(--mk-blue));
}
.mk-brandmark svg { width: 21px; height: 21px; }
.mk-brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.mk-brandtext strong { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.mk-brandtext strong span { color: var(--mk-blue); }
.mk-brandtext small { font-size: 10.5px; color: var(--mk-body); letter-spacing: .1px; }

.mk-nav { display: flex; align-items: center; gap: 26px; margin-left: 18px; }
.mk-nav a { color: var(--mk-body); font-size: 14px; font-weight: 500; }
.mk-nav a:hover { color: var(--mk-ink); }
.mk-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── hero ────────────────────────────────────────────────────────────── */
.mk-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--mk-hero-a) 0%, var(--mk-hero-b) 100%);
  border-bottom: 1px solid var(--mk-line);
}
/* The diagonal colour wedge from the mock. Sits behind the art, clipped by the
   section, and is decorative only. */
.mk-hero-shape {
  position: absolute; top: -22%; right: -14%; width: 62%; height: 150%;
  background: linear-gradient(150deg, var(--mk-sky) 0%, var(--mk-blue) 42%, var(--mk-purple) 100%);
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .92; pointer-events: none;
}
.mk-hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 40px; align-items: center;
  padding-top: 74px; padding-bottom: 78px;
}
.mk-hero-copy h1 {
  margin: 0 0 18px; color: var(--mk-ink);
  font-size: clamp(29px, 3.5vw, 43px); line-height: 1.16;
  font-weight: 800; letter-spacing: -.9px;
}
.mk-lede { margin: 0 0 26px; font-size: 16px; line-height: 1.62; max-width: 30em; }
.mk-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.mk-cta-row.mk-center { justify-content: center; }
.mk-hero-foot { margin: 18px 0 0; font-size: 13px; color: var(--mk-body); opacity: .9; }
.mk-hero-art { display: flex; justify-content: center; }
.mk-art { width: 100%; max-width: 520px; height: auto; }

/* ── sections ────────────────────────────────────────────────────────── */
.mk-section { padding: 76px 0; background: var(--mk-page); }
.mk-section-alt { background: var(--mk-alt); border-block: 1px solid var(--mk-line); }
.mk-h2 {
  margin: 0 0 10px; text-align: center; color: var(--mk-ink);
  font-size: clamp(23px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.5px;
}
.mk-sub { margin: 0 auto 44px; text-align: center; max-width: 46em; font-size: 15px; }
.mk-empty { text-align: center; color: var(--mk-body); }

/* ── feature cards ───────────────────────────────────────────────────── */
.mk-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mk-feature {
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 15px; padding: 28px 24px; text-align: center; box-shadow: var(--mk-shadow);
}
.mk-ficon {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 16px;
  display: grid; place-items: center;
}
.mk-ficon svg { width: 26px; height: 26px; }
.mk-ficon-blue   { background: rgba(47, 107, 240, .12); color: var(--mk-blue); }
.mk-ficon-purple { background: rgba(123, 63, 228, .12); color: var(--mk-purple); }
.mk-ficon-sky    { background: rgba(56, 169, 240, .14); color: var(--mk-sky); }
.mk-feature h3 { margin: 0 0 12px; color: var(--mk-ink); font-size: 17px; font-weight: 700; }
.mk-flist { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.9; }

/* ── pricing ─────────────────────────────────────────────────────────── */
.mk-price-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px; align-items: center; max-width: 940px; margin: 0 auto;
}
.mk-price {
  position: relative; background: var(--mk-panel);
  border: 1px solid var(--mk-line); border-radius: 16px;
  padding: 30px 26px; text-align: center; box-shadow: var(--mk-shadow);
}
/* The highlighted plan is lifted and gradient-filled, exactly like the mock. */
.mk-price.is-featured {
  background: linear-gradient(155deg, var(--mk-sky) -12%, var(--mk-blue) 45%, var(--mk-purple) 108%);
  border-color: transparent; color: #eaf1ff;
  box-shadow: var(--mk-shadow-lg); transform: scale(1.055); z-index: 1;
}
.mk-price h3 { margin: 0 0 12px; color: var(--mk-ink); font-size: 18px; font-weight: 700; }
.mk-price.is-featured h3 { color: #fff; }
.mk-badge {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255, 255, 255, .22); color: #fff;
  border-radius: 999px; padding: 3px 11px; font-size: 11px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase;
}
.mk-amount { display: flex; align-items: baseline; justify-content: center; gap: 1px; margin-bottom: 8px; }
.mk-cur { color: var(--mk-ink); font-size: 20px; font-weight: 700; align-self: flex-start; margin-top: 6px; }
.mk-num { color: var(--mk-ink); font-size: 42px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.mk-per { color: var(--mk-body); font-size: 14px; font-weight: 600; }
.mk-price.is-featured .mk-cur,
.mk-price.is-featured .mk-num { color: #fff; }
.mk-price.is-featured .mk-per { color: rgba(255, 255, 255, .85); }
.mk-price-tag { margin: 0 0 18px; font-size: 13.5px; min-height: 2.8em; }
.mk-price.is-featured .mk-price-tag { color: rgba(255, 255, 255, .9); }
.mk-price-list {
  list-style: none; margin: 0 0 22px; padding: 18px 0 0;
  border-top: 1px solid var(--mk-line); font-size: 14px; line-height: 2;
}
.mk-price-list strong { color: var(--mk-ink); font-weight: 700; }
.mk-price.is-featured .mk-price-list { border-top-color: rgba(255, 255, 255, .28); }
.mk-price.is-featured .mk-price-list strong { color: #fff; }

/* ── add-ons ─────────────────────────────────────────────────────────── */
.mk-addon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.mk-addon {
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 13px; padding: 18px 20px;
}
.mk-addon-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mk-addon h4 { margin: 0 0 6px; color: var(--mk-ink); font-size: 15px; font-weight: 700; }
.mk-addon-price { color: var(--mk-blue); font-size: 13px; font-weight: 700; white-space: nowrap; }
.mk-addon p { margin: 0; font-size: 13.5px; line-height: 1.6; }

/* ── stack chips ─────────────────────────────────────────────────────── */
.mk-stack-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.mk-chip {
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 12px; padding: 14px 20px; min-width: 160px; text-align: center;
}
.mk-chip strong { display: block; color: var(--mk-ink); font-size: 15px; font-weight: 700; }
.mk-chip span { font-size: 12.5px; }

/* ── faq ─────────────────────────────────────────────────────────────── */
.mk-faq { display: grid; gap: 12px; }
.mk-faq details {
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 12px; padding: 16px 20px;
}
.mk-faq summary {
  cursor: pointer; color: var(--mk-ink); font-size: 15px; font-weight: 650;
  list-style: none;
}
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: '+'; float: right; color: var(--mk-blue); font-weight: 700; }
.mk-faq details[open] summary::after { content: '\2212'; }
.mk-faq p { margin: 12px 0 0; font-size: 14px; line-height: 1.7; }
.mk-faq code {
  background: rgba(47, 107, 240, .1); color: var(--mk-blue);
  border-radius: 5px; padding: 1px 6px; font-size: 13px;
}

/* ── closing band ────────────────────────────────────────────────────── */
.mk-final {
  padding: 68px 0; text-align: center; color: #fff;
  background: linear-gradient(120deg, var(--mk-sky) -10%, var(--mk-blue) 45%, var(--mk-purple) 110%);
}
.mk-final h2 { margin: 0 0 10px; font-size: clamp(23px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.5px; }
.mk-final p { margin: 0 0 24px; color: rgba(255, 255, 255, .9); font-size: 15.5px; }

/* ── footer ──────────────────────────────────────────────────────────── */
/* color/font-size/margin-top are restated because the bare `footer` element
   rule further up still applies to them — it sets the emerald --muted and a
   12px size, which leaked into this footer and made it a different grey from
   the rest of the marketing page. */
.mk-footer {
  background: var(--mk-alt); border-top: 1px solid var(--mk-line);
  padding: 52px 0 26px; margin-top: 0;
  color: var(--mk-body); font-size: 14px;
}
.mk-footer-grid {
  display: grid; grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 34px; padding-bottom: 34px;
}
.mk-footer-blurb { margin: 14px 0 0; font-size: 13.5px; line-height: 1.65; max-width: 30em; }
.mk-footer-col h4 {
  margin: 0 0 14px; color: var(--mk-ink); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
}
.mk-footer-col a { display: block; margin-bottom: 9px; color: var(--mk-body); font-size: 13.5px; }
.mk-footer-col a:hover { color: var(--mk-blue); }
.mk-footer-base {
  border-top: 1px solid var(--mk-line); padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
  font-size: 12.5px;
}
.mk-footer-note { opacity: .85; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .mk-hero-inner { grid-template-columns: 1fr; padding-top: 52px; padding-bottom: 56px; }
  .mk-hero-art { order: -1; max-width: 420px; margin: 0 auto; }
  .mk-hero-shape { display: none; }
  .mk-feature-grid { grid-template-columns: 1fr; }
  .mk-footer-grid { grid-template-columns: 1fr 1fr; }
  /* The lifted middle card overlaps its neighbours once they stack. */
  .mk-price.is-featured { transform: none; }
}
@media (max-width: 720px) {
  .mk-nav { display: none; }
  .mk-brandtext small { display: none; }
  .mk-section { padding: 52px 0; }
  .mk-footer-grid { grid-template-columns: 1fr; }
  .mk-br { display: none; }
}

/* ── locations ───────────────────────────────────────────────────────── */
.mk-geo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.mk-geo {
  display: flex; align-items: center; gap: 15px;
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 14px; padding: 20px 22px; box-shadow: var(--mk-shadow);
}
/* A region we can't actually place a site in is visibly quieter than one we
   can — the difference has to read at a glance, not only in the label. */
.mk-geo.is-soon { box-shadow: none; background: transparent; border-style: dashed; }
.mk-geo-flag { font-size: 34px; line-height: 1; flex: none; }
.mk-geo.is-soon .mk-geo-flag { filter: grayscale(1); opacity: .55; }
.mk-geo-body { min-width: 0; }
.mk-geo h3 { margin: 0 0 5px; color: var(--mk-ink); font-size: 16px; font-weight: 700; }
.mk-geo-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.mk-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.mk-geo.is-live .mk-geo-status { color: var(--mk-green); }
.mk-geo.is-live .mk-dot { background: var(--mk-green); box-shadow: 0 0 0 3px rgba(34, 176, 125, .18); }
.mk-geo.is-soon .mk-geo-status { color: var(--mk-body); opacity: .8; }
.mk-geo.is-soon .mk-dot { background: var(--mk-body); opacity: .5; }
.mk-geo-note {
  margin: 26px auto 0; max-width: 52em; text-align: center;
  font-size: 13px; line-height: 1.65; opacity: .85;
}

/* ── billing-period toggle (CSS only, no JS) ─────────────────────────── */
/* The radios are visually hidden but must stay focusable and in the layout
   flow as siblings — display:none would take them out of the sibling chain in
   some engines and kill the toggle. */
.mk-toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mk-toggle {
  display: inline-flex; gap: 4px; margin: 0 auto 30px; padding: 4px;
  background: var(--mk-alt); border: 1px solid var(--mk-line); border-radius: 999px;
}
.mk-section-alt .mk-toggle { background: var(--mk-page); }
.mk-toggle-wrap { display: flex; justify-content: center; }
.mk-toggle-btn {
  cursor: pointer; border-radius: 999px; padding: 8px 20px;
  font-size: 14px; font-weight: 600; color: var(--mk-body);
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s ease;
}
.mk-toggle-btn:hover { color: var(--mk-ink); }
/* Keyboard users must be able to see which option has focus. */
.mk-toggle-input:focus-visible ~ .mk-toggle-wrap label { outline: 2px solid var(--mk-blue); outline-offset: 2px; }
.mk-save {
  background: rgba(34, 176, 125, .16); color: var(--mk-green);
  border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700;
}
/* Panes are hidden by default; the checked radio reveals its own. The rules
   that do the revealing are generated per group in the template. */
.mk-period-pane { display: none; }
.mk-price-save { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--mk-green); }
.mk-price.is-featured .mk-price-save { color: #d6ffe9; }
/* Keeps every card's tagline and feature list on the same baseline whether or
   not that card has a saving to show. */
.mk-price-save-blank { visibility: hidden; }
.mk-price-foot {
  margin: 30px auto 0; max-width: 46em; text-align: center;
  font-size: 14px; line-height: 1.7;
}
.mk-price-foot strong { color: var(--mk-ink); }

/* ── page header (non-home marketing pages) ─────────────────────────── */
.mk-pagehead {
  background: linear-gradient(120deg, var(--mk-hero-a) 0%, var(--mk-hero-b) 100%);
  border-bottom: 1px solid var(--mk-line);
  padding: 46px 0 40px; text-align: center;
}
.mk-pagehead h1 {
  margin: 0 0 12px; color: var(--mk-ink);
  font-size: clamp(27px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.7px;
}
.mk-pagehead-sub { margin: 0 auto; max-width: 44em; font-size: 15.5px; line-height: 1.6; }
.mk-crumbs { margin-bottom: 16px; font-size: 13px; }
.mk-crumbs ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
}
.mk-crumbs li { display: flex; align-items: center; gap: 8px; }
.mk-crumbs span[aria-current] { color: var(--mk-body); }
.mk-crumbs span[aria-hidden] { color: var(--mk-line); }

/* ── numbered steps ─────────────────────────────────────────────────── */
.mk-steps {
  list-style: none; counter-reset: step; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px;
}
.mk-steps li {
  counter-increment: step; position: relative;
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 14px; padding: 24px 22px 22px 22px; box-shadow: var(--mk-shadow);
}
.mk-steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 32px; height: 32px; margin-bottom: 12px; border-radius: 9px;
  background: linear-gradient(135deg, var(--mk-purple), var(--mk-blue));
  color: #fff; font-size: 14px; font-weight: 700;
}
.mk-steps h3 { margin: 0 0 8px; color: var(--mk-ink); font-size: 16.5px; font-weight: 700; }
.mk-steps p { margin: 0; font-size: 14px; line-height: 1.65; }
.mk-steps code {
  background: rgba(47, 107, 240, .1); color: var(--mk-blue);
  border-radius: 5px; padding: 1px 6px; font-size: 13px;
}
/* Active nav item on a multi-page site — you should always know where you are. */
.mk-nav a.active { color: var(--mk-ink); font-weight: 650; }

/* ── legal documents ─────────────────────────────────────────────────── */
/* Narrower than the marketing grid: long prose at full container width is
   unreadable, and these are documents people genuinely have to read. */
.mk-legal { max-width: 46rem; }
.mk-legal h2 {
  margin: 38px 0 12px; color: var(--mk-ink);
  font-size: 19px; font-weight: 700; letter-spacing: -.2px;
}
.mk-legal h2:first-of-type { margin-top: 8px; }
.mk-legal p { margin: 0 0 14px; font-size: 15px; line-height: 1.72; }
.mk-legal ul { margin: 0 0 16px; padding-left: 22px; }
.mk-legal li { margin-bottom: 9px; font-size: 15px; line-height: 1.7; }
.mk-legal strong { color: var(--mk-ink); }
.mk-legal code {
  background: rgba(47, 107, 240, .1); color: var(--mk-blue);
  border-radius: 5px; padding: 1px 6px; font-size: 13.5px;
}
.mk-legal-lead {
  padding: 16px 18px; margin-bottom: 26px;
  background: var(--mk-alt); border-left: 3px solid var(--mk-blue); border-radius: 0 10px 10px 0;
}
.mk-legal-meta { font-size: 13px; color: var(--mk-body); margin-bottom: 26px; }
.mk-legal-table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px;
}
.mk-legal-table th, .mk-legal-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--mk-line);
  vertical-align: top;
}
.mk-legal-table th { color: var(--mk-ink); font-weight: 700; font-size: 13px; }
/* Tables must not force the page to scroll sideways on a phone. */
@media (max-width: 560px) {
  .mk-legal-table, .mk-legal-table tbody, .mk-legal-table tr, .mk-legal-table td { display: block; width: 100%; }
  .mk-legal-table thead { display: none; }
  .mk-legal-table tr { border-bottom: 1px solid var(--mk-line); padding: 8px 0; }
  .mk-legal-table td { border: 0; padding: 4px 0; }
  .mk-legal-table td:first-child { color: var(--mk-ink); font-weight: 650; }
}

/* ── answer block, fact list, prose ──────────────────────────────────── */
.mk-h2-left { text-align: left; }
.mk-answer {
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-left: 3px solid var(--mk-blue); border-radius: 0 12px 12px 0;
  padding: 20px 22px; margin-bottom: 24px; box-shadow: var(--mk-shadow);
}
.mk-answer p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.72; }
.mk-answer p:last-child { margin-bottom: 0; }
.mk-answer strong { color: var(--mk-ink); }

/* Definition list of hard numbers. Scannable for a reader, and unambiguous
   for anything parsing the page. */
.mk-facts {
  /* 210px min gives 3 columns in the narrow container, so six facts land as two
     full rows. At 170px it fitted four across and left two empty grey cells. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; margin: 0; padding: 0;
  background: var(--mk-line); border: 1px solid var(--mk-line); border-radius: 12px;
  overflow: hidden;
}
.mk-facts > div { background: var(--mk-panel); padding: 14px 16px; }
.mk-facts dt {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--mk-body); margin-bottom: 4px;
}
.mk-facts dd { margin: 0; color: var(--mk-ink); font-size: 15px; font-weight: 650; }

.mk-prose h2 { margin-top: 34px; }
.mk-prose h2:first-child { margin-top: 0; }
.mk-prose p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.75; }
.mk-prose ul { margin: 0 0 16px; padding-left: 22px; }
.mk-prose li { margin-bottom: 10px; font-size: 15.5px; line-height: 1.7; }
.mk-prose strong { color: var(--mk-ink); }

/* ── comparison table ────────────────────────────────────────────────── */
/* Wide tables scroll INSIDE their own container; the page body must never
   scroll sideways on a phone. */
.mk-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 13px; }
.mk-table {
  width: 100%; min-width: 560px; border-collapse: collapse;
  background: var(--mk-panel); border: 1px solid var(--mk-line); border-radius: 13px;
  font-size: 14.5px; overflow: hidden;
}
.mk-table th, .mk-table td {
  padding: 13px 16px; text-align: center; border-bottom: 1px solid var(--mk-line);
}
.mk-table thead th {
  background: var(--mk-alt); color: var(--mk-ink);
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.mk-section-alt .mk-table thead th { background: var(--mk-page); }
.mk-table tbody th[scope="row"] {
  text-align: left; color: var(--mk-ink); font-weight: 600; white-space: nowrap;
}
.mk-table tbody tr:last-child th, .mk-table tbody tr:last-child td { border-bottom: 0; }
.mk-table td { color: var(--mk-body); }
.mk-yes { color: var(--mk-green); font-weight: 700; font-size: 16px; }
.mk-no  { color: var(--mk-body); opacity: .5; }
.mk-table-note {
  margin: 18px auto 0; max-width: 48em; text-align: center;
  font-size: 13.5px; line-height: 1.65; opacity: .9;
}
/* Table captions carry real meaning for screen readers and parsers, so they
   are hidden visually rather than removed. */
.mk-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── blog index ──────────────────────────────────────────────────────── */
.mk-tagrail { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 30px; }
.mk-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--mk-alt); border: 1px solid var(--mk-line); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 600; color: var(--mk-body);
}
.mk-tag b { color: var(--mk-blue); font-weight: 700; }
.mk-tag-sm { padding: 3px 10px; font-size: 11.5px; }
.mk-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.mk-post-card {
  display: flex; flex-direction: column;
  background: var(--mk-panel); border: 1px solid var(--mk-line);
  border-radius: 15px; padding: 24px 24px 20px; box-shadow: var(--mk-shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.mk-post-card:hover { transform: translateY(-2px); box-shadow: var(--mk-shadow-lg); }
.mk-post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--mk-body); margin-bottom: 10px;
}
.mk-post-meta-lg { justify-content: center; font-size: 13.5px; margin-top: 14px; }
.mk-post-card h2 { margin: 0 0 10px; font-size: 19px; font-weight: 700; line-height: 1.35; }
.mk-post-card h2 a { color: var(--mk-ink); }
.mk-post-card h2 a:hover { color: var(--mk-blue); }
.mk-post-card > p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.65; }
.mk-post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
/* Pushes the link to the bottom so cards of different heights line up. */
.mk-readmore { margin-top: auto; font-size: 14px; font-weight: 650; }

/* ── article ─────────────────────────────────────────────────────────── */
.mk-pagehead-post { text-align: center; padding-bottom: 34px; }
.mk-article { font-size: 16.5px; line-height: 1.78; color: var(--mk-body); }
.mk-article h2 {
  margin: 40px 0 14px; color: var(--mk-ink);
  font-size: 24px; font-weight: 750; letter-spacing: -.4px; line-height: 1.3;
}
.mk-article h3 { margin: 28px 0 10px; color: var(--mk-ink); font-size: 18.5px; font-weight: 700; }
.mk-article p { margin: 0 0 18px; }
.mk-article strong { color: var(--mk-ink); font-weight: 650; }
.mk-article a { text-decoration: underline; text-underline-offset: 2px; }
.mk-article ul, .mk-article ol { margin: 0 0 18px; padding-left: 24px; }
.mk-article li { margin-bottom: 10px; }
.mk-article hr { border: 0; border-top: 1px solid var(--mk-line); margin: 34px 0; }
.mk-article blockquote {
  margin: 0 0 18px; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--mk-blue); color: var(--mk-body);
}
.mk-article code {
  background: var(--mk-alt); border: 1px solid var(--mk-line);
  border-radius: 5px; padding: 1px 6px; font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mk-article pre {
  background: var(--mk-alt); border: 1px solid var(--mk-line);
  border-radius: 11px; padding: 16px 18px; margin: 0 0 20px;
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
/* A <code> inside <pre> must not repeat the inline chrome. */
.mk-article pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.mk-article table {
  width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px;
  display: block; overflow-x: auto;
}
.mk-article th, .mk-article td { padding: 11px 14px; border-bottom: 1px solid var(--mk-line); text-align: left; }
.mk-article thead th { background: var(--mk-alt); color: var(--mk-ink); font-weight: 700; white-space: nowrap; }
.mk-post-tags-foot { margin: 30px 0 0; padding-top: 22px; border-top: 1px solid var(--mk-line); }

.mk-related { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--mk-line); }
.mk-related h2 { margin: 0 0 16px; color: var(--mk-ink); font-size: 18px; font-weight: 700; }
.mk-related a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--mk-panel); border: 1px solid var(--mk-line); border-radius: 11px;
}
.mk-related a:hover { border-color: var(--mk-blue); }
.mk-related strong { color: var(--mk-ink); font-size: 15px; font-weight: 650; }
.mk-related span { color: var(--mk-body); font-size: 12.5px; white-space: nowrap; }
