/* =================================================================
   Decisioning Studio
   RAC · Scorecard · Dual Matrix
   ================================================================= */
:root {
    --ds-ink:        #0f172a;
    --ds-ink-2:      #475569;
    --ds-ink-3:      #94a3b8;
    --ds-bg:         #f8fafc;
    --ds-surface:    #ffffff;
    --ds-surface-2:  #f1f5f9;
    --ds-surface-3:  #e2e8f0;
    --ds-border:     rgb(15 23 42 / 0.08);
    --ds-border-2:   rgb(15 23 42 / 0.14);
    --ds-accent:     #6366f1;
    --ds-accent-2:   #22d3ee;
    --ds-accent-3:   #f59e0b;
    --ds-success:    #059669;
    --ds-warning:    #d97706;
    --ds-danger:     #dc2626;
    --ds-radius:     14px;
    --ds-radius-sm:  10px;
    --ds-shadow:     0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -12px rgb(15 23 42 / .12);
    --ds-shadow-lg:  0 8px 32px -12px rgb(15 23 42 / .22), 0 0 0 1px rgb(15 23 42 / .06);
}

.ds-page { padding-bottom: 72px; }

/* ============================
   HERO
   ============================ */
.ds-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fafbff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--ds-border);
}
.ds-hero-bg {
    position: absolute; inset: 0; pointer-events: none;
}
.ds-mesh {
    position: absolute; inset: -40% -10% -40% -10%;
    background:
        radial-gradient(circle at 18% 32%, rgba(99,102,241,.35) 0%, transparent 35%),
        radial-gradient(circle at 78% 38%, rgba(34,211,238,.30) 0%, transparent 38%),
        radial-gradient(circle at 50% 80%, rgba(245,158,11,.18) 0%, transparent 35%);
    filter: blur(60px) saturate(1.05);
    opacity: .55;
    animation: dsMesh 20s ease-in-out infinite alternate;
}
@keyframes dsMesh {
    0%  { transform: translate3d(0,0,0) scale(1); }
    100%{ transform: translate3d(20px,-10px,0) scale(1.07); }
}
.ds-grid-fade {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, black 0%, transparent 75%);
    -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 75%);
    opacity: .55;
}
.ds-floaty {
    position: absolute;
    border-radius: 9999px;
    filter: blur(20px);
    opacity: .55;
    animation: dsFloat 14s ease-in-out infinite alternate;
}
.ds-floaty.f1 { width: 220px; height: 220px; top: 12%;  left: 12%; background: radial-gradient(circle, rgba(99,102,241,.55), transparent 70%); }
.ds-floaty.f2 { width: 180px; height: 180px; top: 18%;  right: 22%; background: radial-gradient(circle, rgba(34,211,238,.55), transparent 70%); animation-delay: -4s; }
.ds-floaty.f3 { width: 260px; height: 260px; bottom: -20%; left: 38%; background: radial-gradient(circle, rgba(245,158,11,.45), transparent 70%); animation-delay: -8s; }
@keyframes dsFloat {
    0%   { transform: translate3d(0,0,0) scale(1); }
    100% { transform: translate3d(30px,-20px,0) scale(1.08); }
}
.ds-hero-inner {
    position: relative; z-index: 1;
    padding: 36px 28px 24px;
    max-width: 1480px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: end;
}
.ds-hero-left { min-width: 0; }
.ds-breadcrumb {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--ds-ink-3);
    letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 10px;
    animation: dsFadeUp .6s .05s ease both;
}
.ds-breadcrumb-active { color: var(--ds-ink); font-weight: 600; }
.ds-title {
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ds-ink);
    font-weight: 600;
    margin: 0 0 12px;
    max-width: 880px;
    animation: dsFadeUp .7s .12s ease both;
}
.ds-grad   { background: linear-gradient(90deg,#6366f1,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ds-grad-2 { background: linear-gradient(90deg,#22d3ee,#10b981); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ds-grad-3 { background: linear-gradient(90deg,#f59e0b,#ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ds-sub {
    color: var(--ds-ink-2);
    font-size: 14px;
    max-width: 720px;
    line-height: 1.55;
    margin: 0 0 22px;
    animation: dsFadeUp .7s .2s ease both;
}
.ds-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px; max-width: 640px;
    animation: dsFadeUp .7s .26s ease both;
}
.ds-stat {
    background: var(--ds-surface);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgb(15 23 42 / .04), inset 0 0 0 1px var(--ds-border);
}
.ds-stat-num {
    font-size: 22px; font-weight: 600; color: var(--ds-ink);
    letter-spacing: -.02em; line-height: 1;
    font-feature-settings: 'tnum';
}
.ds-stat-lbl { font-size: 11px; color: var(--ds-ink-3); margin-top: 4px; }

