:root {
    --bg: #0E0F12;
    --surface: #16181D;
    --surface-2: #1E2128;
    --surface-3: #262A32;
    --border: #2A2E37;
    --border-soft: #20242C;
    --text: #ECEDEF;
    --text-muted: #9A9FAE;
    --text-dim: #5E636F;
    --accent: #D9BB6C;
    --accent-hover: #E8CD83;
    --accent-soft: rgba(217, 187, 108, 0.18);
    --accent-faint: rgba(217, 187, 108, 0.10);
    --danger: #E07A76;
    --danger-soft: rgba(224, 122, 118, 0.14);
    --radius: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button { font-family: inherit; }
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* display:flex у .app/.auth-gate перебивает нативный [hidden] — фиксируем явно */
.app[hidden],
.auth-gate[hidden] {
    display: none !important;
}

/* ===== Auth gate (hh.ru OAuth) ===== */
.auth-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(217, 187, 108, 0.12), transparent 55%),
        var(--bg);
}
.auth-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    animation: fadeSlide 0.35s var(--ease) both;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}
.auth-lead {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: -4px;
}
.btn-auth {
    margin-top: 8px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #1A1A1A;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s var(--ease), transform 0.15s var(--ease), box-shadow 0.18s var(--ease);
    box-shadow: var(--shadow-sm);
}
.btn-auth:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}
.btn-auth .btn-icon { width: 18px; height: 18px; }
.auth-status {
    font-size: 12.5px;
    color: var(--accent-hover);
    text-align: center;
}
.auth-error {
    font-size: 12.5px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(224, 122, 118, 0.35);
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    line-height: 1.4;
}

/* ===== Topbar ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #000;
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
}
.brand-title { font-weight: 700; font-size: 15px; color: #FFFFFF; letter-spacing: 0.2px; }
.brand-subtitle { font-size: 12px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-status { font-size: 12px; color: var(--text-muted); }
.btn-ghost {
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
    background: var(--accent-faint);
}

/* ===== Layout ===== */
.layout {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 28px;
    padding: 28px 32px;
    flex: 1;
    min-height: 0;
}

/* ===== Builder ===== */
.builder {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    /* Больше высоты под шаги + дропдауны внизу формы */
    max-height: calc(100vh - 100px);
    position: sticky;
    top: 88px;
}
.builder-head {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.builder-head h1 { font-size: 16px; font-weight: 700; color: #FFFFFF; margin-bottom: 14px; }
.progress { display: flex; align-items: center; gap: 12px; }
.progress-track {
    flex: 1;
    height: 6px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s var(--ease);
}
.progress-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Steps ===== */
.steps {
    padding: 20px 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* запас снизу, чтобы шаг 4 не упирался в кнопку CTA */
    scroll-padding-bottom: 24px;
}
.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    /* visible — иначе absolute-списки .select обрезаются */
    overflow: visible;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.step.done .step-card { box-shadow: var(--shadow-sm); }
.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.step-node {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.25s var(--ease);
}
.step.done .step-node {
    background: var(--accent);
    border-color: var(--accent);
    color: #1A1A1A;
}
.step.done .step-node::after {
    content: "";
    width: 10px; height: 5px;
    border-left: 2px solid #1A1A1A;
    border-bottom: 2px solid #1A1A1A;
    transform: rotate(-45deg) translate(0, -1px);
}
.step.done .step-node { font-size: 0; }
.step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.step-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.step.done .step-icon { color: var(--accent-hover); }
.step-body { padding: 18px; display: grid; gap: 16px; }
.step-body > * { min-width: 0; }

/* ===== Fields ===== */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label, .toggle-text { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.field-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-tip {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.help-tip-icon {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.help-tip:hover,
.help-tip:focus-visible {
    border-color: var(--accent);
    color: var(--accent-hover);
    background: var(--accent-soft);
    outline: none;
}
.help-tip-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: min(280px, 70vw);
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lg);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), visibility 0.15s;
    z-index: 30;
}
.help-tip-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}
.help-tip:hover .help-tip-bubble,
.help-tip:focus-visible .help-tip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11px; color: var(--text-dim); line-height: 1.45; white-space: pre-line; }

input[type="text"], input[type="number"], textarea {
    width: 100%;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    padding: 0 12px;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* floating label */
.field.float { position: relative; }
.field.float label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 13px;
    pointer-events: none;
    transition: all 0.18s var(--ease);
    background: var(--surface);
    padding: 0 4px;
}
.field.float input { padding-top: 0; padding-bottom: 0; }
.field.float input:focus + label,
.field.float input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.82);
    color: var(--accent-hover);
    left: 8px;
}

