/**
 * panel-risk.css — RiskAsistan Suite v5
 * Panel 0: RiskAI Workspace (Fine-Kinney, 5x5 Matrix, Golden Set pipeline).
 * Sadece risk paneline özgü componentler — suite_main.css ile çakışmaz.
 */

/* ─── WORKSPACE TABS ─────────────────────────────────────────────── */
.risk-tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    margin-bottom: 16px;
}
.risk-tab {
    flex: 1;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
    color: var(--warm-gray, #9ca3af);
    cursor: pointer;
    text-align: center;
    transition: all 200ms;
}
.risk-tab.active {
    background: rgba(var(--copper-rgb),0.15);
    color: var(--copper-light, #e8a96a);
    font-weight: 600;
}
.risk-tab:hover:not(.active) { color: var(--warm-white, #f5f0eb); }

/* ─── METHODOLOGY TABLE ──────────────────────────────────────────── */
.methodology-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,14,20,0.7);
}
.methodology-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 900px;
}
.methodology-table th {
    padding: 8px 12px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 600;
    color: var(--warm-gray, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    text-align: left;
}
.methodology-table td {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--warm-white, #f5f0eb);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: top;
}
.methodology-table tr:last-child td { border-bottom: none; }
.methodology-table tr:hover td { background: rgba(var(--copper-rgb),0.04); }

/* Selected cell */
td.cell-selected { outline: 2px solid var(--copper, var(--copper)); outline-offset: -2px; }
tr.row-highlight  { background: rgba(var(--copper-rgb),0.04); }

/* ─── RISK LEVEL CHIPS ───────────────────────────────────────────── */
.risk-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.risk-cok-yuksek { background: rgba(239,68,68,0.15);   color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.risk-yuksek     { background: rgba(249,115,22,0.15);  color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.risk-orta       { background: rgba(245,158,11,0.15);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.risk-dusuk      { background: rgba(34,197,94,0.12);   color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }

/* ─── GOLDEN SET PIPELINE ────────────────────────────────────────── */
.golden-pipeline-banner {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(184,134,11,0.1), rgba(var(--copper-rgb),0.06));
    border: 1px solid rgba(var(--copper-rgb),0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.pipeline-step {
    text-align: center;
    font-family: var(--font-mono, monospace);
}
.pipeline-step-num {
    font-size: 20px;
    font-weight: 900;
    color: var(--copper-light, #e8a96a);
    line-height: 1;
}
.pipeline-step-label {
    font-size: 9px;
    color: var(--warm-gray, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.pipeline-arrow { color: rgba(var(--copper-rgb),0.4); font-size: 16px; }

/* ─── ADD ROW BUTTON ─────────────────────────────────────────────── */
.add-row-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(var(--copper-rgb),0.08);
    border: 1px dashed rgba(var(--copper-rgb),0.25);
    border-radius: 7px;
    color: var(--copper, var(--copper));
    font-size: 12px;
    cursor: pointer;
    transition: all 200ms;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}
.add-row-btn:hover {
    background: rgba(var(--copper-rgb),0.15);
    border-color: rgba(var(--copper-rgb),0.5);
}

/* ─── SHARED COMPANY CONTEXT ────────────────────────────────────── */
.risk-company-context {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 0 16px 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(200,117,51,0.16);
    background:
        radial-gradient(circle at top left, rgba(45,212,191,0.08), transparent 42%),
        linear-gradient(135deg, rgba(200,117,51,0.08), rgba(15,23,42,0.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.risk-company-context.is-empty {
    border-color: rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at top left, rgba(148,163,184,0.08), transparent 40%),
        linear-gradient(135deg, rgba(255,255,255,0.03), rgba(15,23,42,0.58));
}

.risk-company-context__identity,
.risk-company-context__actions {
    min-width: 0;
}

.risk-company-context__identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.risk-company-context__eyebrow {
    width: fit-content;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(45,212,191,0.12);
    border: 1px solid rgba(45,212,191,0.22);
    color: #7dd3fc;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.risk-company-context__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-company-context__title {
    font-size: 16px;
    line-height: 1.1;
    color: var(--warm-white, #f5f0eb);
}

.risk-company-context__status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(200,117,51,0.1);
    border: 1px solid rgba(200,117,51,0.2);
    color: var(--copper-light, #e8a96a);
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.risk-company-context__meta {
    color: var(--warm-gray, #9ca3af);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.risk-company-context__metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.risk-company-context__metric {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    white-space: normal;
    line-height: 1.35;
}

.risk-company-context__metric strong {
    color: var(--warm-white, #f5f0eb);
    font-weight: 600;
}

.risk-company-context__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-company-context__btn {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--warm-white, #f5f0eb);
    font-size: 12px;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.risk-company-context__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(200,117,51,0.28);
    background: rgba(200,117,51,0.08);
}

.risk-company-context__btn--accent {
    border-color: rgba(45,212,191,0.22);
    background: rgba(45,212,191,0.09);
    color: #99f6e4;
}

@media (max-width: 1080px) {
    .risk-company-context {
        grid-template-columns: 1fr;
    }

    .risk-company-context__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .risk-company-context {
        margin-inline: 10px;
        padding: 12px;
    }

    .risk-company-context__title {
        font-size: 15px;
    }

    .risk-company-context__metric,
    .risk-company-context__btn {
        width: 100%;
        justify-content: center;
    }
}

/* Final cascade guard: keep these responsive rules after duplicated legacy blocks. */
@media (max-width: 1280px) {
    .risk-top-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .risk-top-shell > .risk-company-context .risk-company-context__toolbar,
    .methodology-drawer-grid {
        grid-template-columns: 1fr;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__actions,
    .risk-top-shell > .risk-company-context .risk-company-context__btn {
        justify-content: center;
        width: 100%;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__metrics {
        grid-template-columns: 1fr;
    }
}

/* RiskAI top context and drawer hardening.
   Keep search, sector, metrics, and actions from fighting for one row. */
.risk-top-shell > .risk-company-context {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    isolation: isolate;
}

.risk-top-shell > .risk-company-context .risk-company-context__identity,
.risk-top-shell > .risk-company-context .risk-company-context__metrics,
.risk-top-shell > .risk-company-context .risk-company-context__actions {
    width: 100%;
}

.risk-top-shell > .risk-company-context .risk-company-context__toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px);
    align-items: center;
    gap: 8px;
}

.risk-top-shell > .risk-company-context .risk-company-context__search,
.risk-top-shell > .risk-company-context .risk-company-context__search-wrap,
.risk-top-shell > .risk-company-context .sector-select {
    width: 100%;
    min-width: 0;
}

.risk-top-shell > .risk-company-context .risk-company-context__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
}

.risk-top-shell > .risk-company-context .risk-company-context__metric {
    width: auto;
    min-width: 0;
    justify-content: flex-start;
}

.risk-top-shell > .risk-company-context .risk-company-context__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.risk-top-shell > .risk-company-context .firma-dropdown {
    z-index: 4000;
}

.methodology-drawer-section {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at top left, rgba(200,117,51,0.08), transparent 48%),
        rgba(255,255,255,0.025);
}

.methodology-drawer-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.methodology-drawer-section__eyebrow {
    color: var(--copper-light, #e8a96a);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.methodology-drawer-section__title {
    display: block;
    margin-top: 4px;
    color: var(--warm-white, #f5f0eb);
    font-size: 13px;
    line-height: 1.25;
}

.methodology-drawer-section__pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(45,212,191,0.2);
    background: rgba(45,212,191,0.08);
    color: #99f6e4;
    font-size: 10px;
    font-family: var(--font-mono, monospace);
}

.methodology-drawer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.method-card {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.method-card:hover,
.method-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(200,117,51,0.26);
    color: var(--warm-white, #f5f0eb);
    outline: none;
}

.method-card.active {
    border-color: rgba(200,117,51,0.34);
    background: rgba(200,117,51,0.12);
    color: var(--copper-light, #e8a96a);
}

.risk-golden-drawer-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
}

.risk-golden-drawer-item,
.risk-golden-drawer-empty {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    color: var(--warm-white, #f5f0eb);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.risk-golden-drawer-item:hover,
.risk-golden-drawer-empty:hover,
.risk-golden-drawer-item:focus-visible,
.risk-golden-drawer-empty:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(45,212,191,0.24);
    background: rgba(45,212,191,0.08);
    outline: none;
}

.risk-golden-drawer-item__sector {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.risk-golden-drawer-item__meta {
    color: var(--copper-light, #e8a96a);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
}

.risk-golden-drawer-item__note {
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    line-height: 1.35;
}

.risk-golden-ticker__item--empty {
    width: min(100%, 340px);
    border-style: dashed;
    border-color: rgba(45,212,191,0.22);
    background: rgba(45,212,191,0.055);
}

.risk-golden-ticker__item:focus-visible,
.risk-golden-ticker__action:focus-visible,
.method-chip:focus-visible {
    outline: 2px solid rgba(45,212,191,0.65);
    outline-offset: 2px;
}

@media (max-width: 1280px) {
    .risk-top-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .risk-top-shell > .risk-company-context .risk-company-context__toolbar,
    .methodology-drawer-grid {
        grid-template-columns: 1fr;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__actions,
    .risk-top-shell > .risk-company-context .risk-company-context__btn {
        justify-content: center;
        width: 100%;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__metrics {
        grid-template-columns: 1fr;
    }
}

/* ─── UNIFIED RISK TOP SHELL ───────────────────────────────────── */
.risk-top-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
    gap: 16px;
    align-items: stretch;
    padding: 16px;
    border-bottom: 1px solid rgba(200,117,51,0.1);
}

.risk-top-shell__hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at top left, rgba(200,117,51,0.16), transparent 40%),
        linear-gradient(145deg, rgba(16,22,36,0.96), rgba(10,14,26,0.86));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 16px 32px rgba(0,0,0,0.18);
}

.risk-top-shell__eyebrow,
.risk-golden-ticker__eyebrow {
    color: var(--copper-light, #e8a96a);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.risk-top-shell__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.risk-top-shell__title {
    color: var(--warm-white, #f5f0eb);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.15;
}

.risk-top-shell__status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(45,212,191,0.24);
    background: rgba(45,212,191,0.12);
    color: #99f6e4;
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.risk-top-shell__summary {
    margin: 0;
    color: var(--warm-gray, #9ca3af);
    font-size: 13px;
    line-height: 1.55;
    max-width: 72ch;
}

.risk-top-shell__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ws-action-btn--ghost {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--warm-white, #f5f0eb);
}

.risk-top-shell .methodology-drawer-toggle {
    display: inline-flex;
    margin-bottom: 0;
    align-self: auto;
}

.risk-company-context {
    margin: 0;
    min-width: 0;
    min-height: 100%;
    align-content: start;
}

.risk-company-context__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.risk-company-context__search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 240px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.risk-company-context__search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.risk-company-context__search .firma-search-input {
    width: 100%;
    padding: 11px 0;
    border: 0;
    background: transparent;
    color: var(--warm-white, #f5f0eb);
    font-size: 13px;
    outline: none;
}

.risk-company-context__search .firma-search-input::placeholder {
    color: rgba(255,255,255,0.32);
}

.risk-company-context .sector-select {
    min-width: 160px;
    min-height: 44px;
}

.risk-company-context .firma-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(200,117,51,0.2);
    background: rgba(10,14,26,0.97);
    backdrop-filter: blur(20px);
    z-index: 1000;
    box-shadow: 0 14px 48px rgba(0,0,0,0.36);
}

.risk-company-context__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    white-space: nowrap;
}

.risk-golden-ticker {
    margin: 0 16px 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(200,117,51,0.16);
    background:
        linear-gradient(145deg, rgba(10,14,26,0.92), rgba(16,24,34,0.84)),
        radial-gradient(circle at top right, rgba(45,212,191,0.08), transparent 38%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.risk-golden-ticker__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.risk-golden-ticker__title {
    color: var(--warm-white, #f5f0eb);
    font-size: 13px;
    line-height: 1.45;
}

.risk-golden-ticker__action {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(45,212,191,0.24);
    background: rgba(45,212,191,0.08);
    color: #99f6e4;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.risk-golden-ticker__viewport {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}

.risk-golden-ticker__track {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: max-content;
}

.risk-golden-ticker__track.is-marquee {
    animation: riskTickerMarquee 36s linear infinite;
}

.risk-golden-ticker:hover .risk-golden-ticker__track.is-marquee {
    animation-play-state: paused;
}

.risk-golden-ticker__item {
    width: 220px;
    min-height: 84px;
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--warm-white, #f5f0eb);
    cursor: pointer;
    text-align: left;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.risk-golden-ticker__item:hover {
    transform: translateY(-2px);
    border-color: rgba(200,117,51,0.28);
    background: rgba(200,117,51,0.1);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.risk-golden-ticker__item.is-active {
    border-color: rgba(45,212,191,0.34);
    background: rgba(45,212,191,0.1);
    box-shadow: 0 14px 30px rgba(45,212,191,0.08);
}

.risk-golden-ticker__sector {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.risk-golden-ticker__meta {
    color: var(--copper-light, #e8a96a);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
}

.risk-golden-ticker__note {
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.risk-method-rail {
    margin: 0 16px 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(200,117,51,0.14);
    background:
        radial-gradient(circle at top left, rgba(200,117,51,0.08), transparent 40%),
        linear-gradient(145deg, rgba(10,14,26,0.94), rgba(16,22,34,0.88));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.risk-method-rail__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.risk-method-rail__copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.risk-method-rail__eyebrow {
    color: var(--copper-light, #e8a96a);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.risk-method-rail__title {
    color: var(--warm-white, #f5f0eb);
    font-size: 15px;
    line-height: 1.25;
}

.risk-method-rail__summary {
    margin: 0;
    color: var(--warm-gray, #9ca3af);
    font-size: 12px;
    line-height: 1.5;
    max-width: 74ch;
}

.risk-method-rail__meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-method-rail__pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--warm-gray, #9ca3af);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
}

.methodology-chip-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.methodology-chip-bar::-webkit-scrollbar {
    display: none;
}

.method-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
    scroll-snap-align: start;
}

.method-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(200,117,51,0.22);
    color: var(--warm-white, #f5f0eb);
}

.method-chip.active {
    border-color: rgba(200,117,51,0.3);
    background: rgba(200,117,51,0.1);
    color: var(--copper-light, #e8a96a);
    box-shadow: 0 12px 24px rgba(200,117,51,0.12);
}

.method-chip.active::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(45,212,191,0.24);
    opacity: 0;
    pointer-events: none;
}

@keyframes riskTickerMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 5px)); }
}

@keyframes riskChipPulse {
    0%, 100% {
        opacity: 0.12;
        box-shadow: 0 0 0 0 rgba(45,212,191,0.12);
    }
    50% {
        opacity: 0.52;
        box-shadow: 0 0 0 8px rgba(45,212,191,0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .method-chip.active::after {
        animation: riskChipPulse 2.8s ease-in-out infinite;
    }
}

@media (max-width: 1180px) {
    .risk-top-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .risk-top-shell {
        padding: 12px;
        gap: 12px;
    }

    .risk-top-shell__hero,
    .risk-company-context,
    .risk-method-rail,
    .risk-golden-ticker {
        margin: 0;
    }

    .risk-company-context__toolbar,
    .risk-company-context__actions,
    .risk-method-rail__head,
    .risk-golden-ticker__head {
        flex-direction: column;
        align-items: stretch;
    }

    .risk-company-context .sector-select,
    .risk-company-context__chip,
    .risk-company-context__btn,
    .risk-golden-ticker__action {
        width: 100%;
        justify-content: center;
    }

    .risk-method-rail__meta {
        justify-content: flex-start;
    }

    .risk-golden-ticker__viewport {
        overflow-x: auto;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .risk-golden-ticker__track.is-marquee {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .risk-golden-ticker__track.is-marquee,
    .method-chip.active::after {
        animation: none;
    }
}

/* ─── SHARED COMPANY CONTEXT ────────────────────────────────────── */
.risk-company-context {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 0 16px 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(200,117,51,0.16);
    background:
        radial-gradient(circle at top left, rgba(45,212,191,0.08), transparent 42%),
        linear-gradient(135deg, rgba(200,117,51,0.08), rgba(15,23,42,0.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.risk-company-context.is-empty {
    border-color: rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at top left, rgba(148,163,184,0.08), transparent 40%),
        linear-gradient(135deg, rgba(255,255,255,0.03), rgba(15,23,42,0.58));
}

.risk-company-context__identity,
.risk-company-context__actions {
    min-width: 0;
}

.risk-company-context__identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.risk-company-context__eyebrow {
    width: fit-content;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(45,212,191,0.12);
    border: 1px solid rgba(45,212,191,0.22);
    color: #7dd3fc;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.risk-company-context__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-company-context__title {
    font-size: 16px;
    line-height: 1.1;
    color: var(--warm-white, #f5f0eb);
}

.risk-company-context__status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(200,117,51,0.1);
    border: 1px solid rgba(200,117,51,0.2);
    color: var(--copper-light, #e8a96a);
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.risk-company-context__meta {
    color: var(--warm-gray, #9ca3af);
    font-size: 12px;
    line-height: 1.45;
}

.risk-company-context__metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.risk-company-context__metric {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--warm-gray, #9ca3af);
    font-size: 11px;
    white-space: nowrap;
}

.risk-company-context__metric strong {
    color: var(--warm-white, #f5f0eb);
    font-weight: 600;
}

.risk-company-context__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-company-context__btn {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--warm-white, #f5f0eb);
    font-size: 12px;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.risk-company-context__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(200,117,51,0.28);
    background: rgba(200,117,51,0.08);
}

.risk-company-context__btn--accent {
    border-color: rgba(45,212,191,0.22);
    background: rgba(45,212,191,0.09);
    color: #99f6e4;
}

@media (max-width: 1080px) {
    .risk-company-context {
        grid-template-columns: 1fr;
    }

    .risk-company-context__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .risk-company-context {
        margin-inline: 10px;
        padding: 12px;
    }

    .risk-company-context__title {
        font-size: 15px;
    }

    .risk-company-context__metric,
    .risk-company-context__btn {
        width: 100%;
        justify-content: center;
    }
}


/* Final cascade guard: keep these responsive rules after duplicated legacy blocks. */
@media (max-width: 1280px) {
    .risk-top-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .risk-top-shell > .risk-company-context .risk-company-context__toolbar,
    .methodology-drawer-grid {
        grid-template-columns: 1fr;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__actions,
    .risk-top-shell > .risk-company-context .risk-company-context__btn {
        justify-content: center;
        width: 100%;
    }

    .risk-top-shell > .risk-company-context .risk-company-context__metrics {
        grid-template-columns: 1fr;
    }
}