/* HERO CTA */
.ds-hero-right {
    text-align: right;
    animation: dsFadeUp .7s .3s ease both;
}
.ds-cta {
    position: relative;
    border: 0; cursor: pointer;
    padding: 14px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg,#0f172a 0%, #1e293b 60%, #312e81 100%);
    color: #fff;
    font-weight: 600; font-size: 14px;
    letter-spacing: .005em;
    box-shadow: 0 14px 32px -10px rgb(99 102 241 / .55), 0 0 0 1px rgb(15 23 42 / .12);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
.ds-cta:hover { transform: translateY(-1px); box-shadow: 0 18px 40px -10px rgb(99 102 241 / .65), 0 0 0 1px rgb(15 23 42 / .14); }
.ds-cta:active { transform: translateY(0); }
.ds-cta-glow {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.25) 50%, transparent 75%);
    transform: translateX(-110%);
    animation: dsCtaGlow 2.8s ease-in-out infinite;
}
@keyframes dsCtaGlow { 0%,30% {transform:translateX(-110%);} 60% {transform:translateX(110%);} 100% {transform:translateX(110%);} }
.ds-cta-label { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.ds-cta-label i { font-size: 14px; transform: translateY(-1px); }
.ds-cta-hint { margin-top: 10px; font-size: 11px; color: var(--ds-ink-3); max-width: 320px; margin-left: auto; line-height: 1.5; }

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

/* ============================
   MODE SELECTOR (cards)
   ============================ */
.ds-modes {
    max-width: 1480px; margin: 22px auto 0;
    padding: 0 28px;
}
.ds-modes-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px;
    margin: 0 4px 14px;
}
.ds-modes-eyebrow {
    font-size: 10.5px; font-weight: 600;
    color: var(--ds-ink-4);
    text-transform: uppercase; letter-spacing: .12em;
}
.ds-modes-title {
    font-size: 18px; font-weight: 600;
    color: var(--ds-ink);
    letter-spacing: -.02em;
    margin: 2px 0 0;
}
.ds-modes-hint {
    font-size: 12px; color: var(--ds-ink-3);
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--ds-surface);
    box-shadow: 0 1px 2px rgb(15 23 42 / .04), inset 0 0 0 1px var(--ds-border);
}
.ds-modes-hint i { color: var(--ds-ink-4); font-size: 11px; }
.ds-modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ds-mode-card {
    position: relative;
    overflow: hidden;
    text-align: left;
    background: var(--ds-surface);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgb(15 23 42 / .04), inset 0 0 0 1px var(--ds-border);
    padding: 16px 18px 14px;
    cursor: pointer;
    border: 0;
    transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
    isolation: isolate;
    animation: dsFadeUp .55s ease both;
}
.ds-mode-card[data-tone="sapphire"] { --c1: #3b82f6; --c2: #1d4ed8; --soft: rgb(29 78 216 / .08); --ring: rgb(29 78 216 / .35); }
.ds-mode-card[data-tone="violet"]   { --c1: #818cf8; --c2: #4f46e5; --soft: rgb(79 70 229 / .08); --ring: rgb(79 70 229 / .35); }
.ds-mode-card[data-tone="teal"]     { --c1: #2dd4bf; --c2: #0d9488; --soft: rgb(13 148 136 / .08); --ring: rgb(13 148 136 / .35); }

.ds-mode-card:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow);
}
.ds-mode-card:hover:not(.active) .ds-mode-icon {
    transform: scale(1.04) rotate(-2deg);
    box-shadow: 0 8px 22px -6px var(--c1);
}
.ds-mode-card.active {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -10px var(--ring), inset 0 0 0 1.5px var(--ring), 0 0 0 1px var(--ds-border);
    background: linear-gradient(180deg, var(--soft) 0%, var(--ds-surface) 60%);
}

.ds-mode-glow {
    position: absolute;
    top: -60px; right: -60px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--c1) 0%, transparent 65%);
    opacity: 0;
    filter: blur(28px);
    transition: opacity .35s ease;
    z-index: -1;
}
.ds-mode-card.active .ds-mode-glow,
.ds-mode-card:hover .ds-mode-glow { opacity: .14; }

.ds-mode-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.ds-mode-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 17px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    box-shadow: 0 6px 16px -6px var(--c1), inset 0 0 0 1px rgba(255,255,255,.18);
    transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease;
}
.ds-mode-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--ds-surface);
    box-shadow: inset 0 0 0 1.5px var(--ds-border-2);
    color: transparent;
    font-size: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .25s cubic-bezier(.2,.7,.2,1);
}
.ds-mode-card.active .ds-mode-check {
    background: linear-gradient(135deg, var(--c1), var(--c2));
    box-shadow: 0 4px 10px -2px var(--c1);
    color: #fff;
    transform: scale(1.08);
}

.ds-mode-name {
    font-size: 16px; font-weight: 600; color: var(--ds-ink);
    letter-spacing: -.02em;
    line-height: 1.15;
}
.ds-mode-desc {
    font-size: 12px; color: var(--ds-ink-3);
    margin-top: 4px;
    line-height: 1.45;
}
.ds-mode-bands {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ds-border);
}
.ds-mode-band {
    display: flex; flex-direction: column;
    gap: 2px;
    padding: 0 8px;
    line-height: 1.2;
}
.ds-mode-band:not(:last-child) { border-right: 1px solid var(--ds-border); }
.ds-mode-band:first-child      { padding-left: 0; }
.ds-mode-band:last-child       { padding-right: 0; }
.ds-mode-band small {
    font-size: 9.5px; color: var(--ds-ink-4);
    letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
}
.ds-mode-band strong {
    font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 12px; font-weight: 600;
    color: var(--ds-ink);
    letter-spacing: -.02em;
}

@media (max-width: 1100px) {
    .ds-modes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ds-modes { padding: 0 18px; }
    .ds-modes-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============================
   TAB PANELS  (animated entry)
   ============================ */
.ds-tab-panel {
    max-width: 1480px;
    margin: 24px auto;
    padding: 0 28px;
    display: none;
}
.ds-tab-panel[data-active="true"] {
    display: block;
    animation: dsPanelEnter .55s cubic-bezier(.2,.7,.3,1.1) both;
}
@keyframes dsPanelEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================
   PANE HEAD
   ============================ */
.ds-pane-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ds-border);
}
.ds-pane-head > i {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(34,211,238,.10));
    color: var(--ds-accent);
    font-size: 14px;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,.18);
}
.ds-pane-title { font-size: 14px; font-weight: 600; color: var(--ds-ink); letter-spacing: -.01em; line-height: 1.2; }
.ds-pane-sub   { font-size: 11px; color: var(--ds-ink-3); margin-top: 2px; }

