:root {
  --paper: #f4f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --lake: #2563eb;
  --lake-deep: #1d4ed8;
  --lake-soft: #eff6ff;
  --danger: #b91c1c;
  --focus: #2563eb;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus {
  left: 8px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 20;
}

a { color: var(--lake); text-decoration: none; }
a:hover { color: var(--lake-deep); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.site-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 8;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  color: var(--lake);
  display: inline-flex;
  flex-shrink: 0;
}
.brand-mark svg { display: block; }
.brand-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand-name span { color: var(--lake); font-weight: 700; }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--muted);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a.is-active,
.site-nav a:hover {
  color: var(--lake);
  border-bottom-color: var(--lake);
}
.account { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff8e8;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 0.88rem;
}
.credits-coin { color: #f59e0b; font-size: 0.85rem; }
.account-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu {
  position: relative;
}
.account-menu form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.account-menu button {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  padding: 6px 10px;
}

main { padding: 28px 32px 64px; }
.messages { list-style: none; padding: 0; max-width: 1100px; margin: 0 auto 16px; }
.messages li {
  background: var(--card);
  border-left: 4px solid var(--lake);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.messages .error { border-left-color: var(--danger); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 8px;
}
h1, h2, h3 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.02em; }
.lede { color: var(--muted); max-width: 42rem; }

.auth-card, .card, .folio, .filters, .table-wrap, .pack-card, .pack-perks {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.auth-card { max-width: 420px; margin: 10vh auto; padding: 32px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 18px; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; }
input, select, button, summary { font: inherit; }
input, select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.primary, .ghost, .reveal-btn, .pack-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.primary {
  background: var(--lake);
  color: white;
  border-color: var(--lake);
}
.primary:hover { background: var(--lake-deep); color: white; }
.ghost {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
.quiet { color: var(--muted); font-size: 0.88rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.directory {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-areas:
    "filters hero"
    "filters results"
    "filters packs";
  gap: 20px 28px;
  align-items: start;
}
.directory-form { display: contents; }
.filters {
  grid-area: filters;
  padding: 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 76px;
}
.filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.filters h1 { font-size: 1rem; margin: 0; }
.filter-group { border-top: 1px solid var(--line); padding: 10px 0; }
.filter-group summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.check-list { display: grid; gap: 8px; margin-top: 10px; }
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
}
.check input { width: 16px; height: 16px; accent-color: var(--lake); }
.date-range {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.date-range label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.date-range input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--ink);
}

.hero { grid-area: hero; }
.hero h2 { font-size: 1.7rem; }
.hero p { color: var(--muted); margin: 0 0 16px; }
.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) auto;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.search-bar input { width: 100%; border: 0; background: transparent; padding: 8px 10px; }
.search-bar .primary { padding: 12px 22px; }

#results { grid-area: results; }
.results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.results-count { margin: 0; color: var(--muted); font-weight: 500; }
.export-actions, .phone-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.selection-count { color: var(--lake); font-weight: 600; font-size: 0.9rem; }
.unlock-btn { color: var(--lake); border-color: #bfdbfe; background: var(--lake-soft); }
.htmx-indicator { display: none; color: var(--muted); }
.htmx-request .htmx-indicator, .htmx-indicator.htmx-request { display: inline; }
#results.htmx-request { opacity: 0.65; transition: opacity 120ms ease; }

.export-menu { position: relative; }
.export-menu summary { list-style: none; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 240px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 4;
  display: grid;
  gap: 4px;
}
.export-panel a, .export-panel button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.export-panel a:hover, .export-panel button:hover { background: var(--paper); }

.table-wrap { overflow: auto; box-shadow: var(--shadow); }
table.companies {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
table.companies th, table.companies td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.companies th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: #fbfcfe;
}
table.companies tbody tr:hover { background: #f8fbff; }
.col-check { width: 36px; }
.company-name { color: var(--ink); font-weight: 600; }
.company-name:hover { color: var(--lake); }
.company-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.company-heading .badge { margin-left: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.badge-nouveau {
  background: var(--lake-soft);
  color: var(--lake-deep);
}
.badge-etab {
  background: #fef3c7;
  color: #92400e;
}
.muted { color: var(--muted); font-size: 0.88rem; }
.phone { font-variant-numeric: tabular-nums; color: var(--ink); }
.phone.masked, .phone-preview.masked { color: var(--muted); letter-spacing: 0.04em; }
.phone-locked { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reveal-btn {
  border-color: var(--line);
  background: white;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}
.reveal-btn small { color: var(--muted); font-weight: 500; }
.site { color: var(--lake); }

.empty {
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}
.pager {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}
.pager a, .pager-current, .pager-ellipsis {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ink);
}
.pager a { border: 1px solid var(--line); background: white; }
.pager-current { background: var(--lake); color: white; font-weight: 600; }

.packs { grid-area: packs; margin-top: 12px; }
.packs-copy { margin-bottom: 16px; }
.pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 220px;
  gap: 12px;
}
.pack-card { padding: 18px; text-align: center; box-shadow: var(--shadow); }
.pack-card.is-popular {
  background: var(--lake);
  color: white;
  border-color: var(--lake);
}
.pack-card.is-popular .muted { color: #dbeafe; }
.pack-badge {
  display: inline-block;
  background: #1e40af;
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pack-price { font-size: 1.7rem; font-weight: 700; margin: 8px 0 0; }
.pack-buy { width: 100%; margin-top: 12px; }
.pack-card.is-popular .ghost,
.pack-card.is-popular .primary { background: white; color: var(--lake); border-color: white; }
.pack-perks { padding: 18px; }
.pack-perks ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }

.folio { padding: 28px; box-shadow: var(--shadow); }
.folio-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.sector-chip {
  display: inline-flex;
  background: var(--lake-soft);
  color: var(--lake-deep);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card { padding: 18px; }
.card h2 { font-size: 0.95rem; }
dl { margin: 0; display: grid; gap: 10px; }
dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
dd { margin: 0; }

.app-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 420px;
  width: calc(100% - 32px);
}
.app-modal::backdrop { background: rgba(15, 23, 42, 0.45); }
.modal-card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px 20px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}
.modal-icon { color: var(--lake); margin-bottom: 8px; }
.phone-preview {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}
.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

.checkout-return { display: grid; place-items: start; padding: 40px 32px; }
.checkout-return .pack-card { max-width: 480px; }
.notice {
  background: var(--lake-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.maintenance {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}
.maintenance-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.maintenance-head h1 { margin: 0; font-size: 1.7rem; }
.maintenance-head .lede { margin: 8px 0 0; }
.maintenance-live {
  margin: 0;
  max-width: 22rem;
  background: var(--lake-soft);
  color: var(--lake-deep);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}
.method-status {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
}
.method-status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
}
.method-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}
.method-status-item.is-on .method-dot { background: #16a34a; }
.method-status-item.is-off {
  color: var(--muted);
}
.method-status-item.is-off .method-dot { background: #cbd5e1; }
.method-quota {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.method-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.maintenance-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.action-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  box-shadow: none;
}
.action-card h2 { font-size: 1.02rem; line-height: 1.3; }
.action-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.action-card form {
  margin-top: auto;
  display: grid;
  gap: 12px;
}
.action-card fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  display: grid;
  gap: 8px;
}
.action-card legend {
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.action-card .primary { justify-self: start; }
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
}
.schedule-help code,
.schedule-summary code {
  font-size: 0.85em;
}
.schedule-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-muted, #f4f4f2);
  border-radius: 8px;
  font-size: 0.88rem;
}
.schedule-summary p { margin: 0; }
.method-picks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.method-picks li { margin: 0; }
.method-picks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}
.method-picks label:has(input:checked) {
  border-color: #bfdbfe;
  background: var(--lake-soft);
  color: var(--lake-deep);
}
.method-picks input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--lake);
}
.limit-input {
  max-width: 8.5rem;
  font-variant-numeric: tabular-nums;
}
.errorlist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.86rem;
}
.maintenance-results {
  display: grid;
  gap: 20px;
}
.maintenance [hidden] { display: none !important; }
.result-card {
  display: grid;
  gap: 12px;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.result-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.result-message {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}
.result-message:empty { display: none; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill[data-status="running"] {
  color: var(--lake-deep);
  background: var(--lake-soft);
}
.status-pill[data-status="success"] {
  color: #166534;
  background: #f0fdf4;
}
.status-pill[data-status="failed"] {
  color: var(--danger);
  background: #fef2f2;
}
.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.75rem;
}
.stat-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.stat-board[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-board[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-board[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.snapshot-card, .history-block {
  display: grid;
  gap: 16px;
}
.history-block h2 {
  margin: 0;
  font-size: 1.05rem;
}
.history-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.snapshot-card .result-head {
  align-items: flex-start;
}
.snapshot-sectors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.snapshot-sectors li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.snapshot-sectors li:last-child { border-bottom: 0; }
.stat {
  padding: 16px 14px 14px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat.is-found .stat-value { color: var(--lake-deep); }
.stat.is-error .stat-value { color: var(--danger); }
.stat-toggle {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.stat-toggle:hover:not(:disabled),
.stat-toggle[aria-expanded="true"] {
  background: #fef2f2;
}
.stat-toggle:disabled { cursor: default; }
.stat-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.error-panel {
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 16px 18px;
  background: #fff;
  display: grid;
  gap: 12px;
}
.error-panel[hidden] { display: none !important; }
.error-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}
.error-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.9rem;
}
.error-table-wrap { overflow: auto; }
.error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.error-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 8px 0;
}
.error-table td {
  padding: 8px 12px 8px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.error-table td:last-child { color: var(--danger); }
.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lake);
  width: 0;
  transition: width 180ms ease;
}
.progress-label {
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
}
.admin-nav a:hover,
.admin-nav a.is-active {
  color: var(--lake-deep);
  background: var(--lake-soft);
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.admin-stats .card {
  display: grid;
  gap: 5px;
}
.admin-stats strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.admin-stats span { color: var(--muted); }
.admin-section {
  display: grid;
  gap: 16px;
}
.admin-section > h2 { margin: 0; }
.admin-section > .stack { max-width: 34rem; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  background: #fbfcfe;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-inline-form { min-width: 11rem; }
.admin-inline-form input { min-width: 0; width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.admin-create-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account-list {
  display: grid;
  gap: 16px;
}
.account-card {
  display: grid;
  gap: 16px;
}
.account-card.is-inactive {
  background: #f8fafc;
}
.account-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.account-identity h3 {
  margin: 0;
  font-size: 1.08rem;
}
.account-identity p { margin: 4px 0 0; }
.account-meta { color: var(--muted); font-size: 0.88rem; }
.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.account-badges .badge { margin-left: 0; }
.account-balance {
  margin: 0;
  text-align: right;
  display: grid;
  gap: 2px;
}
.account-balance strong {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.account-balance span {
  color: var(--muted);
  font-size: 0.82rem;
}
.account-actions {
  display: grid;
  grid-template-columns: minmax(16rem, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}
.account-panel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.account-panel h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.account-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.account-history li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  font-size: 0.9rem;
}
.account-history-amount,
.admin-table .is-plus,
.admin-table .is-minus {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.is-plus { color: #166534; }
.is-minus { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}

@media (max-width: 1100px) {
  .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .directory {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "filters"
      "results"
      "packs";
  }
  .filters { position: static; }
  .search-bar, .card-grid, .maintenance-actions, .stat-board, .stat-board[data-cols="2"], .stat-board[data-cols="5"], .stat-board[data-cols="6"], .admin-stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .maintenance-head { flex-direction: column; align-items: stretch; }
  .admin-create-form,
  .account-actions,
  .account-history li { grid-template-columns: 1fr; }
  .account-balance { text-align: left; }
  .admin-nav { overflow-x: auto; flex-wrap: nowrap; }
  .admin-nav a { white-space: nowrap; }
  .site-header { flex-wrap: wrap; }
  .account { margin-left: 0; width: 100%; justify-content: space-between; }
  main { padding: 16px; }
}
