:root {
  --bg: #0b0f14;
  --panel: #121820;
  --panel2: #1a2332;
  --border: #2a3548;
  --text: #e8eef7;
  --muted: #94a3b8;
  --accent: #5eead4;
  --accent-dim: #2dd4bf;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(96, 165, 250, 0.1), transparent 55%),
    radial-gradient(600px 400px at 50% 100%, rgba(248, 113, 113, 0.06), transparent 50%);
}

body > * { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon { border-radius: 8px; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.02em; }
.tagline { display: block; font-size: 0.78rem; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 0.6rem; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge.free { background: #1e293b; color: var(--warn); border-color: #854d0e; }
.badge.pro { background: #134e4a; color: var(--accent); border-color: #0f766e; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover:not(:disabled) { border-color: var(--accent-dim); background: #243044; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border-color: #0f766e;
  color: #042f2e;
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }

.linkish {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 1rem;
  padding: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
}

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

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

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.panel h2.mt { margin-top: 1.25rem; }

.drop-panel {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  outline: none;
}
.drop-panel.dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.25);
}

.drop-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.5rem;
}
.drop-icon { font-size: 2.5rem; }
.drop-inner h1 { margin: 0; font-size: 1.35rem; }
.drop-inner p { margin: 0; color: var(--muted); max-width: 28ch; font-size: 0.92rem; }

.file-list-wrap { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 360px;
  overflow: auto;
}
.file-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.file-item.active { border-color: var(--accent-dim); }
.file-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: #0b0f14;
}
.file-item .name { font-size: 0.85rem; font-weight: 600; word-break: break-all; }
.file-item .sub { font-size: 0.72rem; color: var(--muted); }
.file-item .status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.file-item .status.warn { color: var(--warn); }
.file-item .status.ok { color: var(--accent); }

.free-note {
  background: #1c1917;
  border: 1px solid #78350f;
  color: #fde68a;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}
.free-note[hidden] { display: none !important; }

.meta-summary, .fields-box, .meta-box {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}
.preview-meta { margin: 0; color: var(--muted); }

.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.field-table th, .field-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.field-table th { color: var(--muted); font-weight: 600; width: 38%; }
.field-table td { word-break: break-word; }
.field-group {
  margin: 0.6rem 0 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #134e4a;
  color: var(--accent);
  border: 1px solid #0f766e;
}
.chip.danger { background: #450a0a; color: var(--danger); border-color: #7f1d1d; }
.chip.neutral { background: #1e293b; color: var(--muted); border-color: var(--border); }

.actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.privacy { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--muted); }

.how-list { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.88rem; }
.how-list li { margin-bottom: 0.35rem; }
.how-list strong { color: var(--text); }
.how-list code {
  font-size: 0.8em;
  background: #0b0f14;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.warn-box {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  background: #1c1917;
  border: 1px solid #78350f;
  border-radius: 10px;
  color: #fde68a;
  font-size: 0.82rem;
}

.report-panel {
  max-width: 1280px;
  margin: 0 auto 1.25rem;
  padding: 1.15rem;
}
.report-panel[hidden] { display: none !important; }
.wm-tag {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.65rem;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}

.report-preview {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
}
.report-preview h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.report-preview .sub { color: #64748b; margin: 0 0 1rem; font-size: 0.8rem; }
.report-preview table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.report-preview th, .report-preview td {
  text-align: left;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.78rem;
}
.report-preview .wm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(248, 113, 113, 0.18);
  transform: rotate(-24deg);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Ads */
.ad-region {
  margin: 0.5rem 1.25rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed #854d0e;
  background: linear-gradient(90deg, #292524, #1c1917);
  border-radius: 10px;
  color: #fde68a;
  font-size: 0.82rem;
  position: relative;
}
.ad-region[hidden] { display: none !important; }
.ad-sticky-top { margin-top: 0; border-radius: 0; border-left: none; border-right: none; }
.ad-label {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.ad-wrap-mid, .ad-wrap-footer { max-width: 1280px; margin: 0 auto; }
.ad-wrap-mid .ad-region, .ad-wrap-footer .ad-region { margin-left: 1.25rem; margin-right: 1.25rem; }
.ad-scrub { margin: 0.75rem 0; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none !important; }
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-card h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.modal-lead { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.9rem; }
.perk-list { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--text); font-size: 0.88rem; }
.perk-list li { margin-bottom: 0.25rem; }
.modal-actions { margin: 0.5rem 0; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.75rem 0; }
.field span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field input {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.field input:focus { outline: 2px solid rgba(94, 234, 212, 0.35); border-color: var(--accent-dim); }
.hint { margin: 0.35rem 0; font-size: 0.82rem; color: var(--danger); }
.tiny { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--muted); }

.cross-promo {
  flex-basis: 100%;
  text-align: center;
  margin: .35rem 0 0;
  padding: .65rem .75rem .15rem;
  border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  font-size: .8rem;
  color: var(--muted);
}
.cross-promo-intro { margin: 0 0 .35rem; }
.cross-promo-hub { margin: 0 0 .35rem; }
.cross-promo-hub a, .cross-promo-list a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.cross-promo-hub a:hover, .cross-promo-list a:hover { color: var(--text); }
.cross-promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.cross-promo-list .cross-buy { font-weight: 600; color: var(--accent, var(--text)); }

/* Louder Unlock / Buy CTAs (conversion) */
.btn.unlock-cta {
  font-weight: 800;
  font-size: 0.98rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.12) inset;
  letter-spacing: 0.01em;
}
.top-actions .btn.unlock-cta {
  white-space: nowrap;
}
.free-note-cta {
  display: flex;
  margin-top: 0.65rem;
}
.free-note-cta .btn.unlock-cta {
  width: 100%;
}
.unlock-inline {
  margin-bottom: 0.55rem;
}
.unlock-inline[hidden] { display: none !important; }
.soft-path {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-unlock-btn,
.footer-buy-btn {
  text-decoration: none;
}
.footer .btn.unlock-cta {
  min-height: 44px;
}

/* Unlock modal mobile */
.modal {
  align-items: end;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}
@media (min-width: 520px) {
  .modal { align-items: center; place-items: center; }
}
.modal-card {
  max-height: min(92vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  width: min(420px, 100%);
  margin-bottom: 0;
}
.modal-card #buyBtn,
.modal-card #applyKeyBtn {
  min-height: 48px;
  width: 100%;
}
.modal-card input[type="text"] {
  min-height: 44px;
  font-size: 16px; /* avoid iOS zoom */
  width: 100%;
}
.modal-close {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

/* Slim sticky Unlock bar (free tier only) */
.sticky-unlock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  background: rgba(12,14,20,.94);
  border-top: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 -8px 28px rgba(0,0,0,.35);
}
.sticky-unlock[hidden] { display: none !important; }
.sticky-unlock-copy {
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.sticky-unlock .btn.unlock-cta {
  flex-shrink: 0;
  min-height: 44px;
}
body.has-sticky-unlock {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (max-width: 420px) {
  .topbar { padding: 0.75rem 0.85rem; gap: 0.5rem; }
  .tagline { display: none; }
  .sticky-unlock-copy { font-size: 0.75rem; }
}
