/* ============================================================
   ClearDiff — style.css
   Design system: ClearText Editor Suite
============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES  (dark — default)
============================================================ */
:root {
  /* Depth palette */
  --bg-void:      #09090d;
  --bg-deep:      #0e0e14;
  --bg-panel:     #141419;
  --bg-raised:    #1c1c26;
  --bg-surface:   #22222e;

  /* Borders */
  --border-dim:   rgba(255,255,255,0.04);
  --border-mid:   rgba(255,255,255,0.07);
  --border-hi:    rgba(255,255,255,0.11);

  /* Accent: aged gold */
  --gold:         #c9a84c;
  --gold-dim:     #7d6228;
  --gold-muted:   rgba(201,168,76,0.12);
  --gold-glow:    rgba(201,168,76,0.25);

  /* Status green */
  --green:        #3ddc84;
  --green-glow:   rgba(61,220,132,0.35);

  /* Typography */
  --text-bright:  #e2ddd4;
  --text-primary: #b8b3a8;
  --text-dim:     #6a6778;
  --text-muted:   #3e3c4a;

  /* Fonts */
  --font-display: 'Cormorant Garamond', serif;
  --font-ui:      'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Layout */
  --topbar-h: 52px;
  --gap:      10px;
  --r:        10px;
  --r-sm:     6px;

  /* Shadows */
  --shadow-raised:
    0 1px 0   rgba(255,255,255,0.07) inset,
    0 -1px 0  rgba(0,0,0,0.45)       inset,
    0 1px 0   rgba(255,255,255,0.03),
    0 4px 10px rgba(0,0,0,0.55),
    0 1px 3px  rgba(0,0,0,0.80);

  --shadow-inset:
    0 2px 6px  rgba(0,0,0,0.70) inset,
    0 1px 2px  rgba(0,0,0,0.90) inset,
    0 1px 0    rgba(255,255,255,0.03);

  --shadow-panel:
    0 1px 0   rgba(255,255,255,0.06) inset,
    0 -1px 0  rgba(0,0,0,0.35)       inset,
    0 8px 30px rgba(0,0,0,0.65),
    0 2px 8px  rgba(0,0,0,0.85),
    0 1px 0    rgba(255,255,255,0.025);

  --shadow-pressed:
    0 1px 4px  rgba(0,0,0,0.80) inset,
    0 2px 8px  rgba(0,0,0,0.60) inset,
    0 1px 0    rgba(255,255,255,0.02);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-ui);
}

/* Grain texture overlay — identical to main app */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

/* ============================================================
   TOPBAR
============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-dim);
  box-shadow:
    0 1px 0   rgba(255,255,255,0.05) inset,
    0 6px 24px rgba(0,0,0,0.6),
    0 1px 4px  rgba(0,0,0,0.8);
}

/* -- Logo ------------------------------------------------- */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: linear-gradient(145deg, #d4a843 0%, #8a6228 100%);
  box-shadow: var(--shadow-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-bright);
  line-height: 1;
}

.logo-wordmark em {
  font-style: normal;
  color: var(--gold);
}

/* -- Privacy badge (absolute-centered) ------------------- */
.privacy-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  box-shadow: var(--shadow-inset);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.pulse-dot {
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(61,220,132,0.2), 0 0 8px var(--green-glow);
  animation: breathe 2.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes breathe {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(61,220,132,0.2), 0 0 8px var(--green-glow);
  }
  50% {
    opacity: 0.35;
    box-shadow: 0 0 0 2px rgba(61,220,132,0.05), 0 0 4px transparent;
  }
}

/* -- Topbar nav ------------------------------------------- */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

/* Cross-tool credit links */
a.nav-credit,
a.nav-credit:link,
a.nav-credit:visited {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
  padding: 0 2px;
}
a.nav-credit:hover { color: var(--text-dim); }

/* Theme switcher */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-inset);
}

.theme-btn {
  width: 26px; height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0.35;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
}

