:root { color-scheme: dark; }
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0a0e14;
  color: #cbd5e0;
  font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #1a2230;
  padding-bottom: 18px;
  margin-bottom: 56px;
}
.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e2e8f0;
  font-size: 14px;
}
.logo span { color: #4fc3f7; font-weight: 400; }
.tag {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.head-nav {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.head-link {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px dotted #64748b;
}
.head-link:hover { color: #4fc3f7; border-color: #4fc3f7; }

h1 {
  font-size: 28px;
  color: #f1f5f9;
  font-weight: 600;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 56px 0 18px;
  font-weight: 700;
}

form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

input[type=text] {
  flex: 1;
  background: #0f1620;
  border: 1px solid #1f2937;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 6px;
  font: 15px ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.12);
}

button {
  background: #1976d2;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 14px 22px;
  font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background .15s;
}
button:hover { background: #1565c0; }

.examples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.examples-label {
  color: #64748b;
  font-size: 11px;
  margin-right: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.examples button {
  background: transparent;
  border: 1px solid #1f2937;
  color: #94a3b8;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.examples button:hover {
  border-color: #4fc3f7;
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.06);
}

.claims ol {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: item;
}
.claims li {
  counter-increment: item;
  padding: 16px 0 16px 38px;
  border-top: 1px solid #1a2230;
  position: relative;
  color: #94a3b8;
}
.claims li:last-child { border-bottom: 1px solid #1a2230; }
.claims li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 16px;
  color: #4fc3f7;
  font-weight: 700;
  font-size: 13px;
}
.claims b { color: #e2e8f0; font-weight: 600; }
.claims .hint {
  margin-top: 28px;
  color: #64748b;
  font-size: 13px;
}
.claims .hint b { color: #4fc3f7; font-weight: 600; }

code {
  background: #0f1620;
  border: 1px solid #1f2937;
  padding: 2px 6px;
  border-radius: 4px;
  color: #4fc3f7;
  font-size: 13px;
}

a { color: #4fc3f7; text-decoration: none; border-bottom: 1px dotted #4fc3f7; }
a:hover { border-bottom-style: solid; }

.err { color: #ef9a9a; }
.error-hints {
  margin: 22px 0;
  padding: 0 0 0 18px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}
.error-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn-link {
  display: inline-block;
  background: #1976d2;
  color: #fff;
  border: 1px solid #1976d2;
  border-radius: 6px;
  padding: 11px 18px;
  font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.btn-link:hover { background: #1565c0; border-color: #1565c0; }
.btn-link-ghost { background: transparent; color: #94a3b8; border-color: #1f2937; }
.btn-link-ghost:hover { background: transparent; color: #4fc3f7; border-color: #4fc3f7; }
.err-detail {
  color: #94a3b8;
  font-size: 13px;
  background: #0f1620;
  border: 1px solid #1f2937;
  padding: 12px 14px;
  border-radius: 6px;
  word-break: break-word;
}
.hint { color: #64748b; font-size: 13px; }

/* Login page — header sits at the top (inheriting from .wrap); the password
   field sits a comfortable distance below, like the URL input on the landing
   page. No vertical centring — that pulled the header down with it. */
.login-form { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.login-form input[type=password] {
  flex: 1;
  min-width: 220px;
  background: #0f1620;
  border: 1px solid #1f2937;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 6px;
  font: 15px ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
  letter-spacing: 0.12em;
  transition: border-color .15s, box-shadow .15s;
}
.login-form input[type=password]:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.12);
}
.login-err { width: 100%; margin: 6px 0 0; font-size: 13px; }
.bd-sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ───────── Dashboard sections ─────────────────────────────────────── */

.wrap { max-width: 920px; }

.tier {
  padding: 28px 0 40px;
  border-bottom: 1px solid #1a2230;
}
.tier:last-of-type { border-bottom: none; }
.tier-head { margin-bottom: 18px; position: relative; padding-left: 44px; }
.tier-head h1 { font-size: 22px; margin: 0 0 4px; }
.tier-num {
  position: absolute;
  left: 0;
  top: 2px;
  color: #1f2937;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tier-head .sub {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

/* ───────── Cache list ─────────────────────────────────────────────── */

.cache-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cache-list .loading,
.cache-list .empty {
  color: #64748b;
  font-size: 13px;
  padding: 16px;
  text-align: center;
  border: 1px dashed #1f2937;
  border-radius: 6px;
}

.row {
  background: #0f1620;
  border: 1px solid #1f2937;
  border-radius: 6px;
  overflow: hidden;
}

.row-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 16px;
  align-items: center;
}

.row-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.domain { font-weight: 700; color: #e2e8f0; font-size: 14px; word-break: break-all; }
.row-meta .status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-meta .step { color: #94a3b8; font-size: 12px; }
.row-meta .step.err { color: #ef9a9a; }

.progress {
  height: 5px;
  background: #1a2230;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 360px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1976d2, #4fc3f7);
  border-radius: 999px;
  width: 0%;
  transition: width .4s ease;
}

.row-stats {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.row-stats:empty { display: none; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-processing { background: rgba(148, 163, 184, 0.08); color: #94a3b8; border-color: #334155; }
.badge-processing::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  margin-right: 6px;
  vertical-align: middle;
  animation: bd-pulse 1.4s infinite;
}
.badge-cached     { background: rgba(34, 197, 94, 0.08); color: #4ade80; border-color: #166534; }
.badge-failed     { background: rgba(239, 68, 68, 0.08); color: #f87171; border-color: #7f1d1d; }

@keyframes bd-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.btn {
  background: transparent;
  border: 1px solid #1f2937;
  color: #94a3b8;
  padding: 6px 12px;
  font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: #4fc3f7; color: #4fc3f7; }
.btn-open { background: #1976d2; color: #fff; border-color: #1976d2; }
.btn-open:hover { background: #1565c0; color: #fff; border-color: #1565c0; }
.btn-delete:hover { border-color: #b71c1c; color: #ef9a9a; }

/* Inline details panel */
.row-details {
  padding: 14px 16px 16px;
  border-top: 1px solid #1f2937;
  background: #0a1018;
  font-size: 12px;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
}
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 10px;
  background: #0f1620;
  border: 1px solid #1f2937;
  border-radius: 4px;
}
.kv span { color: #64748b; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.kv b { color: #e2e8f0; font-weight: 600; }
.subpages-label {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 8px;
  margin-bottom: 6px;
}
.subpages {
  margin: 0;
  padding: 0;
  list-style: none;
}
.subpages li {
  padding: 4px 0;
  border-bottom: 1px solid #131c28;
  word-break: break-all;
}
.subpages li:last-child { border-bottom: none; }
.subpages a { font-size: 12px; }
.muted { color: #64748b; font-size: 11px; }

.warn {
  background: rgba(202, 138, 4, 0.08);
  border: 1px solid #92400e;
  color: #fde68a;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
}
.warn code { background: #1a1408; border-color: #92400e; color: #fde68a; }

/* Tighter top spacing because the page now has two sections. */
.wrap > header { margin-bottom: 24px; }
.tier:first-of-type { padding-top: 8px; }

/* ───────── Compliance Audit (Tier 3) ──────────────────────────────── */

select {
  background: #0f1620;
  border: 1px solid #1f2937;
  color: #e2e8f0;
  padding: 14px 12px;
  border-radius: 6px;
  font: 15px ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
select:focus {
  border-color: #4fc3f7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.12);
}

.audit-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  margin-top: 8px;
}
.audit-ring {
  --ring-color: #4ade80;
  --ring-pct: 100;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(closest-side, #0a1018 79%, transparent 80% 100%),
    conic-gradient(var(--ring-color) calc(var(--ring-pct) * 1%), #1a2230 0);
}
.audit-score {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
}
.kv-bad b { color: #f87171; }
.audit-score-label {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.6;
}
.audit-cats {
  margin-bottom: 18px;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 14px;
}
.audit-table th,
.audit-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid #1a2230;
}
.audit-table thead th {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: #0a1018;
}
.audit-table tr:last-child td { border-bottom: none; }
.audit-table tbody tr:hover { background: rgba(79, 195, 247, 0.04); }
.audit-url { max-width: 280px; word-break: break-all; }
.audit-actions {
  margin-top: 14px;
}

#audit-result {
  margin-top: 16px;
  padding: 16px;
  background: #0a1018;
  border: 1px solid #1f2937;
  border-radius: 6px;
}

