/* Aprivo Design System */

/* ================================================================== */
/* Design tokens                                                       */
/* ================================================================== */

:root {
    /* — Colors — */
    --color-primary: #0d9488;          /* Teal-600 */
    --color-primary-hover: #0f766e;    /* Teal-700 */
    --color-primary-light: #f0fdfa;    /* Teal-50 */
    --color-primary-ring: rgba(13, 148, 136, 0.15);
    --color-primary-dark: #115e59;     /* Teal-800 */
    --color-primary-surface: #ccfbf1;  /* Teal-100 */
    --color-primary-border: #5eead4;   /* Teal-300 */

    --color-accent: #c2410c;           /* Warm Orange — complementary to teal */
    --color-selected: #fbbf24;         /* Amber-400 — selected/highlighted state border */
    --color-selected-glow: rgba(251, 191, 36, 0.25);

    --color-success: #22c55e;
    --color-success-hover: #16a34a;
    --color-success-light: #dcfce7;
    --color-success-dark: #166534;
    --color-success-border: #86efac;
    --color-success-surface: #f0fdf4;

    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-warning-dark: #92400e;
    --color-warning-surface: #fef9c3;
    --color-warning-border: #fde68a;

    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fee2e2;
    --color-danger-dark: #b91c1c;
    --color-danger-border: #fca5a5;
    --color-danger-surface: #fecaca;

    --color-orange: #f97316;

    --color-info: #3b82f6;
    --color-info-light: #dbeafe;
    --color-info-dark: #1e40af;
    --color-info-border: #93c5fd;

    --color-focus-ring: #99f6e4;     /* Teal-200 — visible focus outline */

    /* Neutrals (teal-tinted) */
    --color-text: #0c1b1a;
    --color-text-secondary: #1e3a38;
    --color-text-muted: #5f7a78;
    --color-text-tertiary: #94a8a6;
    --color-text-inverse: #ffffff;

    --color-surface: #ffffff;
    --color-surface-sunken: #f6faf9;
    --color-bg: #f0f5f4;

    --color-border: #d5e0de;
    --color-border-light: #eaf0ef;
    --color-border-medium: #b8ccc9;

    /* — Typography — */
    --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    /* -- Type Scale (1.25 major third) -- */
    --text-xs: 0.75rem;     /* 12px — badges, captions, fine print */
    --text-sm: 0.875rem;    /* 14px — secondary text, table cells, metadata */
    --text-base: 1rem;      /* 16px — body text, form inputs */
    --text-lg: 1.125rem;    /* 18px — lead text, card titles */
    --text-xl: 1.25rem;     /* 20px — subheadings */
    --text-2xl: 1.5rem;     /* 24px — section headings, page titles */
    --text-3xl: 2rem;       /* 32px — hero headings, feature titles */


    /* — Spacing — */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;

    /* — Radii — */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 999px;

    /* — Shadows — */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);

    /* — Nav — */
    --nav-height: 52px;
    --nav-bg: #134e4a;           /* Deep teal */
    --nav-text: #b8d8d4;         /* Teal-tinted light */
    --nav-text-active: #ffffff;
    --nav-accent: var(--color-primary);
}


/* Tabular numerals for aligned numbers */
.billing-donut-value,
.gauge-value,
.gauge-score-text,
.pricing__price,
.stat-value,
.usage-count,
.summary-count,
.export-action-count,
.gauge-count,
.batch-deck-score {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ================================================================== */
/* Skip link (accessibility)                                           */
/* ================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  overflow: visible;
}

/* Scroll-margin for anchor targets */
[id] {
  scroll-margin-top: calc(var(--nav-height) + var(--space-lg));
}

/* ================================================================== */
/* Utility / page-level classes                                        */
/* ================================================================== */

/* Nav icon SVG alignment (replaces inline style) */
.nav-icon {
  vertical-align: text-bottom;
  margin-right: 4px;
}

/* Page padding utility (replaces style="padding: 24px;") */
.page--padded {
  padding: 24px;
}

/* Page title center (replaces inline style) */
.page-title {
  text-align: center;
  margin-bottom: 24px;
}

/* Billing card center alignment */
.billing-card--centered {
  text-align: center;
}

/* Secondary text color utility */
.text-secondary {
  color: var(--color-text-secondary);
}

/* Narrow page container (replaces inline style) */
.page--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding-top: var(--space-2xl);
}

/* Batch empty state text */
.batch-empty-text {
  text-align: center;
  color: var(--color-text-muted);
}

/* Link primary utility */
.link-primary {
  color: var(--color-primary);
  font-weight: 500;
}

/* ================================================================== */
/* Component classes                                                    */
/* ================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
}
.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-surface-sunken);
}
.btn--danger {
  background: var(--color-danger);
  color: var(--color-text-inverse);
}
.btn--danger:hover {
  background: var(--color-danger-hover);
}
.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary-light);
}
.btn--sm { padding: 6px 14px; font-size: var(--text-xs); min-height: 44px; }
.btn--lg { padding: 14px 28px; font-size: var(--text-base); }

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
}
.card__header {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}
.card__body { /* default, no special styles beyond card padding */ }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge--primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.badge--success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}
.badge--warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}
.badge--danger {
  background: var(--color-danger-light);
  color: var(--color-danger-dark);
}

/* --- Form Inputs --- */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus-visible {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}
.form-input:focus:not(:focus-visible) {
  outline: none;
}
.form-input::placeholder {
  color: var(--color-text-tertiary);
}
.form-input.is-invalid {
  border-color: var(--color-danger);
}
.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

/* --- Tables --- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--color-border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}
.table tr:hover td {
  background: var(--color-surface-sunken);
}

/* --- Score Bar --- */
.score-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-border-light);
  overflow: hidden;
}
.score-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ================================================================== */
/* Layout: App navigation bar                                          */
/* ================================================================== */

