/* ---------------------------------------------------------------------------
   TYPEFACE

   All type in the app flows through the three variables below, so changing the
   whole look is a one-line edit.

   The default is the system type already installed on the machine. It downloads
   nothing, so the console paints immediately even on a slow connection - which
   also means no render delay while a web font loads.

   Want a different feel? Pick ONE of the options further down, paste its two
   lines over the defaults in the :root block, and if it names a web font also
   move its @import to the very top of this file (an @import must come before
   every other rule).

   OPTION A - Plus Jakarta Sans. Rounded and friendly, a little softer.
     @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
     --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
     --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
     --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

   OPTION B - Source Sans 3. Plain, sober, newsprint-like. Very easy to read.
     @import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Source+Code+Pro:wght@400;500&display=swap');
     --font-display: 'Source Sans 3', system-ui, sans-serif;
     --font-body:    'Source Sans 3', system-ui, sans-serif;
     --font-mono:    'Source Code Pro', ui-monospace, Menlo, monospace;

   OPTION C - Roboto. Neutral and familiar, the Android/Google default.
     @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono:wght@400;500&display=swap');
     --font-display: 'Roboto', system-ui, sans-serif;
     --font-body:    'Roboto', system-ui, sans-serif;
     --font-mono:    'Roboto Mono', ui-monospace, Menlo, monospace;
   --------------------------------------------------------------------------- */

/* ==========================================================================
   Zurihub Scrapper
   Ink-navy operations console. Electric indigo drives action, mint/amber/rose
   carry state. Space Grotesk labels, IBM Plex Mono for every number.
   ========================================================================== */

:root {
  --ink:        #0B1120;
  --ink-deep:   #070C17;
  --surface:    #121A2B;
  --surface-2:  #18223A;
  --surface-3:  #1E2A45;
  --line:       #253150;
  --line-soft:  #1B2439;

  --text:       #E4EAF6;
  --text-dim:   #B4C0D6;
  --muted:      #8494B0;
  --muted-deep: #63718C;

  --indigo:     #7C6BFF;
  --indigo-hi:  #9488FF;
  --indigo-dim: #4A3FA8;
  --mint:       #3FD5A0;
  --amber:      #FFB020;
  --rose:       #FF5470;

  --radius:     10px;
  --radius-sm:  7px;
  --radius-lg:  14px;

  --font-display: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --shadow: 0 18px 48px rgba(3, 7, 18, 0.55);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(124, 107, 255, 0.13), transparent 60%),
    radial-gradient(900px 520px at 105% 0%, rgba(63, 213, 160, 0.07), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0; }
a { color: var(--indigo-hi); }

:focus-visible {
  outline: 2px solid var(--indigo-hi);
  outline-offset: 2px;
  border-radius: 4px;
}

.sprite { position: absolute; }

.icon {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-lg { width: 34px; height: 34px; stroke-width: 1.3; }

/* ---------------------------------------------------------------- Brand -- */

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-center { justify-content: center; margin-bottom: 22px; }

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--ink-deep);
  background: linear-gradient(150deg, var(--indigo-hi), var(--indigo) 55%, var(--indigo-dim));
  box-shadow: 0 5px 16px rgba(124, 107, 255, 0.4);
}
.brand-mark .icon, .brand-mark svg { width: 19px; height: 19px; stroke-width: 1.8; fill: none; stroke: currentColor; }

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-text em { font-style: normal; font-weight: 500; color: var(--muted); }

/* -------------------------------------------------------------- Top bar -- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px clamp(14px, 3vw, 30px);
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-meta { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--indigo-dim); background: var(--surface-2); }

.version { font-family: var(--font-mono); font-size: 12px; color: var(--muted-deep); }

/* ---------------------------------------------------------------- Chips -- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.chip-quiet { font-size: 11px; }
.chip[data-state="running"], .chip[data-state="discovering"] {
  color: var(--amber); border-color: rgba(255, 176, 32, 0.45); background: rgba(255, 176, 32, 0.1);
}
.chip[data-state="completed"] {
  color: var(--mint); border-color: rgba(63, 213, 160, 0.45); background: rgba(63, 213, 160, 0.1);
}
.chip[data-state="failed"], .chip[data-state="cancelled"] {
  color: var(--rose); border-color: rgba(255, 84, 112, 0.45); background: rgba(255, 84, 112, 0.1);
}
.chip[data-state="queued"] {
  color: var(--indigo-hi); border-color: rgba(124, 107, 255, 0.45); background: rgba(124, 107, 255, 0.12);
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.tag-mint { background: rgba(63, 213, 160, 0.15); color: var(--mint); }

/* --------------------------------------------------------------- Layout -- */

