/* ════════════════════════════════════════════════════════════
   JSONBox — JSON Toolkit
   Design System — Teal + Violet
   ════════════════════════════════════════════════════════════ */

/* ─── Design Tokens (Light) ─── */
:root {
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;

  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;

  --amber-500: #f59e0b;

  --surface-base: var(--white);
  --surface-raised: var(--white);
  --surface-sunken: var(--gray-50);
  --surface-hover: var(--gray-100);
  --surface-active: var(--teal-50);
  --surface-toolbar: var(--gray-50);
  --surface-editor: #fafbfc;
  --surface-overlay: rgba(0,0,0,.52);

  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-tertiary: var(--gray-400);
  --text-inverse: var(--white);
  --text-link: var(--teal-600);

  --border-default: var(--gray-200);
  --border-subtle: var(--gray-100);
  --border-focus: var(--teal-500);

  --accent: var(--teal-600);
  --accent-hover: var(--teal-700);
  --accent-subtle: var(--teal-50);

  --success: #059669;
  --success-bg: #ecfdf5;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --warning: var(--amber-500);
  --warning-bg: #fffbeb;

  --gradient-brand: linear-gradient(135deg, #0d9488, #7c3aed);
  --gradient-hero: linear-gradient(180deg, var(--teal-50) 0%, var(--white) 100%);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.06), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.08), 0 8px 10px rgba(0,0,0,.04);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', 'Menlo', monospace;

  --header-h: 56px;
  --ease: cubic-bezier(.4,0,.2,1);
  --duration: .18s;
}

/* ─── Design Tokens (Dark) ─── */
[data-theme="dark"] {
  --surface-base: #0b1120;
  --surface-raised: #111827;
  --surface-sunken: #0f172a;
  --surface-hover: #1f2937;
  --surface-active: #134e4a;
  --surface-toolbar: #111827;
  --surface-editor: #0b1120;
  --surface-overlay: rgba(0,0,0,.72);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0b1120;
  --text-link: #2dd4bf;

  --border-default: #1e293b;
  --border-subtle: #1e293b;
  --border-focus: #14b8a6;

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-subtle: #134e4a;

  --success: #34d399;
  --success-bg: #064e3b;
  --error: #f87171;
  --error-bg: #2d0a0a;
  --warning: #fbbf24;
  --warning-bg: #2d1f0a;

  --gradient-brand: linear-gradient(135deg, #2dd4bf, #a78bfa);
  --gradient-hero: linear-gradient(180deg, #111827 0%, var(--surface-base) 100%);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.24);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.32);
  --shadow-md: 0 4px 6px rgba(0,0,0,.36);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.48);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--surface-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: .875em; }

::selection { background: var(--accent-subtle); color: var(--accent); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ─── Header ─── */
.header {
  position: fixed; inset: 0 0 auto; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface-raised) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
  transition: background var(--duration) var(--ease);
}
.logo:hover { background: var(--surface-hover); text-decoration: none; }

.logo-mark {
  width: 30px; height: 30px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.logo-mark svg {
  width: 18px; height: 18px;
  stroke: white;
  stroke-width: 1.8;
  fill: none;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-default); }

.menu-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.menu-btn:hover { background: var(--accent-hover); }

/* ─── Language Switcher ─── */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.lang-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
}
.lang-btn i.i {
  color: var(--accent);
}
.lang-btn-current-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 175px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px;
  z-index: 300;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: modalIn .15s var(--ease);
}
.lang-menu.open {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.lang-option:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.lang-option.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}
.lang-option .lang-flag {
  font-size: 1.05rem;
}
.lang-option .lang-check {
  margin-left: auto;
  font-size: 0.8rem;
  display: none;
}
.lang-option.active .lang-check {
  display: inline-block;
}

/* Drawer Language Section */
.drawer-lang-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-lang-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.drawer-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.drawer-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-base);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.drawer-lang-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.drawer-lang-btn.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

