/* ==========================================================================
   مُنجِز (Munjiz) — Shared Design System (RTL, Mobile-First)
   Palette: Deep Emerald (#0B3B2E), Rich Gold (#C9A24D), Crisp White (#FFFFFF)
   ========================================================================== */

:root {
  /* Brand Colors */
  --primary: #0b3b2e;
  --primary-dark: #07281f;
  --primary-light: #135543;
  --primary-tint: #eef5f2;
  --accent: #c9a24d;
  --accent-hover: #b58d38;
  --accent-tint: #fbf6eb;

  /* Neutrals */
  --bg-page: #f7f9f8;
  --bg-surface: #ffffff;
  --bg-muted: #f0f4f2;
  --text-main: #162420;
  --text-secondary: #4c5e58;
  --text-muted: #6f807a;
  --border: #dce5e1;
  --border-strong: #c2d0ca;

  /* Semantic */
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #0369a1;
  --info-bg: #e0f2fe;

  /* Typography */
  --font-sans: "Cairo", "Tajawal", system-ui, -apple-system, sans-serif;
  --font-alt: "Tajawal", "Cairo", sans-serif;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(11, 59, 46, 0.05);
  --shadow-md: 0 8px 24px rgba(11, 59, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(11, 59, 46, 0.12);

  /* Layout */
  --container-max: 1220px;
  --header-height: 74px;
  --transition: 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
canvas {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

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

button {
  cursor: pointer;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 24px;
  }
}

.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;
}

.hidden {
  display: none !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent-tint);
  color: #84631c;
  border: 1px solid rgba(201, 162, 77, 0.35);
}

.badge-emerald {
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid rgba(11, 59, 46, 0.16);
}

/* ==========================================================================
   Header & Navigation (Mobile-First)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-link:hover {
  color: var(--primary);
}

.brand-logo-svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

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

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name-en {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-hover);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 480px) {
  .brand-tagline {
    display: block;
  }
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--primary);
}

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 12px 16px 18px;
  flex-direction: column;
  gap: 6px;
}

.nav-menu.open {
  display: flex;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-tint);
  color: var(--primary);
}

.nav-link.active {
  font-weight: 700;
}

@media (min-width: 960px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 4px;
  }

  .nav-link {
    padding: 8px 13px;
    font-size: 0.92rem;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.3;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-gold {
  background: linear-gradient(135deg, #c9a24d 0%, #b38a33 100%);
  color: #ffffff;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.04);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--primary);
}

.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border-color: rgba(185, 28, 28, 0.3);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1.02rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Hero & Page Header Sections
   ========================================================================== */

.hero {
  background: radial-gradient(circle at top left, rgba(201, 162, 77, 0.16), transparent 45%),
    linear-gradient(135deg, #07281f 0%, #0b3b2e 55%, #124d3d 100%);
  color: #ffffff;
  padding: 44px 0 54px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(201, 162, 77, 0.14) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.45;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    padding: 64px 0 72px;
  }

  .hero-inner {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

.hero-title {
  margin: 14px 0 14px;
  font-size: clamp(1.75rem, 3.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.28;
}

.hero-title span {
  color: #e6c677;
}

.hero-desc {
  margin: 0 0 24px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 620px;
}

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

.hero-trust-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(8px);
}

.hero-trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.hero-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.94);
}

.page-banner {
  background: linear-gradient(135deg, #07281f 0%, #0b3b2e 100%);
  color: #ffffff;
  padding: 28px 0 32px;
  border-bottom: 3px solid var(--accent);
}

.page-banner h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 800;
}

.page-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  max-width: 740px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}

.breadcrumb a {
  color: #e6c677;
}

/* ==========================================================================
   Cards, Sections & Tool Grid
   ========================================================================== */

.section {
  padding: 40px 0;
}

@media (min-width: 768px) {
  .section {
    padding: 56px 0;
  }
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
}

.section-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--primary);
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.tool-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 59, 46, 0.12);
}

.tool-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.tool-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-grow: 1;
}

.tool-features-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.tool-features-mini li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tool-features-mini li::before {
  content: "✓";
  color: var(--accent-hover);
  font-weight: 800;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .panel {
    padding: 26px;
  }
}

.panel-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Form Controls, Dropzones & Tabs
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control,
.form-select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 59, 46, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 86px;
}

.range-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tabs */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  background: var(--bg-surface);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.92rem;
  transition: all var(--transition);
}

