/*
 * ClipFast stylesheet.
 *
 * Hand-written rather than generated, for three reasons that matter to this
 * product: it is ~12 KB so it inlines into the first round trip and keeps LCP
 * fast, it needs no build step (one less thing to break in deployment), and it
 * uses CSS *logical properties* throughout — margin-inline-start rather than
 * margin-left — so the Arabic RTL layout is genuinely mirrored rather than
 * patched with [dir="rtl"] overrides.
 *
 * Everything is mobile-first: the base rules describe the phone layout and
 * media queries only add to it.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;

  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-raised: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --success: #15803d;
  --success-soft: #f0fdf4;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow: 0 4px 16px rgb(15 23 42 / 0.08);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --container: 68rem;
  --tap: 44px; /* minimum comfortable touch target */

  /* A stack that renders Arabic well on every platform without a webfont
     download: system Arabic faces first, then the Latin system stack. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic",
    "Geeza Pro", "Dubai", "Tahoma", "Arial", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --brand: #60a5fa;
  --brand-strong: #3b82f6;
  --brand-soft: #172554;

  --bg: #0b1120;
  --bg-subtle: #111827;
  --bg-raised: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #0b1120;

  --success: #4ade80;
  --success-soft: #052e16;
  --danger: #f87171;
  --danger-soft: #450a0a;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 4px 16px rgb(0 0 0 / 0.5);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Arabic renders better with slightly more line height and larger glyphs. */
[dir="rtl"] body { line-height: 1.85; font-size: 1.05rem; }

img, svg, video { max-width: 100%; height: auto; display: block; }
svg { fill: none; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 var(--space-3); font-weight: 700; }
p { margin: 0 0 var(--space-4); }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

button, input, select, textarea { font: inherit; color: inherit; }

/* Visible focus everywhere — required for keyboard accessibility. */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }

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

/* ---------------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.site-main { min-height: 60vh; }
.section { margin-block: var(--space-7); }
.section-title { font-size: 1.35rem; margin-bottom: var(--space-4); }
.section-more { margin-top: var(--space-4); }

.icon-inline-end { vertical-align: -2px; margin-inline-start: 4px; }
[dir="rtl"] .icon-inline-end { transform: scaleX(-1); }

/* ---------------------------------------------------------------- header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
}
.brand-mark { color: var(--brand); }

.header-nav {
  display: none;
  gap: var(--space-4);
  margin-inline-start: var(--space-4);
}
.header-nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.header-nav a:hover { color: var(--text); }

.header-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-button {
  min-width: var(--tap);
  min-height: var(--tap);
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
}
.icon-button:hover { background: var(--bg-subtle); color: var(--text); }

.lang-form { margin: 0; }
.lang-button {
  min-height: var(--tap);
  padding-inline: var(--space-3);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.lang-button:hover { background: var(--bg-subtle); }

@media (min-width: 48rem) {
  .header-nav { display: flex; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  background: linear-gradient(180deg, var(--bg-subtle), var(--bg));
  padding-block: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--border);
}

.hero-inner { text-align: center; }

.hero-title {
  font-size: clamp(1.6rem, 5.5vw, 2.6rem);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  color: var(--text-muted);
  max-width: 40rem;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}
.hero-subtitle strong { color: var(--text); }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { color: var(--success); }

/* -------------------------------------------------------------- url form */
.url-form { max-width: 40rem; margin-inline: auto; text-align: start; }

.url-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
}

.url-input-row { display: flex; flex-direction: column; gap: var(--space-2); }

.url-input {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-size: 1rem;
}
.url-input:focus { border-color: var(--brand); outline: none; }
.url-input::placeholder { color: var(--text-muted); }

.url-submit { min-height: 52px; font-size: 1.05rem; }

