* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --surface-2: #f5f5f4;
    --border: #e7e5e4;
    --border-subtle: #efede9;
    --text: #1c1917;
    --text-2: #57534e;
    --text-3: #a8a29e;
    --accent: #18181b;
    --accent-hover: #000;
    --accent-fg: #ffffff;
    --pink: #ec4899;
    --pink-soft: #fdf2f8;
    --success: #16a34a;
    --error: #dc2626;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.1), 0 4px 10px -4px rgba(0, 0, 0, 0.05);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* === SHELL LAYOUT === */
.shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* === SIDEBAR === */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    text-align: center;
}

.brand-logo {
    width: 140px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

.brand-tag {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.side-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.side-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.side-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 0.6rem;
    padding: 0 0.5rem;
}

.side-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    color: var(--text-2);
}

.side-step .step-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-3);
    width: 22px;
}

.side-step .step-label {
    font-size: 0.88rem;
    font-weight: 500;
}

.side-step.active {
    background: var(--text);
    color: var(--accent-fg);
}

.side-step.active .step-num {
    color: var(--accent-fg);
    opacity: 0.6;
}

.side-step.done {
    color: var(--text-3);
}

.side-step.done .step-num::before {
    content: '✓';
    color: var(--success);
    margin-right: 2px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-2);
}

.spec-row code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text);
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 4px;
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--surface-2);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 0.8rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-3);
    letter-spacing: 0.02em;
}

/* Format tiles (sidebar) */
.format-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.format-tile {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.55rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.15s;
}

.format-tile:hover {
    border-color: var(--text-3);
    background: var(--surface);
}

.format-ext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
}

.format-desc {
    font-size: 0.66rem;
    color: var(--text-3);
}

/* Info card (sidebar) */
.info-card {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(24, 24, 27, 0.02));
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.8rem;
}

.info-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.info-desc {
    font-size: 0.72rem;
    color: var(--text-2);
    line-height: 1.45;
}

/* Header stats */
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.header-stats {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.stat-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
}

.stat-chip-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-chip-link:hover {
    border-color: var(--accent, #F17D26);
    transform: translateY(-1px);
}

.stat-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.stat-chip div {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-3);
}

/* Modes showcase */
.modes-showcase {
    margin-top: 2rem;
}

.showcase-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 1rem;
}

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.8rem;
}

.mode-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    transition: all 0.2s;
}

.mode-card:hover {
    border-color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mode-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.mode-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: -0.015em;
}

.mode-card p {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.5;
}

