/* Customer portal design system.

   Mobile first: every rule is the small-screen case, widened at min-width.
   Colours, radii and shadows are tokens on :root, redefined for dark mode, so
   no component below names a raw colour for something that should follow the
   theme. Breakpoints: 640 (large phone), 768 (tablet), 1024 (sidebar appears),
   1280 (wide). */

/* ── fonts ───────────────────────────────────────────────────────────────── */
/* Self-hosted: a third-party font CDN would tell someone else about every
   visitor, and the CSP allows fonts from this origin only. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                 U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── tokens ──────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --sidebar-bg: #ffffff;
  --nav-active: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;

  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef2ff;
  --brand-soft-2: #e0e7ff;
  --brand-text: #3730a3;
  --link: #4338ca;
  --ring: rgba(79, 70, 229, .2);

  --success: #079455;  --success-soft: #ecfdf3; --success-border: #abefc6; --success-text: #067647;
  --warning: #dc6803;  --warning-soft: #fffaeb; --warning-border: #fedf89; --warning-text: #b54708;
  --danger:  #d92d20;  --danger-soft:  #fef3f2; --danger-border:  #fecdca; --danger-text:  #b42318;
  --info:    #0086c9;  --info-soft:    #f0f9ff; --info-border:    #b9e6fe; --info-text:    #026aa2;
  --neutral-soft: #f2f4f7; --neutral-border: #e4e7ec; --neutral-text: #475467;

  --overlay: rgba(16, 24, 40, .5);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
  --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, .1), 0 8px 8px -4px rgba(16, 24, 40, .04);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --sidebar-w: 264px;
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --content-max: 1180px;
}

/* Dark tokens, twice: once for "follow the system" and once for an explicit
   choice. A media query and an attribute cannot share one selector list. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0e12; --surface: #13161b; --surface-2: #171a20; --surface-3: #1e2229;
    --sidebar-bg: #101317; --nav-active: #1e2229;
    --border: #252a33; --border-strong: #333944;
    --text: #f0f2f5; --text-2: #cdd2da; --muted: #949eae; --faint: #6b7586;
    --brand: #6366f1; --brand-hover: #7c7ff3; --brand-soft: rgba(99, 102, 241, .14);
    --brand-soft-2: rgba(99, 102, 241, .22); --brand-text: #b3b5fb; --link: #a5a8fa;
    --ring: rgba(99, 102, 241, .35);
    --success: #2fbf71; --success-soft: rgba(47, 191, 113, .1); --success-border: rgba(47, 191, 113, .3); --success-text: #75e0a7;
    --warning: #f79009; --warning-soft: rgba(247, 144, 9, .1); --warning-border: rgba(247, 144, 9, .3); --warning-text: #fec84b;
    --danger: #f04438; --danger-soft: rgba(240, 68, 56, .1); --danger-border: rgba(240, 68, 56, .32); --danger-text: #fda29b;
    --info: #2e90fa; --info-soft: rgba(46, 144, 250, .1); --info-border: rgba(46, 144, 250, .3); --info-text: #84caff;
    --neutral-soft: #1e2229; --neutral-border: #2c313b; --neutral-text: #b3bac6;
    --overlay: rgba(0, 0, 0, .62);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
    --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, .55);
    --shadow-xl: 0 24px 40px -8px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e12; --surface: #13161b; --surface-2: #171a20; --surface-3: #1e2229;
  --sidebar-bg: #101317; --nav-active: #1e2229;
  --border: #252a33; --border-strong: #333944;
  --text: #f0f2f5; --text-2: #cdd2da; --muted: #949eae; --faint: #6b7586;
  --brand: #6366f1; --brand-hover: #7c7ff3; --brand-soft: rgba(99, 102, 241, .14);
  --brand-soft-2: rgba(99, 102, 241, .22); --brand-text: #b3b5fb; --link: #a5a8fa;
  --ring: rgba(99, 102, 241, .35);
  --success: #2fbf71; --success-soft: rgba(47, 191, 113, .1); --success-border: rgba(47, 191, 113, .3); --success-text: #75e0a7;
  --warning: #f79009; --warning-soft: rgba(247, 144, 9, .1); --warning-border: rgba(247, 144, 9, .3); --warning-text: #fec84b;
  --danger: #f04438; --danger-soft: rgba(240, 68, 56, .1); --danger-border: rgba(240, 68, 56, .32); --danger-text: #fda29b;
  --info: #2e90fa; --info-soft: rgba(46, 144, 250, .1); --info-border: rgba(46, 144, 250, .3); --info-text: #84caff;
  --neutral-soft: #1e2229; --neutral-border: #2c313b; --neutral-text: #b3bac6;
  --overlay: rgba(0, 0, 0, .62);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, .55);
  --shadow-xl: 0 24px 40px -8px rgba(0, 0, 0, .6);
}

/* ── reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.no-scroll, body:has(dialog[open]) { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; color: var(--text); }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-soft-2); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 14px; height: 14px; }
/* The reset makes svg a block; the smallest icons sit inside a line of text. */
.icon-xs { display: inline-block; vertical-align: -2px; }