/* --- App Navigation --- */
.app-nav {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    padding: 0 var(--space-xl);
    background: var(--nav-bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}
.app-nav__brand {
    font-family: 'Pacifico', cursive;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--nav-text-active);
    text-decoration: none;
    letter-spacing: 0.01em;
    margin-right: auto;
    line-height: 1;
}
.app-nav__center {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-right: var(--space-xl);
}
.app-nav__link {
    color: var(--nav-text);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    transition: color 0.15s, background 0.15s;
}
.app-nav__link:hover {
    color: var(--nav-text-active);
    background: rgba(255,255,255,0.08);
}
.app-nav__link--active {
    color: var(--nav-text-active);
    background: rgba(255,255,255,0.12);
}
.app-nav__right {
    display: flex;
    align-items: center;
}
.app-nav__avatar-wrap {
    position: relative;
}
.app-nav__avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: border-color 0.15s;
}
.app-nav__avatar:hover {
    border-color: rgba(255,255,255,0.5);
}
.app-nav__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    z-index: 200;
}
.app-nav__dropdown-name {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}
.app-nav__dropdown-email {
    display: block;
    padding: 0 var(--space-lg) var(--space-sm);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.app-nav__dropdown-divider {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--space-xs) 0;
}
.app-nav__dropdown-item {
    display: block;
    padding: var(--space-md) var(--space-lg);
    min-height: 44px;
    font-size: var(--text-sm);
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.app-nav__dropdown-item:hover,
.app-nav__dropdown-item:focus {
    background: var(--color-surface-sunken);
    outline: none;
}
.app-nav__dropdown-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--color-focus-ring);
}
.app-nav__dropdown-item--danger {
    color: var(--color-danger);
}
.app-nav__dropdown-item--danger:hover {
    background: var(--color-danger-light);
}
.app-nav__dropdown-form {
    margin: 0;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/* Touch targets */
a, button, input, select, textarea, [role="button"] {
  touch-action: manipulation;
}

/* Balanced heading wrapping */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}


/* Ensure hidden attribute always wins over explicit display rules */
[hidden] {
    display: none !important;
}

/* Mobile: app nav and auth */
@media (max-width: 480px) {
  .app-nav {
    padding: 0 var(--space-md);
  }
  .app-nav__center {
    display: none;
  }
  .auth-card {
    padding: var(--space-xl) var(--space-lg);
  }
  .auth-page {
    padding: var(--space-lg);
  }
}

/* Reduced motion preference */
@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;
  }
}


body {
    font-family: var(--font-body);
    line-height: 1.5;
    background: var(--color-bg) radial-gradient(ellipse at 50% 0%, rgba(13, 148, 136, 0.05) 0%, transparent 60%);
    color: var(--color-text-secondary);
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--nav-height);
}

/* ------------------------------------------------------------------ */
/* Page layout                                                          */
/* ------------------------------------------------------------------ */

.page {
    width: 100%;
    max-width: 560px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* ------------------------------------------------------------------ */
/* Upload page: billing & usage notices                                */
/* ------------------------------------------------------------------ */

.billing-warning {
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--color-warning-dark);
}
.billing-warning a {
    color: var(--color-primary);
    font-weight: 500;
}
.usage-counter {
    text-align: center;
    margin-bottom: 16px;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}
.usage-count {
    font-weight: 600;
    color: var(--color-text);
}
.usage-remaining {
    color: var(--color-text-muted);
}
.upload-blocked {
    text-align: center;
    padding: 32px;
    color: var(--color-text-muted);
}
.upload-blocked a {
    color: var(--color-primary);
    font-weight: 500;
}
.ai-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.ai-locked a {
    color: var(--color-primary);
    font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* Upload page: batch file selection                                   */
/* ------------------------------------------------------------------ */

.batch-name-field {
    margin: 16px 0;
}
.batch-name-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary, #1e3a38);
    margin-bottom: 6px;
    font-weight: 400;
}
.batch-name-input {
    font-size: var(--text-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    font-family: inherit;
}
.batch-name-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ring, rgba(13, 148, 136, 0.15));
}
.batch-file-list {
    margin: 12px 0;
}
.batch-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: var(--text-sm);
}
.batch-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
}
.batch-file-size {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    flex-shrink: 0;
}
.batch-file-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--text-lg);
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
    padding: 0;
}
.batch-file-remove:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}
#batch-upload-btn {
    margin-top: 12px;
    width: 100%;
}

/* ------------------------------------------------------------------ */
/* Upload card / drop zone                                             */
/* ------------------------------------------------------------------ */

.upload-card {
    width: 100%;
    background: var(--color-surface);
    border: 2px dashed var(--color-border-medium);
    border-radius: 1rem;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    cursor: default;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    box-shadow: var(--shadow-md);
}

/* Drag-over highlight state toggled by JS */
.upload-card.drag-over {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

/* ------------------------------------------------------------------ */
/* File icon                                                            */
/* ------------------------------------------------------------------ */

.file-icon svg {
    width: 64px;
    height: 64px;
}

/* ------------------------------------------------------------------ */
/* Headings                                                             */
/* ------------------------------------------------------------------ */

.upload-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

.upload-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* AI Model selector (upload page)                                      */
/* ------------------------------------------------------------------ */

/* Upload step containers */
.upload-step {
    width: 100%;
    max-width: 480px;
    margin-bottom: 1rem;
    text-align: left;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}

.step-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.step-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 0.625rem;
    padding-left: 2.25rem;
}

.model-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-medium);
    border-radius: 0.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.model-select:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-color: var(--color-primary);
    box-shadow: none;
}
.model-select:focus:not(:focus-visible) {
    outline: none;
}

.model-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 0.375rem;
    line-height: 1.4;
    min-height: 1.2em;
}

/* ------------------------------------------------------------------ */
/* Visually-hidden utility (accessible file input)                      */
/* ------------------------------------------------------------------ */

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

/* ------------------------------------------------------------------ */
/* Browse button                                                        */
/* ------------------------------------------------------------------ */

.browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
    font-weight: 500;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
    line-height: 1;
}

.browse-btn:hover {
    background: var(--color-primary-hover);
}

.browse-btn:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Error message                                                        */
/* ------------------------------------------------------------------ */

.error-message {
    font-size: var(--text-sm);
    color: var(--color-danger);
    font-weight: 500;
    max-width: 100%;
}

/* ------------------------------------------------------------------ */
/* Upload progress bar                                                  */
/* ------------------------------------------------------------------ */

.upload-progress {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.upload-progress-fill.indeterminate {
    width: 40%;
    animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.upload-progress-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}
.upload-progress-notice {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    font-style: italic;
}

/* ------------------------------------------------------------------ */
/* File info section                                                    */
/* ------------------------------------------------------------------ */

.file-info {
    width: 100%;
}

.file-info-card {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.file-info-icon svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.file-info-details {
    flex: 1;
    min-width: 0;
}

.file-info-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dot-separator {
    font-size: var(--text-base);
    line-height: 1;
    color: var(--color-border-medium);
}

.file-info-check svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Responsive adjustments                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
    .upload-card {
        padding: 2rem 1.25rem;
    }

    .upload-title {
        font-size: var(--text-lg);
    }

    .upload-subtitle {
        font-size: var(--text-sm);
    }
}

/* ================================================================== */
/* Page: Checkout Success                                               */
/* ================================================================== */

.checkout-success {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-xl);
}

.checkout-success-card {
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    max-width: 480px;
    width: 100%;
}

.checkout-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    background: var(--color-success-light, #dcfce7);
    color: var(--color-success, #22c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.checkout-success-card h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-sm);
}

.checkout-success-card p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-lg);
}

