/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page-bg, #0a0a0a);
  color: var(--page-fg, #eaeaea);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}
.mono, .term-line, .terminal-title, .brand-tag, .footer-mono, .preview-name, .preview-size,
.dropzone-hint, .how-n, .hero-eyebrow, .risk-card-value, .risk-eyebrow {
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(255,255,255,0.03), transparent 60%),
    radial-gradient(ellipse at 100% 100%, color-mix(in oklch, var(--accent) 12%, transparent), transparent 60%),
    var(--page-bg);
}

/* ---------- Lang Banner ---------- */
.lang-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: color-mix(in oklch, var(--accent) 10%, var(--page-bg));
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  position: relative;
}
.lang-banner button {
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); padding: 4px 12px; border-radius: 999px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.lang-banner button:hover { background: color-mix(in oklch, var(--accent) 20%, transparent); }
.lang-banner .banner-x {
  margin-left: auto; border: none; font-size: 20px; line-height: 1;
  padding: 0 8px; opacity: 0.6;
}
.lang-banner .banner-x:hover { opacity: 1; background: transparent; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 20px; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.brand-tag { opacity: 0.4; font-size: 12px; }
@media (max-width: 640px) { .brand-tag { display: none; } }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.sound-toggle {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border); color: inherit;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 12px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.sound-toggle:hover { border-color: var(--accent); }
.lang-switch { display: flex; gap: 4px; align-items: center; font-size: 12px; opacity: 0.7; }
.lang-switch button {
  background: transparent; border: none; color: inherit; cursor: pointer;
  padding: 4px 6px; font-family: inherit; font-size: 12px;
}
.lang-switch button.on { color: var(--accent); font-weight: 700; }

/* ---------- Main ---------- */
.main-area { flex: 1; padding: 48px 28px; max-width: 1280px; margin: 0 auto; width: 100%; }
@media (max-width: 640px) { .main-area { padding: 24px 16px; } }

/* ---------- Hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-eyebrow {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); opacity: 0.85;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
  margin: 0 0 20px 0;
  text-wrap: balance;
}
.hero-title-accent {
  background: linear-gradient(110deg, var(--accent), color-mix(in oklch, var(--accent) 60%, white));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.hero-sub {
  max-width: 580px; opacity: 0.7; font-size: 17px; line-height: 1.55;
  margin: 0 0 48px 0; text-wrap: pretty;
}

/* ---------- Dropzone ---------- */
.dropzone {
  width: 100%; max-width: 720px; cursor: pointer;
  transition: transform 0.2s ease;
}
.dropzone:hover { transform: translateY(-2px); }
.dropzone-frame {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 72px 32px;
  background: var(--card-bg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
.dropzone.over .dropzone-frame {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in oklch, var(--accent) 8%, var(--card-bg));
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 15%, transparent),
              0 20px 60px -20px color-mix(in oklch, var(--accent) 40%, transparent);
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dropzone-icon { color: var(--accent); opacity: 0.85; margin-bottom: 8px; }
.dropzone-primary { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.dropzone-secondary { opacity: 0.55; font-size: 14px; }
.dropzone-hint {
  margin-top: 20px; font-size: 12px; opacity: 0.6;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 8%, transparent);
  border: 1px solid var(--border);
}
.hint-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.corner { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--accent); opacity: 0.7; }
.corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---------- How it works ---------- */
.how-it-works { margin-top: 64px; max-width: 720px; width: 100%; }
.how-title {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.5; margin-bottom: 18px;
}
.how-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
}
.how-list li {
  padding: 18px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; opacity: 0.85; line-height: 1.45;
}
.how-n {
  display: block; color: var(--accent); font-size: 12px; margin-bottom: 8px;
  letter-spacing: 0.1em;
}

/* ---------- Analysis Layout ---------- */
.analysis { display: flex; flex-direction: column; gap: 32px; }
.analysis-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 28px;
}
@media (max-width: 900px) {
  .analysis-layout { grid-template-columns: 1fr; }
}