.url-hint {
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.url-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.url-error svg { flex: none; margin-top: 3px; }

.secondary-action {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.secondary-divider { color: var(--text-muted); font-size: 0.85rem; }

@media (min-width: 36rem) {
  .url-input-row { flex-direction: row; }
  .url-input { flex: 1; }
  .url-submit { flex: none; padding-inline: var(--space-5); }
}

/* --------------------------------------------------------------- buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--bg-raised);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--bg-subtle); }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }

.button--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }

.button--ghost { border-color: var(--border-strong); }
.button--block { width: 100%; }
.button--small { min-height: 36px; font-size: 0.875rem; padding-inline: var(--space-3); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgb(255 255 255 / 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  min-height: 40px;
  padding-inline: var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------ tool cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.tool-card:hover { border-color: var(--brand); color: var(--brand); }
.tool-icon { color: var(--brand); }
.tool-name { font-weight: 600; font-size: 0.9rem; }

.tool-list { display: grid; gap: var(--space-2); }
.tool-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
}
.tool-list-item:hover { border-color: var(--brand); }
.tool-list-item strong { display: block; }
.tool-list-item small { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

@media (min-width: 36rem) { .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------ value grid */
.value-grid { display: grid; gap: var(--space-4); }
.value-card {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.value-card h3 { font-size: 1.05rem; }
.value-card p { margin: 0; color: var(--text-muted); }

@media (min-width: 48rem) { .value-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ----------------------------------------------------------------- steps */
.steps { padding-inline-start: 1.25rem; display: grid; gap: var(--space-3); }
.steps li { padding-inline-start: var(--space-1); }

.steps--horizontal {
  list-style: none;
  padding: 0;
  grid-template-columns: 1fr;
  counter-reset: step;
}
.steps--horizontal li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 0;
}
.step-number {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
}
@media (min-width: 48rem) {
  .steps--horizontal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------- article */
.article { padding-block: var(--space-5); }
.article--narrow { max-width: 44rem; }
.prose { color: var(--text-muted); max-width: 42rem; }
.prose.lead { font-size: 1.05rem; }

.breadcrumbs { padding-block: var(--space-3); }
.breadcrumbs ol {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  list-style: none; margin: 0;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumbs li + li::before { content: "›"; margin-inline-end: var(--space-2); }
[dir="rtl"] .breadcrumbs li + li::before { content: "‹"; }

/* ------------------------------------------------------------------- faq */
.faq-list { display: grid; gap: var(--space-2); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: var(--space-3) var(--space-4);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}
.faq-item p { margin: var(--space-2) 0 0; color: var(--text-muted); }

/* ------------------------------------------------------------- workspace */
.workspace { padding-block: var(--space-5); max-width: 46rem; }
.workspace-title { font-size: 1.5rem; }

.source-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}

.source-thumb img,
.source-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.source-thumb-placeholder { display: grid; place-items: center; color: var(--text-muted); }

.source-title { font-size: 1.15rem; margin-bottom: var(--space-3); overflow-wrap: anywhere; }

.source-facts { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: 0; }
.source-facts dt { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.source-facts dd { margin: 0; font-weight: 600; }

@media (min-width: 36rem) {
  .source-card { grid-template-columns: 240px 1fr; align-items: start; }
}

/* -------------------------------------------------------- action picker */
.action-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-block: var(--space-5);
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 88px;
  padding: var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
}
.action-button:hover { border-color: var(--brand-strong); }
.action-button svg { color: var(--brand); }
.action-button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.more-actions { margin-bottom: var(--space-5); }
.more-actions summary {
  cursor: pointer;
  font-weight: 600;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  color: var(--text-muted);
}
.more-actions-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); }

@media (min-width: 36rem) { .action-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- panels */
.panel {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  margin-bottom: var(--space-5);
}
.panel-title { font-size: 1.15rem; display: flex; align-items: center; gap: var(--space-2); }
.panel-title--success { color: var(--success); }
.panel-title--error { color: var(--danger); }
.panel-note { color: var(--text-muted); font-size: 0.9rem; }
.panel--error { border-color: var(--danger); }
.error-text { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--danger); }

.field { display: block; margin-bottom: var(--space-4); }
.field-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: var(--space-2); }
.field select, .field input[type="number"], .field input[type="text"] {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
}
.field-row { display: grid; gap: var(--space-3); }
@media (min-width: 36rem) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.checkbox { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); cursor: pointer; }

/* -------------------------------------------------------- quality list */
.quality-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.quality-info { display: flex; flex-direction: column; gap: 2px; }
.quality-label { font-weight: 700; font-size: 1.05rem; }
.quality-detail, .quality-size { color: var(--text-muted); font-size: 0.85rem; }

/* -------------------------------------------------------------- timeline */
.timeline { margin-block: var(--space-4); }

.timeline-track {
  position: relative;
  height: 56px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  touch-action: none; /* let the handles own the gesture */
}

.timeline-selection {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--brand-soft);
  border-inline: 2px solid var(--brand);
}

