/* =========================================================================
   AVOCADOTOAST — CHAMBRE NOIRE
   Dark, minimal, precise. One accent.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

/* ---- Tokens ---------------------------------------------------------- */
:root {
    --bg: #0B0E09;
    --bg-1: #0F130D;
    --bg-2: #141811;
    --bg-3: #1A1F17;

    --line: rgba(255, 255, 255, 0.055);
    --line-2: rgba(255, 255, 255, 0.095);
    --line-3: rgba(255, 255, 255, 0.16);

    --text: #E8EBE3;
    --text-dim: #9AA095;
    --text-mute: #5E6458;

    --accent: #B8ED3C;
    --accent-2: #9FD028;
    --accent-ink: #0B0E09;
    --accent-soft: rgba(184, 237, 60, 0.12);
    --accent-glow: rgba(184, 237, 60, 0.22);

    --danger: #FF6B5C;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);

    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur: 160ms;
    --dur-lg: 240ms;

    --wrap: 1200px;
    --wrap-wide: 1400px;
}


/* ---- Reset ----------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'ss01', 'ss02', 'cv01', 'cv11';
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    background: none;
    border: 0;
}

input {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Atmospheric background — single radial, no texture */
.glass-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(1100px 600px at 50% -10%, rgba(184, 237, 60, 0.06), transparent 60%),
        radial-gradient(900px 500px at 100% 110%, rgba(184, 237, 60, 0.025), transparent 60%),
        linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

/* ---- Top bar --------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    background: rgba(11, 14, 9, 0.7);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: var(--wrap-wide);
    margin: 0 auto;
    padding: 12px clamp(18px, 3vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.brand-mark {
    display: inline-block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: url('/mark.svg') center / contain no-repeat;
    filter: drop-shadow(0 0 8px var(--accent-glow));
    transition: transform var(--dur-lg) var(--ease);
}

.brand:hover .brand-mark,
.auth-brand:hover .brand-mark {
    transform: rotate(-8deg) scale(1.06);
}

.brand span {
    color: var(--text-dim);
    font-weight: 400;
}

/* Control Components */
.control-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.color-picker-mini {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--line-2);
    overflow: hidden;
    cursor: pointer;
}
.color-picker-mini input[type="color"] {
    position: absolute;
    inset: -5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}
.color-preview {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim);
}
.slider-container input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--line-2);
    border-radius: 2px;
    appearance: none;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.val-tip {
    min-width: 20px;
    font-family: 'Geist Mono', monospace;
    color: var(--accent);
}

.icon-selector {
    display: flex;
    gap: 8px;
}
.icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 14px;
    transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--line-3); color: var(--text); }
.icon-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.topbar-meta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-dim);
}

.topbar-meta .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    margin-right: 6px;
    vertical-align: middle;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    color: var(--text);
    background: var(--bg-1);
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

.topbar-badge strong {
    color: var(--accent);
    font-weight: 600;
    margin-left: 6px;
}

/* ---- Layout ---------------------------------------------------------- */
.container {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(32px, 6vw, 72px) clamp(18px, 3vw, 28px) 120px;
}

/* ---- Hero ------------------------------------------------------------ */
.hero {
    padding: clamp(32px, 7vw, 80px) 0 clamp(28px, 5vw, 56px);
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 22px;
}

.kicker-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.hero-title {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 5.5vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--text);
    max-width: 18ch;
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    margin-top: clamp(18px, 2vw, 24px);
    font-size: clamp(1.0rem, 1.15vw, 1.15rem);
    line-height: 1.55;
    color: var(--text-dim);
    max-width: 54ch;
    font-weight: 400;
}

.hero-sub strong {
    color: var(--text);
    font-weight: 500;
}

.hero-meta {
    margin-top: clamp(24px, 3vw, 36px);
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
}

.hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-meta-item b {
    color: var(--text);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.hero-meta-item .sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-mute);
}

/* ---- Section scaffolding -------------------------------------------- */
.section {
    margin-top: clamp(40px, 6vw, 72px);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-head-l {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.section-index {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
    letter-spacing: 0.04em;
}

.section-title {
    font-family: 'Geist', sans-serif;
    font-weight: 500;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text);
}

.section-hint {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
    letter-spacing: 0.02em;
}

/* ---- Drop zone ------------------------------------------------------- */
.drop-zone {
    position: relative;
    padding: clamp(32px, 5vw, 48px) 28px;
    background: linear-gradient(180deg, var(--bg-1), var(--bg));
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.drop-zone:hover {
    border-color: var(--line-3);
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

.drop-zone:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.drop-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: linear-gradient(180deg, var(--accent-soft), transparent);
    transform: scale(1.005);
}

.drop-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text-dim);
    transition: color var(--dur), border-color var(--dur);
}