/* ================================================================== */
/* Page: Dashboard                                                      */
/* ================================================================== */

.dashboard-body {
    align-items: flex-start;
    justify-content: flex-start;
    background-color: var(--color-bg);
    padding-top: var(--nav-height);
}

.dashboard-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ------------------------------------------------------------------ */
/* Dashboard header                                                     */
/* ------------------------------------------------------------------ */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-sm) 0;
}

.dashboard-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
}

.back-link {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-link {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* ------------------------------------------------------------------ */
/* Two-column layout                                                    */
/* ------------------------------------------------------------------ */

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Dual gauges row                                                      */
/* ------------------------------------------------------------------ */

.gauges-row {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 640px) {
    .gauges-row {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/* ------------------------------------------------------------------ */
/* Gauge section                                                        */
/* ------------------------------------------------------------------ */

.gauge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-surface);
    border-radius: 1rem;
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-md);
}

.gauge {
    width: 120px;
    height: 120px;
}

/* Gauge ring color by score range */
.gauge.gauge-green .gauge-ring {
    stroke: var(--color-success);
}

.gauge.gauge-yellow .gauge-ring {
    stroke: var(--color-warning);
}

.gauge.gauge-red .gauge-ring {
    stroke: var(--color-danger);
}

.gauge-score-text {
    font-size: var(--text-2xl);
    font-weight: 700;
    fill: var(--color-text);
    font-family: var(--font-body);
}

.gauge-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

.gauge-sublabel {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Sidebar (right column)                                              */
/* ------------------------------------------------------------------ */

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Summary cards                                                        */
/* ------------------------------------------------------------------ */

.summary-cards {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.summary-card {
    flex: 1 1 80px;
    background: var(--color-surface);
    border-radius: 0.75rem;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid transparent;
}

.summary-card--green {
    border-top-color: var(--color-success);
}

.summary-card--blue {
    border-top-color: var(--color-primary);
}

.summary-card--orange {
    border-top-color: var(--color-orange);
}

.summary-count {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.summary-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

/* ------------------------------------------------------------------ */
/* Quick Fixes panel                                                    */
/* ------------------------------------------------------------------ */

.quick-fixes-panel {
    margin-top: var(--space-lg);
    background: var(--color-surface);
    border-radius: 1rem;
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-md);
}

.qf-scroll-viewport {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-medium) transparent;
}

.qf-scroll-viewport::-webkit-scrollbar {
    width: 6px;
}

.qf-scroll-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.qf-scroll-viewport::-webkit-scrollbar-thumb {
    background-color: var(--color-border-medium);
    border-radius: 999px;
}

.quick-fixes-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.qf-upsell {
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: var(--text-sm);
    line-height: 1.5;
}
.qf-upsell p {
    margin: 0 0 0.5rem;
}
.qf-upsell p:last-child {
    margin-bottom: 0;
}
.qf-upsell a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

.qf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.qf-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* btn-bulk-approve now uses .btn .btn--primary component classes */
#btn-bulk-approve:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Group card */
.qf-group {
    background: var(--color-surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.qf-group-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.1s ease;
}

.qf-group-header:hover {
    background: var(--color-surface-sunken);
}

.qf-group-check {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.qf-group-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
}

.qf-group-count {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    min-width: 22px;
    text-align: center;
}

.qf-expand-icon {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    transition: transform 0.2s ease;
}

.qf-group.collapsed .qf-expand-icon {
    transform: rotate(-90deg);
}

.qf-group.collapsed .qf-group-body {
    display: none;
}

.qf-group.collapsed .qf-group-header {
    border-bottom-color: transparent;
}

/* Issue row */
.qf-group-body {
    padding: 0.25rem 0;
}

.qf-issue-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.qf-issue-row:last-child {
    border-bottom: none;
}

.qf-thumb {
    width: 128px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.qf-issue-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
}

.qf-slide-label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-primary);
}

.qf-element {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qf-current,
.qf-suggested {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qf-suggested {
    color: var(--color-success-dark);
}

.qf-label {
    font-weight: 600;
    color: var(--color-text-tertiary);
}

.qf-empty {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Manual review section */
.qf-manual-section {
    margin-top: 1.5rem;
    background: var(--color-surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.qf-manual-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.qf-manual-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.qf-manual-row:last-child {
    border-bottom: none;
}

.qf-manual-type {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.qf-manual-count {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    min-width: 22px;
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Severity dots                                                        */
/* ------------------------------------------------------------------ */

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.severity-dot--green {
    background-color: var(--color-success);
}

.severity-dot--yellow {
    background-color: var(--color-warning);
}

.severity-dot--red {
    background-color: var(--color-danger);
}

/* ------------------------------------------------------------------ */
/* Start Review button                                                  */
/* ------------------------------------------------------------------ */

.start-review-container {
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
}

.btn-start-review {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.5rem;
    background: var(--color-success);
    color: var(--color-text-inverse);
    font-size: var(--text-base);
    font-weight: 600;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.btn-start-review:hover {
    background: var(--color-success-hover);
}

.btn-start-review:focus-visible {
    outline: 3px solid var(--color-success-border);
    outline-offset: 2px;
}

/* ================================================================== */
/* Page: Review                                                         */
/* ================================================================== */

/* Reset body for review: full-height, column layout, no centering */
.review-body {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    background-color: var(--color-bg);
    padding-top: 0;
}

/* ------------------------------------------------------------------ */
/* Fixed top bar                                                        */
/* ------------------------------------------------------------------ */

.review-topbar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1.25rem;
    gap: 1rem;
    min-height: 52px;
    box-shadow: var(--shadow-md);
}

.topbar-left,
.topbar-right {
    flex: 0 0 auto;
    min-width: 140px;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.finish-export-btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-inverse);
    background: var(--color-primary);
    border: none;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.finish-export-btn:hover {
    background: var(--color-primary-hover);
}

.topbar-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.topbar-title {
    font-weight: 700;
    color: var(--color-text-secondary);
    font-size: var(--text-base);
}

.review-back-link {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

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

/* Progress text */
.progress-region {
    text-align: center;
}

.progress-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    max-width: 260px;
    height: 4px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Prev/Next nav buttons */
.topbar-nav {
    display: flex;
    gap: 0.375rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-border-light);
    color: var(--color-text-secondary);
    border: 1.5px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: var(--text-base);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.nav-btn:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Filter chips bar                                                     */
/* ------------------------------------------------------------------ */

.filter-bar {
    position: fixed;
    top: calc(var(--nav-height) + 52px);
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--color-surface-sunken);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
}

/* ------------------------------------------------------------------ */
/* Category indicators (remaining issue counts)                         */
/* ------------------------------------------------------------------ */

.category-indicators {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.cat-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}
.cat-indicator:hover {
    background: var(--color-neutral-100);
    border-color: var(--color-neutral-200);
}
.cat-indicator--active {
    background: var(--color-primary-light, #f0fdfa);
    border-color: var(--color-primary, #0d9488);
    color: var(--color-primary, #0d9488);
}
.cat-indicator--active .cat-icon {
    color: var(--color-primary, #0d9488);
}

.cat-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    margin-right: 0.25rem;
}

.cat-icon {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

.cat-count.done {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.cat-indicator.hidden {
    display: none;
}

/* Quick-fix bubble */
.quick-fix-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-neutral-100);
    color: var(--color-text-muted);
    border: 1px solid var(--color-neutral-200);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.quick-fix-icon {
    font-size: 0.75rem;
}
.quick-fix-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.quick-fix-partial {
    background: var(--color-warning-surface);
    color: var(--color-warning-dark);
    border-color: var(--color-warning-border);
}
.quick-fix-done {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    border-color: var(--color-success-border);
}
.quick-fix-active {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* ------------------------------------------------------------------ */
/* Overlap reposition controls                                          */
/* ------------------------------------------------------------------ */

.overlap-controls {
    padding: 0.75rem 0;
}

.overlap-legend {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.legend-a {
    color: var(--color-primary);
    font-weight: 600;
}

.legend-b {
    color: var(--color-orange);
    font-weight: 600;
}

.overlap-instruction {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.direction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.direction-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border-medium);
    border-radius: 0.5rem;
    background: var(--color-surface);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.direction-btn:hover {
    background: var(--color-border-light);
    border-color: var(--color-text-tertiary);
}

.direction-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.dir-arrow {
    font-size: var(--text-base);
}

.dir-amount {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 400;
}

/* ------------------------------------------------------------------ */
/* Split-pane main area                                                 */
/* ------------------------------------------------------------------ */

/* nav (52px) + top bar (52px) + filter bar (~42px) = 94px offset below nav */
.review-split {
    display: grid;
    grid-template-columns: 55% 45%;
    min-height: calc(100vh - var(--nav-height) - 94px);
    margin-top: calc(var(--nav-height) + 94px);
    gap: 0;
}

@media (max-width: 768px) {
    .review-split {
        grid-template-columns: 1fr;
    }
    .topbar-left,
    .topbar-right {
        min-width: auto;
    }
    .topbar-center {
        display: none;
    }
}

/* ------------------------------------------------------------------ */
/* Slide preview (left pane)                                            */
/* ------------------------------------------------------------------ */

.slide-preview-pane {
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-height: 400px;
}

.slide-preview-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    /* 16:9 aspect ratio */
    aspect-ratio: 16 / 9;
    background: #374151;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.slide-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Issue detail card (right pane)                                       */
/* ------------------------------------------------------------------ */

.issue-detail-pane {
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-medium) transparent;
}

.issue-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 480px;
}

/* Issue header: badge + type */
.issue-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.tier-badge-1 {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.tier-badge-2 {
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
}

.tier-badge-3 {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

/* Category keyword badge in issue header */
.category-keyword {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--color-neutral-100);
    color: var(--color-text-muted);
    border: 1px solid var(--color-neutral-200);
}
.category-keyword--images {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    border-color: var(--color-warning-border);
}
.category-keyword--structure {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    border-color: var(--color-info-border);
}
.category-keyword--tables {
    background: var(--color-primary-surface);
    color: var(--color-primary-dark);
    border-color: var(--color-primary-border);
}
.category-keyword--text {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    border-color: var(--color-success-border);
}

.issue-type {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    margin: 0;
}

/* Meta rows (element name, current value, suggested fix) */
.issue-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.issue-meta-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.issue-element {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.issue-current-value,
.issue-suggested {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}


.issue-current-code {
    background: var(--color-border-light);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    word-break: break-all;
}

.issue-suggested-text {
    background: var(--color-success-surface);
    border: 1px solid var(--color-success-border);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    color: var(--color-success-dark);
    line-height: 1.5;
}

/* Why it matters */
.issue-why {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}


.issue-why-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.55;
}

/* ------------------------------------------------------------------ */
/* Action flash                                                          */
/* ------------------------------------------------------------------ */

.action-flash {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-success-hover);
    text-align: center;
    opacity: 0;
    transition: opacity 0.1s ease;
    min-height: 1.25rem;
}

.action-flash.flash-visible {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Action buttons                                                       */
/* ------------------------------------------------------------------ */

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 1rem;
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    text-decoration: none;
    justify-content: center;
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.btn-accept {
    background: var(--color-success);
    color: var(--color-text-inverse);
}

.btn-accept:hover {
    background: var(--color-success-hover);
}

.btn-edit {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.btn-edit:hover {
    background: var(--color-primary-hover);
}

.btn-skip {
    background: var(--color-text-tertiary);
    color: var(--color-text-inverse);
}

.btn-skip:hover {
    background: var(--color-text-muted);
}

.btn-na {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1.5px solid var(--color-border-medium);
}

.btn-na:hover {
    border-color: var(--color-text-muted);
    background: var(--color-surface-sunken);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

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

/* Shortcut number badge on action buttons */
.btn-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    font-size: var(--text-xs);
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.btn-na .btn-shortcut {
    background: rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------ */
/* Inline edit area                                                     */
/* ------------------------------------------------------------------ */

.inline-edit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--color-surface-sunken);
    border: 1.5px solid var(--color-primary);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.edit-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary-hover);
}

.edit-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-medium);
    border-radius: 0.375rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.15s ease;
}

.edit-textarea:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-color: var(--color-primary);
    box-shadow: none;
}
.edit-textarea:focus:not(:focus-visible) {
    outline: none;
}

.edit-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Completion screen                                                    */
/* ------------------------------------------------------------------ */

.completion-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 250, 251, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.completion-screen.visible {
    display: flex;
}

.completion-card {
    background: var(--color-surface);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.completion-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.completion-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* Score change display */
.score-change {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-3xl);
    font-weight: 700;
}

.score-before {
    color: var(--color-danger);
}

.score-arrow {
    color: var(--color-text-tertiary);
    font-size: var(--text-2xl);
}

.score-after {
    color: var(--color-success);
}

.score-change-label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin: 0;
    margin-top: -0.75rem;
}

/* Action breakdown list */
.action-breakdown {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    background: var(--color-surface-sunken);
    border-radius: 0.625rem;
    padding: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.breakdown-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.breakdown-count {
    font-size: var(--text-sm);
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
}

.breakdown-accepted {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.breakdown-edited {
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
}

.breakdown-skipped {
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

.breakdown-na {
    background: var(--color-warning-surface);
    color: var(--color-warning-dark);
}

/* Completion action buttons */
.completion-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.btn-export {
    background: var(--color-text-muted);
    color: var(--color-text-inverse);
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-export:hover {
    background: var(--color-text-muted);
}

.export-tooltip {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-style: italic;
}

.completion-dashboard-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
}

/* ------------------------------------------------------------------ */
/* Issue card slide-in animation (IMG-05/IMG-06 gap closure)           */
/* ------------------------------------------------------------------ */

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.issue-card {
    animation: slide-in-right 0.3s ease both;
}

/* ------------------------------------------------------------------ */
/* Decorative toggle (IMG-05)                                           */
/* ------------------------------------------------------------------ */

.decorative-toggle {
    margin-top: var(--space-sm, 0.5rem);
    padding: var(--space-md, 0.75rem);
    background: var(--color-surface-sunken);
    border-radius: var(--radius-md, 0.5rem);
    border: 1px dashed var(--color-border-medium);
}

.btn-decorative {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1.5px solid var(--color-border-medium);
    width: 100%;
}

.btn-decorative:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.decorative-hint {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--space-sm, 0.5rem);
    line-height: 1.5;
}

.ai-decorative-hint {
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-text-muted);
    margin-top: var(--space-xs, 0.375rem);
    line-height: 1.5;
}

.ai-decorative-hint::before {
    content: "AI: ";
    font-weight: 600;
    font-style: normal;
}

/* ------------------------------------------------------------------ */
/* Alt text editor (IMG-06)                                             */
/* ------------------------------------------------------------------ */

.alt-text-editor {
    margin-top: var(--space-md, 0.75rem);
    padding: var(--space-lg, 1rem);
    background: var(--color-primary-light);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-md, 0.5rem);
}

.alt-text-guidance {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm, 0.5rem);
    line-height: 1.5;
}

.alt-text-textarea {
    min-height: 80px;
}

.alt-text-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-sm, 0.5rem);
}

.char-count {
    font-size: var(--text-xs);
    font-family: var(--font-mono, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace);
    color: var(--color-text-tertiary);
}

/* --- Reading Order Overlay (READ-02) --- */
.reading-order-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.reading-order-badge {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--text-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--color-text-inverse);
    transform: translate(-50%, -50%);
    z-index: 11;
}

.reading-order-badge.double-digit {
    width: 28px;
    height: 28px;
    font-size: var(--text-xs);
}

/* ------------------------------------------------------------------ */
/* Page enter animation                                                */
/* ------------------------------------------------------------------ */

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page,
.dashboard-page,
.export-page {
    animation: page-fade-in 0.3s ease forwards;
}

/* ================================================================== */
/* Page: Export                                                         */
/* ================================================================== */

/* Export-specific layout styles */
.export-page {
    max-width: 960px;
    margin: calc(var(--nav-height) + 52px) auto 0;
    padding: 24px 20px 48px;
}

/* Score comparison card wrapper */
.export-score-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-xl);
    margin-bottom: 32px;
}

/* Two gauges side by side */
.export-gauges {
    display: flex;
    flex-direction: row;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.export-gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.export-gauge-wrap .gauge {
    width: 120px;
    height: 120px;
}

.export-gauge-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Action breakdown cards — 4 in a row */
.export-action-cards {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.export-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 100px;
}

.export-action-count {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1;
}

.export-action-name {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.export-action-card--accepted .export-action-count { color: var(--color-success-hover); }
.export-action-card--edited .export-action-count { color: var(--color-primary-hover); }
.export-action-card--skipped .export-action-count { color: var(--color-orange); }
.export-action-card--na .export-action-count { color: var(--color-text-muted); }

/* Action breakdown section wrapper */
.export-action-section {
    margin-bottom: 32px;
}

/* Per-issue table — card container with scrollable body */
.export-table-section {
    margin-bottom: 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-xl);
}

.export-table-section h2 {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text-secondary);
}

.export-table-scroll {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.export-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    table-layout: fixed;
}

.export-table th {
    background: var(--color-surface-sunken);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.export-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-table tbody tr:last-child td {
    border-bottom: none;
}

/* Alternating row stripes */
.export-table tbody tr:nth-child(even) {
    background: var(--color-surface-sunken);
}

/* Column resize handles */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 2;
}

.col-resize-handle:hover,
.col-resize-handle.resizing {
    background: var(--color-primary);
    opacity: 0.4;
}

.export-value-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.export-value-cell:hover {
    white-space: normal;
    word-break: break-word;
}

.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: capitalize;
}

.action-badge--accept,
.action-badge--edit   { background: var(--color-success-light); color: var(--color-success-dark); }
.action-badge--skip   { background: var(--color-warning-light); color: var(--color-warning-dark); }
.action-badge--na     { background: var(--color-border-light); color: var(--color-text-muted); }
.action-badge--pending{ background: var(--color-danger-light); color: var(--color-danger-dark); }

/* Loading cell in issues table */
.export-loading-cell {
    text-align: center;
    color: var(--color-text-tertiary);
    padding: 16px;
}

/* Apply section */
.export-apply-section {
    text-align: center;
    margin-bottom: 28px;
}

.apply-btn {
    font-size: var(--text-base);
    padding: 14px 32px;
    border-radius: 8px;
    background: var(--color-primary-hover);
    color: var(--color-text-inverse);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
    min-width: 240px;
}

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

.apply-btn:disabled {
    background: var(--color-text-tertiary);
    cursor: not-allowed;
}

.apply-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Download section — hidden until applied */
.download-section {
    text-align: center;
    margin-top: 12px;
}

.download-section .download-buttons {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.export-bundle-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* Error banner */
.export-error {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    border: 1px solid var(--color-danger-border);
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: var(--text-sm);
}

/* Finish / new presentation button */
.finish-btn {
    display: inline-block;
    margin-top: 1.25rem;
    padding: 0.75rem 2rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-border-light);
    border: 1.5px solid var(--color-border-medium);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.finish-btn:hover {
    background: var(--color-border);
    border-color: var(--color-text-tertiary);
}

/* Section heading */
.export-section-heading {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

/* Success message after applying changes */
.export-success-msg {
    color: var(--color-success-hover);
    font-weight: 600;
    margin-bottom: 4px;
}

/* ================================================================== */
/* Page: Settings                                                      */
/* ================================================================== */

.settings-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1.5rem 0;
    gap: 1.5rem;
}

.settings-section {
    background: var(--color-surface);
    border-radius: 0.75rem;
    padding: 1.75rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    width: 100%;
    max-width: 560px;
}

.settings-section h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.settings-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.settings-description a {
    color: var(--color-primary);
    text-decoration: none;
}

.settings-description a:hover {
    text-decoration: underline;
}

.key-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.key-status-icon {
    font-size: var(--text-base);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    font-size: var(--text-sm);
    font-family: inherit;
    border: 1.5px solid var(--color-border-medium);
    border-radius: 0.5rem;
    background: var(--color-surface-sunken);
    color: var(--color-text);
    transition: border-color 0.15s ease;
}

.settings-input:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-color: var(--color-primary);
}
.settings-input:focus:not(:focus-visible) {
    outline: none;
}

.settings-input:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: none;
}

.settings-input::placeholder {
    color: var(--color-text-tertiary);
}

.settings-btn-row {
    display: flex;
    gap: 0.625rem;
}

.settings-btn {
    padding: 0.5rem 1.125rem;
    font-size: var(--text-sm);
    font-family: inherit;
    font-weight: 500;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.settings-btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.settings-btn-primary:hover {
    background: var(--color-primary-hover);
}

.settings-btn-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

.settings-btn-danger:hover {
    background: var(--color-danger-surface);
}

.feedback-success {
    color: var(--color-success);
    font-size: var(--text-sm);
    font-weight: 500;
    min-height: 1.25em;
}

.feedback-error {
    color: var(--color-danger);
    font-size: var(--text-sm);
    font-weight: 500;
    min-height: 1.25em;
}

/* Confidence badge */
.ai-confidence {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.confidence-label {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-text-muted);
}

.confidence-high {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.confidence-medium {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.confidence-low {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

/* ================================================================== */
/* Page: Session list                                                   */
/* ================================================================== */

.recent-sessions {
    margin-top: var(--space-2xl);
    width: 100%;
}

.recent-sessions-heading {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.recent-sessions-empty {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.session-item-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: opacity 0.3s;
}
.session-item-row .session-item {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

.session-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--space-md);
    border: none;
    border-left: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.session-delete-btn:hover,
.session-delete-btn:focus-visible {
    background: var(--color-danger-light);
    color: var(--color-danger);
}
.session-delete-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}
.session-delete-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Scanning status pulse */
.status-scanning {
    background: var(--color-warning-surface);
    color: var(--color-warning-dark);
    animation: scanning-pulse 2s ease-in-out infinite;
}
@keyframes scanning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    min-width: 0;
    overflow: hidden;
}

.session-item:hover {
    background: var(--color-surface-sunken);
    border-color: var(--color-border-medium);
}

.session-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.session-item-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
}

.session-item-filename,
.session-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.session-item-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.session-status-badge {
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
}

.session-status-badge[data-status="scanning"] {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.session-status-badge[data-status="ready"] {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.session-status-badge[data-status="completed"] {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.session-item-status,
.session-item-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* AI enrichment badges */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.ai-badge--active {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary-border);
}

.ai-badge--inactive {
    background: var(--color-surface-sunken);
    color: var(--color-text-tertiary);
    border: 1px solid var(--color-border);
}

.ai-enrich-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-sm);
    font-weight: 600;
}

.ai-enrich-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}


/* ================================================================== */
/* Page: Authentication                                                 */
/* ================================================================== */

/* --- Auth Pages --- */
.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-primary-dark);
}
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
}
.auth-logo {
    margin-bottom: var(--space-2xl);
}
.auth-logo__link {
    font-family: 'Pacifico', cursive;
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--color-text-inverse);
    text-decoration: none;
    letter-spacing: 0.01em;
}
.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-card__title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-xs);
    text-align: center;
}
.auth-card__subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin: 0 0 var(--space-2xl);
}

