:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-2: #6366f1;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --danger: #ef4444;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.span-12, .span-8, .span-6, .span-4 { }

.header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.75rem;
}

@media (max-width: 720px) {
  .header {
    grid-template-columns: 1fr;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.brand-mark {
  width: 10px;
  height: 10px;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.14);
  flex-shrink: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

strong {
  font-weight: 700;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.5;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint code {
  font-size: 0.85em;
  color: var(--accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.row.wrap {
  margin-top: 0.75rem;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn:hover {
  background: rgba(15, 23, 42, 0.03);
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: rgba(59, 130, 246, 0.35);
  color: #ffffff;
}

.btn.primary:hover {
  filter: brightness(0.98);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.file input {
  display: none;
}

.file span {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.file:hover span {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--text);
}

.field {
  margin-top: 0.5rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field select {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.field input:focus,
.field select:focus,
.ta:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.field-inline select {
  width: auto;
}

.chk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.small {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pill-ok {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.1);
}

.pill-warn {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.03);
}

.pill-muted {
  color: var(--muted);
}

.table-wrap {
  margin-top: 1rem;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.table-wrap.hidden {
  display: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

.table td.url {
  word-break: break-all;
  max-width: 340px;
}

.table .mini {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 220px;
}

.linkish {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.output {
  margin: 0;
  padding: 1rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}

.err {
  color: var(--danger);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.badge-ok {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.1);
}

.badge-no {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
}

.scan-ts {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

a.scan-link {
  font-size: 0.8rem;
  color: var(--accent);
}

.progress-panel {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0;
}

.progress-panel.hidden {
  display: none;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.progress-url {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
  max-height: 2.6em;
  overflow: hidden;
}

.mono {
  font-family: ui-monospace, monospace;
}

.ta {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.45;
  resize: vertical;
}

.num {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

/* ── auth / login ────────────────────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 1.25rem;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.auth-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-error {
  margin-top: 0.75rem;
  color: var(--danger);
  font-size: 0.9rem;
}