.drop-zone:hover .drop-icon {
    color: var(--accent);
    border-color: var(--line-3);
}

.drop-icon i {
    width: 22px;
    height: 22px;
}

.drop-title {
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--text);
}

.drop-title .kbd {
    color: var(--accent);
    font-weight: 500;
}

.drop-sub {
    font-size: 13.5px;
    color: var(--text-dim);
    max-width: 42ch;
}

.drop-count {
    margin-top: 6px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
    letter-spacing: 0.02em;
}

.drop-count.active {
    color: var(--accent);
}

/* ---- File list ------------------------------------------------------- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-row {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: grab;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.file-row:hover {
    background: var(--bg-2);
    border-color: var(--line-light);
}

@keyframes swapPulse {
    0% { transform: scale(1); background-color: rgba(99, 102, 241, 0.25); border-color: var(--brand); }
    50% { transform: scale(1.02); background-color: rgba(99, 102, 241, 0.4); border-color: var(--brand); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
    100% { transform: scale(1); background-color: var(--bg-1); }
}

.file-row.row-swapped {
    animation: swapPulse 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
}

.file-number-input {
    width: 38px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--brand);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    padding: 2px 0;
    outline: none;
    transition: all 0.2s;
}

.file-number-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}    background: var(--bg-2);
    border-color: var(--line-2);
}

.file-row:active {
    cursor: grabbing;
}

.file-row.is-ghost {
    opacity: 0.4;
    background: var(--bg-3);
    border-color: var(--accent);
}

.file-row.sortable-chosen {
    border-color: var(--line-3);
}

.file-number {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-title-input {
    border: 0;
    background: transparent;
    width: 100%;
    font-family: 'Geist', sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.005em;
    padding: 2px 0;
    text-overflow: ellipsis;
    border-radius: 4px;
    transition: background var(--dur);
}

.file-title-input:hover {
    background: var(--bg-2);
    padding: 2px 6px;
    margin: 0 -6px;
}

.file-title-input:focus {
    outline: 0;
    background: var(--bg-2);
    padding: 2px 6px;
    margin: 0 -6px;
    box-shadow: 0 0 0 1px var(--accent);
}

.file-meta {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta .dot {
    color: var(--line-3);
    padding: 0 6px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid transparent;
    color: var(--text-mute);
    transition: color var(--dur), background var(--dur), border-color var(--dur);
}

.btn-icon i {
    width: 15px;
    height: 15px;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--bg-3);
}

.btn-icon.delete-file:hover {
    color: var(--danger);
    background: rgba(255, 107, 92, 0.09);
}

.drag-handle {
    display: grid;
    place-items: center;
    width: 26px;
    height: 30px;
    color: var(--text-mute);
    cursor: grab;
    transition: color var(--dur);
}

.drag-handle:hover {
    color: var(--text);
}

.drag-handle i {
    width: 15px;
    height: 15px;
}

/* ---- Compare table --------------------------------------------------- */
.compare {
    margin-top: clamp(32px, 5vw, 56px);
}

.compare-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.compare-head .section-index {
    color: var(--accent);
}

.compare-head .section-title em {
    color: var(--accent);
    font-style: normal;
}

.compare-table {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-1);
}

.compare-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.compare-row:first-child {
    border-top: 0;
}

.compare-head-row {
    background: var(--bg-2);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    padding-top: 11px;
    padding-bottom: 11px;
}

.compare-head-row .col-us {
    color: var(--accent);
}

.compare-head-row .col-them {
    color: var(--text-dim);
}

.compare-label {
    color: var(--text-dim);
}

.compare-label .mono {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text);
    background: var(--bg-3);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--line-2);
}

.col-us,
.col-them {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text);
}

.col-us b {
    color: var(--accent);
}

.col-them {
    color: var(--text-dim);
}

.stamp-render {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    touch-action: none;
    user-select: none;
    cursor: move;
    box-sizing: border-box;
    transition: none !important;
}

.stamp-render.interactable {
    border: 2px dashed #3B82F6;
    background: rgba(59, 130, 246, 0.08);
}

