/* Styles de l'application HexaMedia (extraits d'index.html).
   Fichier partage par le hub et les sept pages outils : servi une fois,
   puis mis en cache, au lieu d'etre reinline dans chaque page. */

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

      :root {
        --bg: #0e0c18;
        --surface: #1a1730;
        --surface2: #1e1a36;
        --border: #2a2647;
        --border-hover: #3d3860;
        --accent: #6c63ff;
        --accent-hover: #5a52e0;
        --accent-light: rgba(108, 99, 255, 0.15);
        --success: #34d399;
        --success-light: rgba(52, 211, 153, 0.15);
        --warning: #fbbf24;
        --error: #f87171;
        --error-light: rgba(248, 113, 113, 0.15);
        --text: #f8f8fc;
        --text-muted: #9692aa;
        --text-dim: #4a4563;
        --text-secondary: #c4c1d8;
        --brand-belden-color: #f8f8fc;
        --brand-labs-color: #827aff;
        --mark-cutout-color: #0e0c18;
        --radius: 12px;
        --radius-sm: 8px;
        --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
        --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.2);
        --transition: 180ms ease;
      }

      [data-theme="light"] {
        --bg: #fcfbff;
        --surface: #ffffff;
        --surface2: #edeaf7;
        --border: #e2dff0;
        --border-hover: #ccc8e0;
        --accent: #6c63ff;
        --accent-hover: #5a52e0;
        --accent-light: rgba(108, 99, 255, 0.1);
        --success: #34d399;
        --success-light: rgba(52, 211, 153, 0.1);
        --warning: #fbbf24;
        --error: #f87171;
        --error-light: rgba(248, 113, 113, 0.1);
        --text: #18142a;
        --text-muted: #9692aa;
        --text-dim: #4a4563;
        --text-secondary: #4a4563;
        --brand-belden-color: #18142a;
        --brand-labs-color: #6c63ff;
        --mark-cutout-color: #fcfbff;
        --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
        --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.15);
      }

      body {
        font-family:
          "Outfit",
          "Inter",
          system-ui,
          -apple-system,
          sans-serif;
        background: var(--bg);
        color: var(--text);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        -webkit-font-smoothing: antialiased;
      }

      /* ── Header ── */
      header {
        position: sticky;
        top: 0;
        z-index: 50;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 0 24px;
        height: 64px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
      }
      :root header {
        background: rgba(14, 12, 24, 0.9);
      }
      [data-theme="light"] header {
        background: rgba(252, 251, 255, 0.9);
      }
      .header-inner {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 64px;
      }
      .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
      }
      .header-right {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .logo-link {
        /* Cette page n'utilise pas shared.css : la règle doit y être répétée, sinon le symbole et le
           nom ne sont pas alignés faute de conteneur flex. */
        display: flex;
        align-items: center;
        gap: 24px;
        text-decoration: none;
        color: var(--text);
      }

      .logo-mark {
        height: 34px;
        width: auto;
        flex-shrink: 0;
      }

      .logo-name {
        font-size: 21px;
        font-weight: 600;
        letter-spacing: -0.01em;
        white-space: nowrap;
        color: var(--brand-belden-color);
      }

      .logo-name-accent {
        color: var(--brand-labs-color);
      }

      /* ── Mode switcher ── */
      .mode-bar {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .mode-btn {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 0.85rem;
        font-weight: 600;
        padding: 8px 18px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
      }
      .mode-btn svg {
        width: 15px;
        height: 15px;
      }
      .mode-btn:hover {
        border-color: var(--accent);
        color: var(--text);
      }
      .mode-btn.active {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }
      .badge {
        margin-left: auto;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
        background: var(--surface2);
        border: 1px solid var(--border);
        padding: 4px 10px;
        border-radius: 999px;
      }

      .theme-toggle {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
      }
      .theme-toggle:hover {
        border-color: var(--accent);
        color: var(--text);
      }
      .theme-toggle svg {
        width: 18px;
        height: 18px;
      }
      .theme-toggle .icon-moon,
      [data-theme="light"] .theme-toggle .icon-sun {
        display: none;
      }
      [data-theme="light"] .theme-toggle .icon-moon {
        display: block;
      }
      .install-wrap {
        position: relative;
      }
      .btn-install {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.75rem;
        font-weight: 600;
        font-family: inherit;
        color: #fff;
        background: var(--accent);
        border: none;
        padding: 6px 14px;
        border-radius: 999px;
        cursor: pointer;
        transition: background var(--transition);
      }
      .btn-install:hover {
        background: var(--accent-hover);
      }
      .install-tooltip {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 12px 32px 12px 16px;
        color: var(--text);
        font-size: 0.8rem;
        white-space: nowrap;
        box-shadow: var(--shadow);
        z-index: 100;
      }
      .install-tooltip p {
        margin: 0;
      }
      .install-tooltip-close {
        position: absolute;
        top: 8px;
        right: 10px;
        cursor: pointer;
        color: var(--text-muted);
        font-size: 1rem;
        line-height: 1;
      }
      .install-tooltip-close:hover {
        color: var(--text);
      }

      /* ── Page layout with ads ── */
      .page-layout {
        flex: 1;
        display: flex;
        justify-content: center;
        gap: 24px;
        padding: 0 24px;
      }

      /* ── Main layout ── */
      main {
        flex: 1;
        max-width: 900px;
        width: 100%;
        padding: 40px 0 60px;
        display: flex;
        flex-direction: column;
        gap: 32px;
      }

      /* ── Drop zone ── */
      .dropzone {
        border: 2px dashed var(--border);
        border-radius: var(--radius);
        padding: 56px 32px;
        text-align: center;
        cursor: pointer;
        transition:
          border-color var(--transition),
          background var(--transition);
        position: relative;
        background: var(--surface);
      }
      .dropzone:hover,
      .dropzone.drag-over {
        border-color: var(--accent);
        background: var(--accent-light);
      }
      .dropzone input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
      }
      .dropzone-icon {
        width: 56px;
        height: 56px;
        background: var(--accent-light);
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 16px;
      }
      .dropzone-icon svg {
        width: 28px;
        height: 28px;
        color: var(--accent);
      }
      .dropzone h2 {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 6px;
      }
      .dropzone p {
        font-size: 0.875rem;
        color: var(--text-muted);
      }
      .dropzone p strong {
        color: var(--accent);
      }

      /* ── Quality slider ── */
      .settings-bar {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px 24px;
        display: flex;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
      }
      .settings-bar label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        white-space: nowrap;
      }
      .slider-wrap {
        flex: 1;
        min-width: 160px;
        display: flex;
        align-items: center;
        gap: 12px;
      }
      input[type="range"] {
        flex: 1;
        -webkit-appearance: none;
        height: 4px;
        background: var(--border);
        border-radius: 4px;
        outline: none;
        cursor: pointer;
      }
      input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--accent);
        cursor: pointer;
        transition: transform var(--transition);
      }
      input[type="range"]::-webkit-slider-thumb:hover {
        transform: scale(1.2);
      }
      .slider-val {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent);
        min-width: 36px;
        text-align: right;
      }
      .quality-labels {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
      }
      .preset-btn {
        font-size: 0.78rem;
        font-weight: 600;
        padding: 5px 12px;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
      }
      .preset-btn:hover,
      .preset-btn.active {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
      }

      /* ── File list ── */
      .file-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .file-list-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .file-list-header h3 {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }
      .btn-clear {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-muted);
        background: none;
        border: none;
        cursor: pointer;
        transition: color var(--transition);
        padding: 4px 8px;
      }
      .btn-clear:hover {
        color: var(--error);
      }

      /* ── File card ── */
      .file-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px 20px;
        display: grid;
        grid-template-columns: 40px 1fr auto;
        align-items: center;
        gap: 14px;
        transition: border-color var(--transition);
      }
      .file-card.processing {
        border-color: var(--accent);
      }
      .file-card.done {
        border-color: var(--success);
      }
      .file-card.error {
        border-color: var(--error);
      }

      .file-icon {
        width: 40px;
        height: 40px;
        background: var(--surface2);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      .file-icon svg {
        width: 20px;
        height: 20px;
        color: var(--accent);
      }
      .file-card.done .file-icon {
        background: var(--success-light);
      }
      .file-card.done .file-icon svg {
        color: var(--success);
      }
      .file-card.error .file-icon {
        background: var(--error-light);
      }
      .file-card.error .file-icon svg {
        color: var(--error);
      }

      .file-info {
        min-width: 0;
      }
      .file-name {
        font-size: 0.875rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .file-meta {
        font-size: 0.78rem;
        color: var(--text-muted);
        margin-top: 3px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .file-meta .sep {
        color: var(--text-dim);
      }
      .savings-badge {
        font-size: 0.72rem;
        font-weight: 700;
        padding: 2px 7px;
        border-radius: 4px;
        background: var(--success-light);
        color: var(--success);
      }
      .error-msg {
        color: var(--error);
        font-size: 0.78rem;
        margin-top: 3px;
      }

      .progress-bar-wrap {
        height: 3px;
        background: var(--border);
        border-radius: 3px;
        margin-top: 8px;
        overflow: hidden;
      }
      .progress-bar {
        height: 100%;
        background: var(--accent);
        border-radius: 3px;
        transition: width 0.3s ease;
        width: 0%;
      }
      .file-card.done .progress-bar {
        background: var(--success);
      }

      .file-actions {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
      }
      .btn-download {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.8rem;
        font-weight: 600;
        padding: 7px 14px;
        border-radius: var(--radius-sm);
        border: none;
        background: var(--success);
        color: #fff;
        cursor: pointer;
        text-decoration: none;
        transition: opacity var(--transition);
      }
      .btn-download:hover {
        opacity: 0.85;
      }
      .btn-download svg {
        width: 14px;
        height: 14px;
      }
      .btn-remove {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: none;
        color: var(--text-dim);
        cursor: pointer;
        transition: all var(--transition);
      }
      .btn-remove:hover {
        border-color: var(--error);
        color: var(--error);
        background: var(--error-light);
      }
      .btn-remove svg {
        width: 14px;
        height: 14px;
      }

      /* ── Compress all button ── */
      .action-bar {
        display: flex;
        gap: 12px;
        align-items: center;
      }
      .btn-primary {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.95rem;
        font-weight: 700;
        padding: 14px 28px;
        border-radius: var(--radius);
        border: none;
        background: var(--accent);
        color: #fff;
        cursor: pointer;
        transition:
          background var(--transition),
          opacity var(--transition),
          transform var(--transition);
        letter-spacing: -0.01em;
      }
      .btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
      }
      .btn-primary:active:not(:disabled) {
        transform: scale(0.98);
      }
      .btn-primary:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }
      .btn-primary svg {
        width: 18px;
        height: 18px;
      }

      .btn-dl-all {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        font-weight: 600;
        padding: 14px 20px;
        border-radius: var(--radius);
        border: 1px solid var(--success);
        background: var(--success-light);
        color: var(--success);
        cursor: pointer;
        transition: all var(--transition);
        white-space: nowrap;
      }
      .btn-dl-all:hover {
        background: var(--success);
        color: #fff;
      }
      .btn-dl-all svg {
        width: 16px;
        height: 16px;
      }
      .btn-dl-all.hidden {
        display: none;
      }

      /* ── Stats summary ── */
      .summary {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px 24px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        background-clip: padding-box;
        position: relative;
      }
      .summary::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: var(--radius);
        background: var(--border);
        z-index: 0;
      }
      .stat {
        background: var(--surface);
        padding: 16px 20px;
        position: relative;
        z-index: 1;
        text-align: center;
      }
      .stat:first-child {
        border-radius: var(--radius) 0 0 var(--radius);
      }
      .stat:last-child {
        border-radius: 0 var(--radius) var(--radius) 0;
      }
      .stat-val {
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: var(--text);
        margin-bottom: 4px;
      }
      .stat-val.green {
        color: var(--success);
      }
      .stat-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }

      /* ── Empty state ── */
      .empty-notice {
        text-align: center;
        color: var(--text-dim);
        font-size: 0.85rem;
        padding: 8px 0;
      }

      /* ── Spinner ── */
      .spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
        flex-shrink: 0;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }

      /* ── Toast ── */
      .toast-wrap {
        position: fixed;
        bottom: 24px;
        right: 24px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 9999;
      }
      .toast {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 12px 16px;
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text);
        box-shadow: var(--shadow);
        animation: slide-in 0.25s ease forwards;
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 320px;
      }
      .toast.success {
        border-color: var(--success);
      }
      .toast.error {
        border-color: var(--error);
      }
      .toast .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
      }
      .toast.success .dot {
        background: var(--success);
      }
      .toast.error .dot {
        background: var(--error);
      }
      .toast.info .dot {
        background: var(--accent);
      }
      @keyframes slide-in {
        from {
          opacity: 0;
          transform: translateX(20px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }
      @keyframes slide-out {
        from {
          opacity: 1;
          transform: translateX(0);
        }
        to {
          opacity: 0;
          transform: translateX(20px);
        }
      }

      /* ── Tabs ── */
      .tabs {
        display: flex;
        gap: 4px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 4px;
      }
      .tab-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: calc(var(--radius) - 4px);
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
      }
      .tab-btn svg {
        width: 16px;
        height: 16px;
      }
      .tab-btn:hover {
        color: var(--text);
        background: var(--surface2);
      }
      .tab-btn.active {
        background: var(--accent);
        color: #fff;
      }

      /* ── Merge list ── */
      .merge-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .merge-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px 16px;
        display: grid;
        grid-template-columns: 28px 40px 1fr auto;
        align-items: center;
        gap: 12px;
        cursor: default;
        transition:
          border-color var(--transition),
          background var(--transition),
          opacity var(--transition);
        user-select: none;
      }
      .merge-card.drag-over-top {
        border-top: 2px solid var(--accent);
      }
      .merge-card.drag-over-bottom {
        border-bottom: 2px solid var(--accent);
      }
      .merge-card.dragging {
        opacity: 0.4;
      }
      .drag-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-dim);
        cursor: grab;
        border-radius: 4px;
        padding: 4px;
        transition: color var(--transition);
      }
      .drag-handle:hover {
        color: var(--text-muted);
      }
      .drag-handle svg {
        width: 16px;
        height: 16px;
      }
      .merge-order {
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      .merge-info {
        min-width: 0;
      }
      .merge-name {
        font-size: 0.875rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .merge-meta {
        font-size: 0.78rem;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .btn-dl-merged {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        font-weight: 600;
        padding: 14px 20px;
        border-radius: var(--radius);
        border: 1px solid var(--success);
        background: var(--success-light);
        color: var(--success);
        cursor: pointer;
        transition: all var(--transition);
        white-space: nowrap;
        text-decoration: none;
      }
      .btn-dl-merged:hover {
        background: var(--success);
        color: #fff;
      }
      .btn-dl-merged svg {
        width: 16px;
        height: 16px;
      }
      .btn-dl-merged.hidden {
        display: none;
      }

      /* ── Split page cards ── */
      .split-page-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        transition: border-color var(--transition);
      }
      .split-page-card.done {
        border-color: var(--success);
      }
      .split-page-card.processing {
        border-color: var(--accent);
      }
      .split-page-thumb {
        width: 100%;
        aspect-ratio: 0.707; /* A4 ratio */
        background: var(--surface2);
        border-radius: 6px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
      }
      .split-page-thumb canvas {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
      }
      .split-page-thumb .thumb-spinner {
        width: 20px;
        height: 20px;
        border: 2px solid var(--border);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
      }
      .split-page-label {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-muted);
        text-align: center;
      }
      .split-page-card.done .split-page-label {
        color: var(--success);
      }
      .btn-dl-page {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 6px 10px;
        border-radius: 6px;
        border: none;
        background: var(--success);
        color: #fff;
        cursor: pointer;
        text-decoration: none;
        transition: opacity var(--transition);
      }
      .btn-dl-page:hover {
        opacity: 0.85;
      }
      .btn-dl-page svg {
        width: 12px;
        height: 12px;
      }

      /* ── Image tools ── */
      .img-settings {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px 24px;
        display: flex;
        flex-direction: column;
        gap: 18px;
      }
      .img-settings-row {
        display: flex;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
      }
      .img-settings-row label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        white-space: nowrap;
        min-width: 100px;
      }
      .format-btns {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
      }
      .format-btn {
        font-size: 0.78rem;
        font-weight: 700;
        padding: 5px 12px;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
        letter-spacing: 0.04em;
      }
      .format-btn:hover,
      .format-btn.active {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
      }
      .cropresize-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        cursor: pointer;
        user-select: none;
      }
      .cropresize-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--accent);
        cursor: pointer;
      }
      .cropresize-panel {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 10px 0 0 24px;
      }
      .cr-section-label {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-dim);
        margin: 0;
      }
      .cr-dim-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .cr-dim-row input[type="number"] {
        width: 90px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text);
        font-size: 0.85rem;
        padding: 6px 10px;
        outline: none;
        transition: border-color var(--transition);
      }
      .cr-dim-row input[type="number"]:focus {
        border-color: var(--accent);
      }
      .cr-dim-row .dim-sep {
        color: var(--text-dim);
        font-size: 0.85rem;
        font-weight: 600;
      }
      .lock-btn {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: none;
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition);
        flex-shrink: 0;
      }
      .lock-btn.locked {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
      }
      .lock-btn svg {
        width: 13px;
        height: 13px;
      }
      .cr-presets {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
      }
      .cr-preset {
        font-size: 0.72rem;
        font-weight: 600;
        padding: 3px 10px;
        border-radius: 5px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-dim);
        cursor: pointer;
        transition: all var(--transition);
      }
      .cr-preset:hover,
      .cr-preset.active {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
      }
      .lock-btn.forced {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
        opacity: 0.6;
        cursor: default;
      }
      /* anchor grid styles removed — replaced by interactive crop editor */
      .cr-subsection {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .cr-divider {
        border: none;
        border-top: 1px solid var(--border);
        margin: 2px 0;
      }
      /* ── Interactive crop editor ── */
      .crop-editor-wrap {
        position: relative;
        max-width: 100%;
        max-height: 400px;
        border-radius: var(--radius-sm);
        overflow: hidden;
        background: repeating-conic-gradient(#1e1a36 0% 25%, #151228 0% 50%) 0
          0 / 16px 16px;
        border: 1px solid var(--border);
        user-select: none;
        -webkit-user-select: none;
        touch-action: none;
      }
      .crop-editor-wrap canvas {
        display: block;
        max-width: 100%;
        max-height: 398px;
        object-fit: contain;
      }
      .crop-editor-empty {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 80px;
        color: var(--text-dim);
        font-size: 0.8rem;
      }
      .crop-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
      }
      .crop-box {
        position: absolute;
        border: 2px solid var(--accent);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
        cursor: move;
        pointer-events: auto;
        z-index: 2;
      }
      .crop-box .thirds-line {
        position: absolute;
        background: rgba(108, 99, 255, 0.25);
      }
      .crop-box .thirds-v1 {
        left: 33.33%;
        top: 0;
        width: 1px;
        height: 100%;
      }
      .crop-box .thirds-v2 {
        left: 66.66%;
        top: 0;
        width: 1px;
        height: 100%;
      }
      .crop-box .thirds-h1 {
        top: 33.33%;
        left: 0;
        height: 1px;
        width: 100%;
      }
      .crop-box .thirds-h2 {
        top: 66.66%;
        left: 0;
        height: 1px;
        width: 100%;
      }
      .crop-handle {
        position: absolute;
        width: 10px;
        height: 10px;
        background: var(--accent);
        border: 2px solid #fff;
        border-radius: 2px;
        pointer-events: auto;
        z-index: 3;
      }
      .crop-handle.tl {
        top: -5px;
        left: -5px;
        cursor: nw-resize;
      }
      .crop-handle.tc {
        top: -5px;
        left: calc(50% - 5px);
        cursor: n-resize;
      }
      .crop-handle.tr {
        top: -5px;
        right: -5px;
        cursor: ne-resize;
      }
      .crop-handle.ml {
        top: calc(50% - 5px);
        left: -5px;
        cursor: w-resize;
      }
      .crop-handle.mr {
        top: calc(50% - 5px);
        right: -5px;
        cursor: e-resize;
      }
      .crop-handle.bl {
        bottom: -5px;
        left: -5px;
        cursor: sw-resize;
      }
      .crop-handle.bc {
        bottom: -5px;
        left: calc(50% - 5px);
        cursor: s-resize;
      }
      .crop-handle.br {
        bottom: -5px;
        right: -5px;
        cursor: se-resize;
      }
      .crop-dims-badge {
        position: absolute;
        bottom: -24px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(26, 23, 48, 0.85);
        color: var(--text-muted);
        font-size: 0.65rem;
        font-family: "Geist Mono", monospace;
        padding: 2px 8px;
        border-radius: 4px;
        white-space: nowrap;
        pointer-events: none;
        z-index: 3;
      }
      .cr-preview-dims {
        font-size: 0.72rem;
        color: var(--text-dim);
        margin-top: 4px;
      }

      /* image file cards */
      .img-file-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px 18px;
        display: grid;
        grid-template-columns: 52px 1fr auto;
        align-items: center;
        gap: 14px;
        transition: border-color var(--transition);
      }
      .img-file-card.processing {
        border-color: var(--accent);
      }
      .img-file-card.done {
        border-color: var(--success);
      }
      .img-file-card.error {
        border-color: var(--error);
      }
      .img-thumb {
        width: 52px;
        height: 52px;
        border-radius: var(--radius-sm);
        object-fit: cover;
        background: var(--surface2);
        display: block;
      }

      /* ── Footer ── */
      footer {
        border-top: 1px solid var(--border);
        padding: 24px;
        background: var(--surface);
        margin-top: auto;
      }
      .footer-inner {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
      }
      .footer-left {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 0.8rem;
        color: var(--text-muted);
      }
      .footer-logo {
        height: 24px;
        width: auto;
      }
      footer a {
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.75rem;
        transition: color var(--transition);
      }
      footer a:hover {
        color: var(--accent);
      }
      footer .footer-links {
        display: flex;
        gap: 24px;
      }
      @media (max-width: 600px) {
        .footer-inner {
          flex-direction: column;
          text-align: center;
        }
      }

      /* ── SEO Content Sections ── */
      .seo-content {
        max-width: 800px;
        margin: 0 auto;
        padding: 48px 32px;
      }
      .seo-content h2 {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 24px;
        text-align: center;
        color: var(--text);
      }
      .how-it-works {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        margin-bottom: 48px;
      }
      .step {
        text-align: center;
        padding: 24px 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
      }
      .step-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 12px;
        background: var(--accent-light);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .step-icon svg {
        width: 22px;
        height: 22px;
        color: var(--accent);
      }
      .step h3 {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 6px;
      }
      .step p {
        font-size: 0.82rem;
        color: var(--text-muted);
        line-height: 1.5;
      }
      .tools-explained {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-bottom: 48px;
      }
      .tool-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px 24px;
      }
      .tool-card h3 {
        font-size: 0.95rem;
        font-weight: 700;
        margin-bottom: 8px;
        color: var(--text);
      }
      .tool-card p {
        font-size: 0.85rem;
        color: var(--text-muted);
        line-height: 1.6;
      }
      .faq {
        margin-bottom: 48px;
      }
      .faq-item {
        border-bottom: 1px solid var(--border);
        padding: 16px 0;
      }
      .faq-item:first-child {
        border-top: 1px solid var(--border);
      }
      .faq-q {
        font-weight: 600;
        font-size: 0.92rem;
        margin-bottom: 6px;
        color: var(--text);
      }
      .faq-a {
        font-size: 0.84rem;
        color: var(--text-muted);
        line-height: 1.6;
      }
      .privacy-block {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 24px;
        text-align: center;
      }
      .privacy-block p {
        font-size: 0.85rem;
        color: var(--text-muted);
        line-height: 1.6;
        max-width: 600px;
        margin: 0 auto;
      }
      .privacy-block .shield-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 12px;
        background: var(--success-light);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .privacy-block .shield-icon svg {
        width: 22px;
        height: 22px;
        color: var(--success);
      }

      /* ── Responsive: hide sidebars on smaller screens ── */
      @media (max-width: 1280px) {
        .page-layout {
          padding: 0;
        }
        main {
          padding-left: 24px;
          padding-right: 24px;
          margin: 0 auto;
        }
      }

      /* ── Responsive: show inline ads on mobile ── */
      @media (max-width: 600px) {
        header {
          padding: 16px;
        }
        main {
          padding: 24px 16px 48px;
        }
        .summary {
          grid-template-columns: 1fr;
        }
        .stat:first-child {
          border-radius: var(--radius) var(--radius) 0 0;
        }
        .stat:last-child {
          border-radius: 0 0 var(--radius) var(--radius);
        }
        .file-card {
          grid-template-columns: 36px 1fr;
        }
        .file-actions {
          grid-column: 1 / -1;
          justify-content: flex-end;
        }
        .settings-bar {
          flex-direction: column;
          align-items: stretch;
          gap: 12px;
        }
        .tabs {
          gap: 2px;
          padding: 3px;
        }
        .tab-btn {
          font-size: 0.78rem;
          padding: 8px 6px;
          gap: 4px;
          white-space: nowrap;
          min-width: 0;
        }
        .tab-btn svg {
          width: 14px;
          height: 14px;
          flex-shrink: 0;
        }
        .how-it-works {
          grid-template-columns: 1fr;
        }
        .tools-explained {
          grid-template-columns: 1fr;
        }
        .seo-content {
          padding: 32px 16px;
        }
      }

/* ── Pages outils dediees ── */
.tool-page-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 8px 0 10px;
  color: var(--text);
}
.tool-page-lede {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--text-dim);
  line-height: 1.6;
}

.tool-card h3 a {
  color: inherit;
  text-decoration: none;
}
.tool-card h3 a:hover,
.tool-card h3 a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Paragraphes de contenu des pages outils ──
   Le hub ne contient que des blocs deja stylés (.how-it-works, .tools-explained),
   donc ces regles manquaient. Les pages outils, elles, ont du texte courant entre
   les titres : sans marges il se colle au bloc precedent. */
.seo-content > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 16px;
}
.seo-content > p:last-of-type {
  margin-bottom: 0;
}
.seo-content > h2:not(:first-child) {
  margin-top: 52px;
}
.seo-content > h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
}