/* ===== Pill tabs ===== */
.tabs { display: flex; flex-direction: column; gap: 12px; }
.tab-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px;
}
.tab {
    flex: none;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s var(--ease);
    position: relative;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { background: var(--accent); color: #1A1A1A; font-weight: 600; box-shadow: var(--shadow-sm); }
.tab.filled::after {
    content: "";
    position: absolute;
    top: 6px; right: 6px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
.tab.active.filled::after { background: #1A1A1A; }
.tab-panels textarea { width: 100%; }

/* ===== Custom select ===== */
.select { position: relative; }
.select-btn {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 13px;
    padding: 0 12px;
    cursor: pointer;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.select-btn:hover { border-color: var(--text-dim); }
.select.open .select-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.2s var(--ease); flex-shrink: 0; }
.select.open .select-chevron { transform: rotate(180deg); color: var(--accent-hover); }
/* Список в потоке документа: при открытии раздвигает конструктор вниз,
   при закрытии — схлопывается обратно (без overlay поверх соседних полей). */
.select-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        max-height 0.22s var(--ease),
        opacity 0.18s var(--ease),
        transform 0.18s var(--ease),
        visibility 0.18s,
        margin 0.18s var(--ease),
        padding 0.18s var(--ease),
        border-width 0.18s var(--ease);
    border-width: 0;
}
.select.open .select-list {
    max-height: 280px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    margin-top: 6px;
    padding: 4px;
    overflow: visible;
    border-width: 1px;
}
.select-item {
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.select-item:hover { background: var(--accent-faint); }
.select-item.selected { color: var(--accent-hover); font-weight: 600; background: var(--accent-soft); }

/* ===== Toggle switch ===== */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px; height: 16px;
    left: 2px; top: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--surface); border-color: var(--accent); }

/* ===== Range slider ===== */
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; }
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--p, 12%), var(--surface-3) var(--p, 12%), var(--surface-3) 100%);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--accent);
    cursor: pointer;
}
.badge {
    min-width: 44px;
    text-align: center;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* ===== Buttons ===== */
.btn {
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 9px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--surface);
    color: var(--text);
    transition: all 0.18s var(--ease);
}
.btn-icon-sm { width: 15px; height: 15px; }
.btn-secondary:hover { border-color: var(--text-dim); background: var(--surface-2); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #1A1A1A;
    border: none;
    border-radius: var(--radius-xs);
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
}
.btn-cta:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-cta:active { transform: translateY(0); }
.btn-cta:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-cta .btn-icon { width: 18px; height: 18px; }
.btn-cta .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(26,26,26,0.3);
    border-top-color: #1A1A1A;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Builder footer ===== */
.builder-foot { padding: 16px 20px 20px; border-top: 1px solid var(--border-soft); }

/* ===== Results ===== */
.results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 28px - 32px - 73px);
    overflow: hidden;
}
.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-soft);
}
.results-head h2 { font-size: 16px; font-weight: 700; color: #FFFFFF; }
.results-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: block; }

.status-area { display: flex; flex-direction: column; gap: 8px; padding: 16px 24px 0; }
.status-msg {
    padding: 11px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    animation: fadeSlide 0.3s var(--ease);
}
.status-msg.success { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.status-msg.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.status-msg.info { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.status-msg .ts { color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.results-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* empty state */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    gap: 12px;
    color: var(--text-dim);
    padding: 40px 20px;
}
.empty-illu { width: 200px; height: 160px; color: var(--text-dim); animation: float 4s ease-in-out infinite; }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.empty p { font-size: 13px; max-width: 360px; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* skeleton */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}
.skeleton-line.short { width: 45%; }
.skeleton-line.mid { width: 70%; }
.skeleton-line.badge { width: 90px; height: 22px; border-radius: 999px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* candidate cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-items: stretch; /* все карточки одного ряда — одной высоты (по умолчанию stretch, дублируем явно) */
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    animation: fadeSlide 0.35s var(--ease) both;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-index { font-size: 12px; color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
/* Заголовок резервирует место под 3 строки и обрезается (line-clamp),
   поэтому ссылка и пояснение во всех карточках ряда стартуют с одной линии. */
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    min-height: calc(3em * 1.4); /* 3 строки высоты всегда, даже для коротких названий */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
}
.verdict-badge.fit { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid var(--accent); }
.verdict-badge.unfit { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.verdict-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* flex:1 заполняет оставшееся пространство — карточки ряда вытягиваются в одну высоту,
   а текст пояснения начинается на одном уровне во всех карточках. */
.card-reason {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.55;
    border-top: 1px solid var(--border-soft);
    padding-top: 10px;
    flex: 1 1 auto;
}
.card-link {
    align-self: flex-start;
    color: var(--accent-hover);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.15s var(--ease);
}
.card-link:hover { gap: 7px; }

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

/* ===== Custom scrollbar ===== */
* {
    scrollbar-width: thin;
    scrollbar-color: #3A3F4A transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #3A3F4A;
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: background 0.18s var(--ease);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); background-clip: padding-box; border-color: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; padding: 20px 18px; gap: 18px; }
    .builder { position: static; max-height: none; }
    .results { min-height: 60vh; }
}
