/* Respect native hidden state even for flex/grid cards and panels. */
[hidden] { display: none !important; }

/* DYNAMIC THEME VARIABLES (Dark & Light Mode Fully Supported) */
:root[data-theme="dark"] {
  --bg: #07090e;
  --bg-surface: #0e121b;
  --bg-surface-elevated: #141b27;
  --bg-input: #0a0d14;
  --border: rgba(245, 158, 11, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow-card: 0 12px 36px -10px rgba(0, 0, 0, 0.75);
}

:root[data-theme="light"] {
  --bg: #f2eee5;
  --bg-surface: #fffaf0;
  --bg-surface-elevated: #f5ead5;
  --bg-input: #fffdf8;
  --border: rgba(180, 83, 9, 0.28);
  --border-subtle: rgba(91, 64, 28, 0.16);
  --text: #29251f;
  --text-muted: #5f5548;
  --text-dim: #766b5c;
  --shadow-card: 0 10px 30px -8px rgba(69, 49, 20, 0.12);
}

:root {
  --border-focus: #f59e0b;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dark: #b45309;
  --gold-glow: rgba(245, 158, 11, 0.26);
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #b45309 100%);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.5;
  padding: 0 12px 48px;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

/* Button Golden Powder Ripple Effect */
span.ripple-effect {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  background: rgba(251, 191, 36, 0.35);
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

/* Sticky Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  opacity: 0.96;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  padding: 10px 16px;
}

.header-inner {
  max-width: 640px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 900;
  font-size: 19px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-name span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme and privacy controls use the app palette instead of browser-default white buttons. */
.icon-btn {
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text);
  min-height: 38px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
#btnPrivacy {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 10px;
  background: var(--bg-surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
#btnPrivacy[aria-pressed="true"] {
  background: rgba(16,185,129,.13);
  color: var(--success);
  border-color: rgba(16,185,129,.4);
}
:root[data-theme="dark"] #btnPrivacy[aria-pressed="false"] { color: var(--text); }
:root[data-theme="light"] .icon-btn:hover,
:root[data-theme="light"] #btnPrivacy:hover { background: #f0dfbd; color: #7c3f08; }

.icon-btn, .theme-picker-wrap { position: relative; display: inline-flex; }
#btnTheme { min-width: 38px; min-height: 38px; justify-content: center; font-size: 17px; padding: 7px 10px; }
.theme-menu {
  position: absolute; z-index: 10020; top: calc(100% + 8px); right: 0; min-width: 126px;
  padding: 5px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-surface); box-shadow: var(--shadow-card);
}
.theme-option { display: block; width: 100%; padding: 10px 12px; text-align: left; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.theme-option:hover, .theme-option.chosen { background: rgba(245,158,11,.14); border-color: var(--gold); color: var(--gold-dark); }
:root[data-theme="dark"] .theme-option:hover, :root[data-theme="dark"] .theme-option.chosen { color: var(--gold-light); }
#goldParticleCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9998; }

.hamburger-btn {
  padding: 7px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.icon-btn:hover, .hamburger-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.hamburger-btn {
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Container */
.app-container {
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 68px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 6px 6px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-dark);
}
:root[data-theme="dark"] .eyebrow { color: var(--gold-light); }

.hero h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.25;
  margin: 6px 0 4px;
  background: linear-gradient(90deg, var(--text) 0%, #fbbf24 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .lede {
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* Cards */
.card, .section-dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
}

.scroll-glow-active {
  border-color: rgba(245, 158, 11, 0.48) !important;
  box-shadow: 0 12px 38px -8px rgba(0, 0, 0, 0.15), 0 0 22px rgba(245, 158, 11, 0.18) !important;
}

/* Rotating Laser Border for Both Input and Result Cards */
@keyframes spinBorderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.laser-card {
  border: 2px solid transparent !important;
  background:
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    linear-gradient(120deg, #f59e0b, #38bdf8, #10b981, #fbbf24, #f59e0b) border-box !important;
  background-size: 100% 100%, 300% 300% !important;
  animation: spinBorderGlow 4s ease infinite;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.2), 0 0 15px rgba(56, 189, 248, 0.12) !important;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0;
}
:root[data-theme="dark"] .card-title { color: var(--gold-light); }

.counter {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* Textarea */
textarea#mainInput, textarea#resultInput, textarea#fbMsg {
  width: 100%;
  min-height: 128px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea#mainInput:focus, textarea#resultInput:focus, textarea#fbMsg:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.counter.warn { color: #d97706; font-weight: 700; }
.counter.danger { color: #ef4444; font-weight: 800; }

/* Magic Hint Strip & Quick Tone Row */
.magic-hint-strip {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
:root[data-theme="dark"] .magic-hint-strip { color: var(--gold-light); }

.quick-tone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.quick-tone-pill {
  padding: 3px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-tone-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.reading-time-badge {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Input Toolbar */
.input-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr 0.7fr 0.7fr 1.1fr;
  gap: 6px;
}

.tool-btn {
  padding: 9px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tool-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold-dark);
  border-color: rgba(245, 158, 11, 0.4);
}
:root[data-theme="dark"] .tool-btn:hover:not(:disabled) { color: var(--gold-light); }

.tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#btnUndo, #btnRedo {
  font-size: 16px;
  font-weight: 900;
  padding: 6px 0;
}

/* Privacy Row */
.privacy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  gap: 10px;
}

.fine {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

#draftNote { display: none; }

.section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
:root[data-theme="dark"] .section-label { color: var(--gold-light); }

/* Modes */
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  text-align: center;
  color: var(--text);
}

.mode-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.mode-card.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 14px var(--gold-glow);
}

.mode-card strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.mode-card span {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pills */
.pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.style-pill {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 34px;
  padding: 7px 13px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.style-pill:hover {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--text);
}

.style-pill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--gold);
  color: var(--gold-dark);
  box-shadow: 0 0 10px var(--gold-glow);
}
:root[data-theme="dark"] .style-pill.active { color: var(--gold-light); }

/* Selectors */
.selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.styled-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.styled-select:focus { border-color: var(--gold); }

/* Generate Button */
.btn-generate, .btn-solid {
  width: 100%;
  padding: 13px;
  background: var(--gold-gradient);
  color: #06090f;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 0 var(--gold-dark), 0 8px 24px var(--gold-glow);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s;
}

.btn-generate:active, .btn-solid:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-dark), 0 3px 10px var(--gold-glow);
}

.btn-generate:disabled { opacity: 0.55; cursor: not-allowed; }

/* Result Actions */
.result-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

@media (min-width: 440px) {
  .result-actions { grid-template-columns: repeat(4, 1fr); }
}

.btn-action {
  padding: 9px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.btn-action:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--text);
  border-color: rgba(245, 158, 11, 0.35);
}

