/* ==========================================================================
   Преди <-> След — design system
   Neutral (zinc) palette with a single purple accent.
   ========================================================================== */

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

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #e4e4e7;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;

    --text: #18181b;
    --text-2: #3f3f46;
    --muted: #71717a;
    --subtle: #a1a1aa;

    --accent: #5b4bdb;
    --accent-hover: #4c3dc7;
    --accent-active: #4234b0;
    --accent-soft: #f1effe;
    --accent-soft-2: #e4e0fc;
    --accent-text: #4636c4;
    --ring: 0 0 0 3px rgba(91, 75, 219, .24);

    --success: #15803d;
    --success-soft: #f0fdf4;
    --success-border: #bbf7d0;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-soft: #fef2f2;
    --danger-border: #fecaca;
    --info: #1d4ed8;
    --info-soft: #eff6ff;
    --info-border: #bfdbfe;

    --before: #27272a;
    --after: var(--accent);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-xs: 0 1px 2px rgba(24, 24, 27, .05);
    --shadow-sm: 0 1px 3px rgba(24, 24, 27, .08), 0 1px 2px rgba(24, 24, 27, .04);
    --shadow-md: 0 6px 16px rgba(24, 24, 27, .08), 0 2px 4px rgba(24, 24, 27, .04);
    --shadow-lg: 0 24px 56px rgba(24, 24, 27, .16), 0 8px 20px rgba(24, 24, 27, .08);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    --nav-h: 60px;
    --gutter: 16px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 768px) {
    :root { --gutter: 24px; }
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html.modal-open { overflow: hidden; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, svg { display: block; }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
strong, b { font-weight: 600; }
.icon { flex-shrink: 0; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Utilities ── */
[hidden] { display: none !important; }
.hidden { display: none !important; }
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.hp-field {
    position: absolute !important;
    left: -10000px;
    width: 1px; height: 1px;
    overflow: hidden;
}
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    --btn-h: 40px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--btn-h);
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-active); }

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

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); color: #fff; }

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

.btn-accent-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-accent-soft:hover { background: var(--accent-soft-2); color: var(--accent-text); }