.timeline-handle {
  position: absolute;
  top: -6px;
  width: 28px;
  height: 68px;
  margin-inline-start: -14px;
  border: none;
  background: transparent;
  cursor: ew-resize;
  padding: 0;
  touch-action: none;
}
.timeline-handle::after {
  content: "";
  display: block;
  width: 6px;
  height: 100%;
  margin-inline: auto;
  border-radius: 3px;
  background: var(--brand);
  box-shadow: var(--shadow-sm);
}
.timeline-handle:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 2px; }

.timeline-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.time-fields { display: grid; gap: var(--space-4); }
.time-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: var(--space-2); }
.time-field input {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 1rem;
  text-align: center;
}
.nudge-row { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.nudge {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.nudge:hover { border-color: var(--brand); color: var(--brand); }

.clip-summary { font-variant-numeric: tabular-nums; }
.clip-savings { color: var(--success); font-weight: 600; margin-inline-start: var(--space-2); }

.inline-range { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.inline-range label { font-weight: 600; font-size: 0.9rem; }
.inline-range input {
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  text-align: center;
}
@media (min-width: 36rem) {
  .time-fields, .inline-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------- choices */
.mode-choice { border: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: var(--space-2); }
.mode-choice legend { font-weight: 600; font-size: 0.9rem; padding: 0; margin-bottom: var(--space-2); }

.radio-card {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input { margin-inline-end: var(--space-2); }
.radio-title { font-weight: 700; }
.radio-note { color: var(--text-muted); font-size: 0.85rem; }

.size-targets { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.radio-chip { position: relative; cursor: pointer; }
.radio-chip input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.radio-chip span {
  display: grid;
  place-items: center;
  min-height: var(--tap);
  min-width: 72px;
  padding-inline: var(--space-3);
  border: 2px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
}
.radio-chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.radio-chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* -------------------------------------------------------------- progress */
.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-block: var(--space-3);
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.4s ease;
}

.job-stage {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.result-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  background: var(--success-soft);
  margin-bottom: var(--space-3);
}
.result-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); color: var(--text-muted); font-size: 0.9rem; }
.result-format { font-weight: 700; color: var(--text); }

.expiry-note, .workspace-privacy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.workspace-privacy { justify-content: center; margin-top: var(--space-5); }

.chain-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------------------------------------------------------------- upload */
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone svg { color: var(--brand); }
.dropzone-title { font-weight: 600; color: var(--text); margin: 0; }
.dropzone-note { font-size: 0.85rem; margin: 0; }

.local-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------- recent */
.recent-list { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-2); }
.recent-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.recent-row--active { border-color: var(--brand); background: var(--brand-soft); }
.recent-main { flex: 1 1 14rem; min-width: 0; }
.recent-operation { font-weight: 600; }
.recent-title {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: block;
  overflow-wrap: anywhere;
}
.recent-error { display: block; color: var(--danger); font-size: 0.85rem; }
.recent-stage { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.recent-main .progress { margin-block: var(--space-2) 4px; }
.recent-status { font-size: 0.85rem; color: var(--text-muted); }
.recent-status--completed { color: var(--success); font-weight: 600; }
.recent-status--failed { color: var(--danger); }
.recent-status--processing,
.recent-status--downloading,
.recent-status--analyzing { color: var(--brand); font-weight: 600; }
.recent-actions { margin-inline-start: auto; display: flex; gap: var(--space-2); }
.recent-gone { font-size: 0.85rem; color: var(--text-muted); }

/* -------------------------------------------------------------------- ads */
.ad-slot {
  margin-block: var(--space-6);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  text-align: center;
  /* Reserve height so ads never shift the layout (Core Web Vitals: CLS). */
  min-height: 120px;
}
.ad-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: var(--space-7);
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding-block: var(--space-6);
}
.footer-inner { display: grid; gap: var(--space-5); }
.footer-tagline { color: var(--text-muted); margin-block: var(--space-2); }
.footer-privacy { display: flex; align-items: center; gap: var(--space-2); color: var(--success); font-size: 0.85rem; }

.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.footer-links h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.footer-links a { display: block; padding-block: 6px; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--brand); }

.footer-bottom { margin-top: var(--space-5); color: var(--text-muted); font-size: 0.8rem; }
.footer-bottom p { margin: 0; }

@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: 1fr 2fr; }
  .footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Sticky primary action on small screens keeps the main CTA reachable. */
@media (max-width: 35.999rem) {
  .panel .button--block[data-start-job] {
    position: sticky;
    bottom: var(--space-3);
    box-shadow: var(--shadow);
  }
}
