:root{
    --bg:#071019;
    --panel:#0b1a27ee;
    --panel-2:#081520;
    --line:#29465b;
    --line-soft:#213849;
    --text:#edf7ff;
    --muted:#8ba4b7;
    --orange:#ff7a2e;
    --red:#e64132;
    --gold:#f7b731;
    --gold-2:#ffd96a;
    --cyan:#69d8ff;
    --green:#41d68a;
    --danger:#ff6f7f;
    --shadow:0 22px 60px rgba(0,0,0,.42);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
    margin:0;
    min-height:100vh;
    color:var(--text);
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    background:#071019;
    overflow-x:hidden;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-3;
    background:
        linear-gradient(90deg,rgba(4,10,15,.94),rgba(4,11,17,.70) 52%,rgba(4,11,17,.86)),
        url("/static/image/fire-crystal-photo.webp") center/cover no-repeat;
}

body::after{
    content:"";
    position:fixed;
    inset:0;
    z-index:-2;
    pointer-events:none;
    background:
        radial-gradient(circle at 17% 16%,rgba(231,76,32,.20),transparent 28%),
        radial-gradient(circle at 80% 18%,rgba(255,162,62,.12),transparent 25%),
        linear-gradient(180deg,transparent 0 45%,rgba(3,9,14,.62));
}

button,input,select{font:inherit}
button{touch-action:manipulation}

/* No numeric spinners anywhere on this page. */
input[type="number"]{
    -moz-appearance:textfield;
    appearance:textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
    -webkit-appearance:none;
    margin:0;
}

.page{
    width:min(1480px,calc(100% - 26px));
    margin:auto;
    padding:74px 0 60px;
}

.top-nav{
    position:absolute;
    left:50%;
    top:18px;
    transform:translateX(-50%);
    display:flex;
    gap:9px;
    z-index:20;
}

.nav-pill{
    color:#eef8ff;
    text-decoration:none;
    background:#081723e8;
    border:1px solid #395970;
    border-radius:999px;
    padding:9px 15px;
    font-weight:850;
    font-size:.78rem;
    box-shadow:0 8px 24px rgba(0,0,0,.34);
    backdrop-filter:blur(10px);
    transition:.17s;
}
.nav-pill:hover{
    transform:translateY(-1px);
    border-color:#e7a33a;
    box-shadow:0 0 22px rgba(247,183,49,.16);
}

.hero{
    position:relative;
    overflow:hidden;
    min-height:248px;
    border:1px solid #47505a;
    border-radius:25px;
    background:
        linear-gradient(93deg,rgba(6,14,20,.97) 0%,rgba(9,21,30,.88) 54%,rgba(30,12,8,.55) 100%);
    box-shadow:var(--shadow);
    padding:34px 38px;
    display:flex;
    align-items:flex-end;
}

.hero::before{
    content:"";
    position:absolute;
    right:-3%;
    top:-27%;
    width:46%;
    aspect-ratio:1;
    border-radius:50%;
    background:radial-gradient(circle,rgba(255,106,42,.25),rgba(255,106,42,.07) 42%,transparent 68%);
    filter:blur(4px);
}

.hero-art{
    position:absolute;
    right:4%;
    top:50%;
    transform:translateY(-50%);
    width:min(370px,35vw);
    height:88%;
    object-fit:contain;
    filter:drop-shadow(0 22px 24px rgba(0,0,0,.65));
    opacity:.96;
}

.hero-copy{
    position:relative;
    z-index:2;
    max-width:760px;
    text-shadow:0 2px 13px rgba(0,0,0,.65);
}

.hero-kicker{
    display:inline-flex;
    align-items:center;
    gap:7px;
    border:1px solid rgba(255,141,58,.55);
    background:rgba(105,32,10,.28);
    border-radius:999px;
    color:#ffd4a8;
    padding:6px 10px;
    font-size:.70rem;
    font-weight:950;
    letter-spacing:.08em;
}

.hero h1{
    margin:10px 0 8px;
    font-size:clamp(2.6rem,5vw,4.7rem);
    line-height:.94;
    color:white;
    letter-spacing:-.045em;
}

.hero p{
    margin:0;
    max-width:720px;
    color:#d7e5ee;
    line-height:1.52;
    font-size:.94rem;
    font-weight:580;
}

.workspace{
    display:grid;
    grid-template-columns:minmax(0,1.42fr) minmax(330px,.58fr);
    gap:14px;
    margin-top:15px;
}

.panel{
    border:1px solid var(--line);
    background:linear-gradient(145deg,rgba(8,25,38,.96),rgba(6,17,27,.95));
    border-radius:20px;
    box-shadow:0 18px 45px rgba(0,0,0,.33),inset 0 1px 0 rgba(177,225,255,.045);
    backdrop-filter:blur(14px);
}

.goal-panel{
    padding:18px;
}

.panel-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:15px;
    margin-bottom:14px;
}

.panel-heading h2{
    margin:0;
    font-size:1rem;
}

.panel-heading p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:.70rem;
    line-height:1.4;
}

