/* ==========================================================================
   amraz.app — Self-Contained Design System
   Gemini Dark Blue & Luminous Gradient Theme (Default Dark + Light Toggle)
   Zero External CSS Frameworks • 100% Self-Hosted Fonts • Full LTR / RTL
   ========================================================================== */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/inter-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/vendor/fonts/inter-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/inter-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/inter-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/vendor/fonts/inter-latin-800.woff2') format('woff2'); }

@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/vazirmatn-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap; src: url('/vendor/fonts/vazirmatn-arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/vazirmatn-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/vazirmatn-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 800; font-display: swap; src: url('/vendor/fonts/vazirmatn-arabic-800.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }

@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/vazirmatn-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap; src: url('/vendor/fonts/vazirmatn-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/vazirmatn-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/vazirmatn-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 800; font-display: swap; src: url('/vendor/fonts/vazirmatn-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/poppins-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/poppins-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/poppins-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/playfair-display-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/playfair-display-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'Merriweather'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/merriweather-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Merriweather'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/merriweather-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/oswald-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/oswald-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/dancing-script-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/dancing-script-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/jetbrains-mono-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/jetbrains-mono-latin-700.woff2') format('woff2'); }

@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/cairo-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/cairo-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/cairo-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/cairo-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/cairo-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/cairo-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/rubik-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/rubik-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/rubik-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/rubik-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/rubik-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/rubik-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/amiri-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/amiri-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/amiri-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/amiri-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