.shell {
  display: grid;
  grid-template-columns: 366px minmax(0, 1fr);
  gap: 18px;
  padding: 20px clamp(14px, 3vw, 30px) 60px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
}
.setup-card   { grid-column: 1; }
.console-card { grid-column: 2; }
.results-card { grid-column: 1 / -1; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .setup-card, .console-card, .results-card { grid-column: 1; }
}

.panel {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(18, 26, 43, 0.72) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* --------------------------------------------------------------- Fields -- */

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted-deep); line-height: 1.45; }

.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted-deep); }
.field input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(124, 107, 255, 0.18);
}
.field input[type="number"] { -moz-appearance: textfield; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-narrow { max-width: 110px; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- Switches -- */

.switch-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 0;
  cursor: pointer;
  border-top: 1px solid var(--line-soft);
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
  position: relative; flex: none;
  width: 38px; height: 21px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background .18s, border-color .18s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s, background .18s;
}
.switch-row input:checked + .switch-track { background: rgba(124, 107, 255, 0.32); border-color: var(--indigo); }
.switch-row input:checked + .switch-track .switch-thumb { transform: translateX(17px); background: var(--indigo-hi); }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--indigo-hi); outline-offset: 2px; }

.switch-text { display: block; min-width: 0; }
.switch-title { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); }
.switch-note { display: block; font-size: 12.5px; color: var(--muted-deep); line-height: 1.45; }

/* -------------------------------------------------------------- Buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: var(--indigo-dim); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(160deg, var(--indigo-hi), var(--indigo) 60%, var(--indigo-dim));
  border-color: transparent;
  color: #0A0E1B;
  box-shadow: 0 8px 22px rgba(124, 107, 255, 0.3);
}
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; }

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-block { width: 100%; }
.btn-lg { padding: 12px 18px; font-size: 14.5px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-sm .icon { width: 15px; height: 15px; }

.text-btn {
  border: 0; background: none; padding: 0;
  color: var(--muted); font-family: var(--font-body); font-size: 12.5px;
  cursor: pointer;
}
.text-btn:hover { color: var(--text); }

.setup-buttons { margin-top: 6px; display: grid; gap: 9px; }
.fine-print { margin-top: 13px; font-size: 12px; color: var(--muted-deep); text-align: center; }

.advanced { margin: 4px 0 14px; }
.advanced > summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 0;
  list-style: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: '+ '; color: var(--indigo-hi); }
.advanced[open] > summary::before { content: '- '; }
.advanced > summary:hover { color: var(--text); }

/* -------------------------------------------------------------- Console -- */

.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.console-head .panel-title { margin-bottom: 0; }

.phase-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}

.counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}
.counter { text-align: center; }
.counter-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.counter-ok { color: var(--mint); }
.counter-bad { color: var(--rose); }
.counter-label {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-deep);
}
@media (max-width: 520px) { .counters { grid-template-columns: repeat(2, 1fr); row-gap: 16px; } }

/* --- Signature: the batch ladder --- */

.ladder-block { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.ladder-head, .log-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.ladder-title {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
}
.ladder-progress {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--indigo-hi);
}

.ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.ladder-empty {
  font-size: 12.5px;
  color: var(--muted-deep);
  font-family: var(--font-body);
}

.ladder-cell {
  position: relative;
  flex: 1 1 62px;
  min-width: 62px;
  padding: 9px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
  overflow: hidden;
  text-align: left;
}
.ladder-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(124, 107, 255, 0.3), rgba(124, 107, 255, 0.12));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.ladder-num, .ladder-count {
  position: relative;
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.ladder-num { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-deep); }
.ladder-count { font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin-top: 1px; }