/* File preview */
.file-preview {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  position: sticky; top: 20px;
}
.preview-frame {
  position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 4/3; background: #000;
}
.preview-frame img {
  width: 100%; height: 100%; object-fit: contain;
  filter: contrast(1.02);
}
.preview-scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
  top: 0; animation: scan 2.5s linear infinite; opacity: 0.7;
}
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }
.preview-meta { margin-top: 12px; font-size: 12px; display: flex; justify-content: space-between; opacity: 0.7; }

/* ---------- Terminal ---------- */
.terminal-shell {
  background: var(--term-bg, #000);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex; flex-direction: column;
  min-height: 480px; max-height: 640px;
}
.terminal-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(#1a1a1a, #0f0f0f);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 11px;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.terminal-title { flex: 1; text-align: center; color: rgba(255,255,255,0.5); }
.terminal-status { color: var(--term-fg); display: flex; align-items: center; gap: 6px; }
.blinkdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--term-fg); box-shadow: 0 0 6px var(--term-fg);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.3; } }

.terminal-body {
  flex: 1; padding: 20px 22px; overflow-y: auto;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, monospace;
  font-size: 13.5px; line-height: 1.7;
  color: var(--term-fg);
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(255,255,255,0.015) 2px, rgba(255,255,255,0.015) 4px),
    var(--term-bg);
}
.term-line { color: var(--term-fg); white-space: pre-wrap; word-break: break-word; }
.term-line.term-prompt { color: var(--term-fg); opacity: 0.95; }
.term-line.term-info { color: var(--term-dim); }
.term-line.term-extract { color: var(--term-fg); }
.term-line.term-warn {
  color: var(--term-warn);
  font-weight: 600;
  text-shadow: 0 0 8px color-mix(in oklch, var(--term-warn) 50%, transparent);
  letter-spacing: 0.02em;
  animation: warnPulse 1.2s ease-in-out infinite;
}
@keyframes warnPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}
.caret {
  display: inline-block;
  animation: caretBlink 1s steps(2) infinite;
  color: var(--term-fg);
  margin-left: 2px;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.terminal-prompt-done { margin-top: 4px; }

/* ---------- Risk Cards ---------- */
.risk-section {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
}
.risk-header {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.risk-eyebrow { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.55; margin-bottom: 6px; }
.risk-level { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.risk-level-crit { color: var(--warn); }
.risk-level-high { color: #ff9142; }
.risk-level-med { color: #ffcf42; }
.risk-level-none { color: var(--accent); }

.select-all-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border); color: inherit;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 13px;
}
.select-all-btn:hover { border-color: var(--accent); }
.mini-check {
  width: 16px; height: 16px; border: 1.5px solid currentColor;
  border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; opacity: 0.7;
}
.mini-check.on { background: var(--accent); color: #000; border-color: var(--accent); opacity: 1; }

.risk-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px;
}
.risk-card {
  position: relative;
  background: color-mix(in oklch, var(--accent) 2%, var(--page-bg));
  border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  transition: all 0.25s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.risk-card.detected { border-color: color-mix(in oklch, var(--warn) 40%, var(--border)); }
.risk-card.detected.selected {
  border-color: var(--warn);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--warn) 20%, transparent),
              0 10px 30px -10px color-mix(in oklch, var(--warn) 30%, transparent);
}
.risk-card-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--accent); }
.risk-card.detected .risk-card-top { color: var(--warn); }
.risk-card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.risk-card-desc { font-size: 13px; opacity: 0.65; line-height: 1.45; }
.risk-card-status { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin-top: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.risk-card-status.bad { color: var(--warn); }
.risk-card-status.bad .status-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: pulse 1.5s ease-in-out infinite; }
.risk-card-status.good { color: var(--accent); }
.risk-card-status.good .status-dot { background: var(--accent); }
.risk-card-value {
  margin-top: 4px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  opacity: 0.9;
}
.risk-card-action {
  margin-top: auto; padding-top: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  background: transparent; border: none; border-top: 1px solid var(--border);
  cursor: pointer; font-family: inherit; width: 100%; text-align: left;
}
.risk-card-action:hover { gap: 12px; }
.risk-card-action .arrow { transition: transform 0.2s; }
.risk-card-action:hover .arrow { transform: translateX(2px); }