.theme-btn svg {
  width: 11px; height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.theme-btn:hover { opacity: 0.65; background: rgba(255,255,255,0.04); }

.theme-btn.active {
  opacity: 1;
  background: var(--bg-deep);
  color: #ffbf00;
  box-shadow:
    0 2px 6px  rgba(0,0,0,0.70) inset,
    0 1px 2px  rgba(0,0,0,0.90) inset,
    0 0 8px    rgba(255,191,0,0.18) inset,
    0 0 1px    rgba(255,191,0,0.30) inset;
}

.theme-btn.active svg {
  filter: drop-shadow(0 0 4px rgba(255,191,0,0.70));
}

/* About / Blog nav buttons */
.btn-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-inset);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.btn-nav:hover {
  color: var(--gold);
  background: var(--bg-raised);
  border-color: var(--border-hi);
}

.btn-nav svg {
  width: 11px; height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ============================================================
   MAIN LAYOUT
============================================================ */
.diff-shell {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
  overflow: hidden;
}

/* ============================================================
   INPUT PANELS ROW
============================================================ */
.diff-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  flex: 3;
  min-height: 0;
}

/* ============================================================
   SHARED PANEL SYSTEM
============================================================ */
.panel {
  background: var(--bg-panel);
  border-radius: var(--r);
  border: 1px solid var(--border-dim);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Top highlight streak */
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.09) 40%,
    rgba(255,255,255,0.09) 60%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Bottom depth line */
.panel::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(0,0,0,0.6);
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 10px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 100%);
}

.panel-icon {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  box-shadow: var(--shadow-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--gold-dim);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.module-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  background: var(--bg-void);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* ============================================================
   DIFF INPUT PANELS
============================================================ */
.diff-panel {
  min-height: 0;
}

.diff-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.diff-textarea {
  flex: 1;
  width: 100%;
  min-height: 220px;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-inset);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  caret-color: var(--gold);
  padding: 14px;
  resize: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-raised) transparent;
  -webkit-font-smoothing: antialiased;
}

.diff-textarea::-webkit-scrollbar        { width: 6px; }
.diff-textarea::-webkit-scrollbar-track  { background: transparent; }
.diff-textarea::-webkit-scrollbar-thumb  { background: var(--bg-raised); border-radius: 3px; }
.diff-textarea::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

.diff-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}

.diff-textarea:focus {
  border-color: var(--border-hi);
  box-shadow:
    0 2px 6px  rgba(0,0,0,0.70) inset,
    0 1px 2px  rgba(0,0,0,0.90) inset,
    0 0 0 1px  rgba(201,168,76,0.10) inset;
}

.diff-panel-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-top: 1px solid var(--border-dim);
  background: linear-gradient(0deg, rgba(0,0,0,0.07) 0%, transparent 100%);
  flex-shrink: 0;
}

.diff-footer-stat {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.diff-footer-stat span {
  color: var(--text-dim);
  font-weight: 500;
}

.diff-footer-sep {
  color: var(--border-hi);
  font-size: 11px;
  user-select: none;
  opacity: 0.5;
}

/* ============================================================
   ACTION BAR
============================================================ */
.diff-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 2px 0;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.1s, box-shadow 0.1s, transform 0.08s, color 0.1s, border-color 0.1s;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
}

.btn svg { flex-shrink: 0; }

.btn:active { transform: translateY(1px); }

/* Primary — gold */
.btn-gold {
  background: linear-gradient(180deg, #d4a843 0%, #9a6e28 100%);
  color: #1c0f00;
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    0 1px 0  rgba(255,255,255,0.28) inset,
    0 -1px 0 rgba(0,0,0,0.40)      inset,
    0 4px 10px rgba(0,0,0,0.6),
    0 1px 3px  rgba(0,0,0,0.8);
  font-weight: 500;
}

.btn-gold:hover  { background: linear-gradient(180deg, #ddb850 0%, #a87830 100%); }
.btn-gold:active {
  background: linear-gradient(180deg, #9a6e28 0%, #c9a84c 100%);
  box-shadow: var(--shadow-pressed);
}

/* Secondary — raised */
.btn-default {
  background: var(--bg-raised);
  color: var(--text-dim);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-raised);
}

.btn-default:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hi);
}

.btn-default:active {
  background: var(--bg-deep);
  color: var(--text-dim);
  box-shadow: var(--shadow-pressed);
  border-color: var(--border-dim);
}

/* Danger — ghost red */
.btn-danger {
  background: var(--bg-raised);
  color: #c0392b;
  border-color: rgba(192,57,43,0.20);
  box-shadow: var(--shadow-raised);
}

.btn-danger:hover {
  background: rgba(192,57,43,0.12);
  border-color: rgba(192,57,43,0.35);
  color: #e05a4a;
}

.btn-danger:active {
  background: var(--bg-deep);
  box-shadow: var(--shadow-pressed);
}

/* Small variant — used for Copy Result */
.btn-sm {
  padding: 5px 11px;
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-left: 8px;
}

/* ============================================================
   RESULT PANEL
============================================================ */
.diff-result-panel {
  flex: 2;
  min-height: 0;
}

.diff-output-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-raised) transparent;
}

