/* ==========================================================================
   Goals. Delivered — design system
   Soft aurora background, floating white cards, pill controls.
   ========================================================================== */

:root {
    --ink: #17181c;
    --ink-soft: #3f4450;
    --ink-muted: #6b7280;
    --line: #e7e7ec;
    --line-soft: #f0f0f4;
    --surface: #ffffff;
    --accent: #2c757c;
    --accent-soft: rgba(44, 117, 124, 0.12);
    --danger: #d92d5a;
    --danger-soft: rgba(217, 45, 90, 0.08);
    --success: #1a7f4f;
    --potent-purple: #5b3fb0;
    --radius-card: 24px;
    --radius-input: 12px;
    --radius-pill: 999px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 32px -8px rgba(16, 24, 40, 0.12);
    --shadow-pill: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -2px rgba(16, 24, 40, 0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--ink);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #eef1f6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* --- Aurora backdrop -------------------------------------------------- */

.aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 10% -10%, rgba(125, 196, 233, 0.55), transparent 62%),
        radial-gradient(820px 560px at 92% -4%, rgba(244, 180, 216, 0.50), transparent 62%),
        radial-gradient(760px 560px at 80% 82%, rgba(255, 199, 153, 0.42), transparent 60%),
        radial-gradient(780px 580px at 8% 88%, rgba(186, 160, 240, 0.40), transparent 62%),
        radial-gradient(640px 500px at 50% 46%, rgba(158, 226, 211, 0.28), transparent 65%);
}

.aurora::after {
    /* film grain */
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.14'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Typography -------------------------------------------------------- */

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-muted); }
.small { font-size: 13px; }

/* --- Layout ------------------------------------------------------------ */