.tab-btn:hover {
  background: var(--bg-muted);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  padding: 28px 18px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.dropzone-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Google AdSense Clean Responsive Placeholders
   ========================================================================== */

.ad-wrapper {
  margin: 22px auto;
}

.ad-slot {
  width: 100%;
  min-height: 96px;
  background: linear-gradient(180deg, #f3f6f4 0%, #eef2f0 100%);
  border: 1px dashed #c7d3cd;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ad-slot-label {
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

@media (min-width: 768px) {
  .ad-slot-banner {
    min-height: 104px;
  }
}

/* ==========================================================================
   Tool Guide, Features & FAQ (SEO & AdSense Content Section)
   ========================================================================== */

.seo-content-section {
  margin-top: 38px;
  display: grid;
  gap: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 820px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: step-counter;
}

.steps-list li {
  counter-increment: step-counter;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.steps-list li::before {
  content: counter(step-counter);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

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

.faq-item summary {
  padding: 15px 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}

.faq-answer {
  padding: 14px 18px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* ==========================================================================
   Toast & Status Alerts
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 640px) {
  .toast-container {
    right: auto;
    align-items: flex-start;
    max-width: 380px;
  }
}

.toast {
  pointer-events: auto;
  background: var(--primary-dark);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-right: 4px solid var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  animation: slideUp 0.25s ease;
}

.toast.toast-error {
  background: #7f1d1d;
  border-right-color: #fca5a5;
}

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

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.alert-info {
  background: var(--info-bg);
  color: #0c4a6e;
  border: 1px solid #bae6fd;
}

.alert-success {
  background: var(--success-bg);
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.alert-warning {
  background: var(--warning-bg);
  color: #78350f;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   Tool Specific Layouts
   ========================================================================== */

/* Workspace 2-column (Controls + Preview) */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

@media (min-width: 980px) {
  .studio-layout {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .studio-layout.preview-first {
    grid-template-columns: 0.95fr 1.05fr;
  }
}

.preview-sticky {
  position: static;
}

@media (min-width: 980px) {
  .preview-sticky {
    position: sticky;
    top: calc(var(--header-height) + 18px);
  }
}

/* Greeting Cards Studio */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pill-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.templates-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.template-thumb {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  transition: all var(--transition);
}

.template-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 162, 77, 0.3);
}

.template-thumb canvas {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.template-thumb span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.phrases-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding-left: 4px;
}

.phrase-chip {
  text-align: right;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.5;
  transition: all var(--transition);
}

.phrase-chip:hover,
.phrase-chip.active {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
}

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

.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
  padding: 0;
}

.swatch-btn.active {
  box-shadow: 0 0 0 2px var(--primary);
  transform: scale(1.1);
}

.canvas-stage {
  background: repeating-conic-gradient(#eef2f0 0% 25%, #f8faf9 0% 50%) 50% / 18px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-stage canvas {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 540px;
  width: auto;
  height: auto;
  touch-action: none;
}

/* PDF File List */
.file-items-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

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

.file-item-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.file-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.pdf-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}

.pdf-page-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.pdf-page-card.selected {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.pdf-page-card canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 4px;
  border: 1px solid #eee;
}

.pdf-page-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.doc-preview-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  max-height: 380px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.75;
}

.doc-preview-frame table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.doc-preview-frame th,
.doc-preview-frame td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  text-align: right;
}

.doc-preview-frame th {
  background: var(--primary);
  color: #ffffff;
}

.doc-preview-frame tr:nth-child(even) td {
  background: #f8fafc;
}

.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.25s ease;
}

/* ID Photo Studio */
.id-crop-stage {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: grab;
  touch-action: none;
}

.id-crop-stage:active {
  cursor: grabbing;
}

.id-sheet-preview {
  background: #e5ebe8;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  justify-content: center;
}

.id-sheet-preview canvas {
  max-height: 400px;
  width: auto;
  box-shadow: var(--shadow-md);
  background: #fff;
}

/* ==========================================================================
   Prose Pages (About, Privacy, Terms, Contact)
   ========================================================================== */

.prose-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  max-width: 880px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .prose-card {
    padding: 38px 42px;
  }
}

.prose-card h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.prose-card h2:first-child {
  margin-top: 0;
}

.prose-card p,
.prose-card li {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.prose-card ul {
  padding-right: 20px;
}

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

.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  margin-top: 56px;
  padding: 44px 0 24px;
  border-top: 4px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-title {
  color: #e6c677;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #e6c677;
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    text-align: right;
  }
}

/* ==========================================================================
   QR Single-Use Invitations & Verification Screens
   ========================================================================== */

.tools-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .tools-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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

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

.invite-tpl-btn {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.invite-tpl-btn.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(201, 162, 77, 0.25);
}

.invite-tpl-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.verify-status-card {
  max-width: 620px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
  background: var(--bg-surface);
  transition: all 0.28s ease;
}

.verify-status-card.state-valid {
  background: linear-gradient(180deg, #ecfdf3 0%, #ffffff 65%);
  border-color: #16a34a;
}

.verify-status-card.state-used {
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 65%);
  border-color: #dc2626;
}

.verify-status-card.state-invalid {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 65%);
  border-color: #d97706;
}

.verify-icon-circle {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
}

.state-valid .verify-icon-circle {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.28);
}

.state-used .verify-icon-circle {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.28);
}

.state-invalid .verify-icon-circle {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(217, 119, 6, 0.25);
}

.verify-details-grid {
  margin: 22px 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 10px;
  text-align: right;
}

.verify-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.94rem;
}

.verify-detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.verify-detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.verify-detail-value {
  color: var(--text-main);
  font-weight: 800;
  word-break: break-word;
}

.scanner-video-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 14px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--primary);
  background: #0b1612;
}

.scanner-video-box video {
  width: 100%;
  height: auto;
  display: block;
}

.scanner-reticle {
  position: absolute;
  inset: 18%;
  border: 2px dashed #e6c677;
  border-radius: var(--radius-md);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
}

.code-block-pre {
  background: #0b1915;
  color: #e6f2ed;
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  max-height: 300px;
}