.active-preset-badge{
    display:none;
    align-items:center;
    gap:7px;
    max-width:310px;
    border:1px solid #7d642a;
    border-radius:11px;
    background:#211c0e;
    color:#ffe092;
    padding:7px 9px;
    font-size:.65rem;
    font-weight:850;
}
.active-preset-badge.show{display:flex}
.active-preset-badge button{
    margin-left:auto;
    border:0;
    background:transparent;
    color:#e4c36d;
    cursor:pointer;
    font-weight:950;
}

.input-grid{
    display:grid;
    grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);
    gap:9px;
}

.field-card{
    min-width:0;
    border:1px solid #28465a;
    border-radius:13px;
    background:#071723;
    padding:10px;
}

.field-card label{
    display:block;
    color:#a8bdcb;
    font-size:.65rem;
    font-weight:850;
    margin-bottom:5px;
}

.input-shell{
    display:flex;
    align-items:center;
    gap:6px;
    border:1px solid #365a70;
    background:#06131d;
    border-radius:10px;
    min-height:46px;
    padding:0 10px;
}

.input-shell:focus-within{
    border-color:#ec8d43;
    box-shadow:0 0 0 3px rgba(238,122,44,.10);
}

.input-shell img{
    width:31px;
    height:31px;
    object-fit:contain;
    flex:0 0 auto;
}

.input-shell input{
    min-width:0;
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    color:#fff;
    font-weight:900;
    font-size:1.04rem;
}

.input-shell input[readonly]{
    color:#ffe29a;
    cursor:default;
}

.input-suffix{
    color:#708c9f;
    font-size:.66rem;
    font-weight:850;
}