.stamp-render.interactable:hover {
    border-color: #2563EB;
    background: rgba(59, 130, 246, 0.12);
}

/* Corner resize handles */
.stamp-render.interactable::before,
.stamp-render.interactable::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #3B82F6;
    border-radius: 1px;
    pointer-events: none;
}

.stamp-render.interactable::before {
    bottom: -2px;
    right: -2px;
    /* Bottom-right corner */
    cursor: nwse-resize;
}

.stamp-render.interactable::after {
    top: -2px;
    left: -2px;
    /* Top-left corner */
    cursor: nwse-resize;
}

.stamp-render span {
    white-space: nowrap;
    padding: 4px 8px;
    font-weight: 700;
    font-size: 10px;
    color: #2563EB;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
}

/* Hide text when document is loaded to show the real backend render instead */
.document-page .stamp-render span {
    display: none;
}

/* ---- Preview Viewer -------------------------------------------------- */
.preview-box.real-doc {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    height: min(760px, calc(100vh - 220px));
}

.document-page {
    background-color: white;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* NO transition — transitions cause interact.js to miscalculate positions */
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    border-radius: var(--radius);
}

.mini-loader {
    width: 24px;
    height: 24px;
    border: 3px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.stamp-render.hidden {
    display: none;
}

.preview-hint {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 8px;
    text-align: center;
}

.check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.check.yes {
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
}

.check.yes-them {
    color: var(--text-dim);
    border: 1px solid var(--line-2);
    background: transparent;
}

.dash {
    color: var(--text-mute);
    font-family: 'Geist Mono', ui-monospace, monospace;
}

.compare-note {
    margin-top: 12px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
    line-height: 1.55;
}

/* ---- Settings -------------------------------------------------------- */
.settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.settings-block {
    background: var(--bg-1);
    padding: 22px 22px 20px;
}

.settings-block-wide {
    grid-column: 1 / -1;
}

.settings-desc {
    font-size: 12.5px;
    color: var(--text-mute);
    margin: -6px 0 12px;
    line-height: 1.5;
}

.badge-opt {
    display: inline-block;
    margin-left: 6px;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    vertical-align: middle;
}

.input-wide {
    min-width: 220px;
    width: 100%;
    max-width: 260px;
}

.settings-block-title {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px dashed var(--line);
}

.field:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.field-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.005em;
}

.field-hint {
    font-size: 12px;
    color: var(--text-mute);
}

.input-text,
.input-number {
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    padding: 8px 10px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text);
    transition: border-color var(--dur), box-shadow var(--dur);
    text-align: left;
}

.input-text {
    min-width: 150px;
}

.input-number {
    width: 72px;
    text-align: center;
}

.input-text:focus,
.input-number:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Custom switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 99px;
    transition: background var(--dur), border-color var(--dur);
}

.switch-track::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: transform var(--dur-lg) var(--ease), background var(--dur);
}

.switch input:checked+.switch-track {
    background: var(--accent);
    border-color: var(--accent);
}

.switch input:checked+.switch-track::after {
    transform: translate(18px, -50%);
    background: var(--accent-ink);
}

.switch input:focus-visible+.switch-track {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Logo upload */
.logo-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.logo-zone.has-logo .logo-name {
    color: var(--accent);
}

.logo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: border-color var(--dur), background var(--dur), transform var(--dur);
}

.logo-upload-btn i {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
}

.logo-upload-btn:hover {
    border-color: var(--line-3);
    background: var(--bg-2);
}

.logo-upload-btn:hover i {
    color: var(--accent);
}

.logo-name {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Action bar ------------------------------------------------------ */
.action-bar {
    position: relative;
    z-index: 20;
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px 10px 18px;
    background: rgba(15, 19, 13, 0.82);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
}

.action-bar-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.action-bar-info .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 99px;
    color: var(--text);
}

.action-bar-info .pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(184, 237, 60, 0.05);
    border: 1px dashed var(--line-2);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-dim);
    max-width: 400px;
    line-height: 1.4;
}

.security-notice i {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.security-notice b {
    color: var(--text);
    font-weight: 500;
}

@media (max-width: 1000px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .security-notice {
        max-width: none;
        order: -1;
    }
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    border-radius: 8px;
    border: 0;
    transition: background var(--dur), transform var(--dur) var(--ease), box-shadow var(--dur);
    box-shadow: 0 0 0 rgba(184, 237, 60, 0);
}

.btn-primary i {
    width: 16px;
    height: 16px;
}

.btn-primary:hover {
    background: #C7F455;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -8px var(--accent-glow), 0 0 0 1px var(--accent-2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* ---- Stamp Preview --------------------------------------------------- */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-3);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mute);
    border-radius: 6px;
    transition: all var(--dur);
    cursor: pointer;
}

.tab-btn.active {
    background: var(--bg-1);
    color: var(--accent);
    box-shadow: var(--shadow-1);
}

.stamp-preview-container {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.preview-label {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-mute);
}

.preview-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-mute);
}

