/* Redactr demo styles — no framework, just CSS. */

:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --panel: #151b27;
  --panel-2: #1b2332;
  --border: #273043;
  --text: #e6eaf2;
  --muted: #9aa6bd;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --danger: #fb7185;
  --warn: #fbbf24;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fc;
    --bg-soft: #eef2f9;
    --panel: #ffffff;
    --panel-2: #f3f6fb;
    --border: #dde3ee;
    --text: #0f172a;
    --muted: #5b6678;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 80% -10%,
      rgba(56, 189, 248, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 0% 0%,
      rgba(94, 234, 212, 0.1),
      transparent 55%
    ),
    var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--accent);
  color: #04201a;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 20;
}

/* Header ------------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  color: var(--accent);
  font-size: 1.3rem;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 999px;
}
.privacy-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(94, 234, 212, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0);
  }
}
.gh-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}
.gh-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Main -------------------------------------------------------------------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 64px;
}
.hero {
  text-align: center;
  padding: 28px 0 22px;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.02rem;
}
.tagline strong {
  color: var(--text);
}

/* Tabs -------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 26px 0 18px;
}
.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.tab.is-active {
  color: #04201a;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

/* Editor ------------------------------------------------------------------ */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 820px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
}
.pane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pane-head label {
  font-weight: 600;
  font-size: 0.9rem;
}
.head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.select:hover {
  border-color: var(--accent);
}
textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
}
textarea:focus {
  border-color: var(--accent-2);
}
textarea.readonly {
  background: var(--panel-2);
}
.dropzone.dragover {
  border: 2px dashed var(--accent);
  background: rgba(94, 234, 212, 0.08);
}
.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 8px 2px 0;
}
.stats {
  font-family: var(--mono);
}

/* Buttons ----------------------------------------------------------------- */
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Detectors + mapping ----------------------------------------------------- */
details {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.warn {
  color: var(--warn);
  font-weight: 500;
  font-size: 0.82rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.chip.on {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.1);
}
.chip .badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--accent);
  color: #04201a;
  border-radius: 6px;
  padding: 0 6px;
  min-width: 18px;
  text-align: center;
}
.chip:not(.on) .badge {
  display: none;
}

.map-table {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.map-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
  word-break: break-all;
}
.map-row .ph {
  color: var(--accent);
}
.map-row .val {
  color: var(--danger);
}
.map-empty {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.site-footer a {
  color: var(--accent-2);
}
.site-footer code {
  font-family: var(--mono);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Toast ------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #04201a;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 30;
}