.diff-output-body::-webkit-scrollbar        { width: 6px; }
.diff-output-body::-webkit-scrollbar-track  { background: transparent; }
.diff-output-body::-webkit-scrollbar-thumb  { background: var(--bg-raised); border-radius: 3px; }
.diff-output-body::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* Output container */
.diff-output {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-primary);
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Diff tokens */
.diff-added {
  background: rgba(61,220,132,0.13);
  color: #3ddc84;
  border-radius: 3px;
  padding: 1px 3px;
}

.diff-removed {
  background: rgba(220,80,80,0.13);
  color: #e05555;
  text-decoration: line-through;
  text-decoration-color: rgba(224,85,85,0.55);
  border-radius: 3px;
  padding: 1px 3px;
}

.diff-equal {
  color: var(--text-primary);
}

/* Empty state placeholder */
.diff-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.55;
}

/* ============================================================
   STATUS BAR
============================================================ */
.status-bar {
  height: 34px;
  background: var(--bg-panel);
  border-radius: var(--r);
  border: 1px solid var(--border-dim);
  box-shadow: var(--shadow-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  flex-shrink: 0;
  position: relative;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.status-tool-name {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legal-link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.legal-link:hover { color: var(--text-dim); }

.legal-sep {
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.35;
  user-select: none;
}

.status-local {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0.7;
  margin-left: auto;
}

/* ============================================================
   TOAST
============================================================ */
.toast {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-raised);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-panel);
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--text-primary);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   MODALS
============================================================ */
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px) brightness(0.4);
  -webkit-backdrop-filter: blur(10px) brightness(0.4);
  animation: backdrop-in 0.2s ease forwards;
}

.modal-backdrop[aria-hidden="true"] { display: none; }

.modal {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: rgba(20,20,28,0.92);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 32px 28px 26px;
  box-shadow:
    0 0 0 1px   rgba(201,168,76,0.08),
    0 24px 60px rgba(0,0,0,0.85),
    0 8px  20px rgba(0,0,0,0.70),
    0 1px  0    rgba(255,255,255,0.06) inset;
  animation: modal-in 0.22s cubic-bezier(0.34,1.28,0.64,1) forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

/* Danger icon circle */
.modal-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(192,57,43,0.12);
  border: 1px solid rgba(192,57,43,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e74c3c;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.modal-icon svg { width: 20px; height: 20px; }

.modal-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.02em;
  margin: 0;
}

.modal-body {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin: 0;
  max-width: 300px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.modal-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.modal-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-mid);
}

.modal-btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-hi);
}

.modal-btn-danger {
  background: rgba(192,57,43,0.15);
  color: #e05a4a;
  border-color: rgba(192,57,43,0.30);
}

.modal-btn-danger:hover {
  background: rgba(192,57,43,0.28);
  border-color: rgba(192,57,43,0.50);
  color: #ff6b5b;
}

/* About modal — left-aligned, wider */
.modal--about {
  width: 480px;
  align-items: flex-start;
  text-align: left;
  gap: 0;
  padding: 36px 32px 28px;
}

.modal--about .modal-heading {
  text-align: center;
  width: 100%;
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 0;
  border-radius: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

.about-section {
  width: 100%;
  margin-bottom: 18px;
}

.about-section-title {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 6px;
  font-weight: 500;
}

.modal--about .modal-body {
  text-align: left;
  max-width: none;
}

.about-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  width: 100%;
  margin-top: 10px;
  line-height: 1.75;
}