.nav-btn {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    background: var(--bg-3);
    color: var(--text);
    transition: all var(--dur);
    cursor: pointer;
}

.nav-btn:hover {
    background: var(--bg-1);
    color: var(--accent);
}

.nav-btn i {
    width: 14px;
    height: 14px;
}

.preview-box.real-doc {
    height: 500px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    overflow: auto;
    position: relative;
}

.document-page {
    background-color: white;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Size will be set dynamically via JS */
    width: 300px;
    height: 400px;
    flex-shrink: 0;
    transition: width 0.3s, height 0.3s;
}

/* Stamp is now in the image background, so we hide the CSS version */
.stamp-render.hidden {
    display: none;
}

.preview-hint {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 12px;
    text-align: center;
}

.btn-primary kbd {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    margin-left: 4px;
    background: rgba(11, 14, 9, 0.14);
    border: 1px solid rgba(11, 14, 9, 0.25);
    border-radius: 4px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-ink);
}

/* ---- Footer / colophon ---------------------------------------------- */
.colophon {
    margin-top: clamp(48px, 7vw, 96px);
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-mute);
}

.colophon a {
    color: var(--text-dim);
    border-bottom: 1px solid var(--line-2);
    transition: color var(--dur), border-color var(--dur);
}

.colophon a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---- Loader ---------------------------------------------------------- */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(11, 14, 9, 0.76);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    display: grid;
    place-items: center;
    padding: 24px;
}

.loader-card {
    min-width: 320px;
    max-width: 420px;
    padding: 28px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    text-align: center;
}

.loader-ring {
    position: relative;
    width: 44px;
    height: 44px;
    margin: 0 auto 20px;
}

.loader-ring::before,
.loader-ring::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--line-2);
}

.loader-ring::after {
    border-color: transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    animation: ringSpin 0.9s linear infinite;
    box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes ringSpin {
    to {
        transform: rotate(360deg);
    }
}

.loader-label {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.loader-msg {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.4;
    font-weight: 500;
    min-height: 2.6em;
    transition: opacity var(--dur);
}

.loader-progress {
    margin-top: 18px;
    height: 2px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.loader-progress::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 35%;
    background: var(--accent);
    border-radius: 99px;
    box-shadow: 0 0 12px var(--accent-glow);
    animation: progSlide 1.4s cubic-bezier(.5, 0, .5, 1) infinite;
}

@keyframes progSlide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(320%);
    }
}

/* ---- Reveal on scroll ----------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---- Utilities ------------------------------------------------------- */
.hidden {
    display: none !important;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

/* =========================================================================
   Landing page specifics (hero CTAs, topbar CTA, final CTA, app header)
   ========================================================================= */
.topbar-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar-cta .btn-secondary {
    padding: 7px 12px;
    font-size: 12.5px;
}

.topbar-cta .btn-primary {
    padding: 7px 12px;
    font-size: 12.5px;
}

.topbar-cta i {
    width: 13px;
    height: 13px;
}

.hero-ctas {
    display: flex;
    gap: 12px;
    margin-top: clamp(28px, 3.5vw, 40px);
    flex-wrap: wrap;
}

.btn-large {
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    letter-spacing: -0.005em;
}

.btn-large i {
    width: 16px;
    height: 16px;
}

.final-cta {
    margin-top: clamp(56px, 8vw, 96px);
    padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
    background: linear-gradient(180deg, var(--bg-1), var(--bg));
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.final-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 300px at 50% 0%, var(--accent-glow), transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.final-cta-title {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 12px;
    position: relative;
}

.final-cta-title em {
    font-style: normal;
    color: var(--accent);
}

.final-cta-sub {
    font-size: clamp(0.98rem, 1.1vw, 1.08rem);
    color: var(--text-dim);
    max-width: 52ch;
    margin: 0 auto;
    line-height: 1.55;
    position: relative;
}

.final-cta .hero-ctas {
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* App header (compact, for /app.html — replaces marketing hero) */
.app-header {
    padding: clamp(16px, 3vw, 28px) 0 clamp(20px, 3vw, 32px);
    border-bottom: 1px solid var(--line);
    margin-bottom: clamp(8px, 1.5vw, 20px);
}

.app-title {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-top: 4px;
    color: var(--text);
}

.app-sub {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.55;
    max-width: 56ch;
}

@media (max-width: 760px) {

    .topbar-cta .btn-secondary span,
    .topbar-cta .btn-primary span {
        display: none;
    }

    .hero-ctas {
        flex-direction: column;
    }

    .hero-ctas .btn-large {
        justify-content: center;
    }
}

/* =========================================================================
   Welcome strip (authenticated home)
   ========================================================================= */
.welcome-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    margin-top: 8px;
    margin-bottom: 16px;
    background: linear-gradient(180deg, var(--bg-1), var(--bg));
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.welcome-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.welcome-left .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
    flex-shrink: 0;
}

.welcome-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.welcome-greeting {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.005em;
}

.welcome-greeting b {
    color: var(--accent);
    font-weight: 600;
}

.welcome-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-dim);
}