.page {
    max-width: 1020px;
    margin: 0 auto;
    padding: 28px 20px 72px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-intro { padding: 12px 6px 0; }
.page-intro h1 { margin-bottom: 6px; }

.card {
    background: var(--surface);
    border: 1px solid rgba(231, 231, 236, 0.9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 32px 36px;
}

.card-flush { padding: 0; overflow: hidden; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.stack { display: flex; flex-direction: column; gap: 20px; }
.cluster { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.divider { border: none; border-top: 1px solid var(--line-soft); margin: 20px 0; }

/* --- Header / nav ------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 16px;
    z-index: 50;
    max-width: 1020px;
    margin: 16px auto 0;
    padding: 0 20px;
}

.site-header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(231, 231, 236, 0.9);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-pill);
    padding: 10px 12px 10px 22px;
}

/* --- Brand mark: header (logo + product name) ------------------------------- */

.site-header .brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-header .brand-mark:hover { text-decoration: none; }

.brand-logo-img {
    display: block;
    height: 26px;
    width: auto;
    flex-shrink: 0;
}

.brand-name {
    font-family: var(--font);
    font-weight: 700;
    font-size: 15.5px;
    letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap;
}

/* --- Auth headline (product name + powered-by credit) ----------------------- */

.auth-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-heading .app-name {
    font-family: var(--font);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* --- "Powered by potent.ai" credit, reused in auth header + app footer ------ */

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.powered-by .pb-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-muted);
}

.powered-by .pb-icon {
    height: 15px;
    width: auto;
    display: block;
}

.powered-by .pb-name {
    font-family: 'Montserrat', var(--font);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.005em;
    text-transform: lowercase;
    color: var(--potent-purple);
}

.site-footer .powered-by { margin-left: auto; }

@media (max-width: 640px) {
    .site-header { top: 10px; margin-top: 10px; padding: 0 12px; }
    .site-header .bar { padding: 8px 10px 8px 14px; }
    .brand-logo-img { height: 22px; }
    .brand-name { font-size: 14px; }
    .auth-heading .app-name { font-size: 23px; }
    .brand-select { max-width: 130px; font-size: 12.5px; padding: 8px 32px 8px 12px; }
    .header-controls { gap: 6px; }
    .icon-button { width: 36px; height: 36px; }
    .card { padding: 24px 20px; }
    .auth-card { padding: 30px 24px; }
}

.header-controls { display: flex; align-items: center; gap: 10px; }

.brand-select {
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-pill);
    padding: 9px 38px 9px 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 190px;
    text-overflow: ellipsis;
}

.brand-select:hover { border-color: #d5d5dd; }
.brand-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-pill);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover { transform: translateY(-1px); border-color: #d5d5dd; text-decoration: none; }

/* --- Buttons ----------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.005em;
    border-radius: var(--radius-pill);
    padding: 11px 22px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.18), 0 8px 20px -6px rgba(16, 24, 40, 0.25);
}

.btn-primary:hover { transform: translateY(-1px); background: #26282f; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--shadow-pill);
}

.btn-secondary:hover { transform: translateY(-1px); border-color: #d5d5dd; }

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(44, 117, 124, 0.25), 0 8px 20px -6px rgba(44, 117, 124, 0.35);
}

.btn-accent:hover { transform: translateY(-1px); background: #25646a; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 6px rgba(217, 45, 90, 0.25), 0 8px 20px -6px rgba(217, 45, 90, 0.35);
}

.btn-danger:hover { transform: translateY(-1px); background: #c02450; }

.btn-block { width: 100%; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* --- Forms ------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; }

.field-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.field-hint { font-size: 12px; font-weight: 500; color: var(--ink-muted); }

.control {
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #dcdce3;
    border-radius: var(--radius-input);
    padding: 11px 14px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control::placeholder { color: #a6aab4; }

.control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.control[readonly] {
    background: #f7f7fa;
    color: var(--ink-muted);
    cursor: default;
}

.control[readonly]:focus { border-color: #dcdce3; box-shadow: none; }

select.control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.field.has-error .control { border-color: var(--danger); }
.field.has-error .control:focus { box-shadow: 0 0 0 4px var(--danger-soft); }

.field-error {
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
    display: none;
}

.field.has-error .field-error { display: block; }

.choice-group-wrap.has-error .field-error { display: block; }

.field-error-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}
.choice-group-wrap.has-error .choice { border-color: var(--danger); }

/* form grid for the scenario detail pages */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
}

@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* --- Section headings inside form cards -------------------------------- */

.form-section { padding-top: 6px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.section-title .icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #f4f4f8;
    border: 1px solid var(--line-soft);
    flex-shrink: 0;
}

.section-title h3 { font-size: 16px; }

.section-title .rule {
    flex: 1;
    border-top: 1px solid var(--line-soft);
}

.section-note { margin: 6px 0 14px; font-size: 14px; color: var(--ink-muted); }

/* --- Choice pills (radio / checkbox cards) ------------------------------ */

.choice-group { display: flex; flex-direction: column; gap: 12px; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; }

.choice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    padding: 16px 18px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.choice:hover { border-color: #d0d0d9; }

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice .dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.8px solid #c9c9d2;
    flex-shrink: 0;
    margin-top: 2px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.choice input:checked ~ .dot {
    border-color: var(--accent);
    border-width: 5.5px;
}

.choice input:focus-visible ~ .dot { box-shadow: 0 0 0 4px var(--accent-soft); }

.choice.checked, .choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.choice .choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice .choice-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.choice .choice-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

.choice-pill {
    align-items: center;
    border-radius: var(--radius-pill);
    padding: 10px 18px;
}

.choice-pill .dot { margin-top: 0; }

/* --- Alerts ------------------------------------------------------------- */

.alert {
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
}

.alert-danger {
    background: var(--danger-soft);
    border: 1px solid rgba(217, 45, 90, 0.25);
    color: #ab1e44;
}

.alert-success {
    background: rgba(26, 127, 79, 0.08);
    border: 1px solid rgba(26, 127, 79, 0.25);
    color: var(--success);
}

.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* --- Tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    font-variant-numeric: tabular-nums;
}

.data-table th.num, .data-table td.num { text-align: right; }
.data-table td.num { font-weight: 550; color: var(--ink); }
.data-table th .unit { text-transform: none; letter-spacing: 0; font-weight: 500; color: #a2a7b2; }

.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    background: #fafafc;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}

.data-table td {
    padding: 15px 24px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background-color 0.12s ease; }
.data-table tbody tr:hover { background: #fafbfd; }

.data-table .empty-cell {
    text-align: center;
    color: var(--ink-muted);
    padding: 36px 24px;
}

/* --- Stat / result display ---------------------------------------------- */

.result-hero {
    text-align: center;
    padding: 18px 0 6px;
}

.result-hero .result-label {
    font-size: 13px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    margin-bottom: 10px;
}

.result-hero .result-value {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.05;
}

@media (max-width: 640px) {
    .result-hero .result-value { font-size: 40px; }
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.score-tile {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
}

.score-tile .score-name { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

.score-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

/* --- Auth pages ---------------------------------------------------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 28px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid rgba(231, 231, 236, 0.9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 40px 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-card .auth-title { font-size: 24px; }
.auth-card .auth-sub { font-size: 14px; color: var(--ink-muted); margin-top: -14px; }

.auth-footer { font-size: 13px; color: var(--ink-muted); text-align: center; }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-muted);
}

.site-footer img { height: 16px; opacity: 0.55; }

/* --- Utilities ----------------------------------------------------------- */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-narrow { max-width: 260px; }

.reveal { animation: reveal 0.3s ease; }

@keyframes reveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* --- Breadcrumbs ----------------------------------------------------------- */

.crumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
    margin: 2px 0 6px;
}

.crumbs a {
    color: var(--ink-muted);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.crumbs a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.75);
    border-color: var(--line);
    text-decoration: none;
}

.crumbs .sep {
    display: inline-flex;
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23c3c6cf' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7' d='m8 6 4 4-4 4'/%3E%3C/svg%3E");
}

.crumbs .current { color: var(--ink-soft); font-weight: 600; padding: 5px 4px; }

/* --- Wizard / stepper ----------------------------------------------------- */

.stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.step-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 7px 16px 7px 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-muted);
    transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.step-pill .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f4;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-muted);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.step-pill.active {
    border-color: var(--ink);
    color: var(--ink);
    box-shadow: var(--shadow-pill);
}

.step-pill.active .step-num { background: var(--ink); color: #fff; }

.step-pill.done { color: var(--accent); border-color: rgba(44, 117, 124, 0.35); }
.step-pill.done .step-num { background: var(--accent); color: #fff; }

.step-connector { flex: 0 0 18px; border-top: 1.5px solid var(--line); }

.progress-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.progress-meta .step-label { font-size: 13.5px; font-weight: 650; color: var(--ink-soft); }

.progress-meta .pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--line-soft);
    overflow: hidden;
    margin-bottom: 26px;
}

.progress-fill {
    position: relative;
    height: 100%;
    width: 0;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent), #6db5bd);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
    animation: shimmer 2.2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    60%, 100% { transform: translateX(100%); }
}

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: reveal 0.35s ease; }

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
}