.skip-link {
  position: fixed; left: 12px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--brand); color: #fff; font-weight: 600;
}
.skip-link:focus { top: 12px; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── utilities ───────────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }
.text-warning { color: var(--warning-text); }
.stack { display: grid; gap: 24px; }
.stack > *, .grid-2 > * { min-width: 0; }
.stack-sm { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spacer { flex: 1; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
@media (max-width: 639px) { .hide-sm { display: none !important; } }
@media (min-width: 640px) { .show-sm { display: none !important; } }
@media (min-width: 1024px) { .hide-lg { display: none !important; } }

/* ── brand ───────────────────────────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--text); font-weight: 650; font-size: 14.5px; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(16, 24, 40, .2);
}
.brand-mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  --spin: currentColor;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn-primary {
  background: var(--brand); color: #fff; --spin: #fff;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary {
  background: var(--surface); color: var(--text-2); border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; --spin: #fff; box-shadow: var(--shadow-xs); }
.btn-danger:hover { filter: brightness(.94); }
.btn-danger-ghost { background: transparent; color: var(--danger-text); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-success { background: var(--success); color: #fff; --spin: #fff; box-shadow: var(--shadow-xs); }
.btn-success:hover { filter: brightness(.95); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--spin); border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--text-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--radius); background: transparent;
  color: var(--muted); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.icon-btn-sm .icon { width: 16px; height: 16px; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: var(--link); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .icon { width: 15px; height: 15px; }

/* ── forms ───────────────────────────────────────────────────────────────── */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; }
@media (min-width: 640px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.field { display: grid; gap: 6px; align-content: start; }
.label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
}
.label .optional { font-weight: 400; color: var(--faint); font-size: 13px; }
.label a { font-size: 13px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-size: 16px; /* below 16px iOS zooms the page on focus */
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 13px; resize: vertical; }
@media (min-width: 640px) {
  .input, .select, .textarea { height: 42px; font-size: 15px; }
}
.input::placeholder { color: var(--faint); }
/* Chrome tints autofilled inputs; inside an input group that tint stopped at
   the show-password button. Delaying the background change keeps it native. */
.input:-webkit-autofill { transition: background-color 600000s 0s, color 600000s 0s; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring);
}
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input:disabled { background: var(--surface-3); color: var(--faint); cursor: not-allowed; }
.select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.input-group {
  display: flex; align-items: stretch; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input-group .input { border: 0; box-shadow: none; background: transparent; min-width: 0; flex: 1; height: 42px; }
.input-group .input:focus { box-shadow: none; }
.input-addon {
  display: flex; align-items: center; padding: 0 13px; flex: none; max-width: 60%;
  background: var(--surface-2); color: var(--muted); font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.input-addon:first-child { border-right: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); }
.input-addon:last-child { border-left: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.input-addon-icon { background: transparent; padding: 0 0 0 12px; color: var(--faint); }
.input-addon-icon:first-child { border-right: 0; }
.input-action {
  display: grid; place-items: center; width: 42px; flex: none;
  border: 0; background: transparent; color: var(--faint); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0;
}
.input-action:hover { color: var(--text); }
.input-action[aria-pressed="true"] .i-eye, .input-action:not([aria-pressed="true"]) .i-eye-off { display: none; }
.field-error { font-size: 13px; color: var(--danger-text); }

.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }

/* ── cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px;
  flex-wrap: wrap; padding: 18px 18px 0;
}
.card-header.bordered { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-header-main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; flex: 1 1 260px; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-desc { margin-top: 4px; font-size: 14px; color: var(--muted); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-header + .card-body.flush { margin-top: 16px; }
.card-header.bordered + .card-body.flush { margin-top: 0; }
.card-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px;
  padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-footer .hint { margin-right: auto; }
@media (min-width: 768px) {
  .card-header { padding: 22px 24px 0; }
  .card-header.bordered { padding-bottom: 18px; }
  .card-body { padding: 22px 24px 24px; }
  .card-footer { padding: 14px 24px; }
}
.card-icon {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.card-icon.success { background: var(--success-soft); color: var(--success); }
.card-icon.warning { background: var(--warning-soft); color: var(--warning); }
.card-icon.danger  { background: var(--danger-soft);  color: var(--danger); }
.card-icon.neutral { background: var(--surface-3);    color: var(--muted); }
.card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
.card-link:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 20px 0; }

/* ── badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--neutral-border); background: var(--neutral-soft); color: var(--neutral-text);
  font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-text); }
.badge-danger  { background: var(--danger-soft);  border-color: var(--danger-border);  color: var(--danger-text); }
.badge-info    { background: var(--info-soft);    border-color: var(--info-border);    color: var(--info-text); }
.badge-brand   { background: var(--brand-soft);   border-color: var(--brand-soft-2);   color: var(--brand-text); }
.badge-sm { height: 20px; padding: 0 7px; font-size: 11.5px; }
.badge-mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border-radius: 6px; background: var(--surface-3); color: var(--text-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.chip.ok .icon { color: var(--success); }
.chip.bad .icon { color: var(--danger); }
.chip.wait .icon { color: var(--warning); }

/* ── alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-border); background: var(--surface);
  font-size: 14px; color: var(--text-2);
}
.alert > .icon { margin-top: 1px; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; color: var(--text); }
.alert-title + .alert-text { margin-top: 2px; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.alert .icon-btn { margin: -6px -8px -6px 0; }
.alert-success { background: var(--success-soft); border-color: var(--success-border); }
.alert-success > .icon { color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); }
.alert-warning > .icon { color: var(--warning); }
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger-border); }
.alert-danger > .icon { color: var(--danger); }
.alert-info    { background: var(--info-soft);    border-color: var(--info-border); }
.alert-info > .icon { color: var(--info); }
.alert-brand   { background: var(--brand-soft);   border-color: var(--brand-soft-2); }
.alert-brand > .icon { color: var(--brand); }
.page-alerts { display: grid; gap: 12px; margin-bottom: 24px; }

/* ── toasts ──────────────────────────────────────────────────────────────── */
.toast-region {
  position: fixed; z-index: 90; left: 12px; right: 12px; top: 12px;
  display: grid; gap: 10px; pointer-events: none;
}
@media (min-width: 640px) {
  .toast-region { left: auto; top: auto; right: 24px; bottom: 24px; width: 400px; }
}
.toast {
  pointer-events: auto;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 10px 14px 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xl);
  font-size: 14px; color: var(--text-2);
  animation: toast-in .3s cubic-bezier(.2, .8, .2, 1);
}
.toast > .icon { margin-top: 1px; color: var(--success); }
.toast-text { flex: 1; min-width: 0; padding-top: 1px; }
.toast .icon-btn { margin: -4px 0; }
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── tables ──────────────────────────────────────────────────────────────── */
.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  padding: 10px 16px; text-align: left; white-space: nowrap;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px; vertical-align: middle; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
@media (min-width: 768px) {
  .table th:first-child, .table td:first-child { padding-left: 24px; }
  .table th:last-child, .table td:last-child { padding-right: 24px; }
}
.card > .table-wrap:first-child .table thead th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table-wrap:first-child .table thead th:last-child { border-top-right-radius: var(--radius-lg); }
.card > .table-wrap:last-child .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
.card > .table-wrap:last-child .table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); }
@media (min-width: 768px) { .table .cell-primary { min-width: 240px; } }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* A dense table: tighter cells, and a first column only as wide as it needs. */
.table-compact th, .table-compact td { padding-left: 12px; padding-right: 12px; }
@media (min-width: 768px) { .table-compact .cell-primary { min-width: 0; } }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions-inner { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.cell-main { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.cell-sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cell-stack > .cell-sub { margin-top: 0; }
.cell-with-icon { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-link { color: inherit; }
.cell-link:not(.cell-with-icon) { display: block; }
.cell-link:hover { text-decoration: none; }
.cell-link:hover .cell-main { color: var(--link); }

/* A table becomes a list of cards — one row per block, each cell labelled
   from its data-label — on phones, and on any screen where that particular
   table is too wide for its space (app.js adds .is-stacked). Scrolling a table
   sideways hides the very columns people came to read, and would clip the row
   menus. */
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 14px 18px; border-bottom: 1px solid var(--border); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 5px 0 !important; border: 0; text-align: right;
  }
  .table-stack td::before {
    content: attr(data-label); flex: none;
    font-size: 13px; font-weight: 400; color: var(--muted); text-align: left;
  }
  .table-stack td.cell-primary { display: block; text-align: left; padding-bottom: 8px !important; }
  .table-stack td.cell-primary::before, .table-stack td.actions::before, .table-stack td:not([data-label])::before { display: none; }
  .table-stack td.actions { justify-content: flex-start; padding-top: 12px !important; }
  .table-stack td.actions .actions-inner { justify-content: flex-start; flex-wrap: wrap; }
  .table-stack .dropdown-panel { right: auto; left: 0; }
  .table-stack .storage, .table-stack .cell-stack { text-align: right; }
  .table-stack .cell-stack { align-items: flex-end; }
  .table-stack td.cell-primary .cell-stack { align-items: flex-start; text-align: left; }
  .table-stack td.num { text-align: right; }
}
.table-stack.is-stacked thead { display: none; }
.table-stack.is-stacked, .table-stack.is-stacked tbody, .table-stack.is-stacked tr, .table-stack.is-stacked td { display: block; width: 100%; }
.table-stack.is-stacked tr { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.table-stack.is-stacked tbody tr:last-child { border-bottom: 0; }
.table-stack.is-stacked td {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 5px 0 !important; border: 0; text-align: right;
}
.table-stack.is-stacked td::before {
  content: attr(data-label); flex: none;
  font-size: 13px; font-weight: 400; color: var(--muted); text-align: left;
}
.table-stack.is-stacked td.cell-primary { display: block; text-align: left; padding-bottom: 8px !important; }
.table-stack.is-stacked td.cell-primary::before, .table-stack.is-stacked td.actions::before, .table-stack.is-stacked td:not([data-label])::before { display: none; }
.table-stack.is-stacked td.actions { justify-content: flex-start; padding-top: 12px !important; }
.table-stack.is-stacked td.actions .actions-inner { justify-content: flex-start; flex-wrap: wrap; }
.table-stack.is-stacked .dropdown-panel { right: auto; left: 0; }
.table-stack.is-stacked .storage, .table-stack.is-stacked .cell-stack { text-align: right; }
.table-stack.is-stacked .cell-stack { align-items: flex-end; }
.table-stack.is-stacked td.cell-primary .cell-stack { align-items: flex-start; text-align: left; }
.table-stack.is-stacked td.num { text-align: right; }

.storage { width: 190px; max-width: 100%; }
.storage .meter { margin-top: 6px; }

/* ── meters ──────────────────────────────────────────────────────────────── */
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-sm { height: 6px; }
.meter > span {
  display: block; height: 100%; width: var(--w, 0%); min-width: 0;
  border-radius: inherit; background: var(--brand);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.meter.is-warn > span { background: var(--warning); }
.meter.is-over > span { background: var(--danger); }
.meter.is-ok > span { background: var(--success); }

/* ── stats ───────────────────────────────────────────────────────────────── */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .stats { gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { padding: 16px; display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 768px) { .stat { padding: 20px; } }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-icon {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center; background: var(--surface-3); color: var(--muted);
}
.stat-icon .icon { width: 17px; height: 17px; }
.stat-value {
  margin-top: 10px; font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15;
  color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat-value .of { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-foot { margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--muted); }
.stat .meter { margin-top: 12px; }
@media (min-width: 768px) { .stat-value { font-size: 28px; } }

/* ── key/value lists ─────────────────────────────────────────────────────── */
.kv { display: grid; margin: 0; }
.kv-row {
  display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.kv-row:first-child { padding-top: 0; }
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { font-size: 13px; color: var(--muted); }
.kv dd { margin: 0; color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .kv-row { grid-template-columns: 180px 1fr; align-items: center; gap: 16px; }
  .kv-stacked .kv-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── copy fields & code ──────────────────────────────────────────────────── */
.code {
  font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--text);
  background: var(--surface-3); border-radius: 6px; padding: 2px 6px;
  overflow-wrap: anywhere;
}
.copy-field {
  display: flex; align-items: stretch; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.copy-field-value {
  flex: 1; min-width: 0; margin: 0; padding: 10px 12px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; word-break: break-all;
}
.copy-field-value.is-long { max-height: 7.2em; overflow-y: auto; }
@media (max-width: 639px) {
  .copy-field { flex-direction: column; }
  .copy-field .copy-btn { min-height: 40px; border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
}
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-width: 84px; padding: 0 12px;
  border: 0; border-left: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.copy-btn:hover { background: var(--surface-3); color: var(--text); }
.copy-btn .icon { width: 15px; height: 15px; }
[data-copy] .i-check { display: none; color: var(--success); }
[data-copy].is-copied .i-check { display: block; }
[data-copy].is-copied .i-copy { display: none; }
.copy-inline {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer;
}
.copy-inline:hover { background: var(--surface-3); color: var(--text); }
.copy-inline .icon { width: 15px; height: 15px; }

/* ── dropdown menus ──────────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop .14s cubic-bezier(.2, .8, .2, 1);
  text-align: left;
}
.dropdown-panel.align-left { right: auto; left: 0; }
.dropdown-panel.drop-up { top: auto; bottom: calc(100% + 6px); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.menu-item .icon { width: 16px; height: 16px; color: var(--muted); }
.menu-item.danger { color: var(--danger-text); }
.menu-item.danger .icon { color: currentColor; }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-item .ext { margin-left: auto; width: 14px; height: 14px; color: var(--faint); }
.menu-sep { height: 1px; margin: 6px -6px; background: var(--border); }
.menu-head { padding: 8px 10px 10px; min-width: 0; }
.menu-head-name { font-weight: 600; color: var(--text); font-size: 14px; }
.menu-head-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-head .badge { margin-top: 8px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.menu-form { margin: 0; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--surface-3); }
.segmented button {
  display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.segmented button .icon { width: 15px; height: 15px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.kebab > summary { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius); color: var(--muted); }
.kebab > summary:hover, .kebab[open] > summary { background: var(--surface-3); color: var(--text); }
.kebab > summary .icon { width: 18px; height: 18px; }

/* ── dialogs ─────────────────────────────────────────────────────────────── */
dialog.modal {
  width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: var(--radius-xl);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-xl);
  overflow: auto; overscroll-behavior: contain;
}
dialog.modal.modal-sm { width: min(440px, calc(100% - 32px)); }
dialog.modal.modal-lg { width: min(640px, calc(100% - 32px)); }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .2s cubic-bezier(.2, .8, .2, 1); }
dialog.modal[open]::backdrop { animation: fade-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-inner { display: block; margin: 0; }
.modal-header { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 22px 56px 0 22px; }
.modal-icon {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-soft) 50%, transparent);
}
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger-soft) 50%, transparent); }
.modal-icon.warning { background: var(--warning-soft); color: var(--warning); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warning-soft) 50%, transparent); }
.modal-icon.success { background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 6px color-mix(in srgb, var(--success-soft) 50%, transparent); }
.modal-title { font-size: 17px; font-weight: 600; padding-top: 2px; }
.modal-desc { margin-top: 4px; font-size: 14px; color: var(--muted); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-body { padding: 22px; display: grid; gap: 18px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2);
}
/* On a phone the dialog becomes a bottom sheet: thumbs live at the bottom. */
@media (max-width: 639px) {
  dialog.modal, dialog.modal.modal-sm, dialog.modal.modal-lg {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
  dialog.modal[open] { animation: sheet-in .26s cubic-bezier(.2, .8, .2, 1); }
  .modal-header { padding: 22px 52px 0 18px; }
  .modal-header::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px;
    margin-left: -18px; border-radius: 4px; background: var(--border-strong);
  }
  .modal-body { padding: 20px 18px; }
  .modal-footer { flex-direction: column-reverse; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { width: 100%; height: 46px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ── empty states ────────────────────────────────────────────────────────── */
.empty { padding: 44px 20px; text-align: center; }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand-soft) 45%, transparent);
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty-title { font-size: 16px; font-weight: 600; }
.empty-desc { max-width: 440px; margin: 6px auto 0; font-size: 14px; color: var(--muted); }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ── tabs (filter links) ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 10px 12px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .tab.is-active { color: var(--text); }
.tab-count {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600;
}
.tab.is-active .tab-count { background: var(--brand-soft); color: var(--brand-text); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .toolbar { padding: 14px 24px; } }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; height: 38px; }

/* ── avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text);
  font-size: 12.5px; font-weight: 650; letter-spacing: .02em;
}
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-square { border-radius: 9px; }

/* ── stepper ─────────────────────────────────────────────────────────────── */
.stepper { display: flex; margin: 0; padding: 0; list-style: none; }
.step { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.step::before {
  content: ""; position: absolute; top: 15px; left: calc(-50% + 22px); right: calc(50% + 22px);
  height: 2px; border-radius: 2px; background: var(--border);
}
.step:first-child::before { display: none; }
.step.is-done + .step::before { background: var(--brand); }
.step-dot {
  position: relative; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--border-strong); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 650;
}
.step-dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.step.is-done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.is-current .step-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.step.is-warning .step-dot { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.step-label { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.step-sub { display: none; font-size: 12.5px; color: var(--muted); }
.step:not(.is-done):not(.is-current):not(.is-warning) .step-label { color: var(--muted); }
.step.is-warning .step-label { color: var(--warning-text); }
@media (min-width: 768px) {
  .step { flex-direction: row; text-align: left; gap: 12px; }
  .step::before { top: 50%; left: 0; right: auto; width: 0; display: none; }
  .step-text { min-width: 0; }
  .step-label { font-size: 14px; }
  .step-sub { display: block; }
  .step + .step { padding-left: 16px; }
  .step + .step::after {
    content: ""; position: absolute; left: -16px; top: 50%; width: 24px; height: 2px;
    margin-top: -1px; border-radius: 2px; background: var(--border);
  }
  .step.is-done + .step::after, .step.is-done + .step.is-current::after { background: var(--brand); }
}

/* ── checklist (onboarding) ──────────────────────────────────────────────── */
.checklist { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); }
@media (min-width: 768px) { .check-item { padding: 14px 24px; } }
.check-mark {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px dashed var(--border-strong); color: transparent;
}
.check-mark .icon { width: 14px; height: 14px; stroke-width: 3; }
.check-item.is-done .check-mark { border: 0; background: var(--success); color: #fff; }
.check-item.is-current .check-mark { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.check-text { flex: 1; min-width: 0; }
.check-title { font-size: 14px; font-weight: 600; color: var(--text); }
.check-item.is-done .check-title { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--border-strong); }
.check-desc { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* ── list rows (domains on overview) ─────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); color: inherit; }
@media (min-width: 768px) { .list-row { padding: 14px 24px; } }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-row .chev { color: var(--faint); width: 18px; height: 18px; }
.list-main { flex: 1; min-width: 0; }
.list-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }

/* ── DNS records ─────────────────────────────────────────────────────────── */
.records { display: grid; gap: 12px; }
.record { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.record.is-problem { border-color: var(--danger-border); }
.record-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.record-status { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-top: 1px; }
.record-status .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.record.is-ok .record-status { background: var(--success-soft); color: var(--success); }
.record.is-problem .record-status { background: var(--danger-soft); color: var(--danger); }
.record.is-pending .record-status { background: var(--warning-soft); color: var(--warning); }
.record-title { flex: 1; min-width: 0; }
.record-name { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-weight: 600; color: var(--text); font-size: 14.5px; }
.record-name .record-state { margin-left: auto; }
.record-why { font-size: 13px; color: var(--muted); margin-top: 2px; }
.record-body { padding: 0 16px 16px; display: grid; gap: 12px; }
.record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
@media (max-width: 639px) { .record-field.is-name { grid-column: 1 / -1; order: -1; } }
@media (min-width: 640px) { .record-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.record-field { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.record-field dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.record-field dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 13.5px; color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.record-field dd .copy-inline { margin: -6px -6px -6px 0; }
.record-value-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.record-found { font-size: 13px; }
.record-found code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12.5px; color: var(--text); word-break: break-all; }
.record-toggle { border-top: 1px solid var(--border); }
.record-toggle > summary {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px; list-style: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.record-toggle > summary::-webkit-details-marker { display: none; }
.record-toggle > summary:hover { color: var(--text); }
.record-toggle > summary .icon { width: 15px; height: 15px; transition: transform .15s; }
.record-toggle[open] > summary .icon { transform: rotate(90deg); }
.record-toggle .record-body { padding-top: 4px; }

.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tips li { display: flex; gap: 12px; font-size: 14px; color: var(--text-2); }
.tips li > .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--brand); }

/* ── connection settings ─────────────────────────────────────────────────── */
.conn-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .conn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.conn { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; background: var(--surface-2); min-width: 0; }
.conn-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin-bottom: 12px; color: var(--text); }
.conn-title .icon { width: 18px; height: 18px; color: var(--brand); }
.conn .kv-row { grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; }
.conn .kv-row:first-child { padding-top: 0; }
@media (max-width: 479px) { .conn .kv-row { grid-template-columns: 1fr; gap: 2px; } }

/* ── pricing cards (billing + landing) ───────────────────────────────────── */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
/* Four plans read best as two pairs, or as one row where there is room for
   four — never three and a stray. */
