/* SynectPay
   A deliberately monochrome interface: black, white, and hairline greys.
   Colour appears only where it carries meaning — a status, a saving, a warning.
   Everything else earns attention through weight, spacing and rule work. */

:root {
  /* Ground and surfaces */
  --bg:          #ffffff;
  --surface:     #fafafa;
  --surface-2:   #f4f4f5;

  /* Ink. Near-black rather than pure, so large areas of text stay comfortable. */
  --ink:         #0a0a0b;
  --ink-2:       #52525b;
  --ink-3:       #8b8b93;

  /* Hairlines */
  --line:        #e6e6e9;
  --line-2:      #d6d6db;
  --line-ink:    #0a0a0b;

  /* Meaning-bearing colour only */
  --ok:          #15803d;
  --ok-bg:       #f0fdf4;
  --ok-line:     #bbf7d0;
  --warn:        #b45309;
  --warn-bg:     #fffbeb;
  --warn-line:   #fde68a;
  --danger:      #b91c1c;
  --danger-bg:   #fef2f2;
  --danger-line: #fecaca;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r:    10px;
  --r-sm: 7px;

  --shadow-sm: 0 1px 2px rgba(10, 10, 11, .05);
  --shadow:    0 1px 3px rgba(10, 10, 11, .07), 0 8px 24px -12px rgba(10, 10, 11, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
p  { margin: 0; }

a { color: var(--ink); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: .875em; font-variant-ligatures: none; }

::selection { background: var(--ink); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.muted   { color: var(--ink-3); }
.small   { font-size: .8125rem; }
.num     { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap  { white-space: nowrap; }
.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;
}

/* Micro-label: the small uppercase text that names a value. */
.eyebrow {
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ==========================================================================
   Checkout — a single centred column. The customer has one decision to make,
   so nothing competes with it.
   ========================================================================== */

.checkout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 20px;
}

.checkout-head {
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
}

.wordmark {
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: -.01em;
}
.wordmark span { color: var(--ink-3); font-weight: 400; }

.checkout-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card-wide { max-width: 520px; }

.card-head { margin-bottom: 24px; }
.card-head.center { text-align: center; }
.lede { margin-top: 6px; color: var(--ink-2); font-size: .9375rem; }

/* Status mark on the receipt page */
.mark {
  width: 44px; height: 44px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 20px; line-height: 1;
}
.mark-ok      { border-color: var(--ok-line);   background: var(--ok-bg);   color: var(--ok); }
.mark-pending { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }

/* --- forms --- */

.field { display: block; margin-bottom: 18px; }
.label {
  display: block;
  margin-bottom: 7px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink);
}
.opt  { font-weight: 400; color: var(--ink-3); }
.help { display: block; margin-top: 7px; font-size: .8125rem; color: var(--ink-3); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: #b4b4bb; }
input:hover, select:hover, textarea:hover { border-color: #bcbcc3; }
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 11, .09);
}
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
textarea { resize: vertical; min-height: 76px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2352525b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* The code field is the hero of the first screen.
   Qualified with the element so it outranks the input[type=...] base rule,
   whose `font: inherit` would otherwise strip the mono face. */
input.code-input {
  font-family: var(--mono);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
  padding: 15px 12px;
}
input.code-input::placeholder { letter-spacing: .16em; color: #c8c8ce; }
input.code-input-sm {
  font-size: 1rem; letter-spacing: .08em;
  text-align: left; padding: 10px 12px;
}

/* --- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #26262b; border-color: #26262b; }

.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); border-color: #bcbcc3; }

.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }

.btn-danger { background: var(--bg); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); }

.btn-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 11px; font-size: .8125rem; }
.btn + .btn-block { margin-top: 9px; }

/* --- summary rows --- */

.summary {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
}
.summary-row:last-child { border-bottom: 0; }
.summary-row > span { color: var(--ink-2); }
.summary-row > strong { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.summary-row.accent { background: var(--surface); }
.summary-row.accent > strong { color: var(--ok); }
.summary-row.total { background: var(--surface); border-top: 1px solid var(--line-2); }
.summary-row.total > span { color: var(--ink); font-weight: 500; }
.summary-row.total > strong { font-size: 1.0625rem; font-weight: 600; }

/* ---- Charge breakdown -----------------------------------------------------
   The itemised charges behind the amount due. Collapsed by default on accounts
   with arrears, where the list can run to a hundred lines. */
.breakdown {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  overflow: hidden;
}
.breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.breakdown-head::-webkit-details-marker { display: none; }
.breakdown-title { font-size: .875rem; font-weight: 500; color: var(--ink); }
.breakdown-hint {
  font-size: .8125rem;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.breakdown[open] .breakdown-head { border-bottom: 1px solid var(--line); }
.breakdown[open] .breakdown-hint { text-decoration: none; }
.breakdown-head:hover .breakdown-hint { color: var(--ink); }
.breakdown-head:focus-visible { outline: 2px solid var(--line-ink); outline-offset: -2px; }

.breakdown-body { background: var(--surface); }
/* Three years of arrears must not push the plan choice off the page. */
.breakdown-scroll { max-height: 20rem; overflow-y: auto; }

.bd-period { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bd-period:last-child { border-bottom: 0; }
.bd-period-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink);
}
.bd-period-head > strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-left: 12px;
  font-size: .8125rem;
  color: var(--ink-2);
}
.bd-line > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-oneoff { background: #fff; }
.bd-note { margin-top: 8px; font-size: .75rem; color: var(--ink-2); }
.bd-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line-2);
  font-size: .875rem;
  font-weight: 500;
}
.bd-total > strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.breakdown:not([open]) .bd-total { display: none; }

/* ---- How the customer wants to pay ---------------------------------------
   Manual is preselected and stays that way unless the customer moves it. */
.billing { border: 0; margin: 0 0 20px; padding: 0; }
.billing-legend {
  padding: 0 0 8px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink);
}
.billing-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: #fff;
}
.billing-option + .billing-option { margin-top: 8px; }
.billing-option:hover { border-color: var(--line-2); }
.billing-option:has(input:checked) {
  border-color: var(--line-ink);
  box-shadow: inset 0 0 0 1px var(--line-ink);
}
.billing-option input { margin-top: 2px; flex: none; }
.billing-body { display: flex; flex-direction: column; gap: 3px; }
.billing-title { font-size: .875rem; font-weight: 500; color: var(--ink); }
.billing-note { font-size: .8125rem; color: var(--ink-2); }
/* The consent wording only appears once that option is actually selected. */
.billing-consent { display: none; font-size: .75rem; color: var(--ink-2); }
.billing-option:has(input:checked) .billing-consent { display: block; margin-top: 5px; }

.autopay-on {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.autopay-on-head { display: flex; flex-direction: column; gap: 3px; font-size: .8125rem; }
.autopay-on-head > strong { font-size: .875rem; font-weight: 500; }
.autopay-on-head > span { color: var(--ink-2); }
.autopay-safety { font-size: .75rem; margin-top: 3px; }

.waiting {
  margin-bottom: 20px; padding: 11px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); font-size: .8125rem; color: var(--ink-2);
}
.waiting > strong { display: block; margin-bottom: 5px; font-size: .875rem; font-weight: 500; color: var(--ink); }
.waiting-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; }
.waiting-row > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- confirmation --- */
.confirm {
  max-width: 26rem; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--ink);
}
.confirm::backdrop { background: rgba(10, 10, 11, .45); }
.confirm h2 { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 600; }
.confirm p { margin: 0 0 18px; font-size: .875rem; color: var(--ink-2); line-height: 1.5; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-actions .btn { flex: 1 1 auto; min-width: 9rem; }

.notice {
  margin-bottom: 20px;
  padding: 11px 14px;
  font-size: .8125rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

/* --- plan chooser --- */

.plans { border: 0; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }

.plan { display: block; cursor: pointer; position: relative; }
.plan input { position: absolute; opacity: 0; width: 0; height: 0; }

.plan-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: border-color .12s ease, background .12s ease;
}
.plan:hover .plan-body { border-color: #b4b4bb; }

/* A real radio, drawn rather than relying on the native control. */
.plan-body::before {
  content: '';
  grid-row: 1 / span 2;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.plan input:checked + .plan-body {
  border-color: var(--line-ink);
  background: var(--surface);
}
.plan input:checked + .plan-body::before {
  border-color: var(--ink);
  border-width: 5px;
}
.plan input:focus-visible + .plan-body {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.plan-title { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.plan-price { text-align: right; font-variant-numeric: tabular-nums; }
.plan-total { display: block; font-weight: 600; font-size: 1rem; }
.plan-was   { display: block; font-size: .75rem; color: var(--ink-3); text-decoration: line-through; }
.plan-note  { grid-column: 2 / -1; font-size: .75rem; color: var(--ink-3); margin-top: 2px; }
.plan-save  { color: var(--ok); font-weight: 500; }

.tag {
  padding: 2px 7px;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
}

/* The confirmation panel sits between the choices and the commit, so it is
   given a little more presence than the informational summary above. */
.summary-selected { margin-top: 20px; border-color: var(--line-2); }
.summary-selected .summary-row.total strong { font-size: 1.1875rem; }

.hint { margin-top: 18px; font-size: .8125rem; color: var(--ink-3); text-align: center; }

/* --- alerts --- */

.alert {
  margin-bottom: 18px;
  padding: 11px 14px;
  font-size: .875rem;
  border: 1px solid;
  border-radius: var(--r-sm);
}
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.alert-info  { color: var(--ok);     background: var(--ok-bg);     border-color: var(--ok-line); }
.alert-warn  { color: var(--warn);   background: var(--warn-bg);   border-color: var(--warn-line); }

.foot {
  padding: 24px 0 32px;
  text-align: center;
  font-size: .75rem;
  color: var(--ink-3);
}
.foot .sep { margin: 0 7px; color: var(--line-2); }

.langswitch { margin-top: 8px; display: flex; gap: 10px; justify-content: center; }
.langswitch a { color: var(--ink-3); text-decoration: underline; }
.langswitch a:hover { color: var(--ink); }
.langswitch [aria-current] { color: var(--ink); font-weight: 500; }

/* ==========================================================================
   Admin — an application shell. Dense, scannable, quiet.
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 54px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: .9375rem; letter-spacing: -.01em; }
.brand span { color: var(--ink-3); font-weight: 400; }

.topbar nav { display: flex; gap: 2px; margin-right: auto; flex-wrap: wrap; }
.topbar nav a {
  padding: 6px 10px;
  font-size: .875rem;
  color: var(--ink-2);
  border-radius: var(--r-sm);
}
.topbar nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 500; background: var(--surface-2); }

.who { font-size: .8125rem; color: var(--ink-3); margin-right: 8px; }
.who em { font-style: normal; }
.inline { display: inline-flex; align-items: center; gap: 6px; }

.admin { max-width: 1200px; margin: 0 auto; padding: 26px 22px 64px; }
.admin-narrow { max-width: 720px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head p { color: var(--ink-2); font-size: .875rem; margin-top: 4px; }

/* --- stat row --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg);
}
.stat { padding: 16px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value {
  display: block;
  margin: 8px 0 3px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value em { font-style: normal; font-size: .8125rem; font-weight: 400; color: var(--ink-3); }
.stat-sub { display: block; font-size: .75rem; color: var(--ink-3); }

.panel {
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 18px;
}
.panel > h2 { margin-bottom: 14px; }
/* Reserved for the one screen that asks an operator to override a safety check,
   so it does not look like the panels around it. */
.panel-danger { border-color: var(--danger-line); background: var(--danger-bg); }
.panel-danger h2 { color: var(--danger); }
.consequences { margin: 0 0 14px; padding-left: 20px; font-size: .9rem; }
.consequences li + li { margin-top: 7px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }

/* --- chart --- */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 108px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line);
}
.bar-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar {
  width: 100%;
  min-height: 2px;
  background: var(--ink);
  opacity: .16;
  border-radius: 2px 2px 0 0;
  transition: opacity .12s ease;
}
.bar-wrap:hover .bar { opacity: .55; }
.bar.has-value { opacity: .82; }
.chart-legend {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: .6875rem; color: var(--ink-3);
}

/* A locked field should look locked, or an empty one reads as forgotten. */
input:disabled { background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; }

/* --- what a reference pays for --- */
.scope { border: 0; margin: 0 0 18px; padding: 0; }
.scope > .label { padding: 0 0 8px; display: block; }
.scope-option {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--bg); cursor: pointer;
}
.scope-option + .scope-option { margin-top: 7px; }
.scope-option:has(input:checked) { border-color: var(--line-ink); box-shadow: inset 0 0 0 1px var(--line-ink); }
.scope-option input { margin-top: 3px; flex: none; }
.scope-option strong { display: block; font-size: .875rem; font-weight: 500; }
.scope-option .help { margin-top: 2px; }

/* --- filters --- */

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 210px; }
.filters select { width: auto; min-width: 145px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .875rem; color: var(--ink-2); }
.check input { width: auto; accent-color: var(--ink); }

/* --- tables --- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  padding: 10px 12px;
  text-align: left;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * + * { margin-left: 5px; }
.panel > .table-wrap { border: 0; border-radius: 0; }
.panel > .table-wrap .table th { background: transparent; }

/* --- pills --- */

.pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill-ok   { color: var(--ok);     background: var(--ok-bg);     border-color: var(--ok-line); }
.pill-warn { color: var(--warn);   background: var(--warn-bg);   border-color: var(--warn-line); }
.pill-off  { color: var(--ink-3); }
.pill-bad  { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }

/* --- IPBILL verification panel --- */

.check-slot { margin: 0 0 18px; transition: opacity .12s ease; }
/* Only what is being replaced fades; the busy line itself stays legible, and on
   a first check there is nothing to fade at all -- hence the line. */
.check-slot.is-checking > :not(.check-busy) { opacity: .4; }
.check-busy {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 10px 12px;
  font-size: .8125rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}
.check-slot:empty { margin: 0; }

.check {
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .875rem;
}
.check-verified  { border-left-color: var(--ok);     background: var(--ok-bg); }
.check-mismatch  { border-left-color: var(--danger); background: var(--danger-bg); }
.check-unchecked { border-left-color: var(--line-2); }

.check-head { display: flex; align-items: baseline; gap: 9px; }
.check-mark {
  flex: none;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  color: #fff; background: var(--ink-3);
}
.check-verified .check-mark { background: var(--ok); }
.check-mismatch .check-mark { background: var(--danger); }

.check-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 11px 0 0;
  font-size: .8125rem;
}
.check-grid dt { color: var(--ink-3); }
.check-grid dd { margin: 0; font-variant-numeric: tabular-nums; }