.summary-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    box-shadow: var(--shadow-pill);
}

.chip .chip-label { color: var(--ink-muted); font-weight: 500; }

/* --- Accordions ----------------------------------------------------------- */

details.accordion {
    background: var(--surface);
    border: 1px solid rgba(231, 231, 236, 0.9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

details.accordion > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 30px;
    user-select: none;
}

details.accordion > summary::-webkit-details-marker { display: none; }

details.accordion > summary h2 { font-size: 19px; }

details.accordion > summary .summary-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 9px;
    border-radius: var(--radius-pill);
    background: #f0f0f4;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-soft);
}

.chev {
    display: inline-flex;
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
}

details[open] > summary .chev { transform: rotate(180deg); }

.accordion-body { animation: reveal 0.3s ease; }

/* result rows inside the results accordion — fixed column widths so every
   row (each an independent grid) lines up pixel-for-pixel with its neighbors
   and with the header row below, regardless of content length. */

.result-grid-cols { grid-template-columns: minmax(0, 1fr) 190px 100px 120px 28px 20px; }

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.row-action:hover { background: var(--danger-soft); color: var(--danger); }
.row-action:focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; }

.result-list-head {
    display: grid;
    align-items: center;
    gap: 16px;
    padding: 0 30px 10px;
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

.result-list-head .col-value { text-align: right; }

details.result-item { border-top: 1px solid var(--line-soft); }

details.result-item > summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    align-items: center;
    gap: 16px;
    padding: 16px 30px;
    transition: background-color 0.15s ease;
}