.ladder-cell[data-state="active"] { border-color: var(--amber); }
.ladder-cell[data-state="active"] .ladder-fill { background: linear-gradient(90deg, rgba(255, 176, 32, 0.34), rgba(255, 176, 32, 0.1)); }
.ladder-cell[data-state="active"] .ladder-num { color: var(--amber); }
.ladder-cell[data-state="active"]::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 32, 0.35);
  animation: pulse 1.6s ease-in-out infinite;
}
.ladder-cell[data-state="done"] { border-color: rgba(63, 213, 160, 0.5); }
.ladder-cell[data-state="done"] .ladder-fill { background: linear-gradient(90deg, rgba(63, 213, 160, 0.26), rgba(63, 213, 160, 0.08)); }
.ladder-cell[data-state="done"] .ladder-num { color: var(--mint); }
.ladder-cell[data-state="done"] .ladder-count { color: var(--text); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.32; } }
@media (prefers-reduced-motion: reduce) {
  .ladder-cell[data-state="active"]::after { animation: none; }
  .ladder-fill { transition: none; }
}

/* --- Activity log --- */

.log-block { padding-top: 15px; }
.log {
  max-height: 200px;
  overflow-y: auto;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  scrollbar-width: thin;
}
.log-line { color: var(--text-dim); overflow-wrap: anywhere; }
.log-time { color: var(--muted-deep); margin-right: 9px; }
.log-muted { color: var(--muted-deep); }
.log-ok { color: var(--mint); }
.log-warn { color: var(--amber); }
.log-error { color: var(--rose); }

.log::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* -------------------------------------------------------------- Results -- */

.results-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.results-head .panel-title { margin-bottom: 4px; }
.results-sub { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.results-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.export-bar {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(30, 42, 69, 0.42);
}
.export-label {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
}
.export-buttons { display: flex; gap: 7px; flex-wrap: wrap; }

.btn-export { padding: 7px 12px; font-size: 12.5px; background: var(--surface); }
.btn-export .icon { width: 15px; height: 15px; }
.btn-export-strong {
  background: rgba(124, 107, 255, 0.16);
  border-color: var(--indigo-dim);
  color: var(--indigo-hi);
}
.btn-export-strong:hover { background: rgba(124, 107, 255, 0.26); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }

.results-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.results-table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 13px;
  text-align: left;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.results-table tbody tr { border-bottom: 1px solid var(--line-soft); transition: background .12s; }
.results-table tbody tr:last-child { border-bottom: 0; }
.results-table tbody tr.product-row { cursor: pointer; }
.results-table tbody tr.product-row:hover { background: rgba(30, 42, 69, 0.5); }
.results-table td { padding: 11px 13px; vertical-align: middle; }

.col-img { width: 74px; }
.col-price { width: 118px; }
.col-meta { width: 190px; }
.col-src { width: 82px; }

.thumb {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line);
  display: block;
}
.thumb-none {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  color: var(--muted-deep);
}
.thumb-none .icon { width: 18px; height: 18px; }

.prod-name {
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.prod-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-deep);
}

.price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.price-was { color: var(--muted-deep); text-decoration: line-through; }
.price-now { color: var(--mint); font-weight: 600; }
.price-none { color: var(--muted-deep); }

.pill-row { display: flex; gap: 5px; flex-wrap: wrap; }
.pill {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.pill-on { color: var(--mint); border-color: rgba(63, 213, 160, 0.35); }

.src-link {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.src-link:hover { color: var(--indigo-hi); border-color: var(--indigo-dim); }

.empty-row td { padding: 0; }
.empty-state { padding: 52px 20px; text-align: center; color: var(--muted-deep); }
.empty-state .icon-lg { color: var(--surface-3); margin-bottom: 12px; }
.empty-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--muted); }
.empty-note { font-size: 13px; margin-top: 4px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.pager-info { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- Drawer -- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 9, 20, 0.68);
  backdrop-filter: blur(3px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(560px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(3, 7, 18, 0.6);
  animation: slideIn .22s cubic-bezier(.4, 0, .2, 1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

.dz { margin-bottom: 22px; }
.dz-label {
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted-deep);
  margin-bottom: 8px;
}
.dz-text { font-size: 14px; color: var(--text-dim); line-height: 1.6; overflow-wrap: anywhere; }
.dz-text img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gallery img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-3);
}

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--line-soft); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table td { padding: 7px 0; font-size: 13.5px; vertical-align: top; }
.spec-table td:first-child { width: 42%; color: var(--muted); padding-right: 14px; }
.spec-table td:last-child { color: var(--text-dim); font-family: var(--font-mono); font-size: 12.5px; }