.plans:has(> .plan:nth-child(4):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(max(230px, calc(50% - 8.5px)), 1fr));
}
@media (min-width: 1180px) {
  .public-plans:has(> .plan:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
  .plans:has(> .plan:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.plan.is-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg); }
.plan.is-current { border-color: var(--success-border); }
.plan-flag {
  position: absolute; top: -11px; left: 22px;
  height: 22px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
}
.plan-flag.current { background: var(--success); }
.plan-name { font-size: 15px; font-weight: 600; color: var(--text); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.plan-amount { font-size: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--text); line-height: 1.1; }
.plan-period { font-size: 14px; color: var(--muted); }
.plan-desc { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.plan-features { list-style: none; margin: 18px 0 22px; padding: 18px 0 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.plan-features li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.plan-features .icon { width: 18px; height: 18px; color: var(--success); margin-top: 1px; }
.plan-features li.is-off { color: var(--muted); }
.plan-features li.is-off .icon { color: var(--faint); }
.plan-cta { margin-top: auto; }
.plan-cta form { margin: 0; }

/* ── checkout: order summary, coupon, payment methods ────────────────────── */
.invoice { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.invoice-lines { margin: 0; padding: 6px 16px; }
.invoice-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.invoice-line + .invoice-line { border-top: 1px solid var(--border); }
.invoice-line dt { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; color: var(--text-2); }
.invoice-line dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; white-space: nowrap; }
.invoice-line.is-discount dd, .invoice-line.is-discount .icon { color: var(--success-text); }
.invoice-line.is-total dt { color: var(--text); font-weight: 600; }
.invoice-line.is-total dd { font-size: 18px; font-weight: 700; }
.inline-form { display: inline; }
.coupon-toggle { border-top: 1px solid var(--border); }
.coupon-toggle > summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 600; color: var(--link);
}
.coupon-toggle > summary::-webkit-details-marker { display: none; }
.coupon-form { display: flex; gap: 8px; padding: 0 16px 16px; }
.coupon-form .input { flex: 1; min-width: 0; text-transform: uppercase; }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset > legend { padding: 0; }
.pay-options { display: grid; gap: 10px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.pay-option {
  position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.pay-option:has(.pay-radio:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pay-radio { position: absolute; opacity: 0; pointer-events: none; }
.pay-option-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.pay-radio:focus-visible + .pay-option-head { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-lg); }
.pay-option-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.pay-option:has(.pay-radio:checked) .pay-option-icon { background: var(--brand-soft); color: var(--brand); }
.pay-option-name { font-weight: 600; color: var(--text); flex: 1; }
.pay-option-check {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 2px solid var(--border-strong); color: transparent;
}
.pay-option-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.pay-option:has(.pay-radio:checked) .pay-option-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pay-option-body { padding: 0 16px 16px; display: grid; gap: 10px; }
.pay-options:has(.pay-radio:checked) .pay-option:not(:has(.pay-radio:checked)) .pay-option-body { display: none; }
.pay-option-body:empty { display: none; }
/* Billing terms in the checkout dialog: the same cards, two to a row. */
.term-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.term-options .pay-option-head { padding: 12px 14px; gap: 8px; }
.term-name { display: block; white-space: nowrap; }
.term-price { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
/* The order total under the choices; empty without JavaScript, when the next
   step shows it instead. */
.checkout-total { margin: 4px 0 0; font-weight: 600; color: var(--text); }
.checkout-total:empty { display: none; }

/* A row of radio "chips": the choice is the label, the circle is implied. */
.segmented-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented-choice label { position: relative; }
.segmented-choice input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-choice span {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-2); background: var(--surface);
}
.segmented-choice input:checked + span { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.segmented-choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.label .link-btn { font-size: 12.5px; }

/* ── payment steps ───────────────────────────────────────────────────────── */
.pay-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: pay; }
.pay-step { display: flex; gap: 14px; }
.pay-num {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 650;
}
.pay-step.is-done .pay-num { background: var(--success); }
.pay-body { flex: 1; min-width: 0; }
.pay-title { font-weight: 600; color: var(--text); font-size: 14.5px; }
.pay-text { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.pay-instructions {
  margin-top: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: 14px; color: var(--text); white-space: pre-line;
}

/* ═══════════════════════════════════════════════════════════════════════════
   App shell
   ═══════════════════════════════════════════════════════════════════════════ */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  width: min(var(--sidebar-w), 86vw);
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .26s;
}
.sidebar.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-xl); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: var(--topbar-h); padding: 0 10px 0 18px; flex: none;
}
.sidenav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.sidenav-section + .sidenav-section { margin-top: 22px; }
.sidenav-label {
  padding: 0 10px 8px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
}
.sidenav-link {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 10px; margin-bottom: 2px; border-radius: var(--radius);
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  transition: background-color .12s, color .12s;
}
.sidenav-link .icon { color: var(--faint); transition: color .12s; }
.sidenav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidenav-link:hover .icon { color: var(--muted); }
.sidenav-link.is-active { background: var(--nav-active); color: var(--text); font-weight: 600; }
.sidenav-link.is-active .icon { color: var(--brand); }
.sidenav-link .ext { margin-left: auto; width: 14px; height: 14px; }
.sidenav-count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 650;
}
.sidebar-foot { flex: none; padding: 12px; border-top: 1px solid var(--border); }

/* Collapsible menu groups: a section heading that opens to its pages. */
.navgroup { margin-bottom: 2px; }
.navgroup > summary { list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.navgroup-label { flex: 1; min-width: 0; }
.navgroup-caret { width: 16px !important; height: 16px !important; color: var(--faint); transition: transform .18s; }
.navgroup[open] > summary .navgroup-caret { transform: rotate(180deg); }
.navgroup[open] > summary .navgroup-count { display: none; }
.navgroup-head.has-active { color: var(--text); }
.navgroup-head.has-active > .icon:first-child { color: var(--brand); }
.navgroup-items { margin: 2px 0 10px 19px; padding-left: 12px; border-left: 1px solid var(--border); }
.sidenav-sublink {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 6px 10px; margin-bottom: 1px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.3;
  transition: background-color .12s, color .12s;
}
.sidenav-sublink:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidenav-sublink.is-active { background: var(--nav-active); color: var(--text); font-weight: 600; }
.sidenav-sublink.is-active::before {
  content: ""; position: absolute; left: -13px; top: 7px; bottom: 7px; width: 2px;
  border-radius: 2px; background: var(--brand);
}
.sidenav-resources { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.crumbs .crumb-group { color: var(--muted); }

/* Admin search in the top bar. */
.topbar-search { display: none; position: relative; flex: 0 1 320px; margin-left: auto; }
.topbar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.topbar-search .input { height: 38px; padding-left: 34px; background: var(--surface); }
.topbar-search + .topbar-actions { margin-left: 8px; }
@media (min-width: 768px) { .topbar-search { display: block; } }
@media (min-width: 768px) { .search-icon-link { display: none !important; } }
.plan-widget {
  padding: 14px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--border);
}
.plan-widget-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-widget-name { font-weight: 600; font-size: 14px; color: var(--text); }
.plan-widget-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan-widget .btn { margin-top: 12px; }
.plan-widget-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.plan-widget-link .icon { width: 14px; height: 14px; }

.app-main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: var(--topbar-h); padding: 0 12px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { margin-left: 2px; }
.crumbs { display: none; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .icon { width: 15px; height: 15px; color: var(--faint); }
.crumbs .crumb-home { display: inline-grid; place-items: center; }
.crumbs .crumb-home .icon { width: 17px; height: 17px; color: var(--muted); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-trigger {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 4px;
  border-radius: 999px; color: var(--text-2);
}
.user-trigger:hover, .user-menu[open] .user-trigger { background: var(--surface-3); }
.user-trigger .icon { width: 16px; height: 16px; color: var(--muted); }
.user-trigger-name { font-size: 14px; font-weight: 600; color: var(--text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content {
  width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: 20px 16px 40px;
}
.content:focus { outline: none; }
.has-tabbar .content { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .content, .has-tabbar .content { padding: 32px 28px 56px; }
}
@media (min-width: 1280px) {
  .content, .has-tabbar .content { padding: 36px 40px 64px; }
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 11.5px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.is-active { color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .tabbar a.is-active { color: var(--brand-text); }
@media (min-width: 768px) { .tabbar { display: none; } }

@media (min-width: 640px) {
  .topbar { padding: 0 16px; gap: 12px; }
}
@media (min-width: 1024px) {
  .sidebar { transform: none; visibility: visible; width: var(--sidebar-w); transition: none; }
  .drawer-backdrop, .sidebar-close, .menu-btn, .topbar-brand { display: none !important; }
  .app-main { padding-left: var(--sidebar-w); }
  .topbar { padding: 0 28px; }
  .crumbs { display: flex; }
}
@media (min-width: 1280px) { .topbar { padding: 0 40px; } }

/* page header */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header-main { min-width: 0; flex: 1 1 320px; }
.page-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.page-eyebrow:hover { color: var(--text); text-decoration: none; }
.page-eyebrow .icon { width: 15px; height: 15px; }
.page-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.page-desc { margin-top: 6px; color: var(--muted); font-size: 15px; max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 768px) { .page-title { font-size: 28px; } .page-header { margin-bottom: 28px; } }
@media (max-width: 639px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
}

/* layout grids */
.grid-2 { display: grid; gap: 24px; }
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
  .grid-2.even { grid-template-columns: 1fr 1fr; }
}
.settings-section { display: grid; gap: 16px; }
.settings-section + .settings-section { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--border); }
.settings-intro h2 { font-size: 16px; }
.settings-intro p { margin-top: 4px; font-size: 14px; color: var(--muted); }
@media (min-width: 1024px) {
  .settings-section { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; }
}

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 30%, var(--surface)));
  border: 1px solid var(--brand-soft-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Auth pages
   ═══════════════════════════════════════════════════════════════════════════ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--surface); }
@media (min-width: 1024px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-aside { display: none; }
@media (min-width: 1024px) {
  .auth-aside {
    position: relative; display: flex; overflow: hidden; color: #fff;
    background:
      radial-gradient(700px 420px at 15% 10%, rgba(129, 140, 248, .55), transparent 60%),
      radial-gradient(600px 400px at 90% 90%, rgba(167, 139, 250, .45), transparent 60%),
      linear-gradient(160deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);
  }
  .auth-aside::before {
    content: ""; position: absolute; inset: 0; opacity: .14;
    background-image:
      linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 30%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 30% 30%, #000 0%, transparent 70%);
  }
}
.auth-aside-inner { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto; padding: 48px 56px; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.auth-pitch { margin-top: auto; padding-top: 48px; }
.auth-pitch h2 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; }
.auth-pitch p { margin-top: 14px; color: rgba(255, 255, 255, .75); font-size: 16px; max-width: 420px; }
.auth-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); font-size: 15px; }
.auth-points .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); flex: none; }
.auth-points .tick .icon { width: 14px; height: 14px; stroke-width: 3; }
.auth-aside-foot { margin-top: 48px; font-size: 13px; color: rgba(255, 255, 255, .55); }
.auth-mock {
  margin-top: 40px; padding: 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.auth-mock-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.auth-mock-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #86efac; }
.auth-mock-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.auth-mock-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.auth-mock-row .icon { width: 16px; height: 16px; color: #86efac; stroke-width: 2.6; }
.auth-mock-row span:last-child { margin-left: auto; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .6); }

.auth-main { display: flex; flex-direction: column; min-width: 0; padding: 20px 20px 28px; }
@media (min-width: 640px) { .auth-main { padding: 28px 40px 32px; } }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (min-width: 1024px) { .auth-top .brand { visibility: hidden; } }
.auth-top-link { font-size: 14px; color: var(--muted); }
.auth-top-link a { font-weight: 600; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 400px; }
.auth-icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 22px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand-soft) 45%, transparent);
}
.auth-icon .icon { width: 24px; height: 24px; }
.auth-icon.success { background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 8px color-mix(in srgb, var(--success-soft) 45%, transparent); }
.auth-icon.warning { background: var(--warning-soft); color: var(--warning); box-shadow: 0 0 0 8px color-mix(in srgb, var(--warning-soft) 45%, transparent); }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.auth-sub { margin-top: 8px; color: var(--muted); font-size: 15px; }
.auth-form { margin-top: 28px; }
.auth-alt { margin-top: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-alt a { font-weight: 600; }
.auth-note {
  margin-top: 28px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); display: flex; gap: 10px;
}
.auth-note .icon { width: 17px; height: 17px; color: var(--faint); margin-top: 1px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--faint); }
.auth-card > .alert { margin-bottom: 24px; }
.auth-body-text { margin-top: 16px; font-size: 15px; color: var(--text-2); line-height: 1.6; }
.auth-body-text + .auth-body-text { margin-top: 12px; }
.auth-actions { display: grid; gap: 10px; margin-top: 28px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Public site
   ═══════════════════════════════════════════════════════════════════════════ */
.site { background: var(--surface); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.site-nav { display: none; gap: 4px; margin-left: 24px; }
.site-nav a { padding: 8px 12px; border-radius: var(--radius); color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-menu > summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); color: var(--text-2); }
.site-menu > summary:hover { background: var(--surface-3); }
.site-menu .dropdown-panel { width: min(300px, calc(100vw - 40px)); }
@media (min-width: 900px) {
  .site-nav { display: flex; }
  .site-menu { display: none; }
}
@media (max-width: 899px) { .site-actions .signin { display: none; } }

.hero { position: relative; isolation: isolate; overflow: hidden; padding: 56px 0 64px; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -10% -20% auto -20%; height: 760px; pointer-events: none;
  background:
    radial-gradient(520px 300px at 18% 18%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(520px 320px at 85% 8%, rgba(139, 92, 246, .14), transparent 70%),
    radial-gradient(620px 360px at 60% 70%, rgba(14, 165, 233, .08), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 10%, transparent 75%);
}
@media (min-width: 1024px) { .hero { padding: 88px 0 96px; } }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs);
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.eyebrow-pill { padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 650; }
.hero-title {
  margin-top: 22px; font-size: clamp(36px, 6.2vw, 60px); line-height: 1.04;
  letter-spacing: -.04em; font-weight: 750;
}
.grad {
  background: linear-gradient(92deg, #4f46e5 0%, #7c3aed 55%, #0ea5e9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="dark"] .grad { background-image: linear-gradient(92deg, #818cf8 0%, #a78bfa 55%, #38bdf8 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grad { background-image: linear-gradient(92deg, #818cf8 0%, #a78bfa 55%, #38bdf8 100%); } }
.hero-sub { margin-top: 20px; max-width: 580px; font-size: clamp(16px, 1.9vw, 19px); line-height: 1.6; color: var(--muted); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 479px) { .hero-ctas .btn { flex: 1 1 100%; } }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: 14px; color: var(--muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .icon { width: 17px; height: 17px; color: var(--success); stroke-width: 2.5; }

.mock {
  position: relative; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 40px 80px -24px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .02);
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.mock-bar .mock-url { margin-left: 12px; flex: 1; height: 24px; border-radius: 6px; background: var(--surface-3); font-size: 12px; color: var(--muted); display: flex; align-items: center; padding: 0 10px; font-family: var(--mono); overflow: hidden; white-space: nowrap; }
.mock-body { padding: 20px; }
.mock-domain { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mock-domain strong { font-size: 17px; letter-spacing: -.01em; }
.mock-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mock-meter { margin-top: 16px; }
.mock-records { margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mock-rec { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 13.5px; border-top: 1px solid var(--border); }
.mock-rec:first-child { border-top: 0; }
.mock-rec .record-status { width: 24px; height: 24px; background: var(--success-soft); color: var(--success); }
.mock-rec .record-status .icon { width: 13px; height: 13px; }
.mock-rec b { font-weight: 600; color: var(--text); }
.mock-rec .badge { margin-left: auto; }
.mock-boxes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mock-box { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.mock-box .avatar { width: 22px; height: 22px; font-size: 10px; }
.mock-float {
  position: absolute; right: -8px; bottom: -18px; display: none;
  align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xl);
  font-size: 13.5px;
}
.mock-float .card-icon { width: 34px; height: 34px; border-radius: 9px; }
.mock-float .card-icon .icon { width: 17px; height: 17px; }
.hero-visual { position: relative; }
@media (min-width: 1024px) { .mock-float { display: flex; right: -20px; } }

.section { padding: 72px 0; }
@media (min-width: 1024px) { .section { padding: 104px 0; } }
.section-alt { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-kicker { font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
:root[data-theme="dark"] .section-kicker { color: var(--brand-text); }
.section-h { margin-top: 10px; font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; }
.section-p { margin-top: 14px; font-size: 17px; color: var(--muted); }

.how { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; counter-reset: how; }
@media (min-width: 640px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .how { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.how li { position: relative; padding: 24px; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--surface); }
.how-num { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .5); }
.how h3 { margin-top: 18px; font-size: 16.5px; }
.how p { margin-top: 6px; font-size: 14.5px; color: var(--muted); }

.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.feature { padding: 26px; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s; }
.feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature .card-icon { width: 44px; height: 44px; border-radius: 12px; }
.feature .card-icon .icon { width: 22px; height: 22px; }
.feature h3 { margin-top: 18px; font-size: 16.5px; }
.feature p { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.6; }

.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; list-style: none; cursor: pointer;
  font-weight: 600; font-size: 15.5px; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding: 0 20px 20px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 48px 28px; border-radius: 24px; text-align: center; color: #fff;
  background:
    radial-gradient(500px 260px at 15% 0%, rgba(129, 140, 248, .6), transparent 60%),
    radial-gradient(500px 260px at 100% 100%, rgba(167, 139, 250, .5), transparent 60%),
    linear-gradient(135deg, #312e81, #4c1d95);
}
@media (min-width: 768px) { .cta-band { padding: 72px 48px; } }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.03em; font-weight: 700; }
.cta-band p { margin: 14px auto 0; max-width: 560px; color: rgba(255, 255, 255, .78); font-size: 17px; }
.cta-band .hero-ctas { justify-content: center; }
.btn-white { background: #fff; color: #312e81; box-shadow: var(--shadow-sm); }
.btn-white:hover { background: #eef2ff; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn-outline-white:hover { background: rgba(255, 255, 255, .1); }

.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); } }
.footer-brand p { margin-top: 12px; max-width: 320px; font-size: 14px; color: var(--muted); }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.footer-col a { display: block; padding: 4px 0; font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint); }

.public-plans .plan { padding: 26px; }
.section-flush-top { padding-top: 0 !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   Invoice document
   ═══════════════════════════════════════════════════════════════════════════ */
.invoice-body { background: var(--bg); }
.invoice-toolbar {
  max-width: 860px; margin: 0 auto; padding: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.invoice-doc {
  max-width: 860px; margin: 0 auto 48px; padding: 28px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); color: var(--text); font-size: 14px;
}
@media (min-width: 768px) { .invoice-doc { padding: 48px 56px; } }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.invoice-title { text-align: right; }
.invoice-title h1 { font-size: 28px; letter-spacing: -.02em; font-weight: 700; text-transform: uppercase; color: var(--text); }
.invoice-title .mono { margin-top: 4px; color: var(--muted); font-size: 14px; }
.invoice-stamp {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 6px;
  border: 2px solid currentColor; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px;
}
.invoice-stamp.is-paid { color: var(--success); }
.invoice-stamp.is-unpaid { color: var(--warning); }
.invoice-stamp.is-void { color: var(--faint); }
.invoice-parties { display: grid; gap: 24px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
@media (min-width: 640px) { .invoice-parties { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.invoice-parties h2, .invoice-section h2 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.invoice-parties p { margin: 0 0 2px; color: var(--text-2); overflow-wrap: anywhere; }
.invoice-parties .strong { color: var(--text); }
.pre { white-space: pre-line; }
.invoice-meta { margin: 0; display: grid; gap: 6px; }
.invoice-meta div { display: flex; justify-content: space-between; gap: 12px; }
.invoice-meta dt { color: var(--muted); }
.invoice-meta dd { margin: 0; color: var(--text); text-align: right; }
.invoice-items { width: 100%; margin-top: 32px; border-collapse: collapse; }
.invoice-items th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--border-strong); }
.invoice-items td { padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.invoice-items .num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-totals { margin: 16px 0 0 auto; max-width: 320px; display: grid; gap: 8px; }
.invoice-totals div { display: flex; justify-content: space-between; gap: 16px; }
.invoice-totals dt { color: var(--muted); }
.invoice-totals dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--text); }
.invoice-totals .is-discount dd { color: var(--success-text); }
.invoice-totals .is-total { padding-top: 10px; border-top: 1px solid var(--border-strong); }
.invoice-totals .is-total dt, .invoice-totals .is-total dd { font-size: 16px; font-weight: 700; color: var(--text); }
.invoice-totals .is-balance dt, .invoice-totals .is-balance dd { font-weight: 600; color: var(--text); }
.invoice-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-2); }
.invoice-section p + p { margin-top: 4px; }
.invoice-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; }
.invoice-foot p + p { margin-top: 4px; }

/* What prints is the invoice, in light colours, whatever the screen theme. */
@media print {
  /* Same specificity as the dark-theme rules, and later, so print wins. */
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #101828; --text-2: #344054;
    --muted: #475467; --faint: #667085; --border: #d0d5dd; --border-strong: #98a2b3;
    --success: #067647; --success-text: #067647; --warning: #b54708;
  }
  .no-print, .skip-link, .toast-region { display: none !important; }
  body, .invoice-body { background: #fff; }
  .invoice-doc { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; border-radius: 0; }
  a { color: inherit; text-decoration: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Mail server admin: status, logs, charts, code, two-step verification
   ═══════════════════════════════════════════════════════════════════════════ */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--faint); flex: none; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status-list { display: grid; gap: 0; }
.status-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-top: 1px solid var(--border); min-width: 0;
}
.status-row:first-child { border-top: 0; }
.status-row-main { flex: 1; min-width: 0; }
.status-row-title { font-weight: 600; font-size: 14px; color: var(--text); }
.status-row-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.status-row-side { flex: none; font-size: 13px; color: var(--muted); text-align: right; }

.logbox {
  margin: 0; padding: 14px 16px; max-height: 70vh; overflow: auto;
  background: #0b0d10; color: #d0d5dd; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font: 12.5px/1.6 var(--mono); white-space: pre; tab-size: 2;
}
.logbox .ln { display: block; }
.logbox .ln:hover { background: rgba(255, 255, 255, .04); }
.logbox .ln-bad { color: #fda29b; }
.logbox .ln-warn { color: #fec84b; }
.logbox .ln-ok { color: #75e0a7; }
.logbox mark { background: rgba(250, 204, 21, .3); color: inherit; border-radius: 2px; }

.code-block {
  position: relative; margin: 0; padding: 14px 16px; overflow-x: auto;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius);
  font: 13px/1.6 var(--mono); color: var(--text); white-space: pre;
}
.code-block .copy-inline { position: absolute; top: 8px; right: 8px; }
.kbd { font: 12px var(--mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* Column chart: one stacked column per day. Series colours were checked with
   the palette validator (CVD, contrast) against the card surface in both themes. */
.chart { --series-1: #2a78d6; --series-2: #eb6834; padding: 18px 20px 14px; }
:root[data-theme="dark"] .chart { --series-1: #3987e5; --series-2: #d95926; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart { --series-1: #3987e5; --series-2: #d95926; } }
.chart-frame { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; }
.chart-yaxis { position: relative; height: 180px; min-width: 24px; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart-yaxis span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; }
.chart-plot {
  position: relative; display: flex; align-items: stretch; gap: 2px; height: 180px;
  border-bottom: 1px solid var(--border-strong);
  background-image: linear-gradient(var(--border) 1px, transparent 1px);
  background-size: 100% 50%; background-repeat: repeat-y;
}
.chart-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column-reverse; align-items: center;
  gap: 2px; border-radius: 4px 4px 0 0; outline: none;
}
.chart-col:hover, .chart-col:focus-visible { background: var(--surface-3); }
.chart-col:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
.chart-seg { width: 100%; max-width: 24px; flex: none; }
.chart-seg:last-child { border-radius: 4px 4px 0 0; }
.chart-seg.s1 { background: var(--series-1); }
.chart-seg.s2 { background: var(--series-2); }
.chart-col:hover .chart-seg, .chart-col:focus-visible .chart-seg { filter: brightness(1.1); }
.chart-axis { display: flex; gap: 2px; margin-top: 6px; }
.chart-axis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.tip {
  position: fixed; z-index: 90; pointer-events: none; max-width: 240px;
  padding: 8px 10px; border-radius: var(--radius); background: var(--text); color: var(--surface);
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-lg); white-space: pre-line;
}
.tip strong { font-weight: 650; }

.qr-box { display: grid; place-items: center; width: 212px; max-width: 100%; aspect-ratio: 1; padding: 10px; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box svg path { fill: #101828; }
.secret-box {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--warning-soft); border: 1px solid var(--warning-border); border-radius: var(--radius);
  font: 600 14px var(--mono); color: var(--text); overflow-wrap: anywhere;
}
.secret-box code { flex: 1; min-width: 0; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px 16px; background: var(--surface-3); border-radius: var(--radius); font: 600 14px var(--mono); }
.verify-code { font: 600 22px var(--mono); letter-spacing: .3em; text-align: center; }
.mono-wrap { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-word; }
.cell-mono { font-family: var(--mono); font-size: 13px; }
.trace-recipient { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.trace-recipient:first-child { border-top: 0; }
.trace-response { flex-basis: 100%; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filters .field { flex: 1 1 180px; margin: 0; }
.filters .field.grow { flex: 3 1 260px; }
.filters .actions-row { display: flex; gap: 8px; }
.subtle-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.subtle-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.subtle-list li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bullets { list-style: disc; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.bullets li::marker { color: var(--faint); }
a.status-row { color: inherit; transition: background-color .12s; }
a.status-row:hover { background: var(--surface-2); text-decoration: none; }
a.status-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.code-wrap { position: relative; }
.code-wrap > .copy-inline { position: absolute; top: 8px; right: 8px; background: var(--surface); }
.code-wrap > .code-block { padding-right: 48px; }

/* ── service policy ────────────────────────────────────────────────────── */
.policy { max-width: 760px; }
.policy .section-head { text-align: left; margin-left: 0; }
.policy-body h2 { font-size: 19px; margin: 32px 0 10px; }
.policy-body ul, .policy-body ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--text); line-height: 1.6; }
.policy-body ol { margin-top: 8px; }
.policy-contact { margin-top: 32px; color: var(--muted); }
.text-center { text-align: center; }

.keep-list { display: grid; gap: 8px; }
.keep-list .checkline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── announcements ─────────────────────────────────────────────────────── */
.mail-preview { display: block; width: 100%; height: 560px; border: 0; border-top: 1px solid var(--border); background: #f4f5f7; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.input-inline { display: inline-block; width: 70px; height: 30px; padding: 2px 8px; margin: 0 4px; }
.segmented-choice .checkline { align-items: flex-start; }