.help-strip{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:8px;
    align-items:center;
    margin-top:10px;
    border:1px solid #315066;
    border-radius:13px;
    background:linear-gradient(90deg,#0b1d2a,#101c23);
    padding:9px 10px;
}

.help-copy strong{
    display:block;
    font-size:.72rem;
}
.help-copy span{
    display:block;
    margin-top:2px;
    color:#8099aa;
    font-size:.61rem;
}

.inline-link,
.preset-open-btn{
    min-height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    padding:0 12px;
    text-decoration:none;
    font-size:.65rem;
    font-weight:900;
    cursor:pointer;
    white-space:nowrap;
}

.inline-link{
    border:1px solid #39667d;
    background:#0d2634;
    color:#95dcff;
}
.inline-link:hover{border-color:#61bfe9}

.preset-open-btn{
    border:1px solid #b17d25;
    background:linear-gradient(135deg,#513608,#8d5c09);
    color:#ffe7a2;
}
.preset-open-btn:hover{
    border-color:#e5b54d;
    box-shadow:0 0 16px rgba(247,183,49,.15);
}

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

.optimize-note{
    color:#7893a6;
    font-size:.60rem;
    line-height:1.35;
}

.optimize-btn{
    min-width:245px;
    min-height:48px;
    border:1px solid #ff984f;
    border-radius:12px;
    background:linear-gradient(135deg,#f17825,#c83a28);
    color:white;
    font-weight:950;
    letter-spacing:.025em;
    cursor:pointer;
    box-shadow:0 9px 22px rgba(211,65,38,.26),inset 0 1px 0 rgba(255,255,255,.20);
    transition:.17s;
}
.optimize-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 13px 28px rgba(211,65,38,.34),0 0 22px rgba(255,112,46,.13);
}


/* Main page CTA */
.goal-panel .optimize-btn{
    min-width:335px;
    min-height:62px;
    font-size:1.20rem;
    border-radius:14px;
    position:relative;
    isolation:isolate;
    animation:optimizeAura 2.5s ease-in-out infinite;
}
.goal-panel .optimize-btn:hover{
    transform:translateY(-2px) scale(1.012);
}
@keyframes optimizeAura{
    0%,100%{
        box-shadow:
            0 10px 24px rgba(211,65,38,.30),
            0 0 0 1px rgba(255,151,78,.12),
            0 0 18px rgba(255,112,46,.14),
            inset 0 1px 0 rgba(255,255,255,.20);
    }
    50%{
        box-shadow:
            0 14px 32px rgba(211,65,38,.40),
            0 0 0 1px rgba(255,176,102,.20),
            0 0 31px rgba(255,112,46,.26),
            inset 0 1px 0 rgba(255,255,255,.24);
    }
}
body.light-theme .goal-panel .optimize-btn{
    box-shadow:
        0 10px 24px rgba(197,72,32,.22),
        0 0 22px rgba(244,120,45,.18);
}


/* Exact optimizer running state */
.goal-panel .optimize-btn:disabled{
    cursor:wait;
    opacity:.94;
    transform:none!important;
    animation:exactSearchAura 1.15s ease-in-out infinite;
}
@keyframes exactSearchAura{
    0%,100%{
        box-shadow:
            0 10px 24px rgba(211,65,38,.30),
            0 0 18px rgba(255,112,46,.18);
    }
    50%{
        box-shadow:
            0 14px 34px rgba(211,65,38,.44),
            0 0 38px rgba(255,163,65,.42);
    }
}


.preset-only-cost.preset-hidden{
    display:none;
}

/* Operation summary */
.operation-panel{
    padding:15px;
    align-self:start;
    position:sticky;
    top:14px;
}

.operation-panel h2{
    margin:0 0 4px;
    font-size:.95rem;
}

.operation-subtitle{
    color:#7893a6;
    font-size:.62rem;
    margin-bottom:10px;
}

.operation-stack{
    display:grid;
    gap:7px;
}

.cost-tile{
    min-height:65px;
    border:1px solid #28465a;
    border-radius:12px;
    background:#071622;
    display:grid;
    grid-template-columns:43px 1fr;
    gap:8px;
    align-items:center;
    padding:8px 10px;
}

.cost-tile img{
    width:40px;
    height:40px;
    object-fit:contain;
}

.cost-copy span{
    display:block;
    color:#7d98aa;
    font-size:.59rem;
    font-weight:850;
    text-transform:uppercase;
    letter-spacing:.045em;
}
.cost-copy strong{
    display:block;
    margin-top:2px;
    font-size:1.04rem;
}

.cost-tile.total{
    border-color:#806129;
    background:linear-gradient(135deg,#231b0c,#101a20);
}
.cost-tile.total strong{color:#ffe084}

.confidence-chip{
    margin-top:8px;
    border:1px solid #2b6651;
    border-radius:10px;
    background:#0c2a20;
    color:#8debbf;
    padding:8px 10px;
    text-align:center;
    font-size:.65rem;
    font-weight:900;
}


/* ================================================================
   Three-plan comparison tabs
   ================================================================ */
.plan-tabs{
    display:flex;
    align-items:stretch;
    gap:8px;
    margin-bottom:10px;
    padding:5px;
    border:1px solid #31495a;
    border-radius:14px;
    background:#07131c;
}
.plan-tab{
    flex:1;
    min-width:0;
    border:1px solid transparent;
    border-radius:10px;
    background:transparent;
    color:#8fa6b6;
    padding:9px 11px;
    cursor:pointer;
    text-align:center;
    transition:.16s;
}
.plan-tab strong{
    display:block;
    font-size:.82rem;
    font-weight:950;
}
.plan-tab small{
    display:block;
    margin-top:2px;
    font-size:.60rem;
    line-height:1.25;
    color:#6f8797;
}
.plan-tab:hover{
    background:#0d202c;
    color:#dceaf2;
}
.plan-tab.active{
    border-color:#c59432;
    background:linear-gradient(145deg,#2a210e,#121a1d);
    color:#ffe39a;
    box-shadow:0 0 13px rgba(247,183,49,.12);
}
.plan-tab.active small{color:#c9ad68}
.plan-tab.exact-tab.active{
    border-color:#57a8c9;
    background:linear-gradient(145deg,#0e2734,#101d23);
    color:#9ee8ff;
    box-shadow:0 0 13px rgba(86,215,255,.11);
}
.plan-tab.expected-tab.active{
    border-color:#9b6c62;
    background:linear-gradient(145deg,#281719,#13191e);
    color:#ffc5b9;
}
.plan-tab-panel[hidden]{display:none!important}

.plan-card-description{
    margin:6px 0 0;
    color:#8299a8;
    font-size:.72rem;
    line-height:1.4;
}

/* Resource icons inside plan statistics */
.plan-stat-label{
    min-height:23px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
}
.plan-stat-label img{
    width:21px;
    height:21px;
    object-fit:contain;
    flex:0 0 auto;
}
.plan-stat.refinement-fc-stat{
    border-color:#a96f21;
    background:
        radial-gradient(circle at 50% 0%,rgba(247,183,49,.09),transparent 55%),
        #12190f;
    box-shadow:
        inset 0 1px 0 rgba(255,229,143,.05),
        0 0 15px rgba(247,183,49,.06);
}
.plan-stat.refinement-fc-stat strong{color:#ffd66d}
.plan-stat.refinement-fc-stat span{color:#c6a75d}

/* Slight emphasis in the right-side operation box as well */
.cost-tile.refinement-cost-tile{
    border-color:#8f6829;
    background:
        radial-gradient(circle at 22% 0%,rgba(247,183,49,.08),transparent 46%),
        #0b191d;
}

/* Light theme */
body.light-theme .plan-tabs{
    background:#f3f9fc;
    border-color:#aec6d4;
}
body.light-theme .plan-tab{color:#5b7687}
body.light-theme .plan-tab small{color:#7c929f}
body.light-theme .plan-tab:hover{background:#fff}
body.light-theme .plan-tab.active{
    background:#fff4d2;
    border-color:#c89423;
    color:#684900;
}
body.light-theme .plan-tab.active small{color:#876a22}
body.light-theme .plan-tab.exact-tab.active{
    background:#e9f8ff;
    border-color:#57a8c9;
    color:#126a8e;
}
body.light-theme .plan-tab.expected-tab.active{
    background:#fff0ed;
    border-color:#c88c80;
    color:#934235;
}
body.light-theme .plan-card-description{color:#5e7889}
body.light-theme .plan-stat.refinement-fc-stat{
    background:linear-gradient(145deg,#fff8de,#fff);
    border-color:#d2aa4c;
}
body.light-theme .plan-stat.refinement-fc-stat strong{color:#795300}
body.light-theme .plan-stat.refinement-fc-stat span{color:#80661f}
body.light-theme .cost-tile.refinement-cost-tile{
    background:linear-gradient(145deg,#fff9e5,#f8fcff);
    border-color:#d1ad58;
}

@media(max-width:700px){
    .plan-tabs{flex-direction:column}
    .plan-tab{text-align:left}
}

/* Results */
.results{
    margin-top:14px;
    display:grid;
    gap:12px;
}

.results:empty{display:none}

.notice{
    border:1px solid #64424a;
    border-radius:18px;
    background:linear-gradient(145deg,#271419,#101922);
    padding:18px;
    box-shadow:0 14px 35px rgba(0,0,0,.28);
}

.notice h3{
    margin:0;
    color:#ffb3bd;
    font-size:1rem;
}
.notice p{
    margin:6px 0 0;
    color:#c7d5de;
    font-size:.73rem;
    line-height:1.5;
}
.notice-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
    margin-top:12px;
}
.notice-stat{
    border:1px solid #4e3940;
    border-radius:10px;
    background:#160f13;
    padding:9px;
    text-align:center;
}
.notice-stat span{display:block;color:#a78389;font-size:.56rem}
.notice-stat strong{display:block;margin-top:3px;color:#f6dfe2;font-size:.88rem}

.recommended-card{
    border:1px solid #845f27;
    border-radius:19px;
    background:
        radial-gradient(circle at 90% 12%,rgba(255,171,61,.10),transparent 26%),
        linear-gradient(145deg,#21180d,#0a1822 62%);
    box-shadow:0 18px 45px rgba(0,0,0,.30),0 0 0 1px rgba(247,183,49,.035);
    padding:16px;
}

.recommended-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.recommended-title span{
    display:block;
    color:#caa65f;
    font-size:.58rem;
    font-weight:950;
    letter-spacing:.08em;
}
.recommended-title h3{
    margin:3px 0 0;
    font-size:1.02rem;
    color:#fff1c4;
}

.success-badge{
    border:1px solid #34785f;
    border-radius:999px;
    background:#0b2c21;
    color:#8df0c1;
    padding:7px 10px;
    font-size:.68rem;
    font-weight:950;
    white-space:nowrap;
}

.plan-stats{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:7px;
    margin-top:11px;
}

.plan-stat{
    border:1px solid #3a443c;
    border-radius:10px;
    background:#0d181b;
    padding:8px;
    text-align:center;
}
.plan-stat span{
    display:block;
    color:#8298a4;
    font-size:.54rem;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.plan-stat strong{
    display:block;
    margin-top:3px;
    font-size:.85rem;
    color:#f0f7fa;
}

.schedule-wrap{
    margin-top:11px;
    border-top:1px solid #423a27;
    padding-top:10px;
}

.schedule-title{
    color:#cfb36e;
    font-size:.64rem;
    font-weight:900;
    margin-bottom:7px;
}

.schedule-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(215px,1fr));
    gap:7px;
}

.schedule-block{
    border:1px solid #324758;
    border-radius:10px;
    background:#091722;
    padding:8px;
}

.schedule-block-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-bottom:5px;
}
.schedule-block-head strong{
    color:#e6eef2;
    font-size:.66rem;
}
.schedule-block-head span{
    color:#f0b65a;
    font-size:.60rem;
    font-weight:850;
}

.day-row{
    display:flex;
    justify-content:space-between;
    gap:8px;
    color:#8fa6b6;
    font-size:.57rem;
    line-height:1.5;
}

.secondary-plan{
    border:1px solid #314b5f;
    border-radius:15px;
    background:#081722;
    padding:12px;
}

.secondary-plan-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
}
.secondary-plan h4{
    margin:0;
    font-size:.77rem;
}
.secondary-plan p{
    margin:3px 0 0;
    color:#768fa1;
    font-size:.58rem;
}
.secondary-stats{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:8px;
}
.secondary-chip{
    border:1px solid #294458;
    border-radius:999px;
    background:#0c1d2a;
    color:#a7becd;
    padding:5px 8px;
    font-size:.58rem;
    font-weight:800;
}

/* Preset modal */
.modal-backdrop{
    position:fixed;
    inset:0;
    z-index:999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(2,7,11,.82);
    backdrop-filter:blur(7px);
}
.modal-backdrop.open{display:flex}

.preset-modal{
    width:min(980px,96vw);
    max-height:88vh;
    overflow:auto;
    border:1px solid #65502a;
    border-radius:21px;
    background:linear-gradient(150deg,#101820,#07131d);
    box-shadow:0 30px 90px rgba(0,0,0,.70);
}

.modal-top{
    position:sticky;
    top:0;
    z-index:3;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 16px;
    border-bottom:1px solid #3b3425;
    background:#0b1720f5;
    backdrop-filter:blur(10px);
}

.modal-top h2{
    margin:0;
    font-size:1rem;
    color:#ffe197;
}
.modal-top p{
    margin:3px 0 0;
    color:#8e815f;
    font-size:.61rem;
}

.modal-close{
    width:34px;
    height:34px;
    border:1px solid #705f38;
    border-radius:9px;
    background:#1e1a11;
    color:#e7cc84;
    cursor:pointer;
    font-weight:950;
}

.preset-body{padding:12px}

.preset-section + .preset-section{margin-top:12px}

.preset-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:7px;
}
.preset-section-head strong{
    font-size:.74rem;
}
.preset-section-head span{
    color:#7e96a5;
    font-size:.58rem;
}

.preset-cards{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}

.preset-card{
    min-width:0;
    border:1px solid #344f62;
    border-radius:12px;
    background:#091824;
    color:#edf7ff;
    padding:10px;
    text-align:left;
    cursor:pointer;
    transition:.16s;
}
.preset-card:hover{
    transform:translateY(-1px);
    border-color:#d5a643;
    background:#102431;
}

.preset-card .range{
    color:#8fa6b6;
    font-size:.58rem;
    font-weight:800;
}
.preset-card .name{
    display:block;
    margin-top:3px;
    font-size:.78rem;
    font-weight:950;
}
.preset-values{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    margin-top:8px;
}
.preset-value{
    display:flex;
    align-items:center;
    gap:4px;
    border:1px solid #30495a;
    border-radius:999px;
    background:#0d1d28;
    padding:4px 6px;
    color:#c8d8e1;
    font-size:.54rem;
    font-weight:850;
}
.preset-value img{
    width:17px;
    height:17px;
    object-fit:contain;
}

.camp-toggle-row{
    display:flex;
    gap:6px;
    align-items:center;
}

.camp-toggle{
    position:relative;
    border:1px solid #3c5b6e;
    border-radius:9px;
    background:#0a1b27;
    color:#9bb3c2;
    min-width:77px;
    padding:6px 7px;
    cursor:pointer;
    text-align:center;
    font-size:.60rem;
    font-weight:900;
}
.camp-toggle input{
    position:absolute;
    opacity:0;
}
.camp-toggle.active{
    border-color:#dfa941;
    background:#2a220f;
    color:#ffe18f;
    box-shadow:0 0 12px rgba(247,183,49,.11);
}

.preset-footnote{
    margin-top:9px;
    color:#708998;
    font-size:.56rem;
    line-height:1.4;
}


/* ===== RFC V3: larger typography and light theme ===== */

/* Target panel */
.goal-panel{padding:23px}
.goal-panel .panel-heading{margin-bottom:18px}
.goal-panel .panel-heading h2{font-size:1.42rem}
.goal-panel .panel-heading p{font-size:.94rem;line-height:1.45}
.goal-panel .field-card{padding:14px}
.goal-panel .field-card label{font-size:.90rem;margin-bottom:8px}
.goal-panel .input-shell{min-height:58px;padding:0 14px}
.goal-panel .input-shell img{width:39px;height:39px}
.goal-panel .input-shell input{font-size:1.42rem}
.goal-panel .input-suffix{font-size:.90rem}
.goal-panel .help-strip{margin-top:13px;padding:13px 14px}
.goal-panel .help-copy strong{font-size:1rem}
.goal-panel .help-copy span{font-size:.82rem;line-height:1.4}
.goal-panel .inline-link,
.goal-panel .preset-open-btn{min-height:44px;font-size:.85rem;padding:0 16px}
.goal-panel .optimize-row{margin-top:17px}
.goal-panel .optimize-note{font-size:.81rem;line-height:1.5;max-width:760px}
.goal-panel .optimize-btn{min-height:57px;min-width:310px;font-size:1.16rem}
.goal-panel .active-preset-badge{font-size:.86rem;padding:10px 12px;max-width:440px}

/* Operation summary */
.operation-panel{padding:19px}
.operation-panel h2{font-size:1.16rem}
.operation-subtitle{font-size:.76rem;line-height:1.45}
.cost-tile{min-height:78px;grid-template-columns:52px 1fr;padding:10px 12px}
.cost-tile img{width:48px;height:48px}
.cost-copy span{font-size:.70rem}
.cost-copy strong{font-size:1.30rem}
.confidence-chip{font-size:.79rem;padding:10px 12px}

/* Recommended result */
.recommended-card{padding:22px}
.recommended-title span{font-size:.70rem}
.recommended-title h3{font-size:1.30rem}
.success-badge{font-size:.85rem;padding:9px 13px}
.plan-stats{gap:10px;margin-top:15px}
.plan-stat{padding:12px}
.plan-stat span{font-size:.70rem}
.plan-stat strong{font-size:1.09rem;margin-top:5px}
.schedule-wrap{margin-top:15px;padding-top:14px}
.schedule-title{font-size:.90rem;margin-bottom:10px}
.schedule-grid{grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px}
.schedule-block{padding:13px}
.schedule-block-head{margin-bottom:8px}
.schedule-block-head strong{font-size:.85rem}
.schedule-block-head span{font-size:.79rem}
.day-row{font-size:.75rem;line-height:1.68}

/* Secondary result */
.secondary-plan{padding:18px}
.secondary-plan h4{font-size:1.02rem}
.secondary-plan p{font-size:.76rem;line-height:1.45}
.secondary-stats{gap:8px;margin-top:10px}
.secondary-chip{font-size:.75rem;padding:7px 10px}

/* Failure / notice */
.notice{padding:22px}
.notice h3{font-size:1.20rem}
.notice p{font-size:.87rem;line-height:1.55}
.notice-stat{padding:12px}
.notice-stat span{font-size:.69rem}
.notice-stat strong{font-size:1rem}

/* Larger preset window */
.preset-modal{width:min(980px,95vw);max-height:88vh;border-radius:22px}
.modal-top{padding:20px 23px}
.modal-top h2{font-size:1.36rem}
.modal-top p{font-size:.82rem;line-height:1.4}
.modal-close{width:42px;height:42px;font-size:1rem}
.preset-body{padding:19px}
.preset-section + .preset-section{margin-top:19px}
.preset-section-head{margin-bottom:12px}
.preset-section-head strong{font-size:1.02rem}
.preset-section-head span{font-size:.77rem}
.preset-cards{gap:11px}
.preset-card{min-height:108px;padding:13px}
.preset-card .range{font-size:.78rem}
.preset-card .name{margin-top:5px;font-size:1.02rem;line-height:1.22}
.preset-values{gap:7px;margin-top:11px}
.preset-value{padding:6px 9px;font-size:.73rem}
.preset-value img{width:23px;height:23px}
.camp-toggle{min-width:102px;padding:9px 11px;font-size:.78rem}
.preset-footnote{margin-top:13px;font-size:.72rem;line-height:1.45}

/* Theme control */
.theme-toggle{
    display:flex;align-items:center;justify-content:center;gap:8px;
    min-height:46px;border:1px solid #4c6a80;border-radius:999px;
    background:#091827e8;color:#edf8ff;padding:10px 16px;font-weight:900;
    cursor:pointer;box-shadow:0 10px 30px #0004;transition:.18s;backdrop-filter:blur(12px);
}
.floating-theme-toggle{
    position:fixed;right:20px;top:50vh;z-index:100000;transform:translateY(-50%);
}
.floating-theme-toggle:hover{transform:translateY(-50%) translateX(-4px);border-color:#f0bc45}
.theme-toggle-text{font-size:.76rem;white-space:nowrap}

/* Light theme */
body.light-theme{color:#173247;background:#eef7fb}
body.light-theme::before{
    background:
        linear-gradient(90deg,rgba(247,252,255,.94),rgba(235,246,252,.82) 52%,rgba(246,250,252,.86)),
        url("/static/image/fire-crystal-photo.webp") center/cover no-repeat;
    filter:saturate(.72) brightness(1.08);
}
body.light-theme::after{
    background:
        radial-gradient(circle at 17% 16%,rgba(231,76,32,.11),transparent 28%),
        radial-gradient(circle at 80% 18%,rgba(255,162,62,.10),transparent 25%),
        linear-gradient(180deg,rgba(255,255,255,.08),rgba(219,235,244,.55));
}
body.light-theme .nav-pill,
body.light-theme .theme-toggle{
    color:#173247;background:#ffffffed;border-color:#9bbbcf;box-shadow:0 8px 24px #345a711e;
}
body.light-theme .hero{
    border-color:#a6bac6;
    background:linear-gradient(93deg,rgba(20,31,40,.92),rgba(32,43,51,.82) 54%,rgba(79,39,26,.60));
}
body.light-theme .hero p{color:#eef7fb}
body.light-theme .panel{
    color:#173247;
    background:linear-gradient(145deg,rgba(252,254,255,.98),rgba(237,247,252,.97));
    border-color:#9dbed1;box-shadow:0 18px 48px #31546b24;
}
body.light-theme .panel-heading p,
body.light-theme .help-copy span,
body.light-theme .optimize-note,
body.light-theme .operation-subtitle{color:#5c7485}
body.light-theme .field-card,
body.light-theme .help-strip,
body.light-theme .cost-tile,
body.light-theme .plan-stat,
body.light-theme .schedule-block,
body.light-theme .secondary-plan{background:#f8fcff;border-color:#abc7d6}
body.light-theme .field-card label,
body.light-theme .cost-copy span,
body.light-theme .plan-stat span{color:#587084}
body.light-theme .input-shell{background:#fff;border-color:#8fb0c3}
body.light-theme .input-shell input{color:#15334a;-webkit-text-fill-color:#15334a}
body.light-theme .input-shell input[readonly]{color:#7e5700;-webkit-text-fill-color:#7e5700}
body.light-theme .input-suffix{color:#587084}
body.light-theme .inline-link{background:#eef8fd;color:#126f98;border-color:#91b9cd}
body.light-theme .preset-open-btn{
    background:linear-gradient(135deg,#f7d47a,#dba31f);color:#5b3d00;border-color:#c69423;
}
body.light-theme .active-preset-badge{background:#fff4d3;color:#745000;border-color:#c99a2d}

/* Stronger light-theme contrast for total FC */
body.light-theme .cost-tile.total .cost-copy span{
    color:#7a5a10!important;
}
body.light-theme .cost-tile.total .cost-copy strong{
    color:#7a5100!important;
    text-shadow:none!important;
}

body.light-theme .cost-tile.total,
body.light-theme .recommended-card{
    background:linear-gradient(145deg,#fff9e9,#eff8fc 62%);border-color:#d2ae55;
}
body.light-theme .recommended-title h3{color:#6c4d00}
body.light-theme .recommended-title span,
body.light-theme .schedule-title{color:#8b691e}
body.light-theme .success-badge,
body.light-theme .confidence-chip{background:#e6f8ef;color:#17613f;border-color:#76b69a}
body.light-theme .plan-stat strong,
body.light-theme .schedule-block-head strong,
body.light-theme .secondary-plan h4{color:#173247}
body.light-theme .day-row,
body.light-theme .secondary-plan p{color:#587084}
body.light-theme .schedule-block-head span{color:#8a620d}
body.light-theme .secondary-chip{background:#eef6fa;color:#496779;border-color:#a8c4d4}
body.light-theme .notice{background:linear-gradient(145deg,#fff2f4,#f4f9fc);border-color:#d7a7ad}
body.light-theme .notice h3{color:#a53d4b}
body.light-theme .notice p{color:#405c6e}
body.light-theme .notice-stat{background:#fff;border-color:#d5b9bd}
body.light-theme .notice-stat span{color:#87676c}
body.light-theme .notice-stat strong{color:#5b3137}

body.light-theme .modal-backdrop{background:rgba(211,226,235,.78)}
body.light-theme .preset-modal{
    background:linear-gradient(150deg,#fafdff,#eaf5fa);border-color:#c9a44d;
}
body.light-theme .modal-top{background:#fbfefff5;border-color:#d9c99f}
body.light-theme .modal-top h2{color:#765100}
body.light-theme .modal-top p{color:#6a7780}
body.light-theme .modal-close{background:#fff7df;color:#765100;border-color:#c9a44d}
body.light-theme .preset-section-head strong{color:#173247}
body.light-theme .preset-section-head span{color:#60798a}
body.light-theme .preset-card{background:#fff;color:#173247;border-color:#a8c3d2}
body.light-theme .preset-card:hover{background:#fff6dc;border-color:#c99a2d}
body.light-theme .preset-card .range{color:#617c8d}
body.light-theme .preset-value{background:#eff7fb;color:#39586b;border-color:#adc8d6}
body.light-theme .camp-toggle{background:#fff;color:#47677a;border-color:#a8c3d2}
body.light-theme .camp-toggle.active{background:#fff1c4;color:#745000;border-color:#c9982b}
body.light-theme .preset-footnote{color:#617889}

@media(max-width:700px){
    .floating-theme-toggle{right:10px;top:auto;bottom:14px;transform:none}
    .floating-theme-toggle:hover{transform:none}
}



/* Compact preset modal layout */
.preset-section-head{
    align-items:flex-start;
}
.camp-toggle-row-centered{
    justify-content:center;
    width:100%;
    margin:2px 0 11px;
}
.camp-toggle-row-centered .camp-toggle{
    min-width:115px;
}

/* Recommended-plan polish */
.recommended-card{
    position:relative;
    overflow:hidden;
}
.recommended-card::before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:3px;
    background:linear-gradient(90deg,#8c671d,#f3bd49,#8c671d);
    opacity:.72;
}
.recommended-title span{
    letter-spacing:.13em;
    font-weight:950;
}
.recommended-title h3{
    letter-spacing:-.015em;
    font-weight:950;
}
.plan-stat{
    box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.plan-stat span{
    letter-spacing:.075em;
    font-weight:900;
}
.plan-stat strong{
    letter-spacing:.01em;
    font-weight:950;
}
.schedule-title{
    display:flex;
    align-items:center;
    gap:8px;
    font-weight:950;
    letter-spacing:.015em;
}
.schedule-title::before{
    content:"";
    width:5px;
    height:5px;
    border-radius:50%;
    background:#d5a440;
    box-shadow:0 0 9px rgba(247,183,49,.42);
}
.schedule-block{
    background:linear-gradient(145deg,#0a1a26,#08151f);
}
.schedule-block-head{
    padding-bottom:7px;
    border-bottom:1px solid #263c4c;
}
.schedule-block-head strong{
    font-weight:950;
    letter-spacing:.01em;
}
.schedule-block-head span{
    border:1px solid #5b4820;
    border-radius:999px;
    background:#1c180d;
    color:#f0bd54;
    padding:4px 7px;
    font-weight:950;
}
.day-list{
    display:grid;
    gap:5px;
    margin-top:7px;
}
.day-row{
    display:grid;
    grid-template-columns:minmax(130px,1fr) minmax(165px,.68fr);
    align-items:center;
    gap:10px;
    min-height:31px;
    padding:5px 7px;
    border:1px solid #203747;
    border-radius:8px;
    background:#07131c;
}
.day-name{
    color:#a5b9c7;
    font-weight:800;
}
.day-count{
    display:flex;
    align-items:baseline;
    justify-content:flex-end;
    gap:6px;
    text-align:right;
}
.day-count b{
    color:#f6c25e;
    font-size:.86rem;
    font-weight:950;
}
.day-count em{
    color:#8099aa;
    font-size:.68rem;
    font-style:normal;
    font-weight:750;
}


/* Keep one schedule category compact instead of stretching edge-to-edge */
.schedule-grid.single-schedule{
    grid-template-columns:minmax(430px,720px);
    justify-content:start;
}
.schedule-grid.single-schedule .day-row{
    grid-template-columns:minmax(150px,1fr) auto;
}
.schedule-grid.single-schedule .day-count{
    justify-content:flex-end;
    text-align:right;
}

/* Expandable cheapest-value plan */
.secondary-collapsible{
    padding:0;
    overflow:hidden;
}
.secondary-toggle{
    width:100%;
    min-height:76px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    border:0;
    background:transparent;
    color:inherit;
    text-align:left;
    padding:14px 17px;
    cursor:pointer;
}
.secondary-toggle:hover{
    background:rgba(82,131,163,.06);
}
.secondary-toggle-copy small{
    display:block;
    color:#d1a74d;
    font-size:.65rem;
    font-weight:950;
    letter-spacing:.11em;
}
.secondary-toggle-copy strong{
    display:block;
    margin-top:3px;
    color:#edf7ff;
    font-size:1rem;
    font-weight:950;
}
.secondary-toggle-copy em{
    display:block;
    margin-top:3px;
    color:#7c95a6;
    font-size:.73rem;
    font-style:normal;
}
.secondary-toggle-icon{
    width:36px;
    height:36px;
    flex:0 0 auto;
    display:grid;
    place-items:center;
    border:1px solid #3b576a;
    border-radius:50%;
    background:#0b1d29;
    color:#d7b35e;
    font-size:1.2rem;
    font-weight:700;
}
.secondary-details{
    border-top:1px solid #2a4455;
    padding:14px 17px 17px;
}
.secondary-details .schedule-wrap{
    margin-top:12px;
}

/* Light-theme schedule / secondary polish */
body.light-theme .schedule-block{
    background:linear-gradient(145deg,#fff,#f0f7fa);
}
body.light-theme .schedule-block-head{
    border-bottom-color:#c7dbe6;
}
body.light-theme .schedule-block-head span{
    background:#fff7de;
    color:#7a5707;
    border-color:#d9b55c;
}
body.light-theme .day-row{
    background:#fff;
    border-color:#c3d9e4;
}
body.light-theme .day-name{color:#4d697b}
body.light-theme .day-count b{color:#7a5400}
body.light-theme .day-count em{color:#647f90}
body.light-theme .secondary-toggle:hover{
    background:#edf6fa;
}
body.light-theme .secondary-toggle-copy strong{color:#173247}
body.light-theme .secondary-toggle-copy em{color:#607b8c}
body.light-theme .secondary-toggle-copy small{color:#8a650d}
body.light-theme .secondary-toggle-icon{
    background:#fff7df;
    color:#7b5700;
    border-color:#d2b66d;
}
body.light-theme .secondary-details{
    border-top-color:#c7dbe6;
}


@media(max-width:760px){
    .schedule-grid.single-schedule{
        grid-template-columns:1fr;
    }
}

@media(max-width:650px){
    .day-row{
        grid-template-columns:1fr;
        gap:3px;
    }
    .day-count{
        justify-content:flex-start;
        text-align:left;
    }
}

/* Small screens */
@media(max-width:1050px){
    .workspace{grid-template-columns:1fr}
    .operation-panel{position:static}
    .input-grid{grid-template-columns:1fr 1fr}

    .preset-cards{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:700px){
    .page{width:calc(100% - 14px);padding-top:68px}
    .hero{padding:26px 18px;min-height:270px}
    .hero-art{right:-15%;width:68vw;opacity:.35}
    .input-grid{grid-template-columns:1fr}

    .help-strip{grid-template-columns:1fr}
    .optimize-row{align-items:stretch;flex-direction:column}
    .optimize-btn{width:100%;min-width:0}
    .plan-stats{grid-template-columns:repeat(2,1fr)}
    .notice-grid{grid-template-columns:1fr}
    .preset-cards{grid-template-columns:1fr}
    .preset-section-head{align-items:flex-start;flex-direction:column}
    .camp-toggle-row{width:100%;flex-wrap:wrap}
}