/* Checkbox */
.risk-check { display: flex; }
.risk-check input { position: absolute; opacity: 0; pointer-events: none; }
.risk-check-box {
  width: 22px; height: 22px; border: 1.5px solid var(--border);
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; font-weight: 700;
  transition: all 0.2s;
  background: rgba(0,0,0,0.2);
}
.risk-card.detected .risk-check-box { border-color: var(--warn); cursor: pointer; }
.risk-card.detected.selected .risk-check-box { background: var(--warn); color: #000; border-color: var(--warn); }
.risk-card:not(.detected) .risk-check-box { opacity: 0.3; cursor: not-allowed; }

/* ---------- Action bar ---------- */
.action-bar {
  display: flex; justify-content: center; padding: 16px 0;
}
.erase-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; background: var(--warn); color: #000;
  border: none; border-radius: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 20px 40px -15px color-mix(in oklch, var(--warn) 50%, transparent);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}
.erase-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 28px 50px -15px color-mix(in oklch, var(--warn) 60%, transparent);
}
.erase-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.erasing-indicator {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; font-family: "SF Mono", monospace; font-size: 13px;
}
.scrub { display: flex; gap: 3px; }
.scrub span {
  width: 4px; height: 20px; background: var(--accent); opacity: 0.3;
  border-radius: 2px; animation: scrubbar 0.9s ease-in-out infinite;
}
.scrub span:nth-child(2) { animation-delay: 0.15s; }
.scrub span:nth-child(3) { animation-delay: 0.3s; }
.scrub span:nth-child(4) { animation-delay: 0.45s; }
@keyframes scrubbar {
  0%, 100% { opacity: 0.3; transform: scaleY(0.4); }
  50% { opacity: 1; transform: scaleY(1); }
}

.erased-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.erased-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--accent); font-weight: 600; font-size: 14px;
  border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
}
.download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; background: var(--accent); color: #000;
  border: none; border-radius: 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 14px 30px -10px color-mix(in oklch, var(--accent) 50%, transparent);
}
.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -10px color-mix(in oklch, var(--accent) 60%, transparent);
}
.reset-btn {
  padding: 14px 22px; background: transparent;
  border: 1px solid var(--border); color: inherit;
  border-radius: 12px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.reset-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Demo button ---------- */
.demo-row { margin-top: 20px; display: flex; justify-content: center; }
.demo-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 1px dashed var(--border);
  color: inherit; padding: 10px 18px; border-radius: 999px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  opacity: 0.75; transition: all 0.2s;
}
.demo-btn:hover {
  border-color: var(--accent); color: var(--accent); opacity: 1;
  border-style: solid;
}
.demo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  padding: 28px; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); font-size: 12px; opacity: 0.65;
  flex-wrap: wrap; gap: 16px;
}
.footer-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.footer-tools-label { opacity: 0.7; margin-right: 4px; }
.footer-tools a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
.footer-tools a:hover { opacity: 0.75; text-decoration: underline; }
.footer-sep { opacity: 0.3; }

/* ---------- Layout: hacker ---------- */
.layout-hacker {
  --page-bg: #000 !important;
}
.layout-hacker .hero-title,
.layout-hacker .dropzone-primary,
.layout-hacker .risk-card-title {
  color: var(--accent);
}
.layout-hacker .hero-title-accent {
  background: none; -webkit-background-clip: initial; background-clip: initial;
  color: var(--accent); text-shadow: 0 0 20px var(--accent);
}
.layout-hacker body, .layout-hacker .main-area { font-family: "SF Mono", "JetBrains Mono", Menlo, monospace; }

/* ---------- Density compact ---------- */
.density-compact .main-area { padding: 28px 24px; }
.density-compact .hero-title { font-size: clamp(28px, 4.5vw, 44px); }
.density-compact .dropzone-frame { padding: 48px 24px; }
.density-compact .risk-section { padding: 20px; }
.density-compact .risk-card { padding: 16px; }
.density-compact .terminal-shell { min-height: 380px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero-sub { font-size: 15px; margin-bottom: 32px; }
  .dropzone-frame { padding: 48px 20px; }
  .dropzone-primary { font-size: 18px; }
  .risk-section { padding: 18px; }
  .risk-header { flex-direction: column; align-items: flex-start; }
  .terminal-body { font-size: 12px; padding: 14px; }
  .terminal-shell { min-height: 360px; }
  .file-preview { position: static; }
}

