.conversion-plan-head,.conversion-status-card{border:1px solid rgba(167,139,250,.35);background:rgba(15,23,42,.55);border-radius:14px;padding:13px 15px;margin-bottom:12px}.conversion-plan-head{display:flex;align-items:center;justify-content:space-between}.conversion-plan-head b{display:block;color:#fff;font-size:1rem;margin-top:3px}.conversion-plan-head>span{color:#c4b5fd;font-size:.72rem;font-weight:800}.conversion-week{border:1px solid rgba(167,139,250,.25);background:rgba(30,27,75,.56);border-radius:12px;padding:10px 12px;margin-bottom:8px}.conversion-week-title{display:flex;justify-content:space-between;gap:10px;color:#f8fafc;font-size:.8rem}.conversion-week-title span{color:#a78bfa;font-size:.68rem}.conversion-week ul{margin:8px 0 0;padding-left:18px;color:#e2e8f0;font-size:.76rem;line-height:1.5}.conversion-noop{color:#94a3b8;font-size:.74rem;margin-top:6px}.conversion-status-card{display:flex;flex-direction:column;gap:6px;text-align:center}.conversion-status-card b{color:#fca5a5}.conversion-status-card span{color:#cbd5e1;font-size:.8rem;line-height:1.5}

/* ============================================================
   Chief Gear layout v2 — larger desktop workspace + light theme
   ============================================================ */
:root {
    --cg-v2-max: 1320px;
    --cg-v2-radius: 30px;
    --cg-v2-text: #f8fafc;
    --cg-v2-muted: #a8b0c8;
    --cg-v2-card: rgba(15,18,47,.94);
    --cg-v2-card-2: rgba(34,27,75,.92);
    --cg-v2-line: rgba(196,181,253,.38);
}

body { transition: background-color .25s ease, color .25s ease; }
.hub-container {
    width:100%; max-width:none; margin:0; padding:34px 220px 78px 28px; box-sizing:border-box;
}
.gear-hub-wrapper { gap:24px; width:100%; }
.chief-hero-shell,
.stock-container,
.planner-workbench,
.chief-container,
.bottom-summary-container {
    width:min(var(--cg-v2-max), 100%); max-width:none; margin-left:auto; margin-right:auto;
}

/* Header / hero */
.chief-hero-shell {
    margin-top:4px; margin-bottom:24px; padding:28px 34px 32px; border-radius:32px;
    min-height:330px;
}
.chief-hero-topline { display:flex; align-items:center; justify-content:flex-start; margin-bottom:28px; }
.chief-hero-topline-simple { grid-template-columns:none; }
.chief-back-pill { padding:10px 16px; font-size:.82rem; }
.chief-hero-copy { grid-template-columns:1.04fr .96fr; gap:42px; align-items:center; }
.chief-mini-label { font-size:.82rem; margin-bottom:10px; }
.chief-premium-title { font-size:clamp(3rem,4.5vw,4.8rem); line-height:.94; }
.chief-hero-lead { font-size:1.08rem; line-height:1.62; max-width:680px; margin-top:20px; }
.chief-feature-grid { gap:12px; }
.chief-feature-card { min-height:98px; border-radius:18px; padding:16px 17px; column-gap:12px; }
.chief-feature-card > span { font-size:.76rem; }
.chief-feature-card b { font-size:.94rem; }
.chief-feature-card small { font-size:.74rem; margin-top:5px; line-height:1.25; }

/* Inventory */
.stock-container { padding:20px 24px 22px; gap:16px; border-radius:24px; }
.stock-title { font-size:1.12rem; }
.stock-subtitle { font-size:.76rem; margin-top:4px; }
.stock-live-pill { font-size:.66rem; padding:7px 10px; }
.stock-items-group { gap:12px; }
.stock-item { min-height:58px; padding:9px 12px; border-radius:14px; }
.stock-item .res-icon-img { width:38px; height:38px; }
.stock-adj-btn { width:30px; height:30px; font-size:.92rem; border-radius:7px; }
.stock-item input { width:105px; height:30px; box-sizing:border-box; font-size:1rem; padding:4px 8px; }

/* Standalone planning controls — no longer overlaps gear pieces */
.planner-workbench {
    display:grid; grid-template-columns:minmax(0,1.65fr) minmax(330px,.75fr); gap:18px;
    border:1px solid var(--cg-v2-line); border-radius:26px; padding:18px;
    background:linear-gradient(145deg, rgba(15,18,47,.94), rgba(34,27,75,.92));
    box-shadow:0 20px 50px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.06); box-sizing:border-box;
}
.planner-workbench-main,
.planner-batch-card {
    border:1px solid rgba(167,139,250,.28); background:rgba(7,11,28,.42); border-radius:20px; padding:16px;
}
.planner-workbench-main { display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; align-items:center; }
.planner-workbench-heading h2 { color:#fff; font-size:1.08rem; margin:4px 0 5px; }
.planner-workbench-heading p { color:#9ca3b8; font-size:.72rem; line-height:1.45; margin:0; }
.quick-build-strategies-large { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) 42px; gap:9px; }
.quick-build-strategies-large .strategy-btn { min-height:72px; border-radius:13px; padding:10px 11px; grid-template-columns:22px 1fr; column-gap:7px; }
.quick-build-strategies-large .strategy-btn span { font-size:1rem; }
.quick-build-strategies-large .strategy-btn b { font-size:.78rem; }
.quick-build-strategies-large .strategy-btn small { font-size:.62rem; line-height:1.2; }
.quick-build-strategies-large .strategy-settings { border-radius:12px; font-size:1rem; }
.planner-batch-card { padding:14px 15px; }
.planner-batch-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.planner-batch-head h3 { color:#fff; font-size:.9rem; margin:4px 0 0; }
.planner-batch-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.planner-batch-column { display:flex; flex-direction:column; gap:6px; }
.planner-batch-card .mass-column-label { font-size:.58rem; }
.planner-batch-card .mass-btn { min-height:34px; border-radius:9px; font-size:.68rem; }

/* Main selection board */
.chief-container {
    height:930px; border-radius:36px;
    background:radial-gradient(circle at 50% 34%, rgba(244,240,255,.97), rgba(188,169,230,.96) 57%, rgba(104,82,165,.96) 100%);
    box-shadow:0 32px 76px rgba(0,0,0,.44), inset 0 0 48px rgba(255,255,255,.38);
}
.selection-board-heading {
    position:absolute; top:28px; left:50%; transform:translateX(-50%); z-index:23; width:420px; max-width:40%;
    text-align:center; border:1px solid rgba(124,58,237,.22); background:rgba(255,255,255,.42); border-radius:18px;
    padding:11px 16px; box-shadow:0 10px 26px rgba(68,43,112,.13); backdrop-filter:blur(8px); box-sizing:border-box;
}
.selection-board-heading b { display:block; color:#2e1d59; font-size:1rem; margin-top:3px; }
.selection-board-heading small { display:block; color:#6f6290; font-size:.66rem; margin-top:3px; line-height:1.3; }
.selection-board-heading .command-eyebrow { color:#7c3aed; }

.gear-slot-pair { gap:9px; }
.gear-box { width:104px; height:104px; border-radius:18px; border-width:2px; }
.gear-tier-badge { top:5px; left:6px; font-size:.9rem; }
.gear-star-icon { width:17px; height:17px; }
.gear-stars-container { left:6px; bottom:6px; }
.gear-extra-bar { bottom:-19px; padding:3px; }
.gear-bar-seg { width:18px; height:10px; }
.gear-adj-btn { width:28px; height:28px; font-size:.76rem; border-radius:6px; }
.gear-adj-controls { gap:5px; }
.gear-arrow { width:60px; height:34px; margin:0 7px; }
.gear-arrow svg { width:56px !important; height:32px !important; }

.slot-top-left { top:112px; left:64px; }
.slot-top-right { top:112px; right:64px; }
.slot-mid-left { top:382px; left:38px; }
.slot-mid-right { top:382px; right:38px; }
.slot-bot-left { top:652px; left:64px; }
.slot-bot-right { top:652px; right:64px; }

.slot-subpanel { width:300px; padding:10px 12px; border-radius:15px; gap:5px; }
.subpanel-0 { top:232px; left:78px; }
.subpanel-1 { top:232px; right:78px; }
.subpanel-2 { top:502px; left:50px; }
.subpanel-3 { top:502px; right:50px; }
.subpanel-4 { top:772px; left:78px; }
.subpanel-5 { top:772px; right:78px; }
.subpanel-col-group { gap:10px; }
.subpanel-half { gap:4px; }
.slot-change-item { font-size:.82rem; }
.slot-change-left { gap:6px; }
.menu-icon-img { width:17px; height:17px; }

.grand-totals-panel { top:53%; width:260px; padding:15px 18px; border-radius:20px; gap:9px; }
.grand-totals-tabs { padding:3px; border-radius:10px; }
.totals-tab-btn { font-size:.88rem; padding:5px; }
.grand-total-item { font-size:.94rem; }
.grand-total-left { gap:9px; }
.grand-total-item .res-icon-img { width:34px; height:34px; }
#conversion-mode-btn { font-size:.82rem !important; padding:8px !important; border-radius:10px !important; }

/* Larger total-gains section */
.bottom-summary-container {
    display:grid; grid-template-columns:250px 1fr 1fr; gap:24px; align-items:center;
    padding:24px 28px; border-radius:26px; min-height:160px;
}
.bottom-summary-heading { align-self:stretch; display:flex; flex-direction:column; justify-content:center; padding-right:22px; border-right:1px solid rgba(196,181,253,.22); }
.bottom-summary-heading h2 { color:#fff; font-size:1.18rem; margin:5px 0 7px; }
.bottom-summary-heading p { color:#9ca3b8; font-size:.72rem; line-height:1.45; margin:0; }
.bottom-summary-group { gap:11px; }
.bottom-summary-item { font-size:1rem; gap:10px; }
.bottom-summary-item .res-icon-img { width:34px; height:34px; }

/* Chief Gear modals must sit above the shared fixed OmniWOS topbar. The topbar uses
   a deliberately very high stacking level; keeping legacy tool modals at z-index:1000
   makes their close/actions unclickable on narrow screens where the dialog reaches the
   header area. */
.gear-modal-overlay{z-index:2147483000!important}

/* Larger selection modals to match the expanded page scale */
.gear-modal-content { width:760px; max-width:calc(100vw - 40px); }
.gear-modal-grid { grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:15px; padding:24px; }
.gear-modal-item { width:92px; height:92px; border-radius:13px; }

/* Fixed middle-right tools rail */
.page-side-rail {
    position:fixed; right:20px; top:50%; transform:translateY(-50%); z-index:1050; width:176px;
    display:flex; flex-direction:column; gap:12px; pointer-events:none;
}
.page-side-rail > * { pointer-events:auto; }
.theme-rail-toggle {
    width:100%; border:1px solid rgba(196,181,253,.42); border-radius:16px; padding:10px 11px;
    background:linear-gradient(145deg, rgba(15,18,47,.96), rgba(39,29,82,.95)); color:#fff; cursor:pointer;
    display:flex; align-items:center; gap:10px; box-shadow:0 15px 34px rgba(0,0,0,.4); transition:.18s ease;
}
.theme-rail-toggle:hover { transform:translateX(-2px); border-color:#f5c451; }
.theme-rail-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:rgba(124,58,237,.3); font-size:1rem; }
.theme-rail-copy { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.theme-rail-copy b { font-size:.74rem; }
.theme-rail-copy small { color:#9ca3b8; font-size:.56rem; }
.page-side-rail .prep-score-widget { position:static !important; width:176px; opacity:1; transform:none !important; }
.page-side-rail .prep-main-img { height:92px; border-radius:14px; }
.page-side-rail .prep-bar { padding:20px 9px 8px; border-radius:14px; }
.page-side-rail .prep-score-top-box { top:-11px; }
.page-side-rail .prep-score-label { font-size:.56rem; white-space:nowrap; }
.page-side-rail .prep-score-value { font-size:1.08rem; }
.page-side-rail .valeria-box { padding:4px 5px; }
.page-side-rail .valeria-text { font-size:.61rem; }

/* Light theme */
body.light-theme .bg-overlay { background:rgba(246,247,252,.62) !important; }
body.light-theme .chief-hero-shell {
    background:radial-gradient(circle at 85% 0%, rgba(139,92,246,.12), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.95), rgba(242,238,255,.94));
    border-color:rgba(109,40,217,.18); box-shadow:0 25px 60px rgba(76,59,120,.22), inset 0 1px 0 #fff;
}
body.light-theme .chief-back-pill { background:rgba(255,255,255,.78); color:#3c2a67; border-color:rgba(109,40,217,.2); }
body.light-theme .chief-hero-lead { color:#5d5870; }
body.light-theme .chief-feature-card { background:rgba(255,255,255,.62); border-color:rgba(109,40,217,.14); }
body.light-theme .chief-feature-card b { color:#31204f; }
body.light-theme .chief-feature-card small { color:#6f6a7c; }
body.light-theme .stock-container,
body.light-theme .planner-workbench,
body.light-theme .bottom-summary-container {
    background:linear-gradient(145deg, rgba(255,255,255,.96), rgba(240,236,252,.95));
    border-color:rgba(109,40,217,.18); box-shadow:0 18px 44px rgba(78,61,120,.2), inset 0 1px 0 #fff;
}
body.light-theme .stock-title,
body.light-theme .planner-workbench-heading h2,
body.light-theme .planner-batch-head h3,
body.light-theme .bottom-summary-heading h2 { color:#2d1d4d; }
body.light-theme .stock-subtitle,
body.light-theme .planner-workbench-heading p,
body.light-theme .bottom-summary-heading p { color:#716b7d; }
body.light-theme .stock-item,
body.light-theme .planner-workbench-main,
body.light-theme .planner-batch-card { background:rgba(255,255,255,.68); border-color:rgba(109,40,217,.16); }
body.light-theme .stock-item input { background:#fff; color:#2d1d4d; border-color:rgba(109,40,217,.28); }
body.light-theme .slot-subpanel,
body.light-theme .grand-totals-panel {
    background:linear-gradient(145deg, rgba(255,255,255,.95), rgba(238,232,252,.95)); border-color:rgba(109,40,217,.24); box-shadow:0 12px 28px rgba(76,59,120,.18);
}
body.light-theme .slot-change-item,
body.light-theme .grand-total-item { color:#6d4b00; text-shadow:none; }
body.light-theme .slot-change-left span { color:#493b62; }
body.light-theme .grand-totals-tabs { background:rgba(237,233,248,.9); border-color:rgba(109,40,217,.25); }
body.light-theme .totals-tab-btn { color:#6d28d9; }
body.light-theme .bottom-summary-item { color:#423653; text-shadow:none; }
body.light-theme .bottom-summary-item span { color:#7c3aed; }
body.light-theme .bottom-summary-heading { border-right-color:rgba(109,40,217,.14); }
body.light-theme .strategy-btn { background:rgba(246,243,255,.95); color:#3e2c5f; border-color:rgba(109,40,217,.18); }
body.light-theme .strategy-btn small { color:#746d82; }
body.light-theme .strategy-primary { background:linear-gradient(135deg, rgba(124,58,237,.18), rgba(167,139,250,.22)); border-color:rgba(109,40,217,.28); }
body.light-theme .strategy-settings { background:#f5f2fb; color:#4c3670; }
body.light-theme .mass-btn { background:rgba(124,58,237,.12); color:#4b3470; }
body.light-theme .mass-btn-ghost { background:rgba(234,229,246,.7); color:#655f70; }
body.light-theme .theme-rail-toggle { background:linear-gradient(145deg, rgba(255,255,255,.98), rgba(239,234,250,.97)); color:#32204f; border-color:rgba(109,40,217,.2); box-shadow:0 14px 32px rgba(76,59,120,.2); }
body.light-theme .theme-rail-copy small { color:#777080; }
body.light-theme .theme-rail-icon { background:rgba(124,58,237,.12); }
body.light-theme .page-side-rail .prep-bar { background:rgba(255,250,235,.97); box-shadow:0 14px 30px rgba(120,82,10,.18); }
body.light-theme .page-side-rail .prep-score-top-box { background:#fff8df; }
body.light-theme .page-side-rail .prep-score-label { color:#8a5b00; }
body.light-theme .page-side-rail .prep-score-value { color:#7a4a00; text-shadow:none; }
body.light-theme .page-side-rail .valeria-box { background:rgba(255,246,213,.9); }
body.light-theme .page-side-rail .valeria-text { color:#6f4a00; }
body.light-theme .page-side-rail .valeria-select-row select { background:#fff; color:#6f4a00; }
body.light-theme .gear-modal-overlay { background:rgba(237,233,248,.76); }
body.light-theme .gear-modal-content { background:linear-gradient(145deg, #fff, #eee9f8); border-color:rgba(109,40,217,.28); }
body.light-theme .gear-modal-header { background:linear-gradient(135deg, #e9e2f8, #ddd3f2); }
body.light-theme .gear-modal-title { color:#2d1d4d; }
body.light-theme .gear-modal-item { background:rgba(255,255,255,.82); border-color:rgba(109,40,217,.25); }
body.light-theme #smart-mode-content { color:#2d1d4d !important; }
body.light-theme #quick-build-settings-modal .gear-modal-content > div:last-child { color:#2d1d4d !important; }
body.light-theme #quick-build-settings-modal [style*="background: rgba(45, 38, 77"] { background:rgba(255,255,255,.72) !important; border-color:rgba(109,40,217,.18) !important; }
body.light-theme #quick-build-settings-modal [style*="color: #fbbf24"] { color:#6d28d9 !important; }
body.light-theme #quick-build-settings-modal [style*="color: #c084fc"] { color:#7c3aed !important; }
body.light-theme #qb-tooltip,
body.light-theme #conversion-mode-tooltip,
body.light-theme .gear-tooltip { background:rgba(255,255,255,.98) !important; color:#2d1d4d !important; border-color:#8b5cf6 !important; box-shadow:0 12px 30px rgba(76,59,120,.22) !important; }
body.light-theme .gear-tooltip-title { color:#7c3aed; border-bottom-color:#d7cdeb; }
body.light-theme .conversion-plan-head,
body.light-theme .conversion-status-card,
body.light-theme .conversion-week { background:rgba(255,255,255,.76); border-color:rgba(109,40,217,.18); }
body.light-theme .conversion-plan-head b,
body.light-theme .conversion-week-title { color:#2d1d4d; }
body.light-theme .conversion-week ul,
body.light-theme .conversion-status-card span { color:#5f5968; }

@media (max-width: 1600px) {
    .hub-container { padding-right:190px; }
    :root { --cg-v2-max: 1240px; }
    .page-side-rail { right:12px; width:158px; }
    .page-side-rail .prep-score-widget { width:158px; }
    .chief-container { height:900px; }
    .slot-top-left,.slot-top-right { top:108px; }
    .slot-mid-left,.slot-mid-right { top:370px; }
    .slot-bot-left,.slot-bot-right { top:632px; }
    .subpanel-0,.subpanel-1 { top:228px; }
    .subpanel-2,.subpanel-3 { top:490px; }
    .subpanel-4,.subpanel-5 { top:752px; }
}
@media (max-width: 1180px) {
    .hub-container { padding:22px 18px 60px; }
    .page-side-rail { right:10px; width:142px; }
    .page-side-rail .prep-score-widget { width:142px; }
    .planner-workbench { grid-template-columns:1fr; }
    .planner-workbench-main { grid-template-columns:1fr; }
    .chief-hero-copy { grid-template-columns:1fr; }
    .chief-feature-grid { grid-template-columns:1fr 1fr; }
    .chief-hero-shell,.stock-container,.planner-workbench,.bottom-summary-container { width:calc(100% - 160px); margin-left:0; }
    .chief-container { min-width:1120px; width:1120px; }
    .gear-hub-wrapper { align-items:flex-start; overflow-x:auto; }
    .bottom-summary-container { grid-template-columns:1fr; }
    .bottom-summary-heading { border-right:0; border-bottom:1px solid rgba(196,181,253,.22); padding:0 0 14px; }
}
@media (max-width: 760px) {
    .page-side-rail { top:auto; bottom:12px; transform:none; width:132px; }
    .page-side-rail .prep-score-widget { display:none; }
    .chief-hero-shell,.stock-container,.planner-workbench,.bottom-summary-container { width:100%; }
    .chief-feature-grid { grid-template-columns:1fr; }
    .stock-item { min-width:46%; }
    .quick-build-strategies-large { grid-template-columns:1fr; }
    .strategy-settings { min-height:38px; }
}

/* ============================================================
   V4 — clearer themes, compact SVS card, modal redesign,
   conversion controls, more breathing room around progress bars.
   ============================================================ */
.chief-premium-title {
    color:#fff !important;
    text-shadow:0 3px 0 rgba(91,33,182,.9), 0 8px 22px rgba(18,8,42,.62), 0 18px 42px rgba(0,0,0,.34) !important;
    letter-spacing:-.035em;
}
/* Batch controls remain crisp in both themes. */
.planner-batch-card .mass-btn {
    min-height:38px; font-weight:850; letter-spacing:.005em;
    background:linear-gradient(135deg,rgba(124,58,237,.5),rgba(91,33,182,.42));
    border-color:rgba(196,181,253,.48); color:#fff;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 5px 12px rgba(0,0,0,.15);
}
.planner-batch-card .mass-btn-ghost { background:rgba(10,14,34,.68); color:#e8e2f6; }
body.light-theme .planner-batch-card .mass-btn {
    background:linear-gradient(135deg,#6d28d9,#7c3aed) !important; color:#fff !important;
    border-color:#5b21b6 !important; box-shadow:0 5px 13px rgba(91,33,182,.2) !important;
}
body.light-theme .planner-batch-card .mass-btn-ghost {
    background:#fff !important; color:#48237b !important; border-color:#b9a7db !important;
    box-shadow:0 4px 11px rgba(72,35,123,.09) !important;
}

/* Extra gap below every gear progress bar. */
.subpanel-0 { top:248px !important; }
.subpanel-1 { top:248px !important; }
.subpanel-2 { top:518px !important; }
.subpanel-3 { top:518px !important; }
.subpanel-4 { top:788px !important; }
.subpanel-5 { top:788px !important; }

/* Quick-Build selected state: none is permanently selected. */
.strategy-btn { position:relative; }
.strategy-btn.strategy-last-run {
    background:linear-gradient(135deg,rgba(124,58,237,.76),rgba(91,33,182,.64)) !important;
    color:#fff !important; border-color:#f5c451 !important;
    box-shadow:0 0 0 2px rgba(245,196,81,.12),0 8px 20px rgba(0,0,0,.18) !important;
}
.strategy-btn.strategy-last-run small { color:#e9ddff !important; }
body.light-theme .strategy-btn { background:#fff !important; color:#392557 !important; border-color:#cfc2e4 !important; }
body.light-theme .strategy-btn small { color:#71687d !important; }
body.light-theme .strategy-btn.strategy-last-run {
    background:linear-gradient(135deg,#6d28d9,#7c3aed) !important; color:#fff !important; border-color:#d4a72c !important;
}
body.light-theme .strategy-btn.strategy-last-run small { color:#eee8ff !important; }

/* Compact exchange controls under Quick-Build presets. */
.planner-workbench-main { grid-template-rows:auto auto; }
.qb-exchange-strip {
    grid-column:2; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px;
    min-height:42px; padding:7px 9px 7px 12px; border-radius:12px;
    border:1px solid rgba(167,139,250,.22); background:rgba(5,8,24,.34);
}
.qb-exchange-copy { display:flex; align-items:center; gap:9px; min-width:0; }
.qb-exchange-copy>div { min-width:0; display:flex; flex-direction:column; gap:1px; }
.qb-exchange-copy b { color:#f8fafc; font-size:.7rem; }
.qb-exchange-copy small { color:#9da5b8; font-size:.56rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qb-exchange-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.12); flex:none; }
.qb-exchange-dot.off { background:#94a3b8; box-shadow:0 0 0 4px rgba(148,163,184,.12); }
.qb-route-btn { border:1px solid rgba(167,139,250,.3); border-radius:9px; background:rgba(124,58,237,.18); color:#ddd6fe; padding:7px 10px; font-size:.61rem; font-weight:800; cursor:pointer; }
.qb-route-btn strong { color:#f5c451; margin-left:4px; }
.qb-route-btn:hover { border-color:#f5c451; }
body.light-theme .qb-exchange-strip { background:rgba(255,255,255,.72); border-color:#d9ccef; }
body.light-theme .qb-exchange-copy b { color:#32204d; }
body.light-theme .qb-exchange-copy small { color:#6f6878; }
body.light-theme .qb-route-btn { background:#f1ecfb; color:#51268b; border-color:#c9b9e3; }
body.light-theme .qb-route-btn strong { color:#8a5a00; }

.cg-mini-switch { position:relative; display:inline-flex; width:38px; height:22px; flex:none; }
.cg-mini-switch input { position:absolute; opacity:0; pointer-events:none; }
.cg-mini-switch>span { width:100%; height:100%; border-radius:99px; background:#475569; border:1px solid rgba(255,255,255,.14); cursor:pointer; transition:.18s; box-sizing:border-box; }
.cg-mini-switch>span:after { content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(0,0,0,.3); transition:.18s; }
.cg-mini-switch input:checked + span { background:#7c3aed; border-color:#a78bfa; }
.cg-mini-switch input:checked + span:after { transform:translateX(16px); }

/* Compact bottom SVS result instead of a tall stacked widget. */
.bottom-summary-container { grid-template-columns:235px minmax(260px,1fr) minmax(260px,1fr) 305px !important; min-height:150px !important; align-items:center !important; }
.bottom-prep-card { align-self:center !important; padding-left:18px !important; min-height:0 !important; }
.prep-compact-card {
    width:100%; min-height:106px; display:grid; grid-template-columns:112px minmax(0,1fr); gap:12px; align-items:center;
    border:1px solid rgba(245,196,81,.6); border-radius:17px; padding:10px;
    background:linear-gradient(145deg,rgba(69,45,12,.48),rgba(25,19,42,.72)); box-shadow:0 12px 26px rgba(0,0,0,.22); box-sizing:border-box;
}
.prep-compact-img { width:112px; height:78px; object-fit:cover; border-radius:12px; border:1px solid rgba(245,196,81,.75); }
.prep-compact-main { min-width:0; display:flex; flex-direction:column; gap:4px; }
.prep-compact-label { color:#f8d676; font-size:.56rem; font-weight:900; letter-spacing:.08em; }
.prep-compact-score { color:#fff3c4; font-size:1.34rem; line-height:1.05; text-shadow:0 3px 10px rgba(0,0,0,.45); }
.prep-compact-valeria { display:grid; grid-template-columns:24px 1fr 48px; gap:6px; align-items:center; margin-top:5px; padding-top:6px; border-top:1px solid rgba(245,196,81,.22); }
.prep-compact-valeria .valeria-tiny-img { width:24px; height:24px; }
.prep-compact-valeria span { color:#e8d7aa; font-size:.62rem; font-weight:800; }
.prep-compact-valeria select { width:48px; height:26px; border-radius:7px; background:rgba(15,23,42,.84); border:1px solid rgba(245,196,81,.6); color:#fff; font-weight:800; text-align:center; }
body.light-theme .prep-compact-card { background:linear-gradient(145deg,#fffaf0,#fff3cc); border-color:#d9a623; box-shadow:0 10px 24px rgba(122,83,10,.12); }
body.light-theme .prep-compact-label { color:#805000; }
body.light-theme .prep-compact-score { color:#5d3b00; text-shadow:0 2px 0 #fff; }
body.light-theme .prep-compact-valeria { border-top-color:#e7cd80; }
body.light-theme .prep-compact-valeria span { color:#704a00; }
body.light-theme .prep-compact-valeria select { background:#fff; color:#5b3b00; border-color:#d7ae45; }

/* Shared modal design */
.cg-smart-modal { width:900px !important; max-width:calc(100vw - 42px) !important; }
.cg-qb-settings-modal { width:820px !important; }
.cg-conversion-settings-modal { width:720px !important; }
.modal-kicker { display:block; color:#f5c451; font-size:.58rem; font-weight:900; letter-spacing:.12em; margin-bottom:4px; }
.cg-modal-body { padding:18px 20px 20px; color:#eef2ff; max-height:72vh; overflow-y:auto; }
.qb-settings-body { display:flex; flex-direction:column; gap:13px; }
.qb-settings-section { border:1px solid rgba(167,139,250,.25); border-radius:15px; padding:14px; background:rgba(15,18,43,.55); }
.qb-settings-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.qb-settings-section-head>div { display:flex; flex-direction:column; gap:2px; }
.qb-settings-section-head b { color:#fff; font-size:.84rem; }
.qb-settings-section-head span { color:#9ca3b8; font-size:.62rem; }
.qb-section-chip { border:1px solid rgba(245,196,81,.35); border-radius:99px; padding:5px 8px; color:#f5d77c !important; background:rgba(245,196,81,.08); font-size:.52rem !important; font-weight:900; letter-spacing:.05em; }
.qb-troop-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.qb-troop-card { display:grid; grid-template-columns:20px 1fr; gap:9px; align-items:center; border:1px solid rgba(167,139,250,.24); border-radius:11px; padding:10px; background:rgba(7,10,26,.38); cursor:pointer; }
.qb-troop-card input { width:17px; height:17px; accent-color:#7c3aed; }
.qb-troop-card span { display:flex; flex-direction:column; gap:1px; }
.qb-troop-card b { color:#f8fafc; font-size:.74rem; }
.qb-troop-card small { color:#939bae; font-size:.57rem; }
.qb-priority-help { color:#9ca3b8; font-size:.62rem; line-height:1.45; margin:-1px 0 9px; }
.qb-priority-rows { display:flex; flex-direction:column; gap:8px; }
.qb-priority-row { display:grid; grid-template-columns:120px 150px minmax(0,1fr); gap:12px; align-items:center; min-height:54px; padding:8px 10px; border:1px solid rgba(167,139,250,.21); border-radius:11px; background:rgba(7,10,26,.34); }
.qb-priority-rank { display:flex; align-items:center; gap:8px; }
.qb-priority-rank i { width:22px; height:22px; border-radius:7px; display:grid; place-items:center; background:rgba(124,58,237,.25); color:#d8c7ff; font-size:.58rem; font-style:normal; font-weight:900; }
.qb-priority-rank b { color:#f4f0ff; font-size:.7rem; }
.qb-priority-row select, .qb-offset-control input { height:31px; border-radius:8px; background:#10162f; border:1px solid #6d4bb3; color:#fff; padding:0 9px; font-weight:800; font-size:.7rem; outline:none; box-sizing:border-box; }
.qb-priority-rule { display:flex; justify-content:flex-end; align-items:center; gap:8px; color:#9ba3b5; font-size:.6rem; text-align:right; }
.qb-offset-control { display:flex; align-items:center; gap:4px; }
.qb-offset-control .stock-adj-btn { width:29px; height:29px; }
.qb-offset-control input { width:50px; text-align:center; padding:0 4px; }
.qb-priority-none { color:#7f889b; font-size:.6rem; text-align:right; }
.qb-exchange-settings-line { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#9ca3b8; font-size:.62rem; }
.qb-inline-link { border:0; background:transparent; color:#c4b5fd; font-size:.62rem; font-weight:850; cursor:pointer; padding:4px 0; }
.qb-inline-link:hover { color:#f5c451; }
.cg-modal-actions { display:flex; align-items:center; gap:8px; justify-content:flex-end; padding-top:2px; }
.cg-action-spacer { flex:1; }
.cg-btn-primary,.cg-btn-secondary { min-height:36px; border-radius:9px; padding:7px 13px; font-size:.68rem; font-weight:850; cursor:pointer; }
.cg-btn-primary { border:1px solid #d8ac32; background:linear-gradient(135deg,#6d28d9,#8b5cf6); color:#fff; box-shadow:0 6px 14px rgba(64,25,121,.24); }
.cg-btn-secondary { border:1px solid rgba(167,139,250,.28); background:rgba(15,23,42,.58); color:#ddd6fe; }

/* Conversion route settings */
.conversion-master-row { display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid rgba(167,139,250,.26); border-radius:13px; padding:12px 14px; background:rgba(15,18,43,.55); }
.conversion-master-row>div { display:flex; flex-direction:column; gap:2px; }
.conversion-master-row b { color:#fff; font-size:.82rem; }
.conversion-master-row span { color:#9ca3b8; font-size:.61rem; }
.conversion-rules-intro { color:#9ca3b8; font-size:.62rem; margin:12px 1px 8px; }
.conversion-rules-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px; }
.conversion-rule-card { display:grid; grid-template-columns:18px 1fr; gap:9px; align-items:start; border:1px solid rgba(167,139,250,.2); border-radius:11px; padding:10px; background:rgba(7,10,26,.36); cursor:pointer; }
.conversion-rule-card input { width:16px; height:16px; accent-color:#7c3aed; margin-top:2px; }
.conversion-rule-card b { display:block; color:#f5f3ff; font-size:.67rem; line-height:1.3; }
.conversion-rule-card small { display:block; color:#8f98aa; font-size:.55rem; margin-top:3px; }
.conversion-rule-card.disabled-by-master { opacity:.48; }

/* Smart conversion plan */
.conversion-plan-summary { display:grid; grid-template-columns:1.2fr .8fr .8fr; gap:8px; margin-bottom:12px; }
.conversion-summary-card { border:1px solid rgba(167,139,250,.24); border-radius:12px; padding:11px 12px; background:rgba(15,18,43,.56); }
.conversion-summary-card span { display:block; color:#929bad; font-size:.54rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.conversion-summary-card b { display:block; color:#fff; font-size:.8rem; margin-top:4px; }
.conversion-plan-message { border:1px solid rgba(167,139,250,.22); border-radius:12px; padding:12px 13px; background:rgba(7,10,26,.35); color:#cbd5e1; font-size:.68rem; line-height:1.5; margin-bottom:10px; }
.conversion-plan-message.error { border-color:rgba(248,113,113,.34); color:#fecaca; }
.conversion-plan-message.off { border-color:rgba(148,163,184,.3); color:#cbd5e1; }
.conversion-timeline { display:flex; flex-direction:column; gap:9px; }
.conversion-week-v4 { display:grid; grid-template-columns:92px minmax(0,1fr); gap:13px; border:1px solid rgba(167,139,250,.18); border-radius:13px; padding:11px 13px; background:rgba(7,10,26,.3); }
.conversion-week-v4-head { display:flex; flex-direction:column; gap:3px; padding-top:2px; }
.conversion-week-v4-head b { color:#f5f3ff; font-size:.72rem; }
.conversion-week-v4-head span { color:#8d96a8; font-size:.55rem; line-height:1.25; }
.conversion-week-v4-body { color:#cbd5e1; font-size:.64rem; line-height:1.45; display:flex; flex-direction:column; gap:6px; min-width:0; }
.conversion-op-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; min-height:34px; padding:6px 8px 6px 10px; border-radius:9px; background:rgba(124,58,237,.11); border:1px solid rgba(167,139,250,.18); }
.conversion-op-name { color:#e9e3ff; font-weight:750; overflow-wrap:anywhere; }
.conversion-op-count { min-width:54px; padding:5px 8px; border-radius:8px; text-align:center; background:rgba(245,196,81,.13); border:1px solid rgba(245,196,81,.3); color:#f8d77c; font-weight:900; letter-spacing:.02em; }
.conversion-unlock-event { display:grid; grid-template-columns:auto minmax(0,1fr); gap:9px; align-items:center; padding:7px 9px; border-radius:9px; background:rgba(245,196,81,.09); border:1px solid rgba(245,196,81,.23); }
.conversion-unlock-badge { padding:4px 7px; border-radius:7px; background:rgba(245,196,81,.16); color:#f8d77c; font-size:.52rem; font-weight:950; letter-spacing:.08em; }
.conversion-unlock-event b { color:#f6e6b4; font-size:.62rem; }
.conversion-no-op { color:#7f899d; font-style:italic; padding:5px 1px; }

/* Light modal theme */
body.light-theme .gear-modal-content { background:linear-gradient(145deg,#fff,#f7f3ff) !important; border-color:#d4c6e8 !important; }
body.light-theme .gear-modal-header { background:rgba(246,241,255,.96) !important; border-bottom-color:#ded3ef !important; }
body.light-theme .gear-modal-title { color:#31204a !important; }
body.light-theme .modal-kicker { color:#855400; }
body.light-theme .gear-modal-close { color:#6d28d9 !important; }
body.light-theme .cg-modal-body { color:#35274c; }
body.light-theme .qb-settings-section, body.light-theme .conversion-master-row, body.light-theme .conversion-summary-card { background:#fff !important; border-color:#ddd1ee !important; }
body.light-theme .qb-settings-section-head b, body.light-theme .conversion-master-row b, body.light-theme .conversion-summary-card b { color:#32204d !important; }
body.light-theme .qb-settings-section-head span, body.light-theme .conversion-master-row span, body.light-theme .qb-priority-help, body.light-theme .conversion-rules-intro { color:#6c6575 !important; }
body.light-theme .qb-troop-card, body.light-theme .qb-priority-row, body.light-theme .conversion-rule-card, body.light-theme .conversion-plan-message, body.light-theme .conversion-week-v4 { background:#faf8fe !important; border-color:#ddd2eb !important; }
body.light-theme .qb-troop-card b, body.light-theme .qb-priority-rank b, body.light-theme .conversion-rule-card b, body.light-theme .conversion-week-v4-head b { color:#36234f !important; }
body.light-theme .qb-troop-card small, body.light-theme .qb-priority-rule, body.light-theme .qb-priority-none, body.light-theme .conversion-rule-card small, body.light-theme .conversion-week-v4-head span, body.light-theme .conversion-week-v4-body { color:#716a79 !important; }
body.light-theme .qb-priority-row select, body.light-theme .qb-offset-control input { background:#fff !important; color:#35234f !important; border-color:#bba9d6 !important; }
body.light-theme .qb-priority-rank i { background:#eee8fb; color:#5b21b6; }
body.light-theme .qb-inline-link { color:#5b21b6; }
body.light-theme .cg-btn-secondary { background:#fff; color:#4c2877; border-color:#cdbde3; }
body.light-theme .conversion-op-row { background:#f5f0fc; border-color:#ddd0ed; }
body.light-theme .conversion-op-name { color:#452a68; }
body.light-theme .conversion-op-count { background:#fff6da; border-color:#e0c66f; color:#704a00; }
body.light-theme .conversion-unlock-event { background:#fff8e7; border-color:#e4c871; }
body.light-theme .conversion-unlock-badge { background:#f6e6aa; color:#6d4700; }
body.light-theme .conversion-unlock-event b { color:#5e4209; }
body.light-theme .conversion-no-op { color:#7a7280; }
body.light-theme .conversion-plan-message.error { background:#fff8f8 !important; color:#9f2f2f !important; border-color:#e8b2b2 !important; }

@media (max-width:1450px) {
    .bottom-summary-container { grid-template-columns:215px 1fr 1fr 285px !important; gap:16px !important; }
    .prep-compact-card { grid-template-columns:96px 1fr; }
    .prep-compact-img { width:96px; height:72px; }
}
@media (max-width:1180px) {
    .bottom-summary-container { grid-template-columns:1fr 1fr !important; }
    .bottom-prep-card { grid-column:1/-1; border-left:none !important; border-top:1px solid rgba(196,181,253,.22); padding:14px 0 0 !important; }
    .prep-compact-card { max-width:430px; margin:auto; }
}
@media (max-width:900px) {
    .qb-troop-grid,.conversion-rules-list { grid-template-columns:1fr; }
    .qb-priority-row { grid-template-columns:1fr 1fr; }
    .qb-priority-rule { grid-column:1/-1; justify-content:flex-start; text-align:left; }
}

/* Light mode: keep the Chief Gear hero shell visually consistent with the panels below it.
   Only the main title adopts the clean Chief Charms light-mode typography. */
body.light-theme .chief-hero-shell {
    background:linear-gradient(145deg, rgba(255,255,255,.96), rgba(240,236,252,.95)) !important;
    border-color:rgba(109,40,217,.18) !important;
    box-shadow:0 18px 44px rgba(78,61,120,.20), inset 0 1px 0 #fff !important;
}
body.light-theme .chief-back-pill {
    background:rgba(255,255,255,.78) !important;
    color:#3c2a67 !important;
    border-color:rgba(109,40,217,.20) !important;
}
body.light-theme #chief-gear-title.chief-premium-title {
    margin:10px 0 10px !important;
    color:#153f5b !important;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
    font-size:clamp(3rem,4.5vw,4.8rem) !important;
    line-height:.92 !important;
    letter-spacing:-.055em !important;
    text-transform:uppercase !important;
    font-weight:1000 !important;
    background:none !important;
    -webkit-background-clip:border-box !important;
    background-clip:border-box !important;
    -webkit-text-fill-color:#153f5b !important;
    -webkit-text-stroke:0 transparent !important;
    text-shadow:none !important;
    filter:none !important;
    -webkit-filter:none !important;
    box-shadow:none !important;
    mix-blend-mode:normal !important;
    opacity:1 !important;
}
body.light-theme #chief-gear-title.chief-premium-title::before,
body.light-theme #chief-gear-title.chief-premium-title::after {
    content:none !important;
    text-shadow:none !important;
    filter:none !important;
    -webkit-filter:none !important;
    box-shadow:none !important;
}
body.light-theme .chief-hero-lead { color:#5d5870 !important; }
body.light-theme .chief-feature-card {
    background:rgba(255,255,255,.62) !important;
    border-color:rgba(109,40,217,.14) !important;
}
body.light-theme .chief-feature-card b { color:#31204f !important; }
body.light-theme .chief-feature-card small { color:#6f6a7c !important; }

/* Phase 3 tooltip shell: template presentation belongs to the feature stylesheet. */
.phase3-floating-tooltip{position:fixed;background:rgba(5,25,39,.97);border:1px solid rgba(118,213,239,.34);border-radius:2px;padding:12px 16px;color:#eafaff;font-size:.8rem;pointer-events:none;z-index:10000;display:none;box-shadow:0 18px 38px rgba(0,0,0,.48);backdrop-filter:blur(8px)}
.phase3-floating-tooltip.qb-tooltip-base{max-width:340px;line-height:1.45}.phase3-floating-tooltip.conversion-tooltip-base{max-width:320px;line-height:1.4}
body.light-theme .phase3-floating-tooltip{background:rgba(249,253,255,.98);color:#17394e;border-color:rgba(61,151,179,.30);box-shadow:0 12px 30px rgba(21,79,100,.18)}