.check-others { margin: 11px 0 0; font-size: .8125rem; color: var(--ink-3); }
.pick-service {
  font: inherit;
  font-family: var(--mono);
  font-size: .75rem;
  padding: 2px 8px;
  margin: 0 3px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
}
.pick-service:hover { border-color: var(--ink); }
.pick-service:disabled { cursor: not-allowed; }
.pick-service:disabled:hover { border-color: var(--line-2); }
.pick-inactive { opacity: .5; text-decoration: line-through; text-decoration-thickness: 1px; }

/* A row followed from elsewhere in the panel announces itself briefly, then
   settles down so the table reads normally again. */
.table tbody tr.is-highlight { animation: rowArrive 4s ease-out 1; }
.table tbody tr.is-highlight td { font-weight: 500; }

@keyframes rowArrive {
  0%, 55% { background: #fff8dd; box-shadow: inset 3px 0 0 var(--warn); }
  100%    { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .table tbody tr.is-highlight { animation: none; background: #fff8dd; }
}

.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: .875rem;
}
.pager {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 14px; font-size: .8125rem; color: var(--ink-3);
}
.pager-count { margin-right: auto; }
.pager-pages { display: inline-flex; align-items: center; gap: 12px; }
.pager-size { display: inline-flex; align-items: center; gap: 7px; }
.pager-size a { color: var(--ink-3); }
.pager-size a:hover { color: var(--ink); }
.pager-size strong { color: var(--ink); font-weight: 600; }

/* --- forms in the admin --- */

.form { max-width: 600px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-actions {
  display: flex; gap: 9px; align-items: center;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
input.sm, select.sm { padding: 5px 9px; font-size: .8125rem; width: auto; min-width: 105px; }
select.sm { padding-right: 26px; background-position: right 8px center; }
.kv { font-family: var(--mono); font-size: .75rem; color: var(--ink-2); }

.lines { border: 0; padding: 0; margin: 0 0 18px; }
.lines legend { padding: 0; margin-bottom: 7px; }
.linetable td { padding: 6px; }
.linetable input { padding: 7px 9px; font-size: .875rem; }
.linetable th.num { text-align: right; }
.linetable td:nth-child(2) { width: 96px; }
.linetable td:nth-child(3) { width: 132px; }
.summary-totals { margin-top: 14px; }
.row-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* A long unbreakable URL would otherwise stretch the panel past the viewport. */
.linkbox {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.linkbox-url {
  flex: 1;
  min-width: 0;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.linkbox .btn { flex: none; }
.kv + .kv { margin-left: 8px; }

@media (max-width: 760px) {
  .card { padding: 24px 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .admin { padding: 18px 14px 48px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