/* Policy modal — scrollable */
.modal--policy {
  max-height: min(82vh, 680px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.modal--policy::-webkit-scrollbar        { width: 4px; }
.modal--policy::-webkit-scrollbar-track  { background: transparent; }
.modal--policy::-webkit-scrollbar-thumb  { background: var(--gold-dim); border-radius: 2px; }

.policy-intro {
  text-align: left;
  max-width: none;
  margin-bottom: 6px;
}

.policy-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.policy-list li {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  padding-left: 14px;
  position: relative;
}

.policy-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold-dim);
}

.policy-list li strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================================
   LIGHT THEME  [data-theme="light"]
============================================================ */
[data-theme="light"] {
  --bg-void:    #F2F0E9;
  --bg-deep:    #ECEAE4;
  --bg-panel:   rgba(255,255,255,0.55);
  --bg-raised:  rgba(255,255,255,0.75);
  --bg-surface: rgba(255,255,255,0.92);

  --border-dim: rgba(44,62,80,0.07);
  --border-mid: rgba(44,62,80,0.12);
  --border-hi:  rgba(44,62,80,0.20);

  --gold:       #2C3E50;
  --gold-dim:   #546e7a;
  --gold-muted: rgba(44,62,80,0.08);
  --gold-glow:  rgba(44,62,80,0.18);

  --green:      #27ae60;
  --green-glow: rgba(39,174,96,0.30);

  --text-bright:  #1a252f;
  --text-primary: #2C3E50;
  --text-dim:     #4a6680;
  --text-muted:   #8fa9b8;

  --shadow-raised:
    0 1px 0   rgba(255,255,255,0.90) inset,
    0 -1px 0  rgba(44,62,80,0.06)   inset,
    0 1px 0   rgba(255,255,255,0.50),
    0 2px 8px rgba(44,62,80,0.10),
    0 1px 3px rgba(44,62,80,0.07);

  --shadow-inset:
    0 2px 5px rgba(44,62,80,0.07) inset,
    0 1px 2px rgba(44,62,80,0.05) inset,
    0 1px 0   rgba(255,255,255,0.70);

  --shadow-panel:
    0 1px 0    rgba(255,255,255,0.90) inset,
    0 -1px 0   rgba(44,62,80,0.04)   inset,
    0 6px 24px rgba(44,62,80,0.10),
    0 2px 6px  rgba(44,62,80,0.07),
    0 1px 0    rgba(255,255,255,0.50);

  --shadow-pressed:
    0 1px 4px rgba(44,62,80,0.10) inset,
    0 2px 8px rgba(44,62,80,0.07) inset,
    0 1px 0   rgba(255,255,255,0.40);
}

[data-theme="light"] body {
  background: var(--bg-void);
}

[data-theme="light"] body::after {
  opacity: 0.18;
  mix-blend-mode: multiply;
}