details.result-item > summary::-webkit-details-marker { display: none; }
details.result-item > summary:hover { background: #fafbfd; }

details.result-item .r-name { font-size: 14.5px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.result-item .r-meta { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.result-item .r-headline { font-size: 14.5px; font-weight: 700; color: var(--accent); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

details.result-item .result-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 4px 30px 20px;
    animation: reveal 0.25s ease;
}

.mini-scores { display: flex; gap: 10px; flex-wrap: wrap; }

.mini-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.mini-score .score-dot { width: 10px; height: 10px; }

@media (max-width: 720px) {
    .result-grid-cols { grid-template-columns: minmax(0, 1fr) 110px 28px 20px; }
    .result-list-head { display: none; }
    details.result-item .r-meta { display: none; }
}

/* --- Flow entry tiles ------------------------------------------------------ */

.tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 720px) {
    .tile-grid { grid-template-columns: 1fr; }
}

a.action-tile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid rgba(231, 231, 236, 0.9);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    padding: 26px 28px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.action-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(44, 117, 124, 0.45);
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 18px 40px -10px rgba(16, 24, 40, 0.18);
    text-decoration: none;
}

.action-tile .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.action-tile .tile-title { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.action-tile .tile-desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.55; }

.action-tile .tile-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f4f4f8;
    border: 1px solid var(--line-soft);
    transition: background-color 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%2317181c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7' d='M4 10h12m-5-5 5 5-5 5'/%3E%3C/svg%3E");
}

a.action-tile:hover .tile-arrow { transform: translateX(3px); }

.tile-tag {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
    padding: 4px 11px;
}

/* --- Icons (inline data-uri sprites) ------------------------------------- */

.mynaui--logout {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%2317181c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M13.496 21H6.5c-1.105 0-2-1.151-2-2.571V5.57c0-1.419.895-2.57 2-2.57h7M16 15.5l3.5-3.5L16 8.5m-6.5 3.496h10'/%3E%3C/svg%3E");
}

.fluent--form-new-20-regular {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='M6 3a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h3.6a5.5 5.5 0 0 1-.393-1H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v3.207q.524.149 1 .393V6a3 3 0 0 0-3-3zm3.5 7h1.837c.895-.63 1.986-1 3.163-1h-5a.5.5 0 0 0 0 1m-4-5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm1 6a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0-1a.5.5 0 1 1 0-1a.5.5 0 0 1 0 1m0 5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0-2a.5.5 0 1 1 0 1a.5.5 0 0 1 0-1M19 14.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0m-4-2a.5.5 0 0 0-1 0V14h-1.5a.5.5 0 0 0 0 1H14v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H15z'/%3E%3C/svg%3E");
}