/* Process summary */
.process-summary {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.process-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.process-step h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.process-step p {
    font-size: 0.72rem;
    color: var(--text-3);
    line-height: 1.4;
}

/* Adaptations responsive */
@media (max-width: 700px) {
    .showcase-grid,
    .process-summary {
        grid-template-columns: 1fr;
    }
    .workspace-header {
        flex-direction: column;
    }
    .header-stats {
        width: 100%;
    }
}

/* ========================================================
   AUTH PAGES (login, signup, success, cancel)
   ======================================================== */

.auth-body {
    background: var(--bg);
    min-height: 100vh;
}

.auth-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-left {
    background: linear-gradient(135deg, #1e3a6e 0%, #17467c 60%, #2d5696 100%);
    color: #fff;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(241, 125, 38, 0.25), transparent 70%);
    border-radius: 50%;
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(241, 125, 38, 0.15), transparent 70%);
    border-radius: 50%;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: block;
    width: fit-content;
}

.auth-brand-logo {
    width: 90px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.auth-hero {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.auth-hero h2 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.auth-hero p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-features li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.auth-footer-left {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    color: var(--text-2);
    margin-bottom: 2rem;
    font-size: 0.92rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.auth-field input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.auth-submit {
    margin-top: 0.8rem;
    padding: 0.95rem;
    font-size: 0.95rem;
}

.auth-switch {
    margin-top: 1.8rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-2);
}

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

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

.auth-flash {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.auth-flash-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-flash-success {
    background: #ecfdf5;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    color: var(--success);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

@media (max-width: 800px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-left { padding: 2rem; min-height: auto; }
    .auth-right { padding: 2rem 1.5rem; }
}

/* Signup étendu */
.signup-form {
    gap: 0.8rem;
}

.auth-field-row {
    display: flex;
    gap: 0.8rem;
}

.auth-field-row .auth-field {
    flex: 1;
}

.auth-field .optional {
    color: var(--text-3);
    font-weight: 400;
    font-size: 0.75rem;
}

.auth-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.8rem 0;
}

.auth-card {
    max-height: 90vh;
    overflow-y: auto;
}

/* Admin panel */
.admin-main {
    max-width: 1400px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.admin-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.3rem 1.5rem;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
}

.admin-stat-label {
    font-size: 0.78rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    margin-top: 0.3rem;
}

.admin-table {
    font-size: 0.82rem;
}

.admin-table th, .admin-table td {
    padding: 0.75rem 1rem;
    vertical-align: top;
}

.td-id {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-3);
    font-size: 0.78rem;
}

.row-admin {
    background: rgba(30, 58, 110, 0.03);
}

.user-name {
    font-weight: 600;
    color: var(--text);
}

.user-company, .user-phone, .user-addr-city {
    font-size: 0.76rem;
    color: var(--text-3);
    margin-top: 0.1rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-2);
}

.user-addr {
    color: var(--text-2);
}

.badge-admin {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    background: #1e3a6e;
    color: white;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.credits-admin {
    font-weight: 700;
    color: #1e3a6e;
    font-size: 1.1rem;
}

.tag-completed {
    background: #dcfce7;
    color: #16a34a;
}

.tag-pending {
    background: #fef3c7;
    color: #d97706;
}

.tag-failed {
    background: #fee2e2;
    color: #dc2626;
}

@media (max-width: 800px) {
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .auth-field-row { flex-direction: column; gap: 0.8rem; }
}

/* ========================================================
   DASHBOARD & PRICING
   ======================================================== */

.dashboard-shell {
    min-height: 100vh;
    background: var(--bg);
}

.dash-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dash-brand {
    display: block;
}

.dash-logo {
    height: 40px;
    width: auto;
}

.dash-nav {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.dash-nav a {
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
}

.dash-nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.dash-nav a.active {
    color: var(--text);
    background: var(--surface-2);
    font-weight: 600;
}

.dash-nav .nav-logout {
    color: var(--text-3);
}

.dash-nav .nav-cta {
    background: var(--text);
    color: var(--accent-fg);
}

.dash-nav .nav-cta:hover {
    background: var(--accent-hover);
    color: var(--accent-fg);
}

.dash-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.dash-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.3rem;
}

.dash-subtitle {
    color: var(--text-2);
    margin-bottom: 2.5rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.dash-card-credits {
    background: linear-gradient(135deg, #1e3a6e, #2d5696);
    color: #fff;
    border-color: transparent;
}

.dash-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 0.6rem;
}

.dash-card-credits .dash-card-label {
    color: rgba(255,255,255,0.7);
}

.dash-credits-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

.dash-info-value {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.dash-card-sub {
    font-size: 0.82rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.dash-btn {
    margin-top: 1.2rem;
    display: inline-block;
    width: auto;
    padding: 0.65rem 1.2rem;
    background: #fff;
    color: #1e3a6e;
    border: none;
}

.dash-btn:hover {
    background: #f0f0f0;
}

.dash-section {
    margin-top: 2.5rem;
}

.dash-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.dash-history {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    padding: 0.9rem 1.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.dash-table td {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}

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

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--surface-2);
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
}

.dash-date {
    color: var(--text-3);
    font-size: 0.82rem;
}

.dash-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-2);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.8rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.price-card-popular {
    border-color: var(--text);
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--accent-fg);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.price-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.5rem;
}

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.price-value {
    font-size: 2.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.price-currency {
    font-size: 1.2rem;
    color: var(--text-2);
}

.price-per-unit {
    font-size: 0.8rem;
    color: var(--text-3);
    margin-bottom: 1.8rem;
}

.price-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    flex: 1;
}

.price-features li {
    padding: 0.4rem 0;
    font-size: 0.88rem;
    color: var(--text-2);
}

.price-cta {
    display: block;
    width: 100%;
    text-align: center;
}

.pricing-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
}

.info-tile {
    padding: 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.info-tile h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.info-tile p {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.5;
}

@media (max-width: 800px) {
    .dash-grid,
    .pricing-grid,
    .pricing-info {
        grid-template-columns: 1fr;
    }
    .price-card-popular { transform: none; }
}

/* === WORKSPACE === */
.workspace {
    padding: 2.5rem 3rem;
    min-height: 100vh;
}

.workspace-header {
    margin-bottom: 2.5rem;
}

.workspace-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.3rem;
}

.subtitle {
    color: var(--text-2);
    font-size: 0.92rem;
    max-width: 560px;
}

/* === PANEL === */
.panel {
    animation: fadeIn 0.3s ease;
}

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

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

/* === DROPZONE === */
.dropzone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.dropzone-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: var(--surface-2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.2s;
}

.dropzone:hover .dropzone-icon,
.dropzone.drag-over .dropzone-icon {
    background: var(--text);
    color: var(--accent-fg);
    transform: scale(1.05);
}

.dropzone-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.dropzone-sub {
    color: var(--text-2);
    margin-bottom: 1.5rem;
}

.format-pills {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.3rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: 0.05em;
}

/* === PREVIEW CARD === */
.preview-card,
.options-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.btn-text:hover {
    background: var(--surface-2);
}

.preview-frame {
    padding: 1.5rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
        linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
        linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.preview-frame img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.preview-meta {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    color: var(--text-2);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === OPTIONS CARD === */
.options-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.field-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.field-hint {
    font-size: 0.72rem;
    color: var(--text-3);
}

.field-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

/* === SEGMENTED === */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius);
}

.segmented.seg-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.segmented.seg-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.segmented.seg-4 .seg-btn {
    padding: 0.6rem 0.4rem;
}

.segmented.seg-4 .seg-title {
    font-size: 0.82rem;
}

.segmented.seg-4 .seg-desc {
    font-size: 0.66rem;
}

.seg-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.15s;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.seg-btn:hover:not(.active) {
    color: var(--text);
}

.seg-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.seg-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.seg-desc {
    font-size: 0.72rem;
    color: var(--text-3);
}

/* === RANGE === */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-labels,
.range-marks {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 0.2rem;
}

.btn-reset-mini {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    margin-top: 0.6rem;
    transition: all 0.15s;
}

.btn-reset-mini:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--text-3);
}