/* Auth flash messages */
.auth-card .flash-error {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
    text-align: center;
}
.auth-card .flash-success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    display: none;
}

.form-error.visible {
    display: block;
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.form-hint--inline {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.85em;
}

.form-group-actions {
    display: flex;
    justify-content: flex-end;
}

.auth-forgot-link {
    font-size: var(--text-sm);
    color: var(--color-primary);
    text-decoration: none;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

.auth-submit {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-inverse);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem var(--space-lg);
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-top: var(--space-sm);
    width: 100%;
}

.auth-submit:hover {
    background: var(--color-primary-hover);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.7);
    margin-top: var(--space-xl);
}

.auth-footer a {
    color: var(--color-text-inverse);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-legal {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: var(--space-md);
    line-height: 1.5;
}
.auth-legal a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-legal a:hover {
    color: var(--text-primary);
}

.auth-alert {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    border-left: 4px solid;
    margin-bottom: var(--space-lg);
}

.auth-alert-error {
    background: var(--color-danger-light);
    border-left-color: var(--color-danger);
    color: var(--color-danger-dark);
}

.auth-alert-success {
    background: var(--color-success-light);
    border-left-color: var(--color-success);
    color: var(--color-success-dark);
}

/* ================================================================== */
/* Page: Billing & Account                                              */
/* ================================================================== */

.billing-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}
@media (max-width: 768px) {
    .billing-layout { grid-template-columns: 1fr; }
}