/* ═══════════════════════════════════════════════════════════════
   Legal / institutional pages (about, contact, privacy, terms)
   ═══════════════════════════════════════════════════════════════ */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #eaeaea;
  line-height: 1.7;
  font-size: 16px;
}
.legal-back {
  display: inline-block;
  font-family: "JetBrains Mono","Fira Mono",monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #39ff85;
  text-decoration: none;
  opacity: 0.75;
  margin-bottom: 24px;
}
.legal-back:hover { opacity: 1; }
.legal-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.legal-page h2 {
  font-size: 1.25rem;
  margin: 40px 0 14px;
  font-weight: 600;
  color: #eaeaea;
}
.legal-page h3 {
  font-size: 1.05rem;
  margin: 28px 0 10px;
  font-weight: 600;
  color: #cfcfcf;
}
.legal-page p { margin: 0 0 14px; opacity: 0.88; }
.legal-page strong { color: #eaeaea; opacity: 1; }
.legal-page a { color: #39ff85; text-decoration: underline; text-underline-offset: 3px; }
.legal-page a:hover { text-decoration: none; }
.legal-page code {
  font-family: "JetBrains Mono","Fira Mono",monospace;
  font-size: 0.92em;
  background: rgba(57,255,133,0.08);
  border: 1px solid rgba(57,255,133,0.18);
  padding: 1px 5px;
  border-radius: 3px;
  color: #cfeed8;
}
.legal-page ul, .legal-page ol {
  padding-left: 22px;
  margin: 0 0 16px;
  opacity: 0.88;
}
.legal-page li { margin-bottom: 6px; }
.legal-page blockquote {
  border-left: 3px solid #39ff85;
  padding: 8px 16px;
  margin: 16px 0;
  background: rgba(57,255,133,0.04);
  opacity: 0.9;
  font-style: italic;
}
.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 14px;
}
.legal-page th, .legal-page td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}
.legal-page th {
  font-family: "JetBrains Mono","Fira Mono",monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a8a;
  font-weight: 500;
  border-bottom: 1px solid rgba(57,255,133,0.25);
}

/* Top topbar inside legal pages */
.legal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  max-width: 1200px; margin: 0 auto;
  font-size: 14px;
}
.legal-topbar-brand {
  font-weight: 700;
  color: #eaeaea;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.legal-topbar-brand .mark { color: #39ff85; margin-right: 6px; }
.legal-topbar-nav {
  display: flex; gap: 18px; align-items: center;
  font-size: 13px;
}
.legal-topbar-nav a {
  color: #cfcfcf; text-decoration: none; opacity: 0.75;
}
.legal-topbar-nav a:hover { opacity: 1; color: #39ff85; }

/* "Available in English" notice for unrevised languages */
.legal-untranslated-notice {
  background: rgba(57,255,133,0.06);
  border: 1px solid rgba(57,255,133,0.25);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.5;
}
.legal-untranslated-notice p { margin: 0 0 6px; opacity: 0.95; }
.legal-untranslated-notice .switcher {
  margin-top: 6px;
  font-size: 13px;
  font-family: "JetBrains Mono","Fira Mono",monospace;
}
.legal-untranslated-notice .switcher a {
  color: #39ff85;
  margin-right: 8px;
  white-space: nowrap;
}

/* RTL adjustments */
html[dir="rtl"] .legal-page { text-align: right; }
html[dir="rtl"] .legal-page ul,
html[dir="rtl"] .legal-page ol { padding-left: 0; padding-right: 22px; }
html[dir="rtl"] .legal-page blockquote {
  border-left: none; border-right: 3px solid #39ff85;
}
html[dir="rtl"] .legal-back::before { content: "→ "; }
html[dir="rtl"] .legal-back { direction: rtl; }

/* Mobile */
@media (max-width: 640px) {
  .legal-page { padding: 24px 18px 60px; font-size: 15px; }
  .legal-page h1 { font-size: 1.6rem; }
  .legal-page table { font-size: 13px; }
  .legal-page th, .legal-page td { padding: 8px 8px; }
  .legal-topbar { padding: 14px 18px; }
  .legal-topbar-nav { gap: 12px; font-size: 12px; }
}