/* Taille finale */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.size-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    transition: border-color 0.15s;
}

.size-input-wrap:focus-within {
    border-color: var(--text);
}

.size-input {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
    padding: 0;
}

.size-input::placeholder {
    color: var(--text-3);
}

.size-unit {
    font-size: 0.72rem;
    color: var(--text-3);
    white-space: nowrap;
}

.size-sep {
    font-size: 0.72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.size-hint-text {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 0.5rem;
    font-style: italic;
}

/* === SWATCHES === */
.swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--surface);
    color: var(--text-3);
}

.swatch:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.swatch.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--text);
}

.swatch-custom {
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    color: #fff;
    font-weight: 600;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--text);
    color: var(--accent-fg);
    border: 1px solid var(--text);
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s;
    letter-spacing: -0.01em;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-secondary:hover {
    border-color: var(--text);
    background: var(--surface-2);
}

/* === STATUS PANEL === */
.status-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.status-panel h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.status-panel p {
    color: var(--text-2);
    margin-bottom: 1.5rem;
}

.status-panel-error {
    border-color: #fecaca;
    background: #fef2f2;
}

/* === LOADER === */
.loader {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.loader-ring {
    width: 100%;
    height: 100%;
    border: 3px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === RESULT === */
.result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: #ecfdf5;
    color: var(--success);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: #fef2f2;
    color: var(--error);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-preview {
    margin: 1.2rem auto 0;
    max-width: 480px;
}

.result-preview img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid var(--border, #e2e6ec);
    border-radius: 10px;
    background:
        repeating-conic-gradient(#f2f3f5 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
    padding: 8px;
}

.result-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted, #6b7280);
    letter-spacing: 0.02em;
}

.result-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.result-actions .btn-primary {
    width: auto;
    margin-top: 0;
}

/* === UTILITY === */
.hidden {
    display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .side-nav { display: none; }
    .sidebar-footer { padding-top: 1rem; }
    .workspace {
        padding: 1.5rem;
    }
    .panel-grid {
        grid-template-columns: 1fr;
    }
}