.billing-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #d5e0de);
    border-radius: 12px;
    padding: 24px;
}

.billing-card h2 {
    margin: 0 0 16px 0;
    font-size: var(--text-lg);
    font-weight: 600;
}

.plan-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light, #eaf0ef);
}
.plan-detail:last-child { border-bottom: none; }
.plan-detail-label { color: var(--color-text-secondary, #1e3a38); }
.plan-detail-value { font-weight: 600; }

.usage-gauge {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color-primary, #0d9488) calc(var(--usage-pct) * 1%),
        var(--color-border-light, #e2e8f0) calc(var(--usage-pct) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 16px;
}
.usage-gauge::after {
    content: '';
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--color-surface, #fff);
    position: absolute;
}
.usage-gauge-text {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.3;
}
.gauge-count {
    display: block;
    font-size: var(--text-2xl);
    font-weight: 700;
}
.gauge-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary, #1e3a38);
}

.billing-upgrade-alert {
    background: var(--color-info-light);
    border: 1px solid var(--color-primary, #0d9488);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: var(--color-info-dark);
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.billing-canceled-alert {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
    color: var(--color-warning-dark);
}

.billing-page-title {
    text-align: center;
    margin-bottom: 24px;
}

.billing-admin-notice {
    margin-top: 16px;
    display: block;
    color: var(--color-text-secondary, #1e3a38);
}

.billing-history {
    grid-column: 1 / -1;
}
.billing-history table {
    width: 100%;
    border-collapse: collapse;
}
.billing-history th,
.billing-history td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-light, #eaf0ef);
}
.billing-history th {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-text-secondary, #1e3a38);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upgrade-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--color-primary, #0d9488);
    color: var(--color-text-inverse);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
}
.upgrade-btn:hover {
    background: var(--color-primary-hover, #0f766e);
}

.account-section {
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 24px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #d5e0de);
    border-radius: 12px;
}
.account-section h2 {
    margin: 0 0 16px 0;
    font-size: var(--text-lg);
    font-weight: 600;
}
.account-field {
    margin-bottom: 12px;
}
.account-field-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary, #1e3a38);
    margin-bottom: 4px;
}
.account-field-value {
    font-weight: 500;
}

/* ================================================================== */
/* Page: Batch dashboard                                                */
/* ================================================================== */

.batch-header {
    margin-bottom: var(--space-xl);
}

.batch-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}
.batch-delete-batch-btn {
    color: var(--color-danger);
    border-color: var(--color-danger);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.batch-delete-batch-btn:hover {
    background: var(--color-danger-light);
}

.batch-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    line-height: 1.2;
    margin: var(--space-sm) 0 var(--space-xs) 0;
    color: var(--color-text);
}

.batch-summary {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.batch-deck-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.batch-deck-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
}

.batch-deck-failed {
    border-left: 3px solid var(--color-danger);
}

.batch-deck-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
    flex: 1;
}

.batch-deck-filename {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-deck-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.batch-deck-score {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
}

.batch-deck-error {
    font-size: var(--text-sm);
    color: var(--color-danger-dark, #b91c1c);
}

.batch-deck-error-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.batch-deck-error-actions {
    display: flex;
    gap: var(--space-sm);
}

.batch-deck-score--high {
    color: var(--color-primary);
}

.batch-deck-status {
    flex-shrink: 0;
}

.batch-deck-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    cursor: pointer;
}
.btn-ghost:hover {
    color: var(--color-text);
    background: var(--color-surface-sunken);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

.action-btn.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.action-btn.btn-primary:hover {
    background: var(--color-primary-hover);
}

.action-btn.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.action-btn.btn-secondary:hover {
    background: var(--color-primary-light);
}

.action-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Status badge classes (complement data-status attribute selectors) */
.badge.status-uploading {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.badge.status-scanning {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}
.badge.status-ready {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}
.badge.status-completed {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.badge.status-failed {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

/* Responsive: stack batch deck cards on narrow screens */
@media (max-width: 640px) {
    .batch-deck-card {
        flex-direction: column;
        align-items: stretch;
    }
    .batch-deck-actions {
        margin-top: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .batch-deck-actions {
        flex-direction: column;
    }
    .action-btn {
        width: 100%;
    }
}

/* ================================================================== */
/* Batch grouping in session list                                      */
/* ================================================================== */

.session-batch-group {
    margin-bottom: var(--space-sm);
}

.session-batch-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-lg);
    background: var(--color-surface-sunken, #f6faf9);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: left;
    font-family: inherit;
    color: var(--color-text);
}

.session-batch-header:hover {
    background: var(--color-surface);
}

.batch-group-status {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: auto;
}

.batch-expand-icon {
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.session-batch-header[aria-expanded="true"] .batch-expand-icon {
    transform: rotate(90deg);
}

.session-batch-items {
    padding-left: var(--space-lg);
}

.session-item-indented {
    padding-left: var(--space-lg);
}

.batch-dashboard-link {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: 600;
}

/* ================================================================== */
/* Landing Page                                                        */
/* ================================================================== */

.landing {
  margin: 0;
  padding: 0;
  color: var(--color-text-inverse);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fixed gradient mesh background */
.landing__bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, #0a1f1e 0%, #134e4a 50%, #0f766e 100%);
}

/* Landing nav */
.landing__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(10, 31, 30, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.landing__nav-brand {
  font-family: 'Pacifico', cursive;
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--color-text-inverse);
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: auto;
}
.landing__nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.landing__nav-link {
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.15s;
}
.landing__nav-link:hover {
  color: var(--color-text-inverse);
}

/* Landing nav hamburger toggle — hidden on desktop */
.landing__nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-inverse);
  cursor: pointer;
  padding: var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.landing__nav-toggle-close {
  display: none;
}
.landing__nav-toggle[aria-expanded="true"] .landing__nav-toggle-open {
  display: none;
}
.landing__nav-toggle[aria-expanded="true"] .landing__nav-toggle-close {
  display: block;
}

/* Hero */
.landing__hero {
  text-align: center;
  padding: 120px var(--space-2xl) 100px;
  max-width: 800px;
  margin: 0 auto;
}
.landing__hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-xl);
  text-wrap: balance;
}
.landing__hero-sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.92);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}
.landing__hero-ctas {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}
.btn.landing__cta-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
}
.btn.landing__cta-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(13, 148, 136, 0.4);
}
.btn.landing__cta-secondary {
  border-color: rgba(255,255,255,0.3);
  color: var(--color-text-inverse);
}
.btn.landing__cta-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

/* Sections */
.landing__section {
  padding: 80px var(--space-2xl);
}
.landing__section--alt {
  background: rgba(10, 31, 30, 0.25);
}
.landing__section-inner {
  max-width: 1000px;
  margin: 0 auto;
}
.landing__section-inner--narrow {
  max-width: 720px;
}
.landing__section-label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-selected);
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}
.landing__section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-lg);
  text-wrap: balance;
}
.landing__section-sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.92);
  margin: 0 0 var(--space-2xl);
}