.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-big { font-family: var(--font-mono); font-size: 25px; font-weight: 600; color: var(--mint); }
.price-strike { font-family: var(--font-mono); font-size: 16px; color: var(--muted-deep); text-decoration: line-through; }

/* ---------------------------------------------------------------- Modal -- */

.modal {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(5, 9, 20, 0.7);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(680px, 100%);
  max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { overflow-y: auto; padding: 8px 20px 20px; }

.job-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.job-row:last-child { border-bottom: 0; }
.job-main { flex: 1; min-width: 0; }
.job-host { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.job-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-deep); margin-top: 2px; }
.job-actions { display: flex; gap: 6px; flex: none; }

/* --------------------------------------------------------------- Toasts -- */

.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 9px;
  max-width: min(400px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--text-dim);
  animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-ok    { border-left-color: var(--mint); }
.toast-ok .icon { color: var(--mint); }
.toast-error { border-left-color: var(--rose); }
.toast-error .icon { color: var(--rose); }
.toast-info  { border-left-color: var(--indigo); }
.toast-info .icon { color: var(--indigo-hi); }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------------------------------------------- Setup / login templates -- */

.setup-body { padding: 0; }
.setup-wrap { max-width: 700px; margin: 0 auto; padding: 26px clamp(14px, 4vw, 24px) 60px; }
.setup-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.setup-wrap .panel { margin-bottom: 16px; }
.setup-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.setup-lede { color: var(--muted); font-size: 14.5px; }
.setup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.setup-foot { text-align: center; font-size: 12.5px; color: var(--muted-deep); margin-top: 26px; }
.setup-form { margin: 0; }
.mt-16 { margin-top: 16px; }

.login-wrap { max-width: 400px; margin: 0 auto; padding: 12vh 18px 40px; }
.login-panel .btn { margin-top: 6px; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.check:last-child { border-bottom: 0; }
.check-icon { display: grid; place-items: center; }
.check-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.check.is-ok .check-icon { color: var(--mint); }
.check.is-bad .check-icon { color: var(--rose); }
.check.is-warn .check-icon { color: var(--amber); }
.check-label { color: var(--text-dim); }
.check-value { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.check-fix { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted-deep); }

.radio-card {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-deep);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.radio-card:hover { border-color: var(--indigo-dim); }
.radio-card input { margin-top: 4px; accent-color: var(--indigo); flex: none; }
.radio-card:has(input:checked) { border-color: var(--indigo); background: rgba(124, 107, 255, 0.08); }
.radio-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.radio-note { display: block; font-size: 12.5px; color: var(--muted-deep); margin-top: 3px; line-height: 1.45; }

.mysql-fields { padding: 4px 0 0; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left-width: 3px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.alert-bad { border-left-color: var(--rose); background: rgba(255, 84, 112, 0.09); color: #FFC2CD; }
.alert p + p { margin-top: 5px; }

.code-block {
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-dim);
}
.hint { font-size: 12.5px; color: var(--muted-deep); line-height: 1.5; }

[hidden] { display: none !important; }

/* "Fetch images" while files are still pending: this step is manual, so it needs
   to read as an action rather than sit quietly in the toolbar. */
.btn-attention {
  border-color: var(--indigo);
  color: var(--indigo-hi);
  background: color-mix(in srgb, var(--indigo) 12%, transparent);
}
.btn-attention:hover { background: color-mix(in srgb, var(--indigo) 20%, transparent); }
@supports not (color: color-mix(in srgb, red, blue)) {
  .btn-attention { background: rgba(124, 107, 255, 0.12); }
  .btn-attention:hover { background: rgba(124, 107, 255, 0.2); }
}