.welcome-meta .welcome-sep {
    color: var(--text-mute);
}

.welcome-meta .tier-badge {
    font-size: 10px;
    padding: 2px 7px;
}

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .welcome-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .welcome-actions {
        justify-content: space-between;
    }
}

/* =========================================================================
   Auth pages (login, signup, accept-invite)
   ========================================================================= */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 40px);
    box-shadow: var(--shadow-2);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
}

.auth-brand .brand-mark {
    width: 24px;
    height: 24px;
}

.auth-brand span {
    color: var(--text-dim);
    font-weight: 400;
}

.auth-kicker {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 8px;
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 26px;
}

.auth-sub b {
    color: var(--text);
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 11px 12px;
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    color: var(--text);
    transition: border-color var(--dur), box-shadow var(--dur);
}

.form-input:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input[readonly] {
    background: var(--bg-2);
    color: var(--text-dim);
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-mute);
    margin-top: 2px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    padding: 10px 12px;
    background: rgba(255, 107, 92, 0.08);
    border: 1px solid rgba(255, 107, 92, 0.25);
    border-radius: 6px;
    line-height: 1.5;
}

.form-error.info-box {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent-glow);
}

.form-error.hidden {
    display: none !important;
}

.form-submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.form-submit[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.form-links {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-mute);
}

.form-links a {
    color: var(--text-dim);
    border-bottom: 1px solid var(--line-2);
    transition: color var(--dur), border-color var(--dur);
}

.form-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.form-links a.disabled {
    pointer-events: none;
    color: var(--text-mute);
    border-color: transparent;
}

/* =========================================================================
   User menu (topbar, team/account pages)
   ========================================================================= */
.user-menu {
    position: relative;
    display: inline-flex;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    background: var(--bg-1);
    font-size: 12.5px;
    color: var(--text);
    transition: border-color var(--dur), background var(--dur);
}