/* Topbar — frosted ivory */
[data-theme="light"] .topbar {
  background: rgba(242,240,233,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(44,62,80,0.08);
  box-shadow:
    0 1px 0   rgba(255,255,255,0.80) inset,
    0 4px 16px rgba(44,62,80,0.08),
    0 1px 3px  rgba(44,62,80,0.05);
}

/* Panels + status bar — frosted glass */
[data-theme="light"] .panel,
[data-theme="light"] .status-bar {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Logo mark — gunmetal */
[data-theme="light"] .logo-mark {
  background: linear-gradient(145deg, #d4a843 0%, #8a6228 100%);
  box-shadow: var(--shadow-raised);
}

/* Theme button active — gunmetal glow */
[data-theme="light"] .theme-btn.active {
  color: #2C3E50;
  box-shadow:
    0 2px 5px rgba(44,62,80,0.10) inset,
    0 1px 2px rgba(44,62,80,0.07) inset;
}

[data-theme="light"] .theme-btn.active svg {
  filter: drop-shadow(0 0 3px rgba(44,62,80,0.25));
}

/* Btn gold → gunmetal in light mode */
[data-theme="light"] .btn-gold {
  background: linear-gradient(180deg, #3d5166 0%, #2c3e50 100%);
  color: #ffffff;
  border-color: rgba(0,0,0,0.15);
  box-shadow:
    0 1px 0  rgba(255,255,255,0.18) inset,
    0 -1px 0 rgba(0,0,0,0.15)      inset,
    0 2px 6px rgba(44,62,80,0.20),
    0 1px 2px rgba(44,62,80,0.12);
}

[data-theme="light"] .btn-gold:hover {
  background: linear-gradient(180deg, #4a6278 0%, #3d5166 100%);
}

[data-theme="light"] .btn-gold:active {
  background: linear-gradient(180deg, #2c3e50 0%, #3d5166 100%);
  box-shadow: var(--shadow-pressed);
}

/* Diff textareas — pure white in light mode */
[data-theme="light"] .diff-textarea {
  background: #FFFFFF;
  box-shadow:
    0 2px 5px rgba(44,62,80,0.07) inset,
    0 1px 2px rgba(44,62,80,0.05) inset;
}

[data-theme="light"] .diff-textarea:focus {
  border-color: rgba(44,62,80,0.20);
  box-shadow:
    0 2px 5px rgba(44,62,80,0.07) inset,
    0 1px 2px rgba(44,62,80,0.05) inset,
    0 0 0 1px rgba(44,62,80,0.12) inset;
}

/* Diff tokens — adapted for light bg */
[data-theme="light"] .diff-added {
  background: rgba(39,174,96,0.12);
  color: #1a8a4e;
}

[data-theme="light"] .diff-removed {
  background: rgba(192,57,43,0.10);
  color: #c0392b;
  text-decoration-color: rgba(192,57,43,0.50);
}

/* Modal — light ivory glass */
[data-theme="light"] .modal-backdrop {
  background: rgba(180,178,172,0.35);
  backdrop-filter: blur(10px) brightness(0.88);
  -webkit-backdrop-filter: blur(10px) brightness(0.88);
}

[data-theme="light"] .modal {
  background: rgba(245,243,238,0.97);
  border-color: rgba(44,62,80,0.12);
  box-shadow:
    0 0 0 1px rgba(44,62,80,0.05),
    0 24px 60px rgba(44,62,80,0.18),
    0 8px  20px rgba(44,62,80,0.10),
    0 1px  0   rgba(255,255,255,0.90) inset;
}

[data-theme="light"] .modal-heading { color: #1a252f; }
[data-theme="light"] .modal-body    { color: #4a6680; }

[data-theme="light"] .modal-btn-ghost {
  color: #4a6680;
  border-color: rgba(44,62,80,0.15);
}

[data-theme="light"] .modal-btn-ghost:hover {
  background: rgba(44,62,80,0.06);
  color: #2C3E50;
  border-color: rgba(44,62,80,0.25);
}

/* ============================================================
   THEME TRANSITIONS — structural containers only
============================================================ */
html, body,
.topbar, .panel, .panel-header, .panel-icon,
.panel-title, .module-badge,
.diff-textarea, .diff-panel-footer, .diff-output,
.status-bar, .status-tool-name, .status-local,
.legal-link, .legal-sep,
.logo-wordmark, .logo-mark, .privacy-badge,
.btn, .modal-backdrop, .modal,
.modal-heading, .modal-body, .toast {
  transition:
    background-color 0.4s ease,
    background       0.4s ease,
    color            0.4s ease,
    border-color     0.35s ease,
    box-shadow       0.4s ease;
}

/* ============================================================
   RESPONSIVE
============================================================ */

/* ── Tablet ≤ 900px: hide privacy badge ─────────────────── */
@media (max-width: 900px) {
  .privacy-badge { display: none; }
}

/* ── Mobile ≤ 767px ──────────────────────────────────────── */
@media (max-width: 767px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .diff-shell {
    position: static;
    display: flex;
    flex-direction: column;
    margin-top: var(--topbar-h);
    padding: 12px 12px 80px;
    height: auto;
    overflow: visible;
    gap: 12px;
  }

  .diff-inputs-row {
    display: flex;
    flex-direction: column;
    flex: none;
    height: auto;
    gap: 12px;
  }

  .diff-panel { min-height: 0; }

  .diff-textarea {
    flex: none;
    min-height: 180px;
    height: 180px;
  }

  .diff-result-panel {
    flex: none;
    min-height: 200px;
  }

  .diff-action-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
  }

  .btn {
    font-size: 9px;
    padding: 8px 14px;
  }

  .nav-label { display: none; }

  .status-tool-name { display: none; }

  .topbar-nav { gap: 4px; }
}