@font-face { font-family: 'Lalezar'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/lalezar-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Lalezar'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/lalezar-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

@font-face { font-family: 'Aref Ruqaa'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/aref-ruqaa-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Aref Ruqaa'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/aref-ruqaa-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011; }
@font-face { font-family: 'Aref Ruqaa'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/aref-ruqaa-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: 'Aref Ruqaa'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/aref-ruqaa-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }

:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-rtl: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-active: var(--font-sans);

  /* Radii & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container-max: 1320px;
  --header-height: 70px;

  /* Brand Luminous Gradients (Obsidian Gold: #141418 & #F5B700) */
  --grad-primary: linear-gradient(135deg, #F5B700 0%, #D49B00 100%);
  --grad-primary-hover: linear-gradient(135deg, #FFCA38 0%, #F5B700 100%);
  --grad-brand-text: linear-gradient(135deg, #FFE082 0%, #F5B700 55%, #D49B00 100%);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-out);
  --transition-med: 240ms var(--ease-out);

  /* Default Dark Theme Tokens (Obsidian Gold — html.dark) */
  --bg-base: #141418;
  --bg-elevated: rgba(16, 16, 20, 0.94);
  --bg-surface: rgba(28, 28, 34, 0.86);
  --bg-surface-hover: rgba(38, 38, 46, 0.94);
  --bg-input: rgba(14, 14, 18, 0.92);
  --bg-canvas-stage: #0E0E12;
  --bg-checker-a: #1E1E24;
  --bg-checker-b: #282830;

  --trim-stroke: #F5B700;
  --border-subtle: rgba(245, 183, 0, 0.48);
  --border-strong: #F5B700;
  --border-hairline: rgba(245, 183, 0, 0.24);

  --text-primary: #f4f5f8;
  --text-secondary: #cbd2de;
  --text-muted: #98a0b2;
  --text-on-accent: #141418;

  --accent-blue: #F5B700;
  --accent-indigo: #FFCA38;
  --accent-teal: #FFE082;
  --accent-soft: rgba(245, 183, 0, 0.14);
  --accent-soft-hover: rgba(245, 183, 0, 0.24);

  --ambient-glow-1: rgba(245, 183, 0, 0.10);
  --ambient-glow-2: rgba(58, 58, 72, 0.22);

  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.14);
  --status-warn: #f59e0b;
  --status-warn-bg: rgba(245, 158, 11, 0.14);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-panel: 0 18px 44px -16px rgba(0, 0, 0, 0.72);
  --shadow-primary-btn: 0 8px 24px -6px rgba(245, 183, 0, 0.42);
  --focus-ring: 0 0 0 3px rgba(245, 183, 0, 0.45);
}

/* Light Mode Tokens (Warm Alabaster & Gold — html.light) */
html.light {
  --bg-base: #f7f6f2;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --bg-surface: rgba(255, 254, 250, 0.96);
  --bg-surface-hover: rgba(254, 246, 218, 0.96);
  --bg-input: rgba(255, 255, 255, 0.98);
  --bg-canvas-stage: #eceae3;
  --bg-checker-a: #e2e8f0;
  --bg-checker-b: #f8fafc;

  --trim-stroke: #C99400;
  --border-subtle: rgba(184, 130, 0, 0.42);
  --border-strong: #C99400;
  --border-hairline: rgba(184, 130, 0, 0.22);

  --text-primary: #141418;
  --text-secondary: #373a45;
  --text-muted: #5a5e6b;
  --text-on-accent: #141418;

  --grad-primary: linear-gradient(135deg, #F5B700 0%, #D49B00 100%);
  --grad-primary-hover: linear-gradient(135deg, #FFCA38 0%, #F5B700 100%);
  --grad-brand-text: linear-gradient(135deg, #141418 0%, #A67600 100%);

  --accent-blue: #A67600;
  --accent-indigo: #141418;
  --accent-teal: #8C6300;
  --accent-soft: rgba(212, 155, 0, 0.12);
  --accent-soft-hover: rgba(212, 155, 0, 0.22);

  --ambient-glow-1: rgba(245, 183, 0, 0.10);
  --ambient-glow-2: rgba(20, 20, 24, 0.06);

  --status-success: #059669;
  --status-success-bg: rgba(5, 150, 105, 0.11);
  --status-warn: #d97706;
  --status-warn-bg: rgba(217, 119, 6, 0.12);
  --status-danger: #dc2626;
  --status-danger-bg: rgba(220, 38, 38, 0.11);

  --shadow-panel: 0 14px 36px -14px rgba(20, 20, 24, 0.14);
  --shadow-primary-btn: 0 8px 22px -6px rgba(212, 155, 0, 0.34);
  --focus-ring: 0 0 0 3px rgba(212, 155, 0, 0.36);
}

html[dir="rtl"] {
  --font-active: var(--font-rtl);
}

/* ==========================================================================
   Base Reset & Ambient Canvas
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.light {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-active);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 68% 48% at 12% -6%, var(--ambient-glow-1), transparent 65%),
    radial-gradient(ellipse 56% 44% at 88% 4%, var(--ambient-glow-2), transparent 65%),
    radial-gradient(ellipse 52% 40% at 52% 102%, var(--ambient-glow-1), transparent 65%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html.light body {
  background-image:
    radial-gradient(ellipse 66% 48% at 12% -8%, var(--ambient-glow-1), transparent 65%),
    radial-gradient(ellipse 54% 44% at 90% 2%, var(--ambient-glow-2), transparent 65%),
    radial-gradient(ellipse 50% 38% at 50% 102%, var(--ambient-glow-1), transparent 65%);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-height);
  padding-block: 10px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-soft);
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  inset-inline: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-select {
  height: 38px;
  padding-inline: 10px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition-fast);
}

html[dir="rtl"] .lang-select {
  padding-inline: 10px 26px;
  background-position: left 8px center;
}

.lang-select:hover {
  border-color: var(--border-strong);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav-drawer {
  display: none;
  border-top: 1px solid var(--border-hairline);
  padding: 12px 16px 16px;
  background: var(--bg-elevated);
}

.mobile-nav-drawer.open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-drawer .nav-link {
  width: 100%;
  padding: 11px 14px;
}

/* ==========================================================================
   Main Content & Landing Hub
   ========================================================================== */

main {
  flex: 1 0 auto;
  padding-block: 32px 56px;
}

.hero-section {
  padding-block: 28px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 36px;
  align-items: center;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.8vw, 3.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-title-accent {
  background: var(--grad-brand-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-meta-line {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.meta-sep {
  color: var(--text-muted);
  user-select: none;
}

.hero-showcase {
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-panel);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.showcase-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.showcase-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.showcase-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.showcase-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.showcase-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.showcase-row-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.showcase-row-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.showcase-row-arrow {
  color: var(--accent-blue);
  flex-shrink: 0;
  display: inline-block;
}

html[dir="rtl"] .showcase-row-arrow {
  transform: scaleX(-1);
}

/* Tool Directory Grid */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-panel);
  transition: transform var(--transition-med), border-color var(--transition-med), box-shadow var(--transition-med);
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-blue);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.tool-icon-box svg {
  width: 22px;
  height: 22px;
}

.tool-card-index {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.tool-card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.tool-card-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  flex: 1 0 auto;
}

.tool-card-specs {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-card-cta {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Architecture Pillars */
.pillars-section {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--border-hairline);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.pillar-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pillar-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Buttons, Forms & Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

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

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

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--grad-primary);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-primary-btn);
}

.btn-primary:hover:not(:disabled) {
  background: var(--grad-primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

/* Segmented Controls / Preset Grids */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.segmented-btn {
  padding: 7px 12px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.active {
  background: var(--grad-primary);
  color: var(--text-on-accent);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.preset-btn {
  padding: 8px 10px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.preset-btn.active {
  background: var(--accent-soft-hover);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

/* Form Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.range-input {
  width: 100%;
  height: 6px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.color-swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-swatch:hover {
  transform: scale(1.06);
}

.color-swatch.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--accent-blue);
}

.color-input {
  width: 36px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  cursor: pointer;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ==========================================================================
   Tool Studio Workspace Layout
   ========================================================================== */

.tool-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.tool-page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.tool-page-subtitle {
  margin: 6px 0 0;
  font-size: 0.925rem;
  color: var(--text-secondary);
}

.tool-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.workspace-grid--wide-side {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.glass-panel {
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.stage-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1101px) {
  .stage-panel--sticky {
    position: sticky;
    top: 84px;
  }
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  flex-wrap: wrap;
}

.stage-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Scrollable outer container around interactive canvas for mobile ergonomics */
.workspace-scroll {
  position: relative;
  width: 100%;
  min-height: 480px;
  max-height: 74vh;
  overflow: auto;
  background-color: var(--bg-canvas-stage);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

.stage-panel.drag-over {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25), var(--shadow-panel);
}

.workspace-scroll > * {
  margin-block: auto;
}

.workspace-scroll--id {
  min-height: 0;
  max-height: none;
  overflow: visible;
  gap: 18px;
}

.workspace-scroll--id > * {
  margin-block: 0;
}

.canvas-checker {
  background-image:
    linear-gradient(45deg, var(--bg-checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--bg-checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--bg-checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--bg-checker-a) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: var(--bg-checker-b);
}

.interactive-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  touch-action: none;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.interactive-canvas:active {
  cursor: grabbing;
}

.interactive-canvas.cursor-crosshair {
  cursor: crosshair;
}

.interactive-canvas.cursor-default {
  cursor: default;
}

/* Sidebar Control Inspector */
.inspector-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.control-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.control-heading {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Dropzone / Empty State */
.dropzone {
  width: 100%;
  max-width: 520px;
  padding: 40px 28px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  background: var(--bg-surface);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.dropzone.drag-over {
  border-color: var(--accent-teal);
  background: var(--accent-soft);
}

.dropzone--compact {
  max-width: 100%;
  padding: 18px 22px;
  gap: 10px;
  cursor: pointer;
}

.dropzone--compact .dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.dropzone-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 38ch;
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

/* Layers & Queue Items */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-input);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.list-item.selected {
  border-color: var(--accent-blue);
  background: var(--accent-soft);
}

.list-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.list-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-canvas-stage);
  flex-shrink: 0;
}

.list-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.mini-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

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

.mini-btn svg {
  width: 14px;
  height: 14px;
}

/* Status Banner & Notices */
.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  line-height: 1.5;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.notice-error {
  background: var(--status-danger-bg);
  border-color: rgba(239, 68, 68, 0.36);
  color: var(--status-danger);
}

.notice-warn {
  background: var(--status-warn-bg);
  border-color: rgba(245, 158, 11, 0.36);
  color: var(--status-warn);
}

.notice-success {
  background: var(--status-success-bg);
  border-color: rgba(16, 185, 129, 0.36);
  color: var(--status-success);
}

.notice-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-panel);
  animation: toastIn 200ms var(--ease-out);
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.55);
}

.toast--success {
  border-color: rgba(16, 185, 129, 0.55);
}

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

/* Image-to-PDF Queue Grid */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  width: 100%;
  align-self: stretch;
  align-content: start;
}

.page-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.page-card.selected {
  border-color: var(--accent-blue);
  box-shadow: var(--focus-ring);
}

.page-card-preview {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-canvas-stage);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  cursor: pointer;
}

.page-card-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.page-card-num {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(6, 9, 20, 0.78);
  color: #f8fafc;
}

.page-card-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

/* ID Photo Dual Stage */
.id-stage-placeholder-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.id-dual-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  align-items: start;
}

.id-stage-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.id-stage-box .interactive-canvas {
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
}

.id-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
  touch-action: pan-y;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  cursor: default;
}

.id-stage-caption {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* QR Preview Box */
.qr-stage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
}

.qr-canvas-wrap {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-panel);
}

.qr-payload-preview {
  max-width: 460px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-input);
  font-size: 0.78rem;
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
}

.qr-preset-bar {
  max-width: 460px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qr-preset-label {
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.qr-preset-select {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 40px;
}

/* 404 Page */
.error-page {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding-block: 48px;
}

.error-code {
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 800;
  line-height: 1;
  background: var(--grad-brand-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  padding-block: 28px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-lang-link {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.footer-lang-link:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.footer-lang-link.active {
  color: var(--text-primary);
  font-weight: 600;
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobile 390px)
   ========================================================================== */

@media (max-width: 1100px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-section {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .workspace-grid--wide-side {
    grid-template-columns: 1fr;
  }

  .id-dual-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .container {
    padding-inline: 14px;
  }

  main {
    padding-block: 18px 40px;
  }

  .header-inner {
    min-height: 60px;
    gap: 8px;
  }

  .brand-link {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-controls {
    gap: 6px;
  }

  .lang-select {
    height: 36px;
    padding-inline: 8px 22px;
    font-size: 0.78rem;
  }

  .tools-grid,
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .workspace-scroll {
    min-height: 340px;
    max-height: 62vh;
    padding: 14px;
  }

  .workspace-scroll--id {
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .inspector-panel {
    padding: 14px;
  }

  .btn {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* ==========================================================================
   Adobe Photoshop-Style Photo Editor Workbench & Batch Mode
   ========================================================================== */

.ps-main {
  padding-block: 14px 28px;
}

.ps-container {
  width: 100%;
  max-width: 1560px;
  margin-inline: auto;
  padding-inline: 16px;
}

.ps-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.ps-opt-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ps-opt-divider {
  width: 1px;
  height: 22px;
  background: var(--border-hairline);
  margin-inline: 4px;
  flex-shrink: 0;
}

.ps-opt-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ps-opt-range {
  width: 84px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.ps-opt-select {
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.ps-workbench {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 356px;
  gap: 10px;
  align-items: stretch;
  min-height: calc(100vh - 178px);
}

/* Left Vertical Tool Dock */
.ps-tool-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-panel);
}

.ps-dock-sep {
  width: 28px;
  height: 1px;
  background: var(--border-hairline);
  margin-block: 3px;
  flex-shrink: 0;
}

.ps-tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 35px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.ps-tool-btn:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.ps-tool-btn.active {
  background: var(--grad-primary);
  color: var(--text-on-accent);
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.55);
}

.ps-tool-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ps-dock-color {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ps-fg-swatch {
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  background: var(--bg-input);
  cursor: pointer;
}

/* Center Studio Canvas Stage */
.ps-stage-wrap {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  min-width: 0;
  max-height: calc(100vh - 178px);
}

.ps-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ps-stage-scroll {
  flex: 1 1 0;
  min-height: 460px;
  max-height: none;
}

.ps-canvas-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.ps-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-input);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ps-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Right Tabbed Photoshop Panel Dock */
.ps-right-dock {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  max-height: calc(100vh - 178px);
}

.ps-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-input);
  flex-shrink: 0;
}

.ps-panel-tab {
  padding: 11px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.ps-panel-tab:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.ps-panel-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
  background: var(--accent-soft);
}

.ps-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ps-preset-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

/* History List */
.ps-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.ps-history-item {
  width: 100%;
  text-align: start;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.79rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ps-history-item:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.ps-history-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  font-weight: 600;
}

.ps-history-item.future {
  opacity: 0.45;
}

/* Batch Processing Queue & Recipe */
.ps-recipe-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.ps-batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.ps-batch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-input);
}

.ps-batch-item.active-preview {
  border-color: var(--accent-blue);
  background: var(--accent-soft);
}

.ps-batch-thumb {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-canvas-stage);
  flex-shrink: 0;
}

.ps-batch-meta {
  flex: 1;
  min-width: 0;
}

.ps-batch-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-batch-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ps-batch-sub.done {
  color: var(--status-success);
  font-weight: 600;
}

.ps-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.ps-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  transition: width 160ms var(--ease-out);
}

@media (max-width: 1120px) {
  .ps-workbench {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ps-tool-dock {
    flex-direction: row;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 6px 8px;
    -webkit-overflow-scrolling: touch;
  }

  .ps-dock-sep {
    width: 1px;
    height: 24px;
    margin-block: 0;
    margin-inline: 4px;
  }

  .ps-dock-color {
    margin-top: 0;
    margin-inline-start: auto;
    padding-top: 0;
    padding-inline-start: 6px;
  }

  .ps-stage-wrap,
  .ps-right-dock {
    max-height: none;
  }

  .ps-stage-scroll {
    flex: 1 1 auto;
    min-height: 360px;
    max-height: 60vh;
  }
}

@media (max-width: 680px) {
  .ps-container {
    padding-inline: 10px;
  }

  .ps-options-bar {
    padding: 8px;
    gap: 6px;
  }

  .ps-opt-divider {
    display: none;
  }
}

/* ==========================================================================
   Privacy Policy, Third-Party Licenses, Upload Notice & PWA UI
   ========================================================================== */

.upload-privacy-note {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.upload-privacy-note a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.upload-privacy-note a:hover {
  color: var(--text-primary);
}

.footer-font-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-font-select {
  height: 32px;
  padding: 0 26px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-active);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  max-width: 175px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

html[dir="rtl"] .footer-font-select {
  padding: 0 10px 0 26px;
}

.footer-font-select:hover,
.footer-font-select:focus-visible {
  border-color: var(--border-strong);
  outline: none;
}

code, pre, .license-text {
  font-family: var(--font-mono);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-legal a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-legal a:hover {
  color: var(--text-primary);
}

.legal-shell {
  max-width: 820px;
  margin-inline: auto;
}

.legal-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-hairline);
}

.legal-meta {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.legal-article {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-section {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.legal-section h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legal-section p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.license-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.license-card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.license-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.license-details summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-blue);
  user-select: none;
  padding-block: 4px;
}

.license-text {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  direction: ltr;
  text-align: left;
}

.toast--update {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: var(--accent-blue);
}

.pwa-install-btn {
  padding-inline: 10px;
  height: 34px;
  min-height: 34px;
  font-size: 0.78rem;
}

@media (max-width: 680px) {
  .legal-section,
  .license-card {
    padding: 16px;
  }

  .pwa-install-btn {
    padding-inline: 8px;
    font-size: 0.74rem;
  }
}

/* Footer version link */
.footer-version {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  margin-inline-start: 6px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.footer-version:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

/* ID Photo Framing Controls, Empty Margin Badge, Guide Disclaimer & Print Sheet Modal */
.id-framing-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.id-tool-btn {
  min-height: 36px;
  min-width: 36px;
  padding-inline: 10px;
  font-variant-numeric: tabular-nums;
}

.id-crop-canvas-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#id-crop-canvas {
  touch-action: none;
  outline: none;
}

#id-crop-canvas:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.id-empty-margin-badge {
  width: 100%;
  max-width: 440px;
  text-align: center;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.id-guide-disclaimer {
  margin: 4px 0 0;
  max-width: 460px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.id-sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.id-sheet-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.id-sheet-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 6px;
}

.id-sheet-wrap.is-actual-size {
  display: block;
  overflow: auto;
  max-height: 440px;
  max-width: 100%;
  padding: 8px;
  background: var(--bg-canvas-stage);
  border: 1px solid var(--border-subtle);
}

.id-sheet-wrap.is-actual-size .id-preview-canvas {
  max-width: none;
  max-height: none;
}

.id-sheet-modal {
  width: min(96vw, 1180px);
  height: min(92vh, 880px);
  max-width: 96vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.id-sheet-modal[open] {
  display: flex;
  flex-direction: column;
}

.id-sheet-modal::backdrop {
  background: rgba(6, 9, 20, 0.78);
  backdrop-filter: blur(6px);
}

.id-sheet-modal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

.id-sheet-modal-head h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.id-sheet-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.id-sheet-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-canvas-stage);
}

.id-sheet-modal-canvas {
  display: block;
  touch-action: none;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Tool Guide Sections, Embedded FAQ & Related Tools */
.tool-guide-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pe-page .tool-guide-section {
  margin-top: 28px;
  padding-bottom: 40px;
}

.tool-guide-intro {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-guide-intro h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.tool-guide-intro p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tool-guide-privacy {
  font-size: 0.88rem !important;
  font-weight: 600;
  color: var(--accent-teal, var(--accent-blue)) !important;
}

.tool-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-guide-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tool-guide-card h3,
.tool-guide-faq h3,
.tool-guide-related h3 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-guide-steps,
.tool-guide-features {
  margin: 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.tool-guide-faq-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-guide-faq-head h3 {
  margin: 0;
}

.tool-guide-faq-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
}

.tool-guide-faq-link:hover {
  text-decoration: underline;
}

.tool-related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.tool-related-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.tool-related-card strong {
  font-size: 0.94rem;
  font-weight: 700;
}

.tool-related-card span {
  font-size: 0.82rem;
  color: var(--accent-blue);
  font-weight: 500;
}

/* Native Details/Summary FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '−';
  color: var(--accent-blue);
}

.faq-answer {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--text-secondary);
}

/* Changelog Page */
.changelog-release {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.changelog-release h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.changelog-group + .changelog-group {
  margin-top: 14px;
}

.changelog-group h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-blue);
}

.changelog-list {
  margin: 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.changelog-list code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  font-size: 0.82rem;
}

/* Privacy Clear Data Controls */
.privacy-clear-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-block: 12px;
}

@media (max-width: 760px) {
  .id-tool-btn {
    min-height: 44px;
    min-width: 44px;
    padding-inline: 12px;
  }

  .id-crop-canvas-shell {
    padding-inline: 22px;
  }

  .tool-guide-grid,
  .tool-related-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