/* ─── Nav Overlay ─── */
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayIn .2s var(--ease);
}
.nav-overlay.open { display: block; }

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nav-overlay__panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 320px; max-width: 85vw;
  background: var(--surface-raised);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  animation: panelSlide .25s var(--ease);
}

@keyframes panelSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.nav-overlay__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.nav-overlay__title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.nav-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: all var(--duration) var(--ease);
}
.nav-item:hover { background: var(--surface-hover); }
.nav-item:active { transform: scale(.98); }

.nav-item__icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: .9rem;
  flex-shrink: 0;
}
.nav-item span:nth-child(2) { flex: 1; }
.nav-item__arrow {
  color: var(--text-tertiary);
  font-size: 1rem;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.nav-item:hover .nav-item__arrow { opacity: 1; }

.nav-item.active .nav-item__icon {
  background: var(--gradient-brand);
  color: white;
}
.nav-item.active {
  font-weight: 600;
}

.nav-item__sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 14px;
}

/* ─── Main Container ─── */
.main-wrap {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.page {
  display: none;
  animation: pageIn .25s var(--ease);
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Editor Wrap ─── */
.editor-wrap {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.editor-wrap:focus-within { box-shadow: var(--shadow-md); }

.editor--main {
  width: 100%;
  min-height: 380px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--surface-editor);
  border: none;
  resize: vertical;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.editor--main::placeholder { color: var(--text-tertiary); }
.editor--main:focus { background: var(--surface-base); }

.editor__stats {
  display: flex; gap: 16px;
  padding: 6px 14px;
  font-size: .6875rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  background: var(--surface-toolbar);
  border-top: 1px solid var(--border-subtle);
}

/* ─── Action Bar & Toolbars (Figure 1 Standard) ─── */
.action-bar,
.options-bar,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}
.action-bar__sep,
.options-bar__sep,
.toolbar__sep {
  width: 1px;
  height: 22px;
  background: var(--border-default);
  margin: 0 4px;
}
.action-bar__group,
.chips-group,
.chip-group,
.toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.action-bar__label,
.options-bar__label,
.toolbar__label,
.examples__label {
  font-size: .6875rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .04em;
  user-select: none;
}

/* ─── Output Area ─── */
.output-area {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.output-area__head {
  display: flex; align-items: center;
  padding: 10px 14px;
  background: var(--surface-toolbar);
  border-bottom: 1px solid var(--border-subtle);
}
.output-area__title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px;
}
.output-area__body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 120px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: .01em;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Examples Bar ─── */
.examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}
.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  line-height: 1.2;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  user-select: none;
  box-shadow: var(--shadow-xs);
}
.example-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.example-chip:active {
  transform: translateY(0);
}

/* ─── Unified Buttons (Figure 1 Standard) ─── */
.btn,
.chip,
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  line-height: 1.2;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  user-select: none;
  box-shadow: var(--shadow-xs);
  outline: none;
  text-decoration: none;
}
.btn:hover,
.chip:hover,
.chip-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active,
.chip:active,
.chip-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* Primary / Active State (Teal background, white text & icon) */
.btn--primary,
.btn.active,
.chip.active,
.chip-btn.active,
.example-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.35);
}
.btn--primary:hover,
.btn.active:hover,
.chip.active:hover,
.chip-btn.active:hover,
.example-chip.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn--accent,
.btn--outline {
  background: var(--surface-raised);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.btn--accent:hover,
.btn--outline:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn--success { background: var(--success); border-color: var(--success); color: white; }
.btn--danger { background: var(--error); border-color: var(--error); color: white; }
.btn--sm { padding: 5px 12px; font-size: .75rem; border-radius: var(--radius-md); }
.btn--xs { padding: 3px 8px; font-size: .6875rem; border-radius: var(--radius-sm); }

.btn i.i,
.chip i.i,
.chip-btn i.i,
.example-chip i.i {
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Unified Select & Input (Figure 1 Standard) ─── */
.select {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: .8125rem;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
}
.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.input {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: .8125rem;
  font-family: var(--font-mono);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.hidden-input { display: none; }

/* ─── Panels ─── */
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease);
}
.panel:focus-within { box-shadow: var(--shadow-md); }

.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-toolbar);
  border-bottom: 1px solid var(--border-subtle);
}
.panel__title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px;
}
.panel__actions { display: flex; gap: 4px; flex-wrap: wrap; }
.panel__body { position: relative; }
.panel__foot {
  display: flex; justify-content: space-between;
  padding: 6px 14px;
  font-size: .6875rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  background: var(--surface-toolbar);
  border-top: 1px solid var(--border-subtle);
}

