:root {
  color-scheme: light dark;
  --bg: #ffffff; --panel: #f5f6f7; --line: #e2e5e8; --text: #16191c; --muted: #646c75;
  --accent: #0f766e; --accent-text: #ffffff; --danger: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111417; --panel: #1b1f23; --line: #2c3238; --text: #e9ecef; --muted: #9aa3ad;
    --accent: #2dd4bf; --accent-text: #06201d; --danger: #f97066; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.brand { all: unset; font-weight: 650; cursor: pointer; white-space: nowrap; }
main { max-width: 820px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
h1 { font-size: 22px; margin: 4px 0 12px; overflow-wrap: anywhere; }
h2 { font-size: 16px; margin: 24px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }
button, .btn { font: inherit; min-height: 44px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  display: inline-flex; align-items: center; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.ghost { background: none; border-color: transparent; }
button.danger { color: var(--danger); }
input, select { font: inherit; min-height: 44px; padding: 0 12px; width: 100%; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 14px; margin: 10px 0 4px; color: var(--muted); }
form.card { max-width: 380px; margin: 40px auto; }
/* The language menu sits under the sign-in card, and on the Account page. */
.lang { max-width: 380px; margin: -24px auto 40px; }
.account .lang { margin: 0; }
.lang select { width: auto; min-width: 200px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row.fields > * { flex: 1 1 150px; width: auto; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0;
  border-bottom: 1px solid var(--line); }
.list .main { all: unset; flex: 1; min-width: 0; cursor: pointer; padding: 4px 0; }
.list .main:focus-visible { outline: 2px solid var(--accent); }
.list div.main { cursor: default; }
.list .title { display: block; overflow-wrap: anywhere; }
.list .sub { display: block; color: var(--muted); font-size: 13px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-bottom: 8px; }
.crumbs button { all: unset; cursor: pointer; color: var(--accent); padding: 8px 4px; overflow-wrap: anywhere; }
.crumbs span { color: var(--muted); }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  overflow-x: auto; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.secret { border: 1px solid var(--accent); border-radius: 8px; padding: 12px; margin: 12px 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.progress { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; margin: 8px 0; }
.progress div { height: 100%; background: var(--accent); width: 0; }
#toast { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; background: var(--text); color: var(--bg); padding: 12px 14px;
  border-radius: 8px; z-index: 5; }

/* Shared additions */
.ghost { background: none; border-color: transparent; }
a.brand { color: inherit; text-decoration: none; font-weight: 650; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Operator console */
:root { --warn: #b54708; }
@media (prefers-color-scheme: dark) { :root { --warn: #fdb022; } }
body.console main { max-width: 1120px; }
.console-tabs { display: flex; gap: 4px; padding: 0 16px; max-width: 1120px; margin: 0 auto;
  border-bottom: 1px solid var(--line); overflow-x: auto; }
.console-tabs a { padding: 12px 10px; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; }
.console-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 12px 0; }
.tile, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tile-label, .tile-sub { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
a.tile-link { display: block; color: inherit; text-decoration: none; }
a.tile-link:hover { border-color: var(--accent); }
.panel h2 { margin: 0; }
.panel p { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter div { height: 100%; background: var(--accent); border-radius: 4px; }
.meter.warn div { background: var(--warn); }
.meter.critical div { background: var(--danger); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.badge.warn { border-color: var(--warn); }
.badge.critical { border-color: var(--danger); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 16px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); white-space: nowrap; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td select { min-width: 110px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
tr.has-notes td { border-bottom: 0; }
tr.notes-row td { padding-top: 0; }
.notes-row summary { cursor: pointer; color: var(--accent); width: max-content; }
.release-notes { margin: 8px 0 4px; padding-left: 12px; border-left: 2px solid var(--line); }
.release-notes h3 { font-size: 14px; margin: 12px 0 4px; }
.release-notes h4 { font-size: 13px; margin: 10px 0 2px; color: var(--muted); }
.release-notes p, .release-notes ul { margin: 4px 0; }
.release-notes ul { padding-left: 20px; }
.toolbar input { flex: 1 1 220px; width: auto; }
.grow { flex: 1 1 200px; }
.align-end { align-self: flex-end; }
.row.end { justify-content: flex-end; margin-bottom: 0; }
.link { color: var(--accent); text-decoration: none; }
.actions { display: grid; gap: 8px; }
.actions button { justify-content: center; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
  width: min(440px, calc(100vw - 32px)); padding: 16px; }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog h2 { margin: 0 0 8px; overflow-wrap: anywhere; }

/* Account page */
.account form, .account > p { max-width: 440px; }
.account button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

/* Five nav items fit beside the name on most phones; the rest wrap. */
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 480px) { nav .ghost { padding: 0 6px; font-size: 15px; } }
.emails { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 16px;
  align-items: start; margin-top: 12px; }
.email-list { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.email-list button { justify-content: flex-start; text-align: left; background: none; border-color: transparent;
  border-left: 3px solid transparent; border-radius: 0 8px 8px 0; padding: 8px 12px; line-height: 1.3; }
.email-list button:hover { background: var(--panel); }
.email-list button[aria-selected="true"] { background: var(--panel); border-color: var(--line);
  border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 720px) {
  .emails { grid-template-columns: 1fr; }
  .email-list { position: static; }
}
.email-frame { display: block; width: 100%; height: 600px; border: 1px solid var(--line); border-radius: 8px;
  background: #f4f5f7; margin-bottom: 12px; }
.email details summary { cursor: pointer; color: var(--accent); }
.email pre { margin-bottom: 0; user-select: text; }

/* Plans and prices on the Subscription page */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0; }
.plan { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.plan h3 { margin: 0 0 4px; }
.plan p { margin: 0; }
.plan .price { font-size: 24px; font-weight: 600; }
.plan .price .muted { font-size: 15px; font-weight: 400; }
.plan .features { margin: 8px 0; padding-left: 18px; flex: 1; }
.plan .offer { margin: 4px 0 0; padding: 6px 8px; border-radius: 6px; background: var(--accent-soft, rgba(15, 118, 110, .08)); font-size: 14px; }
.plan button { margin-top: 8px; justify-content: center; }