.solar--download-minimalistic-bold {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2317181c' d='M12.554 16.506a.75.75 0 0 1-1.107 0l-4-4.375a.75.75 0 0 1 1.107-1.012l2.696 2.95V3a.75.75 0 0 1 1.5 0v11.068l2.697-2.95a.75.75 0 1 1 1.107 1.013z'/%3E%3Cpath fill='%2317181c' d='M3.75 15a.75.75 0 0 0-1.5 0v.055c0 1.367 0 2.47.117 3.337c.12.9.38 1.658.981 2.26c.602.602 1.36.86 2.26.982c.867.116 1.97.116 3.337.116h6.11c1.367 0 2.47 0 3.337-.116c.9-.122 1.658-.38 2.26-.982c.602-.602.86-1.36.982-2.26c.116-.867.116-1.97.116-3.337V15a.75.75 0 0 0-1.5 0c0 1.435-.002 2.436-.103 3.192c-.099.734-.28 1.122-.556 1.399c-.277.277-.665.457-1.4.556c-.755.101-1.756.103-3.191.103H9c-1.435 0-2.437-.002-3.192-.103c-.734-.099-1.122-.28-1.399-.556c-.277-.277-.457-.665-.556-1.4c-.101-.755-.103-1.756-.103-3.191'/%3E%3C/svg%3E");
}

.ic--baseline-border-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%233f4450' d='M13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68l-3.75-3.75l1.83-1.83a.996.996 0 0 1 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z'/%3E%3C/svg%3E");
}

.hugeicons--apple-stocks {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%233f4450' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='M2.5 12c0-4.478 0-6.718 1.391-8.109S7.521 2.5 12 2.5c4.478 0 6.718 0 8.109 1.391S21.5 7.521 21.5 12c0 4.478 0 6.718-1.391 8.109S16.479 21.5 12 21.5c-4.478 0-6.718 0-8.109-1.391S2.5 16.479 2.5 12'/%3E%3Cpath d='M2.5 14.5h.539c.472 0 .708 0 .914-.099c.205-.098.352-.283.647-.652L6 12l1.5 2.5L9 11l2.5 5L15 9l2 3.5l1.5-1.5l1.445 2.168c.252.378.378.567.562.681q.055.034.114.061c.198.09.425.09.879.09M15 2.5v3m0 16v-7'/%3E%3Ccircle cx='15' cy='9' r='1'/%3E%3C/g%3E%3C/svg%3E");
}

.mdi--talking {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%233f4450' d='M9 5a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 10c2.67 0 8 1.34 8 4v2H1v-2c0-2.66 5.33-4 8-4m7.76-9.64c2.02 2.2 2.02 5.25 0 7.27l-1.68-1.69c.84-1.18.84-2.71 0-3.89zM20.07 2c3.93 4.05 3.9 10.11 0 14l-1.63-1.63c2.77-3.18 2.77-7.72 0-10.74z'/%3E%3C/svg%3E");
}

.fluent--data-funnel-20-regular {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%233f4450' d='M2 4a2 2 0 0 1 2-2h12a2 2 0 1 1 0 4H4a2 2 0 0 1-2-2m2-1a1 1 0 0 0 0 2h12a1 1 0 1 0 0-2zm0 7a2 2 0 0 1 2-2h8a2 2 0 1 1 0 4H6a2 2 0 0 1-2-2m2-1a1 1 0 0 0 0 2h8a1 1 0 1 0 0-2zm2 5a2 2 0 1 0 0 4h4a2 2 0 1 0 0-4zm-1 2a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1'/%3E%3C/svg%3E");
}

.icon-park-outline--creative {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%233f4450' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M42 39V9a3 3 0 0 0-3-3H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3Z'/%3E%3Cpath d='m24 18.316l-2.896 5.91l-6.578.954l4.765 4.658l-1.139 6.478L24 33.199l5.849 3.117l-1.13-6.478l4.756-4.658l-6.541-.954z'/%3E%3Cpath stroke-linecap='round' d='M18.316 12.632h11.368'/%3E%3C/g%3E%3C/svg%3E");
}

/* --- Accessibility -------------------------------------------------------- */

.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
.icon-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Print (PDF export) --------------------------------------------------- */

@media print {
    .aurora, .site-header, .site-footer { display: none; }
}