.btn-success { background: #16a34a; color: #fff; box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-success:active { background: #166534; }

.btn-link {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    font-weight: 600;
}
.btn-link:hover { text-decoration: underline !important; text-underline-offset: 2px; }

.btn-lg { --btn-h: 46px; padding: 0 20px; font-size: 15px; }
.btn-sm { --btn-h: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-xs { --btn-h: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-block { display: flex; width: 100%; }

/* Loading state: label hidden, spinner shown */
.btn.is-loading { pointer-events: none; }
.btn.is-loading .icon { display: none; }
.btn.is-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Icon button */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; background: transparent; }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn--bordered { border-color: var(--border); background: var(--surface); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn--overlay {
    background: rgba(24, 24, 27, .62);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.icon-btn--overlay:hover { background: var(--danger); color: #fff; }

@media (pointer: coarse) {
    .btn { --btn-h: 44px; }
    .btn-sm { --btn-h: 40px; }
    .icon-btn { width: 42px; height: 42px; }
    .icon-btn--sm { width: 38px; height: 38px; }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 560px) {
    .field-row--2 { grid-template-columns: 1fr 1fr; }
}

.label, .field > label:not(.check) {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.label-link { font-size: 13px; font-weight: 500; }
.label-optional { font-weight: 400; color: var(--muted); }

.input {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
.input::placeholder { color: var(--subtle); }
.input:hover { border-color: #a1a1aa; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
textarea.input { min-height: 72px; resize: vertical; }
select.input {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
.input--sm { min-height: 36px; padding: 7px 10px; font-size: 13px; border-radius: 8px; }
textarea.input--sm { min-height: 60px; }
.input--mono { font-family: var(--mono); font-size: 13px; }

/* iOS zooms into inputs smaller than 16px */
@media (max-width: 640px) {
    .input, .input--sm { font-size: 16px; }
}

.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { padding-right: 46px; }
.input-action {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.input-action:hover { color: var(--text); background: var(--surface-2); }
.input-action:focus-visible { outline: none; box-shadow: var(--ring); }
.input-action .icon-off { display: none; }
.input-action.is-on .icon-on { display: none; }
.input-action.is-on .icon-off { display: block; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

.field-help { font-size: 13px; color: var(--muted); line-height: 1.45; }
.field-error {
    display: none;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}
.field.is-invalid .field-error { display: flex; }
.field.is-invalid .input { border-color: var(--danger); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }

/* Checkbox */
.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.45;
    cursor: pointer;
}
.check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.field.is-invalid .check { color: var(--danger); }

/* Password strength */
.pw-meter { display: flex; align-items: center; gap: 10px; min-height: 18px; }
.pw-meter-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; max-width: 180px; }
.pw-meter-bars span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background-color .2s; }
.pw-meter-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.pw-meter[data-score="1"] .pw-meter-bars span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] .pw-meter-bars span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-score="3"] .pw-meter-bars span:nth-child(-n+3) { background: #84cc16; }
.pw-meter[data-score="4"] .pw-meter-bars span:nth-child(-n+4) { background: var(--success); }
.pw-meter[data-score="1"] .pw-meter-label { color: var(--danger); }
.pw-meter[data-score="2"] .pw-meter-label { color: var(--warning); }
.pw-meter[data-score="3"] .pw-meter-label,
.pw-meter[data-score="4"] .pw-meter-label { color: var(--success); }
.pw-match { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; min-height: 18px; }
.pw-match.is-ok { color: var(--success); }
.pw-match.is-bad { color: var(--danger); }

/* ==========================================================================
   Callouts
   ========================================================================== */
.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.5;
}
.callout-icon { flex-shrink: 0; margin-top: 1px; }
.callout-body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.callout-title { font-weight: 600; color: var(--text); }
.callout-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.callout--success { background: var(--success-soft); border-color: var(--success-border); }
.callout--success .callout-icon { color: var(--success); }
.callout--warning { background: var(--warning-soft); border-color: var(--warning-border); }
.callout--warning .callout-icon { color: var(--warning); }
.callout--danger { background: var(--danger-soft); border-color: var(--danger-border); }
.callout--danger .callout-icon { color: var(--danger); }
.callout--info { background: var(--info-soft); border-color: var(--info-border); }
.callout--info .callout-icon { color: var(--info); }
.callout--accent { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.callout--accent .callout-icon { color: var(--accent); }
.callout--compact { padding: 10px 12px; font-size: 13px; gap: 10px; }
.callouts { display: grid; gap: 12px; }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--text-2);
}
.badge--before { background: var(--before); color: #fff; }
.badge--after { background: var(--after); color: #fff; }
.badge--pair { background: rgba(255, 255, 255, .94); color: var(--text); box-shadow: var(--shadow-xs); }
.badge--single { background: #fef3c7; color: #92400e; }
.badge--success { background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1px var(--success-border); }
.badge--danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-border); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--neutral { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card-body { padding: 20px; }
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (min-width: 768px) {
    .card-body { padding: 24px; }
}

/* ==========================================================================
   Modal (<dialog>)
   ========================================================================== */
dialog.modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: calc(100% - 32px);
    max-width: 520px;
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}
dialog.modal--sm { max-width: 420px; }
dialog.modal--wide { max-width: 580px; }
dialog.modal::backdrop {
    background: rgba(24, 24, 27, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
dialog.modal[open] { animation: modal-in .22s var(--ease); }
dialog.modal[open]::backdrop { animation: fade-in .2s ease; }
dialog.modal.is-fallback[open] {
    z-index: 1000;
    top: 50%;
    transform: translateY(-50%);
    height: fit-content;
    box-shadow: 0 0 0 100vmax rgba(24, 24, 27, .55);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    position: relative;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.modal-box:focus { outline: none; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--text-2);
}
.modal-icon--accent { background: var(--accent-soft); color: var(--accent); }
.modal-icon--success { background: var(--success-soft); color: var(--success); }
.modal-icon--warning { background: var(--warning-soft); color: var(--warning); }
.modal-icon--danger { background: var(--danger-soft); color: var(--danger); }
.modal-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 6px;
}
.modal-eyebrow--danger { color: var(--danger); }
.modal-title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.02em;
    padding-right: 28px;
}
.modal-text { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.modal-text p + p { margin-top: 8px; }
.modal-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.modal-section { margin-top: 20px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.modal-actions--end { justify-content: flex-end; }
.modal-actions form { display: contents; }
.modal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted);
}
.modal-foot form { display: inline; }

.email-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 15px;
    word-break: break-all;
}
.email-chip strong { color: var(--text); font-weight: 600; }

.howto { list-style: none; display: grid; gap: 14px; margin-top: 20px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; }
.howto-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--text);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.howto-text { display: grid; gap: 2px; padding-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.howto-text strong { color: var(--text); font-size: 15px; }

@media (max-width: 560px) {
    dialog.modal,
    dialog.modal--sm,
    dialog.modal--wide {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
    }
    dialog.modal[open] { animation: sheet-in .28s var(--ease); }
    .modal-box {
        max-height: 92vh;
        max-height: 92dvh;
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
    }
    .modal-box::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        margin: -10px auto 16px;
        border-radius: 4px;
        background: var(--surface-3);
    }
    .modal-title { font-size: 19px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
    dialog.modal.is-fallback[open] { top: auto; bottom: 0; transform: none; }
}
@keyframes sheet-in {
    from { transform: translateY(40px); opacity: .6; }
    to   { transform: none; opacity: 1; }
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-region {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 2000;
    display: grid;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    background: #18181b;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s var(--ease);
}
.toast .icon { color: #4ade80; }
.toast--error .icon { color: #f87171; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Stepper (sign-up flow)
   ========================================================================== */
.stepper {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--muted);
}
.stepper li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stepper li:not(:last-child)::after {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--border-strong);
    flex-shrink: 0;
}
.stepper-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
}
.stepper-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.is-current { color: var(--text); font-weight: 600; }
.stepper li.is-current .stepper-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.is-done .stepper-dot { background: var(--success); border-color: var(--success); color: #fff; }
@media (max-width: 420px) {
    .stepper li:not(.is-current) .stepper-label { display: none; }
}

/* ==========================================================================
   Auth pages (centered card)
   ========================================================================== */
.auth-body { min-height: 100vh; background: var(--bg); }
.auth-center {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px var(--gutter);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo img { height: 56px; width: auto; }
.auth-head { margin-bottom: 24px; text-align: center; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.auth-sub { margin-top: 6px; color: var(--muted); font-size: 14px; }
.auth-foot { font-size: 14px; color: var(--muted); text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.auth-status { text-align: center; }
.auth-status .modal-icon { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 18px; }
.auth-status .auth-title { margin-bottom: 8px; }
.auth-status p { color: var(--text-2); }
.auth-status .btn { margin-top: 24px; }
@media (max-width: 480px) {
    .auth-center { justify-content: flex-start; padding-top: 24px; }
    .auth-card { padding: 24px 20px; border-radius: var(--radius-lg); }
}

/* ==========================================================================
   Split layout (login + sign-up)
   ========================================================================== */
.split-body { background: var(--surface); }
.split { display: grid; min-height: 100vh; min-height: 100dvh; }
.split-main {
    display: flex;
    justify-content: center;
    padding: 28px var(--gutter) 40px;
}
.split-inner { width: 100%; max-width: 440px; }
.split-aside {
    position: relative;
    overflow: hidden;
    background: #18181b;
    color: #fafafa;
}

@media (min-width: 1000px) {
    .split { grid-template-columns: minmax(480px, 1fr) minmax(0, 1.05fr); }
    .split--home { grid-template-columns: minmax(480px, 1fr) minmax(0, .7fr); }
    .split-main { align-items: center; padding: 48px 56px; }
    .split-aside {
        position: sticky;
        top: 12px;
        margin: 12px 12px 12px 0;
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        border-radius: 24px;
    }
    /* Sign-up aside is text: let it grow with the form instead of clipping on short screens */
    .split-aside--glow { position: relative; top: auto; height: auto; min-height: calc(100vh - 24px); }
}

.brand-logo { display: inline-block; margin-bottom: 28px; }
.brand-logo img { height: 52px; width: auto; }

/* Homepage (index.php) only */
.brand-logo--home { display: flex; justify-content: center; margin-bottom: 32px; }
.brand-logo--home img { height: 72px; }
.hero-title--home { font-size: clamp(24px, 4.4vw, 30px); }
.channel-list--center { justify-content: center; }
.product-links--center { justify-items: center; text-align: center; }
.login-card-tool { margin-top: 10px; white-space: normal; text-align: center; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }
.hero-title {
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.03em;
    text-align: center;
}
.hero-lead { margin-top: 12px; font-size: 16px; color: var(--text-2); line-height: 1.6; text-align: center; }
.hero-lead strong { color: var(--accent-text); }

.channel-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.channel-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}
.channel-list .icon { color: var(--accent); }

/* "Виж как работи?" pulsing button + lightbox carousel */
.howto-cta { display: flex; justify-content: center; margin-top: 22px; }
.howto-btn {
    position: relative;
    gap: 10px;
    padding-left: 26px;
    padding-right: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #e11d48);
    color: #fff;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 6px 18px rgba(225, 29, 72, .35);
    animation: howto-pulse 1.8s ease-out infinite;
}
.howto-btn:hover { color: #fff; filter: brightness(1.07); transform: translateY(-1px); }
.howto-btn:active { transform: none; }
@keyframes howto-pulse {
    0%   { box-shadow: 0 6px 18px rgba(225, 29, 72, .35), 0 0 0 0 rgba(249, 115, 22, .55); }
    70%  { box-shadow: 0 6px 18px rgba(225, 29, 72, .35), 0 0 0 16px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 6px 18px rgba(225, 29, 72, .35), 0 0 0 0 rgba(249, 115, 22, 0); }
}

dialog.modal--lightbox { max-width: 1200px; width: calc(100% - 24px); }
.lightbox { padding: 20px; }
.lightbox-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-right: 36px; margin-bottom: 14px; }
.lightbox-counter { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.lightbox-stage {
    position: relative;
    aspect-ratio: 2 / 1;
    max-height: calc(100dvh - 210px);
    margin: 0 auto;
    border-radius: var(--radius);
    background: var(--surface-2);
    overflow: hidden;
    touch-action: pan-y;
}
.lightbox-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}
.lightbox-slide.is-active { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border: 0;
    border-radius: 50%;
    background: rgba(24, 24, 27, .7);
    color: #fff;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
@media (hover: hover) { .lightbox-nav:hover { background: var(--accent); } }
.lightbox-nav[disabled] { opacity: 0; pointer-events: none; }
.lightbox-nav--prev { left: 10px; }
.lightbox-nav--next { right: 10px; }
.lightbox-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.lightbox-dot {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
@media (hover: hover) { .lightbox-dot:hover { border-color: var(--accent); color: var(--accent-text); } }
.lightbox-dot.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lightbox-foot { display: flex; justify-content: center; margin-top: 14px; }
.lightbox-foot:has(> [hidden]:only-child) { display: none; }
.lightbox-rotate { display: none; }

/* Phone, portrait: tall bottom sheet, image centred vertically */
@media (max-width: 560px) and (orientation: portrait) {
    dialog.modal--lightbox { width: 100%; max-width: 100%; }
    .lightbox {
        display: flex;
        flex-direction: column;
        height: 92vh;
        height: 92dvh;
        padding: 24px 12px calc(16px + env(safe-area-inset-bottom));
    }
    .lightbox-head { padding: 0 40px 0 8px; margin-bottom: 8px; }
    .lightbox-stage {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        aspect-ratio: auto;
        max-height: none;
        background: transparent;
        border-radius: 0;
    }
    .lightbox-nav { width: 40px; height: 40px; margin-top: -20px; }
    .lightbox-nav--prev { left: 2px; }
    .lightbox-nav--next { right: 2px; }
    .lightbox-dots { gap: 5px; }
    .lightbox-dot { width: 30px; height: 30px; font-size: 12px; }
    .lightbox-rotate {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
        font-size: 13px;
        color: var(--muted);
        text-align: center;
    }
    .lightbox-rotate .icon { flex-shrink: 0; color: var(--accent); }
    .lightbox-foot .btn { width: 100%; }
}

/* Phone, landscape: full-screen dark viewer, image as large as possible */
@media (max-height: 560px) and (orientation: landscape) {
    dialog.modal--lightbox {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }
    dialog.modal--lightbox[open] { animation: fade-in .2s ease; }
    .lightbox {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        border-radius: 0;
        background: #111113;
        color: #fff;
    }
    .lightbox::before { display: none; }
    .lightbox-head { align-items: center; margin-bottom: 4px; padding-right: 44px; min-height: 36px; }
    .lightbox .modal-title { font-size: 15px; color: #fff; padding-right: 0; }
    .lightbox-counter { font-size: 13px; color: #c7c0ff; }
    .lightbox .modal-close { top: 4px; right: max(6px, env(safe-area-inset-right)); color: #fff; }
    .lightbox-stage {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        aspect-ratio: auto;
        max-height: none;
        background: transparent;
        border-radius: 0;
    }
    .lightbox-nav { width: 40px; height: 40px; margin-top: -20px; background: rgba(255, 255, 255, .16); }
    .lightbox-nav--prev { left: 0; }
    .lightbox-nav--next { right: 0; }
    .lightbox-dots { display: none; }
    .lightbox-foot { margin-top: 6px; }
    .lightbox-foot .btn { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
}

.login-card {
    margin-top: 28px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.login-card .card-title { font-size: 18px; margin-bottom: 18px; }
.login-card .callouts { margin-bottom: 18px; }
@media (max-width: 480px) {
    .login-card { padding: 20px 16px; }
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    font-size: 13px;
    color: var(--muted);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.product-links {
    display: grid;
    gap: 6px;
    margin-top: 28px;
    font-size: 12px;
    color: var(--subtle);
}
.product-links a { color: var(--muted); }
.product-links a:hover { color: var(--accent-text); }

/* Example gallery (login page aside) */
.gallery { position: relative; height: 100%; }
.gallery-hint {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(24, 24, 27, .78);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}
.gallery-track {
    position: absolute;
    inset: 0 0 auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    animation: gallery-up 60s linear infinite;
}
.gallery:hover .gallery-track { animation-play-state: paused; }
@keyframes gallery-up {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}
.gallery-item {
    position: relative;
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 14px;
    line-height: 0;
}
.gallery-item img { width: 100%; height: auto; transition: transform .4s var(--ease); }
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent 45%);
    pointer-events: none;
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.03); }
.gallery-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background-color .2s, color .2s;
}
.gallery-item:hover .gallery-badge, .gallery-item:focus-visible .gallery-badge { background: var(--accent); color: #fff; }

@media (max-width: 999px) {
    .split { min-height: 0; }
    .split-aside { background: var(--surface); color: var(--text); }
    .gallery { padding: 8px 0 32px; }
    .gallery-heading {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 var(--gutter);
        margin-bottom: 12px;
        font-size: 15px;
        font-weight: 700;
    }
    .gallery-heading .icon { color: var(--accent); }
    .gallery-hint { display: none; }
    .gallery-track {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 var(--gutter) 8px;
        animation: none;
        scrollbar-width: none;
    }
    .gallery-track::-webkit-scrollbar { display: none; }
    .gallery-item { width: 78%; max-width: 360px; scroll-snap-align: center; border-radius: 12px; }
    .gallery-item img { aspect-ratio: 4 / 3; object-fit: cover; }
    .gallery-item[aria-hidden="true"] { display: none; }
}
@media (min-width: 1000px) {
    .gallery-heading { display: none; }
}

/* Sign-up aside */
.aside-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 56px 48px;
}
.split-aside--glow::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto auto;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(91, 75, 219, .45), transparent 65%);
    pointer-events: none;
}
.aside-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a5b4fc;
}
.aside-title { margin-top: 10px; font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.feature-list { list-style: none; display: grid; gap: 16px; margin-top: 28px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #c4b5fd;
}
.feature-text { display: grid; gap: 2px; font-size: 14px; color: #a1a1aa; line-height: 1.5; }
.feature-text strong { color: #fafafa; font-size: 15px; }
.aside-steps {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.aside-steps h3 { font-size: 14px; font-weight: 600; color: #fafafa; margin-bottom: 14px; }
.aside-steps ol { list-style: none; display: grid; gap: 10px; counter-reset: s; }
.aside-steps li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #d4d4d8; counter-increment: s; }
.aside-steps li::before {
    content: counter(s);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
@media (max-width: 999px) {
    .split-aside--glow { background: #18181b; color: #fafafa; }
    .aside-content { padding: 36px var(--gutter) 40px; }
    .aside-title { font-size: 22px; }
}

.signup-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }

/* ==========================================================================
   App shell (dashboard, project, admin)
   ========================================================================== */
.app-body { min-height: 100vh; background: var(--bg); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-brand img { height: 28px; width: auto; }
.topbar-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.topbar-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar-link.is-active { color: var(--text); background: var(--surface-2); }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
}
.user-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}
.topbar-badge { background: var(--text); color: #fff; }
@media (max-width: 400px) {
    .topbar-link-label { display: none; }
}
@media (max-width: 767px) {
    .user-name, .logout-label { display: none; }
    .topbar-inner { gap: 8px; }
    .topbar-brand img { height: 24px; }
    .topbar-link { padding: 0 10px; }
}

.page { max-width: 1200px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-head-main { min-width: 0; flex: 1 1 320px; }
.page-title {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}
.page-sub { margin-top: 6px; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
    .page { padding-top: 20px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .icon { color: var(--subtle); }
.breadcrumb-current { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.page-notices { display: grid; gap: 12px; margin-bottom: 24px; }

.section { margin-top: 32px; }
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
}
.section-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.section-meta { font-size: 13px; color: var(--muted); }

/* Usage meter */
.usage { display: grid; gap: 6px; max-width: 280px; margin-top: 12px; }
.usage-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.usage-label strong { color: var(--text); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s var(--ease); }
.progress-bar.is-full { background: var(--warning); }

/* Empty state */
.empty {
    padding: 48px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
}
.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}
.empty-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.empty-text { max-width: 460px; margin: 8px auto 0; color: var(--muted); }
.empty-steps {
    list-style: none;
    display: grid;
    gap: 12px;
    max-width: 820px;
    margin: 28px auto;
    text-align: left;
}
.empty-steps li {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
}
.empty-steps .howto-num { background: var(--accent); }
.empty-steps strong { display: block; font-size: 14px; }
.empty-steps span { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (min-width: 720px) {
    .empty-steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .empty { padding: 32px 16px; }
}

/* ==========================================================================
   Project cards (dashboard)
   ========================================================================== */
.project-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 400px) {
    .project-grid { grid-template-columns: 1fr; }
}
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.project-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.project-card:hover .project-cover img { transform: scale(1.03); }
.project-cover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--subtle);
    font-size: 13px;
    font-weight: 500;
}
.project-cover-badges { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.project-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 16px 12px; }
.project-title { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; overflow-wrap: anywhere; }
.project-title a { color: var(--text); }
.project-title a:hover { text-decoration: none; }
.stretched-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.project-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}
.project-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.project-meta span { display: inline-flex; align-items: center; gap: 5px; }
.project-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.project-actions .btn { margin-right: auto; }
.project-actions form { display: contents; }

/* ==========================================================================
   Project page
   ========================================================================== */
.project-layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1024px) {
    .project-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .project-aside { position: sticky; top: calc(var(--nav-h) + 20px); }
}
.project-desc-full { margin-top: 8px; color: var(--text-2); font-size: 14px; white-space: pre-wrap; max-width: 75ch; overflow-wrap: anywhere; }

/* Progress checklist */
.checklist {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
    counter-reset: c;
}
@media (min-width: 720px) {
    .checklist { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
    .checklist { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .checklist-item { flex-direction: column; gap: 6px; padding: 10px 6px; text-align: center; }
    .checklist-text strong { font-size: 12px; line-height: 1.3; }
    .checklist-text span { display: none; }
}
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--muted);
}
.checklist-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.checklist-text { display: grid; line-height: 1.35; }
.checklist-text strong { color: var(--text); font-size: 14px; }
.checklist-text span { font-size: 12px; }
.checklist-item.is-done .checklist-mark { background: var(--success); border-color: var(--success); color: #fff; }
.checklist-item.is-current { border-color: var(--accent); box-shadow: var(--ring); }
.checklist-item.is-current .checklist-mark { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Share card */
.share-card .card-body { display: grid; gap: 18px; }
.share-block { display: grid; gap: 8px; }
.share-block-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.share-block-title .icon { color: var(--muted); }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-divider { height: 1px; background: var(--border); }
.embed-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
}
.embed-details summary::-webkit-details-marker { display: none; }
.embed-details summary .icon-chev { transition: transform .2s; color: var(--muted); }
.embed-details[open] summary .icon-chev { transform: rotate(180deg); }
.embed-details-body { display: grid; gap: 10px; margin-top: 12px; }
.embed-preview {
    display: flex;
    justify-content: center;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    background-image: radial-gradient(var(--surface-3) 1px, transparent 1px);
    background-size: 12px 12px;
}
.code-box {
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #18181b;
    color: #e4e4e7;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
    resize: none;
}
.code-box:focus { outline: none; box-shadow: var(--ring); }
.share-card-disabled { opacity: .55; pointer-events: none; }

/* Drop zone + upload preview */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 20px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: var(--surface);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.dropzone-title { font-size: 15px; font-weight: 600; }
.dropzone-sub { font-size: 13px; color: var(--muted); }
.dropzone .btn { margin-top: 10px; }
.dropzone .touch-only { display: none; }
@media (hover: none) {
    .dropzone .mouse-only { display: none; }
    .dropzone .touch-only { display: inline; }
}

.upload-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 16px; }
.upload-list:empty { display: none; }
.upload-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.upload-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-remove { position: absolute; top: 6px; right: 6px; }
.upload-body { display: grid; gap: 8px; padding: 10px; }
.upload-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.upload-bar .field-help { flex: 1 1 240px; }
@media (max-width: 560px) {
    .upload-bar .btn { width: 100%; }
}

/* Segmented control (Преди / След) */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 3px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.segmented-btn {
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented-btn:hover { color: var(--text); }
.segmented-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.segmented-btn[aria-pressed="true"][data-type="before"],
.segmented-btn[aria-pressed="true"][data-set-type="before"] { background: var(--before); color: #fff; box-shadow: var(--shadow-sm); }
.segmented-btn[aria-pressed="true"][data-type="after"],
.segmented-btn[aria-pressed="true"][data-set-type="after"] { background: var(--after); color: #fff; box-shadow: var(--shadow-sm); }
@media (pointer: coarse) {
    .segmented-btn { min-height: 38px; }
}

/* Photo grid */
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 520px) {
    .photo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 360px) {
    .photo-grid { grid-template-columns: 1fr; }
}
.photo-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .15s, border-color .15s, opacity .15s;
    scroll-margin-top: calc(var(--nav-h) + 16px);
}
.photo-card.is-dragging { opacity: .45; }
.photo-card.is-drop-target { border-color: var(--accent); box-shadow: var(--ring); }
.photo-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #18181b;
    cursor: grab;
}
.photo-media:active { cursor: grabbing; }
.photo-media img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 56px); }
.photo-delete-form { position: absolute; top: 6px; right: 6px; }
.photo-delete { opacity: 0; transition: opacity .15s, background-color .15s; }
.photo-card:hover .photo-delete,
.photo-delete:focus-visible { opacity: 1; }
@media (hover: none) {
    .photo-delete { opacity: 1; }
    .photo-media { cursor: default; }
}
.photo-grip {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
    background: rgba(24, 24, 27, .55);
    color: #fff;
    opacity: 0;
    transition: opacity .15s;
}
.photo-card:hover .photo-grip { opacity: 1; }
@media (hover: none) {
    .photo-grip { display: none; }
}
.photo-body { display: grid; gap: 10px; padding: 12px; }
.desc-form { display: grid; gap: 8px; }
.desc-actions { display: none; gap: 6px; }
.desc-form.is-dirty .desc-actions { display: flex; }
.photo-move {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}
.photo-pos { font-weight: 600; }
@media (max-width: 520px) {
    .photo-body { padding: 10px; gap: 8px; }
    .photo-badges .badge { height: 20px; font-size: 10px; padding: 0 6px; }
}

.pair-summary { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   Admin: stats + table
   ========================================================================== */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 28px; }
.stat {
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 14px 16px; }
    .stat-value { font-size: 24px; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search .input { padding-left: 38px; }

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfcfd; }
.table-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.table-actions form { display: contents; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-value { display: grid; gap: 4px; justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 860px) {
    .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr {
        margin-bottom: 12px;
        padding: 6px 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xs);
    }
    .table--stack td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 8px 16px;
        border: 0;
        text-align: right;
    }
    .table--stack td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
        text-align: left;
    }
    .table--stack .cell-value { justify-items: end; }
    .table--stack td.cell-main { display: block; text-align: left; padding-top: 10px; }
    .table--stack td.cell-main::before { display: none; }
    .table--stack td.cell-actions { display: block; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
    .table--stack td.cell-actions::before { display: none; }
    .table--stack .table-actions { justify-content: flex-start; }
    .table tbody tr:hover { background: var(--surface); }
}

.kv { display: grid; gap: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--muted); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.pre-box {
    overflow-x: auto;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12px;
    white-space: pre-wrap;
}

/* ==========================================================================
   Legacy viewer (view.php, /s/TOKEN)
   ========================================================================== */
.viewer-page { background: #0c0c0e; min-height: 100vh; display: flex; flex-direction: column; color: #fff; }
.viewer { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    height: 56px;
    padding: 0 16px;
    background: #18181b;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 600; }
.viewer-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agency-tag {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
}
.viewer-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.counter { color: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.viewer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s;
}
.viewer-btn:hover { background: rgba(255, 255, 255, .14); }
.viewer-main { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nav-btn {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 56px;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(24, 24, 27, .55);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color .15s;
}
.nav-btn:hover { background: rgba(24, 24, 27, .85); }
.nav-prev { left: 12px; }
.nav-next { right: 12px; }
.viewer-desc {
    flex-shrink: 0;
    min-height: 40px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    text-align: center;
}
.viewer-thumbs {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    overflow-x: auto;
    background: #18181b;
    border-top: 1px solid rgba(255, 255, 255, .08);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.thumb {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    height: 52px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    opacity: .5;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active, .thumb:hover { opacity: 1; border-color: var(--accent); }
.thumb-compare-icon {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 11px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.viewer-empty { display: flex; align-items: center; justify-content: center; height: 100vh; color: rgba(255, 255, 255, .5); }

.slides-wrap { position: relative; width: 100%; height: 100%; }
.slide { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; padding: 12px; }
.slide.active { display: flex; }
.single-wrap { position: relative; max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; }
.single-wrap img { max-width: calc(100vw - 120px); max-height: 100%; object-fit: contain; border-radius: 6px; }
.single-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(39, 39, 42, .9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.compare-wrap {
    position: relative;
    width: calc(100% - 100px);
    max-width: 1100px;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    user-select: none;
    cursor: col-resize;
    touch-action: pan-y;
}
.compare-after { position: absolute; inset: 0; }
.compare-after img { width: 100%; height: 100%; object-fit: contain; }
.compare-before { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.compare-before img { position: absolute; top: 0; left: 0; height: 100%; object-fit: contain; }
.compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 10;
    width: 3px;
    transform: translateX(-50%);
    cursor: col-resize;
}
.divider-line { width: 3px; height: 100%; background: rgba(255, 255, 255, .95); box-shadow: 0 0 6px rgba(0, 0, 0, .5); }
.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    color: #18181b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.compare-labels {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    padding: 0 14px;
    pointer-events: none;
}
.compare-labels span {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.label-before { background: rgba(39, 39, 42, .88); color: #fff; }
.label-after { background: rgba(91, 75, 219, .9); color: #fff; }

@media (max-width: 640px) {
    .viewer-header { height: 52px; padding: 0 12px; }
    .viewer-title .agency-tag { display: none; }
    .slide { padding: 0; }
    .compare-wrap { width: 100%; border-radius: 0; }
    .single-wrap img { max-width: 100vw; border-radius: 0; }
    .nav-btn { top: auto; bottom: 12px; width: 40px; height: 40px; transform: none; border-radius: 50%; }
    .nav-prev { left: 12px; }
    .nav-next { right: 12px; }
    .compare-labels { bottom: 60px; }
}

/* ==========================================================================
   Public marketing pages (homepage sections, topic pages)
   ========================================================================== */
.site-body { background: var(--surface); }
.site-body [id] { scroll-margin-top: 80px; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    height: 64px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.site-logo { display: flex; flex-shrink: 0; }
.site-logo img { height: 48px; width: auto; }
.site-nav { display: flex; gap: 2px; margin-left: 12px; }
.site-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.site-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (max-width: 900px) {
    .site-nav { display: none; }
}
.site-header-actions .label-short { display: none; }
@media (max-width: 480px) {
    .site-logo img { height: 38px; }
    .site-header-actions .label-long { display: none; }
    .site-header-actions .label-short { display: inline; }
}

.section-eyebrow {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent-text);
}
.hero-eyebrow {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-text);
    text-align: center;
}

.landing-section { padding: 72px 0; }
.landing-section--muted { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.landing-split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) {
    .landing-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; }
}
.landing-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.landing-head--left { margin-left: 0; text-align: left; }
.landing-title {
    font-size: clamp(24px, 3.4vw, 34px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}
.landing-h1 {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
}
.landing-lead { margin-top: 14px; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.landing-fine { margin-top: 12px; font-size: 13px; color: var(--muted); }
.landing-hero { padding: 40px 0 64px; }
.landing-hero .breadcrumb { margin-bottom: 20px; }
.landing-note { margin-top: 32px; }
@media (max-width: 560px) {
    .landing-section { padding: 48px 0; }
    .landing-hero { padding: 24px 0 48px; }
    .landing-actions .btn { width: 100%; }
    .landing-lead { font-size: 16px; }
    .landing-head { margin-bottom: 28px; }
}

.check-list { list-style: none; display: grid; gap: 10px; margin-top: 20px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text-2); }
.check-list .icon { margin-top: 2px; color: var(--success); }

.steps-grid { list-style: none; display: grid; gap: 16px; }
@media (min-width: 768px) {
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
}
.step-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}
.step-card h3 { margin: 14px 0 6px; font-size: 17px; font-weight: 700; }
.step-card p { font-size: 14px; line-height: 1.6; color: var(--muted); }

.niche-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.niche-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.niche-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.niche-icon,
.feature-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}
.niche-card h3 { margin-top: 6px; font-size: 17px; font-weight: 700; }
.niche-card p { flex: 1; font-size: 14px; line-height: 1.55; color: var(--muted); }
.niche-more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-text); }

.feature-grid { display: grid; gap: 28px 32px; }
@media (min-width: 640px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    .feature-grid--2 { grid-template-columns: repeat(2, 1fr); max-width: 960px; margin: 0 auto; }
}
.feature { display: flex; gap: 14px; }
.feature h3 { margin-bottom: 4px; font-size: 16px; font-weight: 600; }
.feature p { font-size: 14px; line-height: 1.6; color: var(--muted); }

.uses-grid { list-style: none; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.uses-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
}
.uses-grid .icon { color: var(--success); }

.tips-list { list-style: none; display: grid; gap: 16px; max-width: 820px; }
.tips-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.tips-list .howto-num { background: var(--accent); margin-top: 1px; }

.example-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.example-card {
    display: block;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: box-shadow .2s, border-color .2s;
}
.example-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); text-decoration: none; }
.example-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.example-card-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 600; font-size: 15px; }
.example-card-body .icon { color: var(--accent); }

.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { flex-shrink: 0; color: var(--muted); transition: transform .2s; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-answer { padding: 0 20px 18px; line-height: 1.7; color: var(--text-2); }

.landing-cta { padding: 24px 0 72px; }
.cta-box {
    position: relative;
    overflow: hidden;
    padding: 56px 32px;
    border-radius: 24px;
    background: #18181b;
    color: #fafafa;
    text-align: center;
}
.cta-box::before {
    content: '';
    position: absolute;
    inset: -40% 20% auto;
    height: 120%;
    background: radial-gradient(circle, rgba(91, 75, 219, .45), transparent 65%);
    pointer-events: none;
}
.cta-box > * { position: relative; }
.cta-box h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.cta-box p { max-width: 560px; margin: 12px auto 0; color: #a1a1aa; font-size: 16px; }
.cta-box .landing-actions { justify-content: center; }
.cta-box .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.cta-box .btn-secondary:hover { background: rgba(255, 255, 255, .08); color: #fff; }
@media (max-width: 560px) {
    .cta-box { padding: 40px 20px; border-radius: 18px; }
    .landing-cta { padding-bottom: 48px; }
}

.site-footer { padding: 56px 0 24px; background: #18181b; color: #a1a1aa; font-size: 14px; }
.site-footer-inner { display: grid; gap: 32px; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 860px) {
    .site-footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.site-footer-brand img { height: 56px; width: auto; padding: 6px 10px; border-radius: 10px; background: #fff; }
.site-footer-brand p { max-width: 320px; margin-top: 14px; line-height: 1.6; }
.site-footer-title { margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #fafafa; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: #d4d4d8; }
.site-footer a:hover { color: #fff; }
.site-footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 20px var(--gutter) 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 13px;
}

/* Before/after comparison slider */
.compare { margin: 0; }
.compare-stage {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #18181b;
    box-shadow: var(--shadow-lg);
    cursor: ew-resize;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.compare-stage:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.compare-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare-img--before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos, 50%);
    width: 3px;
    margin-left: -1.5px;
    background: #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, .45);
    pointer-events: none;
}
.compare-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.compare-tag {
    position: absolute;
    top: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    pointer-events: none;
}
.compare-tag--before { left: 14px; background: rgba(39, 39, 42, .88); }
.compare-tag--after { right: 14px; background: rgba(91, 75, 219, .92); }
.compare-caption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}
.compare-caption span { display: inline-flex; align-items: center; gap: 6px; }
.compare-caption a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ==========================================================================
   "Обзаведи с AI" — prompt builder (/obzavedi/)
   ========================================================================== */
.pb-tagline { margin-top: 10px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; color: var(--muted); }
.pb-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pb-trust li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
}

.pb-presets { margin-bottom: 20px; }
.pb-presets-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pb-presets-title .icon { color: #f59e0b; }
.pb-preset-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-preset {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    transition: border-color .15s, background-color .15s, color .15s;
}
.pb-preset:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.pb-preset.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.pb-more { margin-top: 10px; }
.pb-more summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-text);
}
.pb-more summary::-webkit-details-marker { display: none; }
.pb-more summary .icon { transition: transform .2s; }
.pb-more[open] summary .icon { transform: rotate(180deg); }
.pb-more .pb-preset-list { margin-top: 10px; }

.pb-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1024px) {
    .pb-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
    .pb-output { position: sticky; top: calc(64px + 16px); }
}

/* Task switch: Обзаведи / Изпразни / Реновирай */
.pb-modes { display: grid; gap: 10px; margin: 0 0 24px; border: 0; min-width: 0; }
@media (min-width: 720px) {
    .pb-modes { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
.pb-mode { position: relative; cursor: pointer; }
.pb-mode input { position: absolute; opacity: 0; pointer-events: none; }
.pb-mode-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pb-mode:hover .pb-mode-body { border-color: var(--accent); }
.pb-mode input:checked + .pb-mode-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pb-mode input:focus-visible + .pb-mode-body { box-shadow: var(--ring); }
.pb-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-2);
    transition: background-color .15s, color .15s;
}
.pb-mode input:checked + .pb-mode-body .pb-mode-icon { background: var(--accent); color: #fff; }
.pb-mode-text { display: grid; gap: 2px; min-width: 0; }
.pb-mode-text strong { font-size: 17px; font-weight: 700; color: var(--text); }
.pb-mode-sub { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.pb-mode-hint { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
@media (max-width: 719px) {
    .pb-mode-body { padding: 12px 14px; align-items: center; }
    .pb-mode-icon { width: 38px; height: 38px; }
    .pb-mode-hint { display: none; }
}

/* Step numbers follow only the visible fields of the current task */
.pb-form { counter-reset: pbstep; }
.pb-step { counter-increment: pbstep; }
.pb-step::before { content: counter(pbstep); }
.field-row--2:has(> [hidden]) { grid-template-columns: 1fr; }
.pb-cards--2 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .pb-cards.pb-cards--2 { grid-template-columns: repeat(2, 1fr); }
}
.pb-mode-note { align-items: center; }
.pb-note { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pb-note .icon { margin-top: 2px; color: var(--info); }
.pb-chain {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
}

.pb-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 700;
    vertical-align: 1px;
}
.pb-group { border: 0; min-width: 0; display: grid; gap: 8px; }
.pb-group legend { margin-bottom: 8px; }

.pb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-chip { position: relative; cursor: pointer; }
.pb-chip input, .pb-card input { position: absolute; opacity: 0; pointer-events: none; }
.pb-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    transition: background-color .15s, border-color .15s, color .15s;
}
.pb-chip:hover span { border-color: var(--accent); }
.pb-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pb-chip input:focus-visible + span,
.pb-card input:focus-visible + .pb-card-body { box-shadow: var(--ring); }

.pb-cards { display: grid; gap: 8px; }
@media (min-width: 640px) {
    .pb-cards { grid-template-columns: repeat(3, 1fr); }
}
.pb-card { position: relative; cursor: pointer; }
.pb-card-body {
    display: grid;
    gap: 2px;
    height: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, background-color .15s;
}
.pb-card:hover .pb-card-body { border-color: var(--accent); }
.pb-card-body strong { font-size: 14px; color: var(--text); }
.pb-card-en { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.pb-card-hint { margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.pb-card input:checked + .pb-card-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

.pb-extra summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.pb-extra summary::-webkit-details-marker { display: none; }
.pb-extra summary .icon { color: var(--accent); transition: transform .2s; }
.pb-extra[open] summary .icon { transform: rotate(45deg); }
.pb-extra textarea { margin-top: 10px; }
.pb-extra .field-help { margin-top: 6px; }

.pb-output { border-color: var(--accent-soft-2); box-shadow: var(--shadow-md); }
.pb-output .card-body { display: grid; gap: 12px; }
.pb-output-head { display: grid; gap: 4px; }
.pb-summary { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.pb-prompt {
    width: 100%;
    min-height: 260px;
    max-height: 46vh;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #18181b;
    color: #e4e4e7;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    resize: vertical;
    transition: opacity .15s;
}
.pb-prompt:focus { outline: none; box-shadow: var(--ring); }
.pb-prompt.is-updating { opacity: .55; }
.pb-meta { font-size: 12px; color: var(--muted); }
.pb-actions { display: grid; gap: 8px; }
.pb-actions-row { display: grid; gap: 8px; }
@media (min-width: 480px) {
    .pb-actions-row { grid-template-columns: 1fr 1fr; }
}
.pb-actions-row .btn { white-space: normal; }
.pb-actions > .btn-ghost { justify-self: center; }
.pb-howto { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 12px; border-top: 1px solid var(--border); list-style: none; counter-reset: h; font-size: 12px; color: var(--muted); }
.pb-howto li { counter-increment: h; }
.pb-howto li::before { content: counter(h) '. '; font-weight: 700; color: var(--accent-text); }

.pb-fix {
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-2);
}

.pb-tips { display: grid; gap: 32px; }
@media (min-width: 860px) {
    .pb-tips { grid-template-columns: 1fr 1fr; }
}
.pb-tips-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 17px; font-weight: 700; }
.pb-tips-title .icon { color: var(--accent); }
.pb-ethics { margin-top: 32px; }

@media (max-width: 640px) {
    /* One swipeable row of presets instead of a tall block above the form */
    .pb-preset-group > .pb-preset-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 calc(var(--gutter) * -1);
        padding: 0 var(--gutter) 6px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }
    .pb-preset-group > .pb-preset-list::-webkit-scrollbar { display: none; }
    .pb-preset-group > .pb-preset-list .pb-preset { flex-shrink: 0; white-space: nowrap; scroll-snap-align: start; }
}
@media (max-width: 560px) {
    .pb-prompt { min-height: 220px; max-height: 60vh; font-size: 12px; }
    .pb-chip span { min-height: 40px; padding: 0 12px; }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .gallery-track { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 1000px) {
    .gallery-track { position: absolute; overflow-y: auto; height: 100%; }
}