.user-menu-btn:hover {
    border-color: var(--line-3);
    background: var(--bg-2);
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.user-menu-btn i {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: var(--shadow-2);
    padding: 6px;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity var(--dur), transform var(--dur);
    z-index: 50;
}

.user-menu.is-open .user-menu-dropdown {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.user-menu-dropdown .menu-header {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

.user-menu-dropdown .menu-header b {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.user-menu-dropdown .menu-header span {
    font-size: 11.5px;
    color: var(--text-mute);
    font-family: 'Geist Mono', monospace;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    transition: background var(--dur);
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: var(--bg-2);
}

.user-menu-dropdown i {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
}

.user-menu-dropdown .danger {
    color: var(--danger);
}

.user-menu-dropdown .danger i {
    color: var(--danger);
}

/* =========================================================================
   Team page
   ========================================================================= */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 99px;
    border: 1px solid var(--line-2);
    color: var(--text-dim);
    background: var(--bg-3);
}

.tier-badge.tier-cabinet,
.tier-badge.tier-cabinet_pro,
.tier-badge.tier-enterprise {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.seat-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
}

.seat-meter .bar {
    position: relative;
    flex: 1;
    max-width: 200px;
    height: 4px;
    background: var(--bg-3);
    border-radius: 99px;
    overflow: hidden;
}

.seat-meter .fill {
    position: absolute;
    inset: 0;
    background: var(--accent);
    border-radius: 99px;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width var(--dur-lg) var(--ease);
}

.seat-meter.is-full .fill {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(255, 107, 92, 0.4);
}

.invite-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.invite-form .form-input {
    min-width: 220px;
}

.invite-form select {
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    color: var(--text);
}

.member-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.member-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-1);
    border-top: 1px solid var(--line);
}

.member-row:first-child {
    border-top: 0;
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.member-email {
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px;
    color: var(--text-mute);
}

.member-role {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 3px 8px;
    border: 1px solid var(--accent);
    border-radius: 99px;
    background: var(--accent-soft);
}

.member-role.role-member {
    color: var(--text-dim);
    border-color: var(--line-2);
    background: var(--bg-3);
}

.copy-link {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
    padding: 12px;
    background: var(--bg-2);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}

.copy-link-url {
    background: transparent;
    border: 0;
    padding: 0;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--text);
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
}

.copy-link-url:focus {
    outline: 0;
}

.copy-link-btn {
    padding: 6px 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 0;
}

.copy-link-btn:hover {
    background: #C7F455;
}

.copy-link-note {
    grid-column: 1 / -1;
    font-size: 11.5px;
    color: var(--text-mute);
    font-family: 'Geist Mono', monospace;
    line-height: 1.5;
}

.seat-full-notice {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.55;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.seat-full-notice b {
    color: var(--text);
}

.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    color: var(--text-dim);
    cursor: not-allowed;
}

.btn-upgrade.enabled {
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    cursor: pointer;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-3);
    color: var(--text);
    font-family: 'Geist', sans-serif;
    font-weight: 500;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--line-2);
    transition: border-color var(--dur), background var(--dur);
}

.btn-secondary:hover {
    border-color: var(--line-3);
    background: var(--bg-2);
}

.btn-secondary i {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 92, 0.3);
    transition: background var(--dur), border-color var(--dur);
}

.btn-danger:hover {
    background: rgba(255, 107, 92, 0.08);
    border-color: var(--danger);
}

.btn-danger i {
    width: 13px;
    height: 13px;
}

