/* Defensive: an author rule that sets `display` on an element always beats the
   user-agent's `[hidden] { display: none }`, regardless of selector order or
   specificity — because origin outranks specificity in the cascade. Any class
   below (e.g. `.controls { display: flex }`) would otherwise silently show a
   "hidden" element. This rule wins over such collisions via !important. */
[hidden] { display: none !important; }

:root {
  --bg: #f4f9f8;
  --surface: #ffffff;
  --border: #dbe7e4;
  --text: #14201d;
  --muted: #5f7570;
  --primary: #0d9488;
  --primary-ink: #ffffff;
  --accent: #d97706;
  --danger: #e0405c;
  --danger-bg: #fdeef1;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 30, 26, 0.04), 0 8px 24px rgba(10, 30, 26, 0.06);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101715;
    --surface: #182421;
    --border: #263834;
    --text: #eaf3f1;
    --muted: #8ba39d;
    --primary: #2dd4bf;
    --primary-ink: #08201c;
    --accent: #fbbf24;
    --danger: #ff7a92;
    --danger-bg: #3a1c26;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand span { color: var(--primary); }

main { flex: 1; display: flex; flex-direction: column; gap: 20px; }

.hero { text-align: center; margin: 12px 0 4px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0; letter-spacing: -0.03em; font-weight: 800; }
.hero h1 span { color: var(--primary); }
.tagline { color: var(--muted); margin: 10px auto 0; max-width: 42ch; font-size: 1.05rem; }

/* cards: flat surface, hairline border, soft shadow — no blur/glass */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.card h1, .card h2 { margin: 0 0 4px; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 6px 0; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop-emoji { font-size: 2.6rem; line-height: 1; }
.dropzone h2 { margin: 14px 0 4px; font-size: 1.2rem; }

/* file lists */
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.filelist:not(:empty) { margin-top: 16px; }
.file {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.file-status { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.file-status.ok { color: var(--primary); font-weight: 600; }
.file-status.bad { color: var(--danger); font-weight: 600; }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* controls row */
.controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
select, input[type="text"], input[type="password"], input[type="url"], input[type="email"], textarea {
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
select { cursor: pointer; }
textarea { resize: vertical; width: 100%; }

/* stacked field forms: report / contact */
.stack-form { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.checkbox-field input { margin-top: 3px; flex-shrink: 0; }

/* legal pages */
.legal h2 { margin-top: 28px; font-size: 1.15rem; }
.legal ul, .legal ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal a { color: var(--primary); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; color: var(--text); position: relative;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.15s;
  overflow: hidden;
}
.btn.sm { padding: 8px 14px; font-size: 0.85rem; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: 0.9; }
.btn.ghost { background: var(--bg); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger-ghost { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn.danger-ghost:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.55; cursor: default; }
/* upload progress: fills the primary button via --p, set from JS */
.btn.busy::before {
  content: ""; position: absolute; inset: 0; width: var(--p, 0%);
  background: rgba(255, 255, 255, 0.25); transition: width 0.15s ease;
}

/* result */
.linkrow { display: flex; gap: 10px; margin: 14px 0; }
.linkrow input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }
.result-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.fineprint { color: var(--muted); font-size: 0.8rem; margin-top: 14px; }

/* bundle */
.bundle-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pill { font-size: 0.8rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.bundle-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.error { color: var(--danger); font-size: 0.88rem; margin: 0; }

/* generic data table (used by the privacy policy's data-collection table) */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }

footer { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 32px; padding-top: 18px; }
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }

@media (max-width: 560px) {
  .card { padding: 20px; }
  .controls { flex-direction: column; align-items: stretch; }
  .controls .btn { width: 100%; }
  .file-actions { flex-direction: column; }
}