.editor {
  width: 100%;
  min-height: 360px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--surface-editor);
  border: none;
  resize: vertical;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.editor::placeholder { color: var(--text-tertiary); }
.editor:focus { background: var(--surface-base); }

.editor--out { min-height: 180px; max-height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.editor--readonly { cursor: default; }
.editor--short { min-height: 200px; }
.editor--xs { min-height: 72px; padding: 10px 14px; }

/* ─── Status ─── */
.status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: .8125rem;
  font-weight: 500;
  margin-top: 12px;
}
.status--idle { background: var(--surface-sunken); border: 1px solid var(--border-subtle); color: var(--text-tertiary); }
.status--ok { background: var(--success-bg); border: 1px solid var(--success); color: var(--success); }
.status--err { background: var(--error-bg); border: 1px solid var(--error); color: var(--error); }

/* ─── Error Card ─── */
.err-card {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: var(--radius-lg);
}
.err-card__loc { font-size: .8125rem; font-weight: 700; color: var(--error); margin-bottom: 4px; }
.err-card__msg { font-family: var(--font-mono); font-size: .8125rem; color: var(--error); }
.err-card__snippet {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-base);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: .75rem;
  white-space: pre;
  overflow-x: auto;
  border-left: 3px solid var(--error);
  line-height: 1.5;
}

/* ─── Grid Layouts ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ─── All Tools Hub Redesign ─── */
.hub-hero {
  text-align: center;
  padding: 36px 16px 24px;
  position: relative;
  background: radial-gradient(circle at 50% -20%, rgba(20, 184, 166, 0.16), transparent 70%);
  border-radius: var(--radius-2xl);
  margin-bottom: 20px;
}
.hub-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 14px;
  border: 1px solid rgba(45, 212, 191, 0.25);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.15);
}
.hub-hero__title {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.hub-hero__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* Stats Ribbon */
.hub-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.hub-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}
.hub-stat-pill strong {
  color: var(--accent);
  font-weight: 700;
}

/* Search Bar */
.hub-search-container {
  max-width: 620px;
  margin: 0 auto 20px;
  position: relative;
}
.hub-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-raised);
  border: 1.5px solid var(--border-default);
  border-radius: 9999px;
  padding: 4px 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
}
.hub-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2), var(--shadow-md);
}
.hub-search-icon {
  color: var(--text-tertiary);
  font-size: 1.1rem;
  margin-right: 10px;
}
.hub-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding: 8px 0;
  font-family: inherit;
}
.hub-search-input::placeholder {
  color: var(--text-tertiary);
}
.hub-search-clear {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
}
.hub-search-clear:hover {
  color: var(--text-primary);
}
.hub-search-shortcut {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Filter Tabs */
.hub-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hub-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.hub-filter-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.hub-filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}
.hub-filter-btn .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  background: rgba(0,0,0,0.12);
  color: inherit;
}
.hub-filter-btn.active .count-badge {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* Redesigned Elevated Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  padding: 8px 0 36px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: transparent;
  transition: all 0.2s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(45, 212, 191, 0.12);
}
.tool-card:hover::before {
  background: var(--gradient-brand);
}

.tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Gradient Icon Badges */
.icon-gradient-emerald { background: linear-gradient(135deg, #10b981, #06b6d4); }
.icon-gradient-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.icon-gradient-rose { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.icon-gradient-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.icon-gradient-cyan { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.icon-gradient-purple { background: linear-gradient(135deg, #a855f7, #ec4899); }
.icon-gradient-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.icon-gradient-blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }

/* Category & Feature Badges */
.tool-card__tag {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
}
.tag-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tag-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.tag-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.tag-teal { background: rgba(13, 148, 136, 0.15); color: #2dd4bf; }

.tool-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  transition: color var(--duration) ease;
}
.tool-card:hover .tool-card__title {
  color: var(--accent);
}

.tool-card__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.tool-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}
.tool-card__action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tool-card__action .arrow {
  transition: transform 0.2s ease;
}
.tool-card:hover .tool-card__action .arrow {
  transform: translateX(4px);
}

/* Page Top Nav (Breadcrumb Back to Hub) */
.page-top-nav {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.back-to-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.back-to-hub-btn:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Diff View ─── */
.diff-view { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.diff-pane {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
  max-height: 420px;
}
.diff-pane:first-child { border-right: 1px solid var(--border-default); }
.diff-add { background: var(--success-bg); }
.diff-rem { background: var(--error-bg); }
.diff-add::before { content: '+ '; color: var(--success); font-weight: 700; }
.diff-rem::before { content: '- '; color: var(--error); font-weight: 700; }

.tree-view { padding: 8px 12px; font-family: var(--font-mono); font-size: .8125rem; line-height: 1.8; color: var(--text-primary); }
.tree-node { margin: 2px 0; }
.tree-key { color: var(--accent); font-weight: 600; }
.tree-string, .tree-str { color: #059669; }
[data-theme="dark"] .tree-string, [data-theme="dark"] .tree-str { color: #6ee7b7; }
.tree-number, .tree-num { color: #ea580c; font-weight: 500; }
[data-theme="dark"] .tree-number, [data-theme="dark"] .tree-num { color: #fb923c; }
.tree-boolean, .tree-bool { color: #9333ea; font-weight: 600; }
[data-theme="dark"] .tree-boolean, [data-theme="dark"] .tree-bool { color: #c084fc; }
.tree-null, .tree-nil { color: #dc2626; font-style: italic; }
[data-theme="dark"] .tree-null, [data-theme="dark"] .tree-nil { color: #f87171; }
.tree-bracket { color: var(--text-secondary); cursor: pointer; user-select: none; font-weight: 600; }
.tree-bracket.toggle:hover { color: var(--accent); }
.tree-children { padding-left: 18px; border-left: 1px dashed var(--border-subtle); margin: 2px 0 2px 6px; }
.tree-children.hidden { display: none; }
.tree-bracket.collapsed::after { content: ' ... }'; color: var(--text-tertiary); font-weight: 400; }

/* ─── Stats Grid ─── */
.stat-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 16px 0;
}
@media (max-width: 768px) {
  .stat-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .stat-grid, .stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  text-align: center;
  padding: 20px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}
.stat-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.stat-card__label {
  font-size: .6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}

/* ─── Icons ─── */
.i { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; }
.i svg { width: 1em; height: 1em; vertical-align: -0.125em; }
.icon-wrap { display: inline-flex; align-items: center; justify-content: center; }
.btn .i { margin-right: 2px; }
.panel__title .i { margin-right: 4px; }
.status .i { margin-right: 4px; }
.tool-card__icon .i { width: 1.15rem; height: 1.15rem; }
.tool-card__icon .i svg { width: 1.15rem; height: 1.15rem; }
.hero__badge .i { margin-right: 4px; }
.theme-toggle .i { width: 1.1rem; height: 1.1rem; }
.theme-toggle .i svg { width: 1.1rem; height: 1.1rem; }

/* ─── About & Privacy Policy ─── */
.about { max-width: 860px; margin: 0 auto; padding-bottom: 48px; }
.about h2 { font-size: 1.25rem; font-weight: 700; margin: 32px 0 12px; color: var(--text-primary); }
.about p { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.8; font-size: .9375rem; }
.about ul { padding-left: 20px; color: var(--text-secondary); margin-bottom: 16px; }
.about li { margin-bottom: 6px; font-size: .875rem; line-height: 1.6; }

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 32px;
}
@media (max-width: 640px) {
  .privacy-grid { grid-template-columns: 1fr; }
}

.privacy-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.privacy-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.privacy-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.privacy-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--teal-50);
  color: var(--teal-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
[data-theme="dark"] .privacy-card__icon {
  background: rgba(0, 210, 180, 0.12);
  color: var(--teal-400);
}
.privacy-card__title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.privacy-card__desc {
  font-size: .8125rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.legal-section {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.legal-section__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.legal-section__text {
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}
.legal-section__text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-section__text a:hover {
  opacity: 0.8;
}
.legal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 12px;
}

.disclaimer-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin: 24px 0 20px;
  position: relative;
}
[data-theme="dark"] .disclaimer-box {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
}
.disclaimer-box__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #d97706;
  font-size: 1.0625rem;
  font-weight: 700;
}
[data-theme="dark"] .disclaimer-box__head {
  color: #fbbf24;
}
.disclaimer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.disclaimer-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .84375rem;
  line-height: 1.75;
  color: var(--text-secondary);
}
.disclaimer-item__icon {
  color: #d97706;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 3px;
}
[data-theme="dark"] .disclaimer-item__icon {
  color: #fbbf24;
}
.disclaimer-item strong {
  color: var(--text-primary);
  font-weight: 600;
}



/* ─── Syntax Highlighting ─── */
.hl-key { color: var(--teal-600); font-weight: 600; }
.hl-string { color: #16a34a; }
.hl-number { color: #ea580c; font-weight: 500; }
.hl-boolean { color: #9333ea; font-weight: 600; }
.hl-null { color: #dc2626; font-style: italic; }

[data-theme="dark"] .hl-key { color: #2dd4bf; }
[data-theme="dark"] .hl-string { color: #4ade80; }
[data-theme="dark"] .hl-number { color: #fb923c; }
[data-theme="dark"] .hl-boolean { color: #c084fc; }
[data-theme="dark"] .hl-null { color: #f87171; }

.tree-badge {
  font-size: .6875rem;
  padding: 1px 6px;
  background: var(--surface-sunken);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  margin-left: 4px;
}
.tree-idx {
  color: var(--text-tertiary);
  font-size: .75rem;
  margin-right: 4px;
}

/* ─── Info Box / Callouts ─── */
.info-box {
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.info-box h4 {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.info-box code {
  background: var(--surface-editor);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}



.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
}

/* ─── Modal ─── */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--surface-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn .2s var(--ease);
}
.modal.open {
  display: flex;
}
.modal__backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
}
.modal__dialog, .modal__content {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .2s var(--ease);
  z-index: 1;
}
@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}
.modal__close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal__foot, .modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-sunken);
}

/* ─── History List ─── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.history-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
}
.history-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.history-item__snippet {
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}
.history-item__meta {
  font-size: .6875rem;
  color: var(--text-tertiary);
}
.history-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-tertiary);
  font-size: .875rem;
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: .8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn .25s var(--ease);
  max-width: 380px;
}
.toast--ok, .toast-success { background: var(--success); color: white; }
.toast--err, .toast-error { background: var(--error); color: white; }
.toast--info, .toast-info { background: var(--accent); color: white; }
@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-tertiary);
  font-size: .75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 64px;
}
.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--text-primary); }
.footer__links { margin-top: 6px; display: flex; justify-content: center; gap: 12px; font-size: .75rem; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .diff-view { grid-template-columns: 1fr; }
  .diff-pane:first-child { border-right: none; border-bottom: 1px solid var(--border-default); }
}

@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: .9375rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .editor--main { min-height: 240px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar__sep { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-overlay__panel { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.375rem; }
  .logo-text { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