/* Problem cards */
.landing__problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}
.landing__problem-card {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
}
.landing__problem-stat {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  font-variant-numeric: tabular-nums;
}
.landing__problem-card p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  margin: 0;
  line-height: 1.5;
}

/* Hidden complexity cards */
.landing__hidden-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}
.landing__hidden-card {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: left;
}
.landing__hidden-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.15);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}
.landing__hidden-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.landing__hidden-card p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  margin: 0;
  line-height: 1.6;
}

/* Steps */
.landing__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}
.landing__step {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
}
.landing__step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing__step-content h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
}
.landing__step-content p {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.92);
  margin: 0;
  line-height: 1.6;
  max-width: 560px;
}

/* Use case cards */
.landing__cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}
.landing__case-card {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}
.landing__case-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-md);
}
.landing__case-card p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  margin: 0;
  line-height: 1.6;
}

/* Features grid */
.landing__features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}
.landing__feature {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}
.landing__feature h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
}
.landing__feature p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  margin: 0;
  line-height: 1.6;
}

/* Pricing */
.landing__pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.landing__pricing-card {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.landing__pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.2);
}
.landing__pricing-card--featured:hover {
  border-color: var(--color-selected);
}
.landing__pricing-card--featured {
  border: 2px solid var(--color-selected);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  background: rgba(10, 31, 30, 0.7);
}
.landing__pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-selected);
  color: #0a1f1e;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.landing__pricing-name {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-sm);
}
.landing__pricing-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  margin: 0 0 var(--space-lg);
  line-height: 1.5;
}
.landing__pricing-price {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  font-variant-numeric: tabular-nums;
}
.landing__pricing-period {
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}
.landing__pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  text-align: left;
  flex: 1;
}
.landing__pricing-features li {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.95);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.landing__pricing-features li::before {
  content: "\2713";
  color: var(--color-success);
  margin-right: var(--space-sm);
  font-weight: 700;
}
.landing__pricing-features li.landing__pricing-feature--includes {
  color: rgba(255,255,255,0.55);
  font-style: italic;
  font-size: var(--text-xs);
  border-bottom: none;
  padding-bottom: 0;
}
.landing__pricing-features li.landing__pricing-feature--includes::before {
  content: "";
  margin-right: 0;
}
.landing__pricing-features li.landing__pricing-feature--muted {
  color: rgba(255,255,255,0.4);
}
.landing__pricing-features li.landing__pricing-feature--muted::before {
  content: "\2717";
  color: rgba(255,255,255,0.25);
}
.landing__pricing-cta {
  width: 100%;
}