#btnCopyResult, #btnShareWhatsApp {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--gold);
  color: var(--gold-dark);
}
:root[data-theme="dark"] #btnCopyResult, :root[data-theme="dark"] #btnShareWhatsApp { color: var(--gold-light); }

/* Diff Box */
.diff-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 90px;
}

.diff-removed {
  text-decoration: line-through #ef4444 2px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 5px;
  margin: 0 2px;
  font-weight: 600;
}
:root[data-theme="dark"] .diff-removed { color: #fca5a5; }

.diff-added {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  color: #047857;
  padding: 1px 6px;
  border-radius: 5px;
  margin: 0 2px;
  font-weight: 700;
}
:root[data-theme="dark"] .diff-added { color: #6ee7b7; }

/* Loading */
.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  text-align: center;
}

.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #38bdf8, #10b981);
  transition: width 300ms ease;
}

.btn-ghost {
  padding: 6px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Accordions */
details.clean-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

details.clean-accordion summary {
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
:root[data-theme="dark"] details.clean-accordion summary { color: var(--gold-light); }

details.clean-accordion summary::-webkit-details-marker { display: none; }
details.clean-accordion summary::after { content: "▼"; font-size: 11px; color: var(--text-muted); transition: transform 0.2s ease; }
details.clean-accordion[open] summary::after { transform: rotate(180deg); color: var(--gold); }

.accordion-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.info-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) { .info-grid.two { grid-template-columns: 1fr 1fr; } }

.step, .use-card, .style-note {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.step b, .use-card b, .style-note b {
  display: block;
  color: var(--gold-dark);
  font-size: 12.5px;
  margin-bottom: 3px;
}
:root[data-theme="dark"] .step b, :root[data-theme="dark"] .use-card b { color: var(--gold-light); }

.faq-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-a { padding: 0 12px 11px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.sentiment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080b11;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-frame img, .video-frame iframe { width: 100%; height: 100%; object-fit: cover; border: none; }

/* Social Icons */
.social-logos-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 6px 0;
}

.social-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
:root[data-theme="dark"] .social-icon-box { color: var(--gold-light); }

.social-icon-box:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.social-icon-box svg { width: 21px; height: 21px; fill: currentColor; }

/* Brand Banner */
.brand-summary-banner {
  background: var(--bg-surface);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.brand-banner-top { display: flex; align-items: center; gap: 12px; }
.brand-banner-top img { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--gold); }
.brand-banner-title { font-size: 16px; font-weight: 800; color: var(--text); }
.brand-banner-title span { color: var(--gold-dark); }
:root[data-theme="dark"] .brand-banner-title span { color: var(--gold-light); }

.brand-banner-sub { font-size: 11.5px; color: var(--text-muted); }
.brand-safety-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 500px) { .brand-safety-grid { grid-template-columns: 1fr 1fr; } }

.safety-pill-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.safety-pill-box.warn-box {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.alert, .net-banner {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  text-align: center;
}
:root[data-theme="dark"] .alert, :root[data-theme="dark"] .net-banner { color: var(--gold-light); }

/* Drawer & Modals */
.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 13, 0.78);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px; max-width: 85vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 210; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.drawer[aria-hidden="true"] { display: none; }

.drawer-item {
  padding: 11px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.drawer-item:hover { border-color: var(--gold); color: var(--gold); }

.modal-backdrop:not([hidden]) {
  display: flex; align-items: center; justify-content: center; padding: 14px;
}

.modal {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 460px; width: 100%;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  font-size: 13px; color: var(--text-muted);
}

.site-footer {
  text-align: center; font-size: 11.5px; color: var(--text-dim);
  padding: 8px 0 20px; display: flex; flex-direction: column; gap: 6px;
}
.site-footer a { color: var(--gold-dark); text-decoration: none; font-weight: 700; cursor: pointer; }
:root[data-theme="dark"] .site-footer a { color: var(--gold-light); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--gold-gradient); color: #06090f; padding: 8px 18px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 800;
  z-index: 9999; box-shadow: 0 8px 24px var(--gold-glow);
}

.contact-btn-row {
  display: flex; gap: 8px; margin-top: 4px;
}
.contact-action-btn {
  flex: 1; padding: 8px; background: var(--bg-surface-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 11.5px; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.contact-action-btn:hover { border-color: var(--gold); color: var(--gold); }


/* Final theme polish: warm cream surfaces in Light mode, deep ink surfaces in Dark mode. */
:root[data-theme="light"] .card,
:root[data-theme="light"] .clean-accordion,
:root[data-theme="light"] .modal {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] #btnPrivacy,
:root[data-theme="dark"] .styled-select,
:root[data-theme="dark"] .theme-option {
  color: var(--text);
}
.install-app-card .btn-solid { margin-top: 2px; }
#installHelpText { margin-top: 2px; }
#fbLimitCounter.limit-reached { color: var(--danger); font-weight: 800; }

/* Light theme refinement: warm ivory + soft sand + ink, avoiding harsh pure-white panels. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eee8dc;
  --bg-surface: #f8f3e9;
  --bg-surface-elevated: #eee2cc;
  --bg-input: #fdf8ef;
  --border: rgba(137, 83, 18, 0.28);
  --border-subtle: rgba(100, 72, 38, 0.18);
  --text: #28251f;
  --text-muted: #5d5549;
  --text-dim: #776d5e;
  --shadow-card: 0 10px 28px -12px rgba(65, 45, 18, 0.24);
}
:root[data-theme="light"] body { background: #eee8dc; color: var(--text); }
:root[data-theme="light"] .site-header { background: rgba(248, 243, 233, .94); border-bottom-color: rgba(137, 83, 18, .18); }
:root[data-theme="light"] .card,
:root[data-theme="light"] .clean-accordion,
:root[data-theme="light"] .modal,
:root[data-theme="light"] .install-app-card,
:root[data-theme="light"] .feedback-card,
:root[data-theme="light"] .contact-card { background: var(--bg-surface); border-color: var(--border-subtle); box-shadow: var(--shadow-card); }
:root[data-theme="light"] textarea,
:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="light"] select,
:root[data-theme="light"] .styled-select { background-color: var(--bg-input); color: var(--text); border-color: var(--border); }
:root[data-theme="light"] textarea::placeholder,
:root[data-theme="light"] input::placeholder { color: #817667; opacity: 1; }
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] #btnPrivacy,
:root[data-theme="light"] .theme-option,
:root[data-theme="light"] .style-pill,
:root[data-theme="light"] .tool-btn,
:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .contact-action-btn { background: #eee3cf; color: #3b3328; border-color: rgba(137, 83, 18, .22); }
:root[data-theme="light"] .icon-btn:hover,
:root[data-theme="light"] #btnPrivacy:hover,
:root[data-theme="light"] .theme-option:hover,
:root[data-theme="light"] .style-pill:hover,
:root[data-theme="light"] .tool-btn:hover,
:root[data-theme="light"] .btn-ghost:hover,
:root[data-theme="light"] .contact-action-btn:hover { background: #e4d2b2; border-color: #c78a22; color: #5b3507; }
:root[data-theme="light"] .style-pill.active,
:root[data-theme="light"] .theme-option.chosen,
:root[data-theme="light"] #btnPrivacy[aria-pressed="true"] { background: linear-gradient(135deg, #f8cf68, #e9a52b); color: #35230a; border-color: #bd7b16; box-shadow: 0 3px 10px rgba(153, 93, 12, .16); }
:root[data-theme="light"] .section-label,
:root[data-theme="light"] .card-title,
:root[data-theme="light"] .site-footer a { color: #7c4b0b; }
:root[data-theme="light"] .magic-hint-strip,
:root[data-theme="light"] .privacy-row,
:root[data-theme="light"] .net-banner,
:root[data-theme="light"] .alert { background: #f2e5cc; color: #554126; border-color: rgba(137, 83, 18, .22); }
:root[data-theme="light"] .diff-removed { background: rgba(185, 28, 28, .09); color: #991b1b; }
:root[data-theme="light"] .diff-added { background: rgba(4, 120, 87, .10); color: #065f46; }
:root[data-theme="light"] .site-footer { color: #6b6255; }
:root[data-theme="light"] .btn-solid { color: #2e2008; }
:root[data-theme="light"] .style-pill:focus-visible,
:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] a:focus-visible,
:root[data-theme="light"] textarea:focus-visible,
:root[data-theme="light"] input:focus-visible { outline-color: #b7791f; }
