/* Verifio portal. Brand colours follow the Addresser logo (teal to green). No inline styles are used
   anywhere: the content security policy forbids them. */
:root {
  --brand-a: #02d4e4; --brand-b: #09e885;
  --brand-grad: linear-gradient(45deg, var(--brand-a), var(--brand-b));
  --ink: #21575f; --ink-strong: #06343a; --muted: #5f7a7f; --line: #dbe7e9;
  --bg: #f3f7f8; --card: #fff; --primary: #1fa463; --primary-hover: #188a53; --primary-ink: #fff;
  --shadow: 0 6px 20px 0 #9ac1cc55;
  --ok-bg: #e3f7ea; --ok-fg: #0f6b2f; --warn-bg: #fff3d6; --warn-fg: #7a5200;
  --bad-bg: #fde4e8; --bad-fg: #a3112f; --none-bg: #eceff1; --none-fg: #455a64;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #cfe3e6; --ink-strong: #f1fafb; --muted: #93b0b4; --line: #27454a; --bg: #0f1f22;
    --card: #162a2e; --primary: #3fcf86; --primary-hover: #4fd28b; --primary-ink: #06343a;
    --shadow: none;
    --ok-bg: #12361f; --ok-fg: #7fe2a1; --warn-bg: #3d3110; --warn-fg: #f3cf7a;
    --bad-bg: #3f1a22; --bad-fg: #ff9aae; --none-bg: #22363a; --none-fg: #b6c9cc;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
a { color: var(--primary); }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 1rem; background: var(--card); border-bottom: 3px solid transparent;
  border-image: var(--brand-grad) 1;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.wordmark { font-size: 1.35rem; font-weight: 700; color: var(--ink-strong); letter-spacing: 0.01em; }
main { flex: 1; width: 100%; max-width: 56rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
footer {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 1rem;
  color: var(--muted); font-size: 0.875rem;
}
h1 { margin: 0 0 0.25rem; font-size: 1.6rem; color: var(--ink-strong); }
h2 { margin: 0 0 0.75rem; font-size: 1.1rem; color: var(--ink-strong); }
.org { margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--ink-strong); font-weight: 600; }
.plan { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem;
  padding: 1.25rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.card.narrow { max-width: 26rem; margin: 2rem auto; }

form { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1rem; }
label { font-weight: 600; color: var(--ink-strong); margin-top: 0.5rem; }
input[type="email"], input[type="password"], input[type="text"] {
  padding: 0.6rem 0.7rem; font: inherit; color: var(--ink-strong); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0.5rem;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand-a); outline-offset: 2px; }
fieldset { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin: 0; }
legend { font-weight: 600; padding: 0 0.25rem; }
.choice { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.25rem 0; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 0.5rem; padding: 0.65rem 1rem;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-strong);
  text-decoration: none; text-align: center; display: inline-block;
}
button.primary, .button.primary {
  margin-top: 0.75rem; background: var(--primary); color: var(--primary-ink); border-color: var(--primary);
}
button.primary:hover, .button.primary:hover { background: var(--primary-hover); }
button.link { background: none; border: none; padding: 0.25rem 0.5rem; color: var(--primary); }
.signout { margin: 0; flex-direction: row; }
.form-error, .notice { padding: 0.65rem 0.85rem; border-radius: 0.5rem; margin: 0.75rem 0; }
.form-error { background: var(--bad-bg); color: var(--bad-fg); }
.notice.state-exceeded { background: var(--bad-bg); color: var(--bad-fg); }
.notice.state-warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice.state-none { background: var(--none-bg); color: var(--none-fg); }