/* FAQ */
.landing__faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}
.landing__faq-item {
  background: rgba(10, 31, 30, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.landing__faq-item summary {
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.landing__faq-item summary::after {
  content: "+";
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.5);
  transition: transform 0.2s;
}
.landing__faq-item[open] summary::after {
  content: "\2212";
}
.landing__faq-item summary::-webkit-details-marker {
  display: none;
}
.landing__faq-item p {
  padding: 0 var(--space-xl) var(--space-lg);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  line-height: 1.6;
  margin: 0;
}

/* CTA Banner */
.landing__cta-banner {
  text-align: center;
  padding: 80px var(--space-2xl);
}
.landing__cta-banner h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 var(--space-md);
}
.landing__cta-banner p {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.92);
  margin: 0 0 var(--space-2xl);
}
.btn.landing__cta-white {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  border: none;
  font-weight: 700;
}
.btn.landing__cta-white:hover {
  background: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255,255,255,0.15);
}

/* Main content grows to push footer down */
.landing > main {
  flex: 1;
}

/* Footer */
.landing__footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-2xl);
  margin-top: auto;
}
.landing__footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
}
.landing__footer-brand {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  font-size: 1.575rem;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.7);
}
.landing__footer nav {
  display: flex;
  gap: var(--space-xl);
}
.landing__footer nav a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
.landing__footer nav a:hover {
  color: var(--color-text-inverse);
}