/* ============================
   RAC LAYOUT
   ============================ */
.ds-rac-grid {
    display: grid;
    grid-template-columns: 320px minmax(0,1fr) 360px;
    gap: 18px;
}
.ds-rac-segments, .ds-rac-editor, .ds-rac-tester {
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    border: 1px solid var(--ds-border);
    overflow: hidden;
}
.ds-rac-segments { max-height: 78vh; display: flex; flex-direction: column; }
.ds-segment-section {
    padding: 10px 12px;
    overflow-y: auto;
}
.ds-segment-cap {
    font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ds-ink-3); padding: 8px 6px 6px;
}
.ds-segment {
    width: 100%;
    display: grid; grid-template-columns: 32px 1fr auto;
    align-items: center; gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
    text-align: left;
    margin-bottom: 4px;
}
.ds-segment:hover { background: var(--ds-surface-2); }
.ds-segment.active {
    background: rgba(99,102,241,.07);
    border-color: rgba(99,102,241,.28);
    box-shadow: 0 1px 2px rgba(99,102,241,.10);
}
.ds-segment.not-offered { opacity: .5; cursor: not-allowed; }
.ds-segment.not-offered:hover { background: transparent; }
.ds-seg-flag {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
}
.ds-seg-flag[data-tone="emerald"] { background: linear-gradient(135deg,#10b981,#059669); }
.ds-seg-flag[data-tone="indigo"]  { background: linear-gradient(135deg,#6366f1,#4338ca); }
.ds-seg-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-seg-sector { font-size: 13px; font-weight: 500; color: var(--ds-ink); line-height: 1.1; }
.ds-seg-sub { font-size: 11px; color: var(--ds-ink-3); }
.ds-seg-tag {
    font-size: 10px; color: var(--ds-danger);
    background: rgba(220,38,38,.08);
    padding: 2px 6px; border-radius: 4px;
    font-weight: 500;
}
.ds-seg-chev { color: var(--ds-ink-3); font-size: 10px; opacity: 0; transform: translateX(-4px); transition: all .15s ease; }
.ds-segment.active .ds-seg-chev,
.ds-segment:hover .ds-seg-chev { opacity: 1; transform: translateX(0); }

/* RAC editor body */
.ds-rac-editor { display: flex; flex-direction: column; }
.ds-rac-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}
.ds-rac-section {
    margin-bottom: 22px;
    animation: dsFadeUp .35s ease both;
}
.ds-rac-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--ds-ink-2);
    margin-bottom: 10px;
}
.ds-rac-section-title i { font-size: 10px; color: var(--ds-accent); }
.ds-rac-section-title::after {
    content: '';
    flex: 1; height: 1px; background: linear-gradient(90deg, var(--ds-border) 0%, transparent 100%);
    margin-left: 6px;
}
.ds-rac-fields {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px;
}
.ds-rac-field {
    background: var(--ds-surface-2);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    position: relative;
}
.ds-rac-field:hover {
    background: var(--ds-surface);
    border-color: var(--ds-border);
    box-shadow: 0 2px 8px -4px rgba(15,23,42,.10);
}
.ds-rac-field.invalid {
    background: rgba(220,38,38,.05);
    border-color: rgba(220,38,38,.30);
}
.ds-rac-field.passed {
    background: rgba(16,185,129,.05);
    border-color: rgba(16,185,129,.28);
    animation: dsRacPass .6s ease both;
}
.ds-rac-field.failed {
    background: rgba(220,38,38,.06);
    border-color: rgba(220,38,38,.35);
    animation: dsRacFail .55s ease both;
}
@keyframes dsRacPass { 0% {transform:scale(.98);} 50% {transform:scale(1.02);} 100% {transform:scale(1);} }
@keyframes dsRacFail { 0%,100% {transform:translateX(0);} 25% {transform:translateX(-3px);} 75% {transform:translateX(3px);} }
.ds-rac-label { font-size: 11px; color: var(--ds-ink-3); display: block; margin-bottom: 4px; line-height: 1.3; }
.ds-rac-input-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.ds-rac-input {
    width: 100%;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ds-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ds-rac-input:focus { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.ds-rac-unit {
    font-size: 11px; color: var(--ds-ink-3); white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}
.ds-rac-tip {
    position: absolute; right: 8px; top: 8px;
    width: 16px; height: 16px;
    border-radius: 50%; background: rgba(15,23,42,.06);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; color: var(--ds-ink-3);
    cursor: help;
}

/* Bureau cards */
.ds-rac-bureau {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px;
}
.ds-rac-bureau-card {
    background: var(--ds-surface-2);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid transparent;
    transition: all .15s ease;
}
.ds-rac-bureau-card.passed { background: rgba(16,185,129,.05); border-color: rgba(16,185,129,.28); animation: dsRacPass .6s ease both; }
.ds-rac-bureau-card.failed { background: rgba(220,38,38,.06); border-color: rgba(220,38,38,.35); animation: dsRacFail .55s ease both; }
.ds-rac-bureau-icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(34,211,238,.10));
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ds-accent); font-size: 11px;
    margin-bottom: 8px;
}
.ds-rac-bureau-label { font-size: 12px; font-weight: 500; color: var(--ds-ink); line-height: 1.2; margin-bottom: 4px; }
.ds-rac-bureau-value {
    font-size: 11px; color: var(--ds-ink-2);
    font-family: 'JetBrains Mono', monospace;
    background: var(--ds-surface); border-radius: 6px;
    padding: 4px 6px; display: inline-block;
    border: 1px solid var(--ds-border);
}
.ds-rac-bureau-desc { font-size: 10px; color: var(--ds-ink-3); margin-top: 6px; line-height: 1.4; }

