:root{
  --bg:#f4f7f6;--surface:#fff;--ink:#15302d;--muted:#6e817e;--line:#dce7e4;
  --primary:#0b6b5f;--primary2:#128171;--soft:#e8f5f1;--gold:#c69a39;--warn:#fff7e5;
  --radius:22px;--shadow:0 12px 38px rgba(25,66,60,.08)
}
*{box-sizing:border-box}html{scroll-behavior:smooth}
body{margin:0;font-family:"Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif;background:var(--bg);color:var(--ink);line-height:1.5}
button,input{font:inherit}button:disabled{opacity:.5;cursor:not-allowed}
.topbar{height:74px;background:rgba(255,255,255,.93);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,calc((100vw - 1180px)/2));position:sticky;top:0;z-index:20}
.brand{display:flex;gap:11px;align-items:center;min-width:0}.director-logo{width:48px;height:48px;border-radius:50%;object-fit:cover;flex:0 0 auto;box-shadow:0 5px 16px rgba(11,107,95,.18);border:2px solid #fff}.brand-copy{min-width:0}.brand-title-row{display:flex;align-items:center;gap:8px}.logo{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:var(--primary);color:#fff;font-weight:800;font-size:17px;box-shadow:0 6px 15px rgba(11,107,95,.16)}
.brand h1{margin:0;font-size:18px;line-height:1.1}.brand p{margin:3px 0 0;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:500px}.top-actions{display:flex;gap:7px}
.shell{max-width:1180px;margin:auto;padding:30px 20px 56px}
.hero{background:linear-gradient(125deg,#0a6257 0%,#0e796a 60%,#179282 100%);color:#fff;border-radius:30px;padding:36px 42px;display:flex;align-items:center;justify-content:space-between;gap:30px;box-shadow:0 20px 48px rgba(10,98,87,.18);overflow:hidden;position:relative}
.hero:after{content:"";position:absolute;width:330px;height:330px;border:70px solid rgba(255,255,255,.07);border-radius:50%;right:-130px;top:-145px}
.eyebrow{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;opacity:.75}.hero h2{font-size:clamp(28px,4.5vw,46px);line-height:1.16;margin:8px 0 12px;max-width:720px}.hero h2 span{color:#d7f6ee}.hero p{margin:0;max-width:720px;color:#dcefeb}
.hero-badge{min-width:210px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);padding:22px;border-radius:22px;position:relative;z-index:1}.hero-badge span,.hero-badge small{display:block;color:#d8eeea}.hero-badge strong{display:block;font-size:23px;margin:3px 0 6px}
.mode-tabs{display:flex;gap:6px;background:#e7efed;padding:5px;border-radius:16px;width:max-content;margin:22px 0 14px}.mode-tab{border:0;background:transparent;padding:10px 18px;border-radius:12px;color:var(--muted);font-weight:700;cursor:pointer}.mode-tab.active{background:#fff;color:var(--primary);box-shadow:0 4px 12px rgba(34,71,66,.08)}
.grid{display:grid;grid-template-columns:.94fr 1.06fr;gap:18px}.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.input-panel,.result-panel{padding:24px}
.section-title,.result-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.section-title>div{display:flex;gap:12px;align-items:center}.section-title h3,.result-head h3{margin:0;font-size:19px}.section-title p{margin:2px 0 0;color:var(--muted);font-size:12px}.section-title.compact{margin-top:2px}.step{width:34px;height:34px;border-radius:11px;background:var(--soft);color:var(--primary);display:grid;place-items:center;font-weight:800;flex:0 0 auto}
.text-btn,.ghost,.file-btn{border:1px solid var(--line);background:#fff;color:var(--primary);border-radius:12px;padding:8px 11px;cursor:pointer;font-weight:700}.small{font-size:12px}
.fields{display:grid;gap:16px;margin-top:20px}.fields.two{grid-template-columns:1fr 1fr}.fields label{font-size:13px;font-weight:700;color:#38524f}.fields input[type="date"],.fields input[type="number"],.fields input.thai-date,.field-select{width:100%;margin-top:7px;border:1px solid #cedbd8;background:#fbfcfc;border-radius:12px;padding:12px 13px;outline:none;color:var(--ink)}.fields input:focus{border-color:#63a99f;box-shadow:0 0 0 3px rgba(18,129,113,.1)}
.date-input-wrap{position:relative;display:flex;align-items:center}.date-input-wrap .thai-date{padding-right:54px}.calendar-btn{position:absolute;right:5px;top:12px;width:38px;height:38px;border:0;border-radius:10px;background:var(--soft);cursor:pointer;font-size:18px;display:grid;place-items:center}.calendar-btn:hover{background:#d9eee8}
.thai-calendar-dialog{border:0;padding:0;border-radius:22px;max-width:520px;width:calc(100% - 28px);box-shadow:0 28px 80px rgba(11,48,43,.28)}.thai-calendar-dialog::backdrop{background:rgba(7,32,29,.48);backdrop-filter:blur(3px)}.thai-calendar-card{padding:22px;background:#fff}.thai-calendar-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.thai-calendar-head h3{margin:3px 0 0;font-size:20px}.calendar-close{border:0;background:#eef4f2;border-radius:10px;width:36px;height:36px;font-size:24px;line-height:1;cursor:pointer;color:var(--ink)}.thai-calendar-selects{display:grid;grid-template-columns:.75fr 1.25fr 1fr;gap:10px;margin-top:20px}.thai-calendar-selects label{font-size:12px;font-weight:800;color:#38524f}.thai-calendar-selects select{width:100%;margin-top:6px;border:1px solid #cedbd8;border-radius:12px;background:#fbfcfc;padding:11px 10px;color:var(--ink);font:inherit}.thai-calendar-preview{margin-top:16px;padding:12px 14px;border-radius:13px;background:var(--soft);font-size:13px;color:#38524f}.thai-calendar-preview strong{color:var(--primary)}.thai-calendar-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.money-input{position:relative}.money-input input{padding-right:50px!important}.money-input span{position:absolute;right:12px;top:19px;color:var(--muted);font-size:12px;font-weight:500}
.range-row{display:flex;align-items:center;gap:12px;margin-top:10px}.range-row input{width:100%;accent-color:var(--primary)}.range-row output{min-width:48px;text-align:center;background:var(--soft);color:var(--primary);padding:5px 7px;border-radius:9px;font-weight:800}.fields small{display:block;margin-top:5px;color:var(--muted);font-weight:400}
.section-divider{height:1px;background:var(--line);margin:22px 0}.detail-fields{padding-top:1px}.subhead{font-size:13px;font-weight:800;margin-top:22px;padding-top:17px;border-top:1px dashed var(--line)}.subhead small{display:block;color:var(--muted);font-weight:400;margin-top:3px}
.primary{width:100%;border:0;border-radius:14px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;padding:14px;font-weight:800;font-size:16px;margin-top:22px;cursor:pointer;box-shadow:0 9px 18px rgba(11,107,95,.18)}.primary:hover{filter:brightness(1.03)}.primary.inline{width:auto;margin:0;padding:12px 18px}
.privacy-note{text-align:center;font-size:11px;color:var(--muted);margin:10px 0 0}
.pill{font-size:11px;font-weight:800;padding:6px 10px;border-radius:999px}.pill.neutral{background:#eef2f1;color:#73827f}.pill.good{background:#e0f5ee;color:#08715e}.pill.warn{background:#fff1d5;color:#8a6212}
.big-result{background:linear-gradient(135deg,#eff8f5,#f8fbfa);border:1px solid #dceee9;border-radius:20px;padding:22px;margin-top:18px}.big-result span,.result-cards span{font-size:12px;color:var(--muted)}.big-result strong{display:block;font-size:37px;color:var(--primary);letter-spacing:-.02em;margin:2px 0}.big-result small,.result-cards small{color:var(--muted)}
.result-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.result-cards article{border:1px solid var(--line);border-radius:16px;padding:15px;min-height:112px}.result-cards strong{display:block;font-size:19px;margin:4px 0;color:#244843}
.meter-wrap{margin-top:18px}.meter-label{display:flex;justify-content:space-between;font-size:12px;margin-bottom:7px}.meter{height:10px;border-radius:999px;background:#e7eeec;overflow:hidden}.meter i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--primary2),#57b49f);border-radius:999px;transition:width .4s ease}
.explain{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-top:20px;padding:10px 0}.explain-row{display:flex;justify-content:space-between;gap:15px;padding:8px 2px;font-size:12px}.explain-row span{color:var(--muted)}.explain-row strong{text-align:right}
.scenario-box{margin-top:18px;background:#183f3a;color:#fff;border-radius:18px;padding:18px}.scenario-box h4{margin:4px 0 12px}.scenario-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.scenario-grid div{background:rgba(255,255,255,.1);border-radius:12px;padding:10px}.scenario-grid span{font-size:10px;color:#c9ded9}.scenario-grid strong{display:block;font-size:12px;margin-top:3px}
.import-panel,.compare-panel{padding:24px;margin-top:18px}.import-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}.import-card{display:grid;grid-template-columns:64px 1fr;gap:14px;border:1px solid var(--line);border-radius:18px;padding:17px}.import-icon{width:64px;height:64px;border-radius:18px;background:var(--soft);color:var(--primary);display:grid;place-items:center;font-weight:900;font-size:18px}.import-card h4{margin:0}.import-card p{margin:4px 0 12px;font-size:12px;color:var(--muted)}.import-card small{display:block;margin-top:9px;color:var(--muted)}.button-row{display:flex;gap:8px;flex-wrap:wrap}.file-btn{display:inline-block;font-size:12px}.button-row .ghost{font-size:12px}
.choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}.choice-card{border:1px solid var(--line);border-radius:20px;padding:20px;background:#fbfcfc}.choice-card h4{margin:7px 0 15px;font-size:18px}.choice-tag{display:inline-block;border-radius:999px;background:var(--soft);color:var(--primary);font-weight:800;font-size:11px;padding:6px 9px}.lump-choice .choice-tag{background:#fff2d8;color:#876015}.choice-big{padding:15px;background:#fff;border:1px solid var(--line);border-radius:15px}.choice-big span{font-size:11px;color:var(--muted)}.choice-big strong{display:block;font-size:26px;color:var(--primary);margin-top:3px}.lump-choice .choice-big strong{color:#805c17}.choice-line{display:flex;justify-content:space-between;gap:12px;padding:12px 2px;border-bottom:1px dashed var(--line);font-size:12px}.choice-line span{color:var(--muted)}.choice-card>small{display:block;margin-top:12px;color:var(--muted);font-size:11px}.comparison-caveat{margin-top:12px;background:#f6f8f7;border-radius:13px;padding:11px 13px;font-size:11px;color:var(--muted)}.report-actions{text-align:right;margin-top:14px}
.info-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.info-strip article{background:#fff;border:1px solid var(--line);border-radius:16px;padding:15px}.info-strip b,.info-strip span{display:block}.info-strip b{font-size:13px}.info-strip span{font-size:11px;color:var(--muted);margin-top:3px}
.notice{background:var(--warn);border:1px solid #f2dfb1;border-radius:18px;padding:18px 20px}.notice strong{color:#765411}.notice p{margin:5px 0 0;font-size:12px;color:#725f39}.sources{font-size:11px;color:var(--muted);padding:13px 4px;display:flex;gap:10px;flex-wrap:wrap}.sources a{color:var(--primary)}
.print-report{display:none}
footer{text-align:center;color:#7a8c89;font-size:11px;padding:0 20px 34px}
@media(max-width:850px){.grid{grid-template-columns:1fr}.hero{padding:28px 24px}.hero-badge{display:none}.result-panel{order:-1}.mode-tabs{width:100%}.mode-tab{flex:1}.import-grid,.choice-grid{grid-template-columns:1fr}.info-strip{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.topbar{height:70px;padding:0 10px}.director-logo{width:42px;height:42px}.brand{gap:8px}.brand p{display:block;max-width:190px;font-size:9px}.brand h1{font-size:15px}.brand-title-row .logo{width:25px;height:25px;font-size:14px}.top-actions .small{padding:7px 8px}.shell{padding:16px 12px 38px}.hero{border-radius:22px;padding:24px 20px}.hero h2{font-size:29px}.hero p{font-size:13px}.panel{border-radius:18px}.input-panel,.result-panel,.import-panel,.compare-panel{padding:17px}.fields.two{grid-template-columns:1fr}.result-cards{grid-template-columns:1fr 1fr}.result-cards article{min-height:100px;padding:12px}.big-result strong{font-size:31px}.scenario-grid{grid-template-columns:1fr 1fr}.info-strip{grid-template-columns:1fr 1fr}.brand h1{font-size:17px}.import-card{grid-template-columns:50px 1fr}.import-icon{width:50px;height:50px;border-radius:14px;font-size:14px}.choice-big strong{font-size:23px}}
@media print{
  body{background:#fff}.topbar,.shell,footer{display:none!important}.print-report{display:block!important;padding:12mm 14mm;color:#111;font-family:"Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif}.print-report h1{margin:0 0 3mm;font-size:22px}.print-report .print-muted{color:#555;font-size:11px}.print-report .print-grid{display:grid;grid-template-columns:1fr 1fr;gap:5mm;margin-top:6mm}.print-report .print-card{border:1px solid #bbb;border-radius:4mm;padding:5mm}.print-report .print-card h2{font-size:15px;margin:0 0 3mm}.print-report .print-big{font-size:25px;font-weight:800;margin:2mm 0}.print-report table{width:100%;border-collapse:collapse;margin-top:5mm;font-size:11px}.print-report td{border-bottom:1px solid #ddd;padding:2.2mm}.print-report td:last-child{text-align:right;font-weight:700}.print-report .print-note{margin-top:7mm;border-top:1px solid #bbb;padding-top:4mm;font-size:10px;color:#555}
}