/* Scroll reveal animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="delay-1"] { transition-delay: 0.1s; }
[data-reveal="delay-2"] { transition-delay: 0.2s; }
[data-reveal="delay-3"] { transition-delay: 0.3s; }
[data-reveal="delay-4"] { transition-delay: 0.4s; }

/* Landing focus styles (WCAG 2.4.7) */
.landing__nav-link:focus-visible,
.landing__pricing-cta:focus-visible,
.landing__faq-item summary:focus-visible,
.landing__footer nav a:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Landing responsive */
@media (max-width: 768px) {
  .landing__problem-grid,
  .landing__cases-grid,
  .landing__hidden-grid {
    grid-template-columns: 1fr;
  }
  .landing__features-grid {
    grid-template-columns: 1fr;
  }
  .landing__pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing__hero {
    padding: 80px var(--space-lg) 60px;
  }
  .landing__hero-sub {
    font-size: var(--text-base);
  }
  .landing__hero-ctas {
    flex-direction: column;
    align-items: center;
  }
  .landing__hero-ctas .btn {
    width: 100%;
    max-width: 300px;
  }
  .landing__section {
    padding: 60px var(--space-lg);
  }
  .landing__section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }
  .landing__cta-banner h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  /* Hamburger menu */
  .landing__nav {
    padding: var(--space-md) var(--space-lg);
  }
  .landing__nav-toggle {
    display: flex;
  }
  .landing__nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 31, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-lg);
    gap: var(--space-sm);
  }
  .landing__nav-links.is-open {
    display: flex;
  }
  .landing__nav-link {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
  }
  .landing__nav-link:hover {
    background: rgba(255,255,255,0.08);
  }
  .landing__nav-links .btn {
    width: 100%;
    text-align: center;
    margin-top: var(--space-sm);
  }

  .landing__step {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .landing__cta-banner {
    padding: 60px var(--space-lg);
  }

  .landing__footer-inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* ---------------------------------------------------------------------------
   Legal pages (Terms, Privacy)
   --------------------------------------------------------------------------- */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px var(--space-lg) 80px;
  color: var(--text-primary);
  line-height: 1.7;
}
.legal__title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.legal__effective {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}
.legal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}
.legal h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}
.legal p,
.legal ul {
  margin-bottom: var(--space-md);
}
.legal ul {
  padding-left: 1.5em;
}
.legal li {
  margin-bottom: var(--space-xs);
}
.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover {
  opacity: 0.8;
}

/* Upgrade hint */
.upgrade-hint {
  max-width: 680px;
  margin: var(--space-md) auto var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: rgba(13, 148, 136, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
}
.upgrade-hint__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.upgrade-hint__icon {
  margin-right: 4px;
}
.upgrade-hint__link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 4px;
}
.upgrade-hint__link:hover {
  opacity: 0.8;
}

/* Choose Plan page */
.choose-plan {
  min-height: 100vh;
  padding: calc(var(--nav-height) + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  background: var(--bg);
}
.choose-plan__inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.choose-plan__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
}
.choose-plan__sub {
  color: var(--text-secondary);
  font-size: var(--text-md);
  margin: 0 0 var(--space-2xl);
}
.choose-plan__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}
.choose-plan__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.choose-plan__card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover, rgba(255,255,255,0.2));
}
.choose-plan__card--featured {
  border: 2px solid var(--color-selected);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.choose-plan__card--featured:hover {
  border-color: var(--color-selected);
}
.choose-plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-selected);
  color: #0a1f1e;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.choose-plan__name {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-sm);
}
.choose-plan__price {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  font-variant-numeric: tabular-nums;
}
.choose-plan__period {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.choose-plan__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg);
  line-height: 1.5;
}
.choose-plan__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  text-align: left;
  flex: 1;
}
.choose-plan__features li {
  font-size: var(--text-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}
.choose-plan__features li::before {
  content: "\2713";
  color: var(--color-success);
  margin-right: var(--space-sm);
  font-weight: 700;
}
.choose-plan__feature--includes {
  color: var(--text-secondary);
  font-style: italic;
  font-size: var(--text-xs) !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}
.choose-plan__feature--includes::before {
  content: "" !important;
  margin-right: 0 !important;
}
.choose-plan__feature--muted {
  color: var(--text-secondary);
  opacity: 0.6;
}
.choose-plan__feature--muted::before {
  content: "\2717" !important;
  color: var(--text-secondary) !important;
  opacity: 0.5;
}
.choose-plan__cta {
  width: 100%;
}
@media (max-width: 900px) {
  .choose-plan__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .choose-plan__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