/* Segment header */
.ds-rac-editor-head {
    padding: 18px;
    border-bottom: 1px solid var(--ds-border);
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(34,211,238,.03));
}
.ds-rac-editor-flag {
    width: 44px; height: 44px;
    border-radius: 10px;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 14px -4px rgba(99,102,241,.45);
}
.ds-rac-editor-flag[data-tone="emerald"] { background: linear-gradient(135deg,#10b981,#059669); }
.ds-rac-editor-flag[data-tone="indigo"]  { background: linear-gradient(135deg,#6366f1,#4338ca); }
.ds-rac-editor-name { font-size: 16px; font-weight: 600; color: var(--ds-ink); letter-spacing: -.01em; }
.ds-rac-editor-sub  { font-size: 12px; color: var(--ds-ink-3); margin-top: 2px; }
.ds-rac-editor-not-offered {
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(220,38,38,.08);
    color: var(--ds-danger);
    font-size: 11px; font-weight: 500;
}

/* RAC tester */
.ds-rac-tester { max-height: 78vh; display: flex; flex-direction: column; }
.ds-form {
    padding: 14px 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}
.ds-form-row { display: grid; grid-template-columns: 1fr 1fr; }
.ds-field {
    display: flex; flex-direction: column; gap: 6px;
}
.ds-field-grid-2 { grid-column: 1 / -1; }
.ds-field > span { font-size: 11px; color: var(--ds-ink-3); }
.ds-field input, .ds-field select {
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ds-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ds-field input:focus, .ds-field select:focus {
    outline: none;
    border-color: var(--ds-accent);
    background: var(--ds-surface);
    box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}
.ds-run {
    margin: 0 18px 14px;
    border: 0; cursor: pointer;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg,#6366f1, #4338ca);
    color: #fff;
    font-weight: 600; font-size: 13px;
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
    box-shadow: 0 8px 22px -8px rgba(99,102,241,.55);
    transition: transform .15s ease, box-shadow .15s ease;
}
.ds-run:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(99,102,241,.65); }
.ds-run:active { transform: translateY(0); }
.ds-run i { font-size: 12px; }
.ds-rac-trace {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px;
    max-height: 280px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
}
.ds-trace-line {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(15,23,42,.06);
    animation: dsTraceLine .35s ease both;
    color: var(--ds-ink-2);
}
.ds-trace-line[data-state="pass"] { color: var(--ds-success); }
.ds-trace-line[data-state="fail"] { color: var(--ds-danger); }
.ds-trace-line[data-state="warn"] { color: var(--ds-warning); }
.ds-trace-line i { padding-top: 2px; }
.ds-trace-line .ds-trace-label { color: var(--ds-ink); font-family: 'Inter', sans-serif; font-size: 12px; }
.ds-trace-line .ds-trace-val   { font-size: 11px; color: var(--ds-ink-3); }
@keyframes dsTraceLine { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.ds-rac-verdict {
    margin: 14px 18px 18px;
    padding: 14px;
    border-radius: 12px;
    display: flex; align-items: center; gap: 12px;
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    transition: all .25s ease;
}
.ds-rac-verdict[data-state="pass"] { background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(16,185,129,.04)); border-color: rgba(16,185,129,.32); }
.ds-rac-verdict[data-state="fail"] { background: linear-gradient(135deg, rgba(220,38,38,.10), rgba(220,38,38,.04)); border-color: rgba(220,38,38,.32); }
.ds-rac-verdict[data-state="warn"] { background: linear-gradient(135deg, rgba(217,119,6,.10), rgba(217,119,6,.04)); border-color: rgba(217,119,6,.32); }
.ds-verdict-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
    background: var(--ds-surface);
    color: var(--ds-ink-3);
    box-shadow: inset 0 0 0 1px var(--ds-border);
}
.ds-rac-verdict[data-state="pass"] .ds-verdict-icon { color: var(--ds-success); box-shadow: inset 0 0 0 1px rgba(16,185,129,.35); }
.ds-rac-verdict[data-state="fail"] .ds-verdict-icon { color: var(--ds-danger);  box-shadow: inset 0 0 0 1px rgba(220,38,38,.35); }
.ds-rac-verdict[data-state="warn"] .ds-verdict-icon { color: var(--ds-warning); box-shadow: inset 0 0 0 1px rgba(217,119,6,.35); }
.ds-verdict-text { display: flex; flex-direction: column; gap: 2px; }
.ds-verdict-text strong { font-size: 14px; color: var(--ds-ink); }
.ds-verdict-text span { font-size: 11.5px; color: var(--ds-ink-2); }

/* ============================
   SCORECARD
   ============================ */
.ds-sc-toolbar {
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    border: 1px solid var(--ds-border);
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 18px;
}
.ds-sc-weight-summary {
    display: flex; align-items: center; gap: 14px; min-width: 0;
}
.ds-sc-weight-label { font-size: 12px; color: var(--ds-ink-3); }
.ds-sc-weight-bar {
    position: relative; width: 260px; height: 6px;
    background: var(--ds-surface-2); border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--ds-border);
}
#sc-weight-fill {
    display: block; height: 100%;
    background: linear-gradient(90deg,#6366f1,#22d3ee);
    width: 100%;
    border-radius: 999px;
    transition: width .35s cubic-bezier(.4,0,.2,1), background .25s ease;
}
.ds-sc-weight-pct {
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    color: var(--ds-ink); font-weight: 600;
    min-width: 50px;
}
.ds-sc-weight-flag {
    font-size: 11px; color: var(--ds-success);
    background: rgba(16,185,129,.10); border-radius: 999px;
    padding: 3px 8px; font-weight: 500;
}
.ds-sc-weight-flag[data-state="off"] { color: var(--ds-warning); background: rgba(217,119,6,.10); }
.ds-sc-weight-flag[data-state="over"] { color: var(--ds-danger);  background: rgba(220,38,38,.10); }
.ds-sc-actions { display: flex; gap: 8px; }
.ds-btn-secondary {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink-2);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ds-btn-secondary:hover { background: var(--ds-surface); color: var(--ds-ink); border-color: var(--ds-border-2); }
.ds-btn-secondary i { font-size: 11px; }

.ds-sc-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 380px;
    gap: 18px;
}
.ds-sc-vars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}
.ds-sc-var {
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    border: 1px solid var(--ds-border);
    padding: 16px;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: dsFadeUp .45s ease both;
}
.ds-sc-var:hover { transform: translateY(-2px); box-shadow: var(--ds-shadow-lg); }
.ds-sc-var-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ds-sc-var-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(34,211,238,.10));
    color: var(--ds-accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,.18);
}
.ds-sc-var-meta { flex: 1; min-width: 0; }
.ds-sc-var-name { font-size: 14px; font-weight: 600; color: var(--ds-ink); letter-spacing: -.01em; line-height: 1.2; }
.ds-sc-var-type { font-size: 11px; color: var(--ds-ink-3); }
.ds-sc-var-weight-readout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 600;
    color: var(--ds-ink);
    min-width: 56px; text-align: right;
}
.ds-sc-var-slider-wrap { margin-bottom: 14px; }
.ds-sc-var-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px;
    background: linear-gradient(90deg, var(--ds-surface-3) 0%, var(--ds-surface-3) 100%);
    border-radius: 999px;
    cursor: pointer;
    margin: 0; padding: 0;
}
.ds-sc-var-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg,#6366f1,#22d3ee);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.45);
    cursor: grab;
    transition: transform .15s ease;
}
.ds-sc-var-slider::-webkit-slider-thumb:hover { transform: scale(1.18); }
.ds-sc-var-slider::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg,#6366f1,#22d3ee);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.45);
    cursor: grab;
}
.ds-sc-var-buckets {
    display: flex; flex-direction: column; gap: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--ds-border);
}
.ds-sc-bucket {
    display: grid;
    grid-template-columns: 1fr 64px;
    gap: 8px; align-items: center;
    padding: 5px 4px;
    border-radius: 6px;
}
.ds-sc-bucket:hover { background: var(--ds-surface-2); }
.ds-sc-bucket-label { font-size: 12px; color: var(--ds-ink-2); font-family: 'JetBrains Mono', monospace; }
.ds-sc-bucket-input {
    width: 100%;
    background: var(--ds-surface-2);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ds-ink);
    text-align: right;
    transition: all .15s ease;
}
.ds-sc-bucket-input:hover { background: var(--ds-surface); border-color: var(--ds-border); }
.ds-sc-bucket-input:focus { outline: none; background: var(--ds-surface); border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.ds-sc-var-note {
    margin-top: 10px;
    font-size: 11px;
    color: var(--ds-ink-3);
    background: var(--ds-surface-2);
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1.45;
}
.ds-sc-var-note i { color: var(--ds-accent); margin-right: 6px; }

/* Simulator */
.ds-sc-simulator {
    position: sticky; top: 80px;
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    align-self: start;
}
.ds-sim-form {
    padding: 14px 18px;
    display: grid; grid-template-columns: 1fr; gap: 9px;
    max-height: 36vh;
    overflow-y: auto;
    border-bottom: 1px solid var(--ds-border);
}
.ds-sim-row {
    display: grid; grid-template-columns: 96px 1fr;
    gap: 10px; align-items: center;
}
.ds-sim-row label {
    font-size: 11px; color: var(--ds-ink-3);
    line-height: 1.25;
}
.ds-sim-row select {
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 12.5px;
    color: var(--ds-ink);
    transition: all .15s ease;
}
.ds-sim-row select:focus { outline: none; background: var(--ds-surface); border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.ds-sim-result {
    padding: 18px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ds-sim-ring {
    position: relative;
    width: 180px; height: 180px;
    margin: 4px 0;
}
.ds-sim-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ds-sim-track {
    fill: none; stroke: var(--ds-surface-3); stroke-width: 9;
}
.ds-sim-arc {
    fill: none;
    stroke: url(#simRingGrad);
    stroke-width: 9; stroke-linecap: round;
    transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1);
    filter: drop-shadow(0 0 8px rgba(99,102,241,.35));
}
.ds-sim-readout {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ds-sim-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px; font-weight: 600;
    color: var(--ds-ink);
    letter-spacing: -.02em;
    line-height: 1;
}
.ds-sim-lbl { font-size: 11px; color: var(--ds-ink-3); margin-top: 4px; }
.ds-sim-band {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--ds-surface-2);
    box-shadow: inset 0 0 0 1px var(--ds-border);
    font-size: 12px; font-weight: 500; color: var(--ds-ink-2);
}
.ds-sim-band-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--ds-ink-3);
}
.ds-sim-band[data-band="very-low"]  .ds-sim-band-dot { background: #dc2626; box-shadow: 0 0 8px rgba(220,38,38,.5); }
.ds-sim-band[data-band="low"]       .ds-sim-band-dot { background: #f97316; box-shadow: 0 0 8px rgba(249,115,22,.5); }
.ds-sim-band[data-band="fair"]      .ds-sim-band-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.5); }
.ds-sim-band[data-band="good"]      .ds-sim-band-dot { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.5); }
.ds-sim-band[data-band="excellent"] .ds-sim-band-dot { background: #06b6d4; box-shadow: 0 0 8px rgba(6,182,212,.5); }
.ds-sim-band-label { font-family: 'JetBrains Mono', monospace; letter-spacing: .02em; }

/* Contribution bars */
.ds-sim-bars {
    width: 100%;
    display: flex; flex-direction: column; gap: 5px;
    margin-top: 6px;
}
.ds-sim-bar-row {
    display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px; align-items: center;
}
.ds-sim-bar-name {
    font-size: 10.5px; color: var(--ds-ink-2);
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.ds-sim-bar-track {
    position: relative;
    height: 6px; background: var(--ds-surface-2);
    border-radius: 999px; overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--ds-border);
}
.ds-sim-bar-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    width: 0;
    background: linear-gradient(90deg,#6366f1,#22d3ee);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}
.ds-sim-bar-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; color: var(--ds-ink); text-align: right;
}

/* ============================
   DUAL MATRIX
   ============================ */
.ds-dm-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 380px;
    gap: 18px;
}
.ds-dm-board, .ds-dm-side > div {
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    border: 1px solid var(--ds-border);
    overflow: hidden;
}
.ds-dm-board { padding-bottom: 18px; }
.ds-dm-side { display: flex; flex-direction: column; gap: 18px; }
.ds-dm-matrix-wrap {
    padding: 18px;
    overflow-x: auto;
}
.ds-dm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}
.ds-dm-corner {
    padding: 0; vertical-align: bottom;
    background: transparent;
    position: relative;
    width: 100px;
}
.ds-dm-corner-row, .ds-dm-corner-col {
    font-size: 10px; color: var(--ds-ink-3);
    letter-spacing: .08em; text-transform: uppercase;
    display: block;
}
.ds-dm-corner-row { text-align: left; padding-left: 8px; }
.ds-dm-corner-col { text-align: right; padding-right: 8px; }
.ds-dm-table th .ds-dm-head {
    font-size: 11.5px; font-weight: 600; color: var(--ds-ink);
    font-family: 'JetBrains Mono', monospace;
}
.ds-dm-table th .ds-dm-head-q {
    font-size: 10px; color: var(--ds-ink-3);
    margin-top: 3px; font-weight: 500;
    letter-spacing: .04em; text-transform: uppercase;
}
.ds-dm-row {
    font-size: 11.5px; font-weight: 600; color: var(--ds-ink);
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    padding-right: 10px;
    background: var(--ds-surface-2);
    border-radius: 8px;
}
.ds-dm-cell {
    position: relative;
    padding: 0;
    width: 14%;
    aspect-ratio: 1.7 / 1;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    color: #fff;
    overflow: hidden;
}
.ds-dm-cell::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    opacity: .9;
    transition: opacity .25s ease;
}
.ds-dm-cell[data-tone="emerald"] { --c1: #34d399; --c2: #059669; }
.ds-dm-cell[data-tone="teal"]    { --c1: #2dd4bf; --c2: #0d9488; }
.ds-dm-cell[data-tone="amber"]   { --c1: #fbbf24; --c2: #d97706; }
.ds-dm-cell[data-tone="rose"]    { --c1: #f87171; --c2: #dc2626; }
.ds-dm-cell > span {
    position: relative;
    display: block;
    line-height: 1.1;
}
.ds-dm-grade {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px; font-weight: 700; padding-top: 18px;
    letter-spacing: -.02em;
}
.ds-dm-decision {
    font-size: 10.5px; opacity: .92;
    letter-spacing: .04em; text-transform: uppercase;
    margin-top: 4px;
}
.ds-dm-cell:hover { transform: scale(1.04); filter: brightness(1.06); z-index: 2; box-shadow: 0 10px 24px -8px rgba(15,23,42,.30); }
.ds-dm-cell.lit {
    transform: scale(1.10);
    z-index: 3;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ds-accent), 0 14px 36px -8px rgba(99,102,241,.55);
    animation: dsCellPulse 1.6s ease-in-out infinite;
}
@keyframes dsCellPulse {
    0%,100% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ds-accent), 0 14px 36px -8px rgba(99,102,241,.55); }
    50%     { box-shadow: 0 0 0 3px #fff, 0 0 0 8px var(--ds-accent), 0 18px 42px -8px rgba(99,102,241,.75); }
}
.ds-dm-cell .ds-dm-edit-input {
    position: absolute; inset: 6px 6px auto 6px;
    background: rgba(255,255,255,.92);
    color: var(--ds-ink);
    border: 0; border-radius: 6px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 600;
    padding: 4px 0;
    z-index: 4;
}
.ds-dm-legend {
    display: flex; gap: 12px;
    padding: 0 18px;
    flex-wrap: wrap;
}
.ds-dm-leg-item {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--ds-ink-2);
}
.ds-dm-leg-item i {
    width: 14px; height: 14px; border-radius: 4px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    display: inline-block;
}
.ds-dm-leg-item[data-tone="emerald"] { --c1: #34d399; --c2: #059669; }
.ds-dm-leg-item[data-tone="teal"]    { --c1: #2dd4bf; --c2: #0d9488; }
.ds-dm-leg-item[data-tone="amber"]   { --c1: #fbbf24; --c2: #d97706; }
.ds-dm-leg-item[data-tone="rose"]    { --c1: #f87171; --c2: #dc2626; }

/* Grade configuration list */
.ds-dm-grade-list { padding: 8px 12px 14px; }
.ds-dm-grade-row {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 1fr;
    gap: 8px; align-items: center;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background-color .15s ease;
}
.ds-dm-grade-row:hover { background: var(--ds-surface-2); }
.ds-dm-grade-pill {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 2px 8px -2px var(--c2);
    background: linear-gradient(135deg, var(--c1), var(--c2));
}
.ds-dm-grade-row[data-tone="emerald"] { --c1: #34d399; --c2: #059669; }
.ds-dm-grade-row[data-tone="teal"]    { --c1: #2dd4bf; --c2: #0d9488; }
.ds-dm-grade-row[data-tone="amber"]   { --c1: #fbbf24; --c2: #d97706; }
.ds-dm-grade-row[data-tone="rose"]    { --c1: #f87171; --c2: #dc2626; }
.ds-dm-grade-row > select,
.ds-dm-grade-row > input {
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    color: var(--ds-ink);
    transition: all .15s ease;
    width: 100%;
}
.ds-dm-grade-row > select:focus,
.ds-dm-grade-row > input:focus {
    outline: none; background: var(--ds-surface);
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}

/* DM verdict */
.ds-dm-verdict {
    margin: 14px 18px 18px;
    padding: 14px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px; align-items: center;
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    transition: all .25s ease;
}
.ds-dm-verdict[data-state="accept"] { background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(16,185,129,.04)); border-color: rgba(16,185,129,.32); }
.ds-dm-verdict[data-state="refer"]  { background: linear-gradient(135deg, rgba(217,119,6,.10), rgba(217,119,6,.04)); border-color: rgba(217,119,6,.32); }
.ds-dm-verdict[data-state="reject"] { background: linear-gradient(135deg, rgba(220,38,38,.10), rgba(220,38,38,.04)); border-color: rgba(220,38,38,.32); }
.ds-dm-verdict-grade {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 8px;
    background: var(--ds-surface);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--ds-border);
}
.ds-dm-verdict-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px; font-weight: 700;
    color: var(--ds-ink); line-height: 1;
}
.ds-dm-verdict-tag { font-size: 10px; color: var(--ds-ink-3); letter-spacing: .08em; text-transform: uppercase; }
.ds-dm-verdict-decision { display: flex; flex-direction: column; gap: 4px; }
.ds-dm-decision-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--ds-ink);
}
.ds-dm-verdict[data-state="accept"] .ds-dm-decision-tag::before { content: '●'; color: var(--ds-success); }
.ds-dm-verdict[data-state="refer"]  .ds-dm-decision-tag::before { content: '●'; color: var(--ds-warning); }
.ds-dm-verdict[data-state="reject"] .ds-dm-decision-tag::before { content: '●'; color: var(--ds-danger); }
.ds-dm-verdict-detail { font-size: 11.5px; color: var(--ds-ink-2); }

/* ============================
   AI CALIBRATE MODAL
   ============================ */
.ds-ai-overlay {
    position: fixed; inset: 0;
    z-index: 60;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .25s ease;
}
.ds-ai-overlay[data-open="true"] {
    display: flex;
    opacity: 1;
}
.ds-ai-modal {
    position: relative;
    width: min(880px, 100%);
    max-height: calc(100vh - 48px);
    background: var(--ds-surface);
    border-radius: 20px;
    box-shadow: 0 40px 80px -20px rgba(15,23,42,.45), 0 0 0 1px rgb(15 23 42 / .08);
    overflow: hidden;
    display: flex; flex-direction: column;
    transform: translateY(20px) scale(.96);
    opacity: 0;
    transition: transform .35s cubic-bezier(.2,.7,.3,1.1), opacity .25s ease;
}
.ds-ai-overlay[data-open="true"] .ds-ai-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.ds-ai-bg { position: absolute; inset: 0; pointer-events: none; }
.ds-ai-mesh {
    position: absolute; inset: -30%;
    background:
        radial-gradient(circle at 18% 26%, rgba(99,102,241,.32) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(34,211,238,.30) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(245,158,11,.20) 0%, transparent 40%);
    filter: blur(60px);
    opacity: .60;
    animation: dsMesh 22s ease-in-out infinite alternate;
}
.ds-ai-head {
    position: relative; z-index: 1;
    padding: 22px 26px 18px;
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--ds-border);
}
.ds-ai-orb {
    position: relative;
    width: 64px; height: 64px;
}
.ds-ai-orb-core {
    position: absolute; inset: 16px;
    background: radial-gradient(circle at 35% 30%, #fff 0%, #c7d2fe 30%, #6366f1 70%);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(99,102,241,.65), 0 0 60px rgba(99,102,241,.40);
    animation: dsOrbPulse 2.6s ease-in-out infinite;
}
@keyframes dsOrbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.ds-ai-orb-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(99,102,241,.45);
    animation: dsRingSpin 8s linear infinite;
}
.ds-ai-orb-ring.r1 { inset: 4px; animation-duration: 6s; }
.ds-ai-orb-ring.r2 { inset: 0;   animation-duration: 9s; animation-direction: reverse; border-color: rgba(34,211,238,.45); }
.ds-ai-orb-ring.r3 { inset: -6px; animation-duration: 12s; border-color: rgba(245,158,11,.32); }
@keyframes dsRingSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.ds-ai-eyebrow {
    font-size: 11px; color: var(--ds-accent); font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    margin-bottom: 4px;
}
.ds-ai-title { font-size: 20px; font-weight: 600; color: var(--ds-ink); letter-spacing: -.02em; line-height: 1.15; }
.ds-ai-sub { font-size: 12px; color: var(--ds-ink-3); margin-top: 4px; }
.ds-ai-close {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ds-surface-2); border: 1px solid var(--ds-border);
    color: var(--ds-ink-2); cursor: pointer;
    font-size: 14px;
    transition: all .15s ease;
}
.ds-ai-close:hover { background: var(--ds-surface); color: var(--ds-ink); }
.ds-ai-progress {
    position: relative; z-index: 1;
    height: 3px;
    background: var(--ds-surface-2);
    overflow: hidden;
}
#ds-ai-progress-fill {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg,#6366f1,#22d3ee,#10b981);
    background-size: 200% 100%;
    animation: dsBarShine 2.5s linear infinite;
    transition: width .25s linear;
}
@keyframes dsBarShine { 0%{background-position:0% 0%} 100%{background-position:-200% 0%} }
.ds-ai-thinking {
    position: relative; z-index: 1;
    padding: 14px 26px;
    border-bottom: 1px solid var(--ds-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--ds-ink-2);
    min-height: 42px;
    display: flex; align-items: center; gap: 8px;
}
.ds-ai-caret { color: var(--ds-accent); animation: dsCaret 1.05s infinite; font-weight: 600; }
@keyframes dsCaret { 0%,49% {opacity: 1;} 50%,100% {opacity: 0;} }

.ds-ai-body {
    position: relative; z-index: 1;
    padding: 18px 26px;
    overflow-y: auto;
    max-height: 50vh;
    display: none;
}
.ds-ai-body[data-shown="true"] {
    display: block;
    animation: dsFadeUp .45s ease both;
}
.ds-ai-rec {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 14px; align-items: center;
    background: var(--ds-surface-2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease;
    animation: dsRecIn .45s cubic-bezier(.2,.7,.3,1.1) both;
}
@keyframes dsRecIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ds-ai-rec:hover { background: var(--ds-surface); border-color: var(--ds-border); }
.ds-ai-rec-ico {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 12px -2px var(--c2);
}
.ds-ai-rec[data-tone="emerald"]    { --c1: #34d399; --c2: #059669; }
.ds-ai-rec[data-tone="cyan"]       { --c1: #22d3ee; --c2: #0e7490; }
.ds-ai-rec[data-tone="amber"]      { --c1: #fbbf24; --c2: #d97706; }
.ds-ai-rec[data-tone="indigo"]     { --c1: #818cf8; --c2: #4338ca; }
.ds-ai-rec[data-tone="rose"]       { --c1: #f87171; --c2: #dc2626; }
.ds-ai-rec-name { font-size: 13px; font-weight: 600; color: var(--ds-ink); margin-bottom: 4px; }
.ds-ai-rec-delta {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
}
.ds-ai-rec-from { color: var(--ds-ink-3); text-decoration: line-through; }
.ds-ai-rec-arrow { color: var(--ds-ink-3); }
.ds-ai-rec-to { color: var(--ds-success); font-weight: 600; }
.ds-ai-rec-rationale { font-size: 11px; color: var(--ds-ink-2); margin-top: 4px; max-width: 480px; line-height: 1.45; }
.ds-ai-rec-conf {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px;
    color: var(--ds-ink-2);
    background: var(--ds-surface); border-radius: 999px;
    padding: 4px 10px;
    box-shadow: inset 0 0 0 1px var(--ds-border);
}
.ds-ai-rec-conf strong { color: var(--ds-success); font-family: 'JetBrains Mono', monospace; }
.ds-ai-rec input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--ds-accent);
    cursor: pointer;
}

.ds-ai-foot {
    position: relative; z-index: 1;
    padding: 14px 26px;
    border-top: 1px solid var(--ds-border);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    display: none;
}
.ds-ai-foot[data-shown="true"] { display: flex; }
.ds-btn-ghost {
    background: transparent; border: 0;
    color: var(--ds-ink-3); font-size: 12.5px; cursor: pointer;
    padding: 8px 12px;
    transition: color .15s ease;
}
.ds-btn-ghost:hover { color: var(--ds-ink-2); }
.ds-btn-apply {
    position: relative;
    border: 0; cursor: pointer;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg,#10b981, #059669);
    color: #fff;
    font-weight: 600; font-size: 13px;
    box-shadow: 0 12px 26px -8px rgba(16,185,129,.55);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ds-btn-apply:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -8px rgba(16,185,129,.65); }
.ds-btn-apply-glow {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.25) 50%, transparent 75%);
    transform: translateX(-110%);
    animation: dsCtaGlow 3s ease-in-out infinite;
}
.ds-btn-apply i { margin-right: 6px; font-size: 11px; }
.ds-btn-apply > span { position: relative; z-index: 1; }

/* ============================
   TOAST
   ============================ */
.ds-toast-stack {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 70;
    pointer-events: none;
}
.ds-toast {
    pointer-events: auto;
    background: var(--ds-surface);
    border-radius: 10px;
    box-shadow: 0 12px 32px -12px rgba(15,23,42,.20), 0 0 0 1px var(--ds-border);
    padding: 12px 14px;
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 360px;
    font-size: 13px; color: var(--ds-ink);
    transform: translateY(20px); opacity: 0;
    transition: transform .3s cubic-bezier(.2,.7,.3,1.1), opacity .3s ease;
}
.ds-toast.show { transform: translateY(0); opacity: 1; }
.ds-toast i { color: var(--ds-accent); font-size: 14px; }
.ds-toast[data-tone="success"] i { color: var(--ds-success); }
.ds-toast[data-tone="error"]   i { color: var(--ds-danger);  }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1200px) {
    .ds-rac-grid { grid-template-columns: 280px 1fr; }
    .ds-rac-tester { grid-column: 1 / -1; max-height: none; }
    .ds-sc-grid { grid-template-columns: 1fr; }
    .ds-sc-simulator { position: static; }
    .ds-dm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .ds-hero-inner { grid-template-columns: 1fr; }
    .ds-hero-right { text-align: left; }
    .ds-cta-hint   { margin-left: 0; }
    .ds-stats { grid-template-columns: repeat(2, 1fr); }
    .ds-rac-grid { grid-template-columns: 1fr; }
    .ds-sc-vars { grid-template-columns: 1fr; }
    .ds-rac-fields { grid-template-columns: 1fr; }
    .ds-rac-bureau { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ds-mesh, .ds-floaty, .ds-ai-orb-core, .ds-ai-orb-ring,
    .ds-cta-glow, .ds-btn-apply-glow, #ds-ai-progress-fill,
    .ds-ai-mesh { animation: none !important; }
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