@media (max-width: 760px) {
    .invite-form {
        grid-template-columns: 1fr;
    }

    .invite-form .form-input {
        min-width: 0;
    }

    .member-row {
        grid-template-columns: 1fr auto;
        row-gap: 6px;
    }

    .member-row .btn-danger {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

/* =========================================================================
   Billing — plan cards
   ========================================================================= */
.billing-banner {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.billing-banner.success {
    background: rgba(184, 237, 60, 0.1);
    border: 1px solid var(--accent);
    color: var(--text);
}

.billing-banner.info {
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    color: var(--text-dim);
}

.billing-banner.warning {
    background: rgba(255, 107, 92, 0.08);
    border: 1px solid rgba(255, 107, 92, 0.3);
    color: var(--text);
}

.billing-banner i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.billing-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.billing-summary-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.billing-summary-left .label {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.billing-summary-left .tier {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.billing-summary-left .status {
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px;
    color: var(--text-dim);
}

.billing-summary-left .status.active {
    color: var(--accent);
}

.billing-summary-left .status.past_due {
    color: var(--danger);
}

.billing-summary-left .status.canceled {
    color: var(--text-mute);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.plan-card {
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color var(--dur), transform var(--dur) var(--ease);
    position: relative;
}

.plan-card:hover {
    border-color: var(--line-3);
}

.plan-card.is-current {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-soft), var(--bg-1) 50%);
}

.plan-card .plan-current-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: var(--accent);
    padding: 3px 7px;
    border-radius: 99px;
    font-weight: 600;
}

.plan-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.plan-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.plan-seats {
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px;
    color: var(--text-mute);
}

.plan-price {
    display: baseline;
    align-items: baseline;
    gap: 4px;
    font-family: 'Geist', sans-serif;
}

.plan-price .amount {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.plan-price .per {
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--text-mute);
    margin-left: 6px;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.plan-features li::before {
    content: "✓";
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 2px;
}

.plan-cta {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
}

@media (max-width: 760px) {
    .plan-grid {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-3);
    border-radius: 99px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--line-3);
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 760px) {
    .settings {
        grid-template-columns: 1fr;
    }

    .settings-block-wide {
        grid-column: auto;
    }

    .topbar-meta {
        display: none;
    }

    .topbar-badge {
        font-size: 10.5px;
        padding: 3px 8px;
    }

    .file-row {
        grid-template-columns: 36px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .file-row .file-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-top: 4px;
        border-top: 1px dashed var(--line);
        margin-top: 4px;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-bar .btn-primary {
        justify-content: center;
    }

    .hero-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .compare-row {
        grid-template-columns: 1.2fr .7fr .7fr;
        padding: 11px 12px;
        font-size: 13px;
        gap: 8px;
    }

    .compare-head-row {
        font-size: 10px;
    }

    .compare-label .mono {
        display: none;
    }

    .input-wide {
        max-width: 170px;
    }
}

/* --- Notifications --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    color: var(--text-dim);
    background: var(--bg-1);
    transition: all var(--dur);
}

.user-pill:hover {
    border-color: var(--line-3);
    color: var(--text);
    background: var(--bg-2);
}

.user-pill i {
    width: 18px;
    height: 18px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--line-2);
}

.notif-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-wrapper .btn-icon {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s, transform 0.2s;
}

.notif-wrapper .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.notif-wrapper .btn-icon i {
    width: 18px;
    height: 18px;
    color: var(--text-dim);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF4F38;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0B0E09;
    box-shadow: 0 0 12px rgba(255, 79, 56, 0.4);
    z-index: 10;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 340px;
    background: #141811;
    /* Solid, no transparency */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.notif-dropdown.show {
    display: flex;
}

.notif-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1A1F17;
}

.notif-header span {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.notif-body {
    max-height: 420px;
    overflow-y: auto;
    background: #0B0E09;
}

.notif-item {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    background: #0B0E09;
}

.notif-item:hover {
    background: #141811;
}

.notif-item.unread {
    background: #1A1F17;
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    box-shadow: 2px 0 10px var(--accent-glow);
}

.notif-msg {
    font-size: 0.88rem;
    color: #9AA095;
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.notif-msg b {
    color: #fff;
    font-weight: 600;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-mute);
}

.notif-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #5E6458;
    font-size: 0.9rem;
}

.btn-text {
    background: none;
    border: none;
    color: #00d2ff;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-text:hover {
    text-decoration: underline;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- User Menu Extensions --- */
.menu-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.menu-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.menu-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    gap: 12px;
}

.menu-data-row .label {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.menu-data-row .value {
    color: #fff;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.menu-data-row .value small {
    color: var(--accent);
    font-weight: 400;
    opacity: 0.8;
    margin-left: 4px;
}

.code-value {
    font-family: 'Geist Mono', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.code-value:hover {
    background: rgba(184, 237, 60, 0.1);
    color: var(--accent);
    border-color: rgba(184, 237, 60, 0.2);
}

.code-value i {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.5;
}

/* --- Pricing & FAQ --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.pricing-card.featured {
    background: rgba(59, 74, 26, 0.1);
    border: 2px solid #A3B18A;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pricing-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #A3B18A;
    color: #0B0E09;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.pricing-header {
    margin-bottom: 2rem;
}

.tier-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.price span {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

.tier-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    flex-grow: 1;
}

.tier-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.tier-features i {
    width: 18px;
    height: 18px;
    color: #A3B18A;
}

.faq-section {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.faq-item h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.faq-item p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

@media (max-width: 600px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Settings Groups (Accordion/Cards) ------------------------------- */
.settings-group.card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform var(--dur), border-color var(--dur), box-shadow var(--dur);
}

.settings-group.card:hover {
    border-color: var(--line-2);
    box-shadow: var(--shadow-1);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(to right, var(--bg-2), transparent);
    border-bottom: 1px solid var(--line);
}

.group-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.group-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.group-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.group-hint {
    font-size: 11px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1px;
}

.group-body {
    padding: 20px;
}

.settings-block {
    padding: 24px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
}

.settings-tabs {
    display: flex;
    background: var(--bg-2);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.settings-tabs .tab-btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: 6px;
    transition: all var(--dur);
}

.settings-tabs .tab-btn.active {
    background: var(--bg-3);
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.field.no-margin {
    margin-bottom: 0;
}

.badge-opt {
    font-size: 10px;
    background: var(--bg-3);
    color: var(--text-mute);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 8px;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ---- Split View Layout ---------------------------------------------- */
.app-body {
    display: flex;
    height: calc(100vh - 65px); /* Adjust based on topbar */
    overflow: hidden;
}

.left-panel {
    flex: 1;
    overflow-y: auto;
    min-width: 400px;
}

.full-width-step {
    max-width: 1440px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}

.step-2-layout {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#settings-column {
    padding: 32px;
    border-right: 1px solid var(--line);
    flex: 0 0 500px;
}

.preview-column {
    background: var(--bg-1);
    padding: 32px;
    height: calc(100vh - 65px);
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

.full-page-section {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.resizer {
    width: 6px;
    cursor: col-resize;
    background: var(--line);
    transition: background 0.2s, width 0.2s;
    z-index: 100;
}

.resizer:hover, .resizer.is-dragging {
    background: var(--accent);
    width: 8px;
}

.view-toggle {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s var(--ease);
}

.view-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.view-btn.active {
    background: var(--bg-1);
    color: var(--brand);
    box-shadow: var(--shadow-1);
}

.view-btn i {
    width: 14px;
    height: 14px;
}

.right-panel {
    width: 50%;
    min-width: 300px;
    background: var(--bg-1);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transition: width 0.3s var(--ease);
}

.right-panel.hidden {
    display: none;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
}

.side-panel-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.side-panel-body {
    flex: 1;
    padding: 0;
    background: #e5e7eb; /* Standard PDF background */
}

.side-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    font-size: 12px;
    color: var(--text-dim);
}

.hidden { display: none !important; }

/* ---- Stepper -------------------------------------------------------- */
.app-stepper {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 40px;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s var(--ease);
}

.step-item.active {
    opacity: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-3);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s var(--ease);
}

.step-item.active .step-dot {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-mute);
}

.step-item.active .step-label {
    color: var(--text);
}

.step-content {
    animation: fadeIn 0.4s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nav Buttons */
.step-header-nav {
    margin-bottom: 24px;
    padding-left: 32px;
}

.step-nav-bar {
    display: flex;
    align-items: center;
    margin-top: 48px;
}

.info-box {
    padding: 12px 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

#shape-options {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Small-screen fixes (≤ 480px): keep top bars and modals inside the viewport
   ========================================================================= */
@media (max-width: 480px) {
    .topbar-inner { gap: 10px; }
    /* Landing: hero already has a "Se connecter" CTA */
    .topbar-cta .btn-secondary { display: none; }
    /* App: the guided tour targets desktop layout */
    #start-tour-btn,
    .header-divider { display: none !important; }
    .header-right { gap: 8px; min-width: 0; }
    .user-menu-btn > span:not(.user-avatar) { display: none; }
    .user-menu-dropdown { max-width: calc(100vw - 24px); }
    /* Inline-styled modals in app.html use fixed min-widths */
    .loader-overlay .loader-card {
        min-width: 0 !important;
        width: calc(100vw - 32px);
        max-width: 480px;
        padding: 22px !important;
    }
}

/* App step 2 on tablets/phones: stack settings and preview instead of fixed 500px column */
@media (max-width: 900px) {
    .left-panel { min-width: 0; }
    .step-2-layout { flex-direction: column; }
    #settings-column { flex: 1 1 auto; padding: 20px 0; border-right: 0; }
    .preview-column { position: static; height: auto; padding: 20px 0; }
}
@media (max-width: 480px) {
    .full-width-step { padding-left: 16px !important; padding-right: 16px !important; }
    .field { grid-template-columns: 1fr; gap: 8px; }
    .field .input-text, .field .input-number, .field select { width: 100%; max-width: 100%; }
    .settings-block { padding: 16px; }
}

/* =========================================================================
   Email verification: banner (unverified users) + "verify first" prompt
   ========================================================================= */
.verify-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 171, 0, 0.25);
    background: rgba(255, 171, 0, 0.07);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-dim);
}
.verify-banner b { color: var(--text); font-weight: 600; word-break: break-all; }
.verify-banner-status { display: block; margin-top: 2px; color: var(--accent); }
.verify-banner-status:empty { display: none; }
.verify-banner-btn { padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }

.verify-prompt-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(11, 14, 9, 0.8);
    backdrop-filter: blur(10px);
}
.verify-prompt-card {
    width: 100%;
    max-width: 460px;
    padding: 32px;
    text-align: center;
    background: var(--bg-1);
    border: 1px solid var(--accent);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.verify-prompt-emoji { font-size: 3rem; margin-bottom: 12px; }
.verify-prompt-card h2 { font-size: 1.35rem; color: var(--text); margin-bottom: 10px; }
.verify-prompt-card p { color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.verify-prompt-status { color: var(--accent) !important; min-height: 1em; }
.verify-prompt-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.verify-prompt-actions button { width: auto; padding: 10px 18px; }