.steps { padding-left: 1.2rem; }
.qr { display: block; margin: 0.75rem auto; background: #fff; padding: 0.5rem; border-radius: 0.5rem; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.codes li { background: var(--bg); border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.4rem 0.6rem; text-align: center; }

.quota-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.quota-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.quota-label { font-weight: 600; color: var(--ink-strong); }
.quota-numbers { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.badge { margin-left: auto; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.state-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.state-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.state-exceeded { background: var(--bad-bg); color: var(--bad-fg); }
progress { width: 100%; height: 0.7rem; border: none; border-radius: 999px; overflow: hidden; background: var(--line); appearance: none; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--brand-grad); }
progress::-moz-progress-bar { background: var(--brand-b); }
.quota-row[data-state="WARN"] progress::-webkit-progress-value { background: #e0a21a; }
.quota-row[data-state="WARN"] progress::-moz-progress-bar { background: #e0a21a; }
.quota-row[data-state="EXCEEDED"] progress::-webkit-progress-value { background: #d63a58; }
.quota-row[data-state="EXCEEDED"] progress::-moz-progress-bar { background: #d63a58; }
.stat { margin: 0 0 0.5rem; }
.stat strong { font-size: 1.5rem; color: var(--ink-strong); }
.usage-chart { width: 100%; height: auto; max-height: 6rem; }
.usage-bar { fill: var(--brand-a); }
.usage-bar:hover { fill: var(--brand-b); }
@media (max-width: 30rem) { .codes { grid-template-columns: 1fr; } }

/* The signed-in shell, from the clickable prototype (R-59): grouped sidebar and a gradient top bar. */
:root { --nav-w: 232px; --bar-h: 52px; }
.with-shell { display: block; }
#nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); background: var(--card); z-index: 30;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.12); overflow-y: auto; padding-bottom: 24px;
}
#nav .brand { height: var(--bar-h); padding: 0 18px; font-weight: 800; font-size: 18px; color: var(--ink-strong); }
#nav .brand small { display: block; font-size: 10px; font-weight: 700; color: var(--muted); margin-top: -3px; }
.navgroup {
  margin: 14px 0 2px; padding: 0 18px; font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
#nav a:not(.brand) {
  display: flex; align-items: center; gap: 10px; height: 36px; margin: 1px 10px 1px 0; padding: 0 14px 0 18px;
  border-radius: 0 24px 24px 0; color: var(--ink); text-decoration: none; font-weight: 600;
}
#nav a:not(.brand):hover { background: rgba(2, 212, 228, 0.12); }
#nav a.active { background: var(--brand-grad); color: #06343a; box-shadow: var(--shadow); }
#nav a.denied { opacity: 0.5; }
#nav .ic { width: 18px; text-align: center; }
.navnote { margin: 18px 18px 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
.brand .wordmark small { font-size: 10px; font-weight: 700; color: var(--muted); }
#top {
  position: fixed; top: 0; left: var(--nav-w); right: 0; height: var(--bar-h); z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--brand-grad); box-shadow: var(--shadow); color: #06343a; font-weight: 700;
}
#top .grow { flex: 1; }
#top .who { font-size: 0.85rem; font-weight: 600; }
#top form { margin: 0; flex-direction: row; }
.signout-button {
  padding: 0.3rem 0.8rem; background: rgba(255, 255, 255, 0.55); border: 0; color: #06343a;
}
.signout-button:hover { background: rgba(255, 255, 255, 0.8); }
#main { margin-left: var(--nav-w); max-width: 1180px; width: auto; padding: calc(var(--bar-h) + 22px) 26px 40px; }
#main footer { justify-content: flex-start; padding: 1.5rem 0 0; }
.head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.head p { margin: 4px 0 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid .card { margin: 0; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi { font-size: 26px; font-weight: 800; color: var(--ink-strong); }
.tip { font-size: 12px; color: var(--muted); }
.banner { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.banner.fail { background: var(--bad-bg); color: var(--bad-fg); }
.banner.info { background: var(--none-bg); color: var(--none-fg); }
.quota-numbers { margin-left: auto; }
@media (max-width: 900px) {
  #nav { position: static; width: auto; box-shadow: none; }
  #top { position: static; flex-wrap: wrap; padding: 10px 14px; }
  #main { margin: 0; padding: 16px; }
  .grid.g2 { grid-template-columns: 1fr; }
}

/* Components from the prototype used by the keys and users screens. */
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 700;
  cursor: pointer; background: var(--primary); color: var(--primary-ink); text-decoration: none; margin: 0;
}
.btn:hover { background: var(--primary-hover); }
.btn.primary { margin-top: 0.75rem; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(2, 212, 228, 0.12); }
.btn.danger { background: #c62645; color: #fff; }
.btn.danger:hover { background: #a3112f; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.off, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { margin: 0; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.chip.pass { background: var(--ok-bg); color: var(--ok-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.fail { background: var(--bad-bg); color: var(--bad-fg); }
.chip.none { background: var(--none-bg); color: var(--none-fg); }
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); }
.keybox { background: var(--none-bg); border-radius: 8px; padding: 10px 12px; word-break: break-all; margin: 8px 0; }
.pick { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 8px 0; }
.pick input { width: auto; }
textarea {
  width: 100%; font: inherit; color: var(--ink-strong); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.6rem 0.7rem;
}
textarea:focus-visible { outline: 3px solid var(--brand-a); outline-offset: 2px; }
.problems { list-style: none; margin: 8px 0; padding: 0; font-size: 0.9rem; }
.bad { color: var(--bad-fg); font-weight: 700; }
.ok { color: var(--ok-fg); font-weight: 700; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

select {
  font: inherit; color: var(--ink-strong); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px;
}
select:disabled { opacity: 0.6; }
select:focus-visible { outline: 3px solid var(--brand-a); outline-offset: 2px; }

.filters {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
  justify-content: flex-start; gap: 0.5rem 0.75rem; margin-top: 0;
}
.filters label { font-weight: 600; margin-top: 0; }
.filters .button { margin-left: 0.25rem; }
.bar-col { width: 40%; }

.wizard-steps {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; list-style: none; padding: 0;
  margin: 0 0 1rem; color: var(--muted); font-weight: 600; font-size: 0.9rem;
}
.wizard-steps .on { color: var(--ink-strong); }
input[type="file"] { font: inherit; color: var(--ink-strong); }

/* Check now: mode tabs, the form beside the result, and one card per check with its facts. */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 20px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  font-weight: 700; text-decoration: none; color: var(--ink);
}
.tab:hover { background: rgba(2, 212, 228, 0.12); }
.tab.active { background: var(--card); border-color: var(--line); color: var(--ink-strong); margin-bottom: -1px; }
.check-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.check-layout .card { margin: 0; }
.check-output { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.check-form form { margin-top: 0.25rem; }
.country-picker {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 0.9rem; padding: 0 0 0.9rem; border-bottom: 1px solid var(--line);
}
.country-picker label { font-weight: 700; }
.country-picker select { width: auto; min-width: 10rem; }
.country-picker .hint { flex-basis: 100%; }
.group { display: flex; flex-direction: column; gap: 0.3rem; border: 0; padding: 0; margin: 0 0 0.75rem; }
.group legend {
  padding: 0; margin-bottom: 2px; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
.hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 0.25rem; }
.form-actions .btn.primary { margin-top: 0; }
.result-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.result-top .grow { flex: 1; min-width: 14rem; }
.result-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.result-summary { margin: 0; font-weight: 600; color: var(--ink-strong); }
.chip.lg { font-size: 15px; padding: 4px 14px; }
.scorebox { min-width: 9rem; text-align: right; }
.scorebox .kpi small { font-size: 14px; font-weight: 600; color: var(--muted); }
.scorebox p { margin: 2px 0 0; }
.result .banner { margin: 12px 0 0; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.check-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.check-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.check-head h3 { margin: 0; font-size: 1rem; color: var(--ink-strong); }
.headline { margin: 2px 0 8px; color: var(--muted); }
.facts { display: grid; grid-template-columns: minmax(9rem, 36%) 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.875rem; }
.facts dd { margin: 0; font-weight: 600; color: var(--ink-strong); overflow-wrap: anywhere; }
.guide ul { margin: 0 0 0.75rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) {
  .check-layout { grid-template-columns: 1fr; }
  .scorebox { text-align: left; }
}
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; } }

/* Check now: the "running your check" overlay and spinner (static/check-loader.js). */
.spinner {
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
.btn.is-loading::before, button.is-loading::before {
  content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.5em;
  vertical-align: -0.1em; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.check-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(6, 52, 58, 0.45); backdrop-filter: blur(2px);
}
.check-overlay.on { display: flex; }
.check-overlay-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 28px 32px; max-width: 22rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.check-overlay-text { margin: 0; font-weight: 600; color: var(--ink-strong); }
.check-overlay-sub { margin: 0; font-size: 0.875rem; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner, .btn.is-loading::before, button.is-loading::before { animation-duration: 2.4s; }
}

/* New-bulk-job columns: with a matched saved mapping, the save-a-new-mapping fields stay hidden
   until the checkbox is ticked (bulk_new_columns.html; no script, just the checked state). */
.save-new-box { position: absolute; opacity: 0; width: 1px; height: 1px; }
.save-new-toggle { display: inline-block; margin-top: 0.75rem; color: var(--primary); cursor: pointer; }
.save-new-toggle::before { content: "+ "; font-weight: 700; }
.save-new-box:checked ~ .save-new-toggle::before { content: "– "; }
.save-new-box:focus-visible ~ .save-new-toggle { outline: 2px solid var(--primary); outline-offset: 2px; }
.save-new-fields { display: none; }
.save-new-box:checked ~ .save-new-fields { display: block; }

/* Check now: the phone-validation-hours confirmation, shown as a modal dialog over the page
   (check.html, role alertdialog aria-modal). The backdrop blocks the page behind it; the choice
   is made with the two buttons (Proceed posts the skip, Cancel returns to the filled form). */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 900; display: flex;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(6, 52, 58, 0.45); backdrop-filter: blur(2px);
}
.phone-confirm {
  border-left: 4px solid var(--warn-fg); max-width: 30rem; margin: 0;
  box-shadow: var(--shadow);
}
.phone-confirm h2 { margin-top: 0; }
.phone-confirm .form-actions { margin-top: 0.5rem; }
/* ---- Platform Admin only: the Create subscriber form (R-64) ---- */
.field-error { color: var(--bad-fg); font-size: 0.875rem; font-weight: 600; }
.form-section { margin: 1.25rem 0 0; }
.form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: flex-start; }
.form-row > div { flex: 1 1 10rem; min-width: 0; }
