:root{
  --green-950:#00562f;
  --green-900:#006a3a;
  --green-800:#007943;
  --green-700:#078b4c;
  --green-100:#e7f5ee;
  --green-050:#f1f9f5;
  --yellow:#f2bf22;
  --red:#df3038;
  --red-050:#fff1f1;
  --red-100:#ffe2e3;
  --ink:#253229;
  --muted:#66736b;
  --line:#dce5df;
  --panel:#ffffff;
  --bg:#f2f6f3;
  --shadow:0 18px 38px rgba(31, 74, 50, .12);
  --radius:15px;
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);background:var(--bg)}
body{border:1px solid #263229;border-radius:0 0 12px 12px;overflow-x:hidden}

.topbar{
  min-height:92px;
  padding:12px clamp(22px,3.2vw,52px);
  background:linear-gradient(135deg,#05683b 0%,#006d3a 48%,#00713c 100%);
  color:white;
  border-bottom:4px solid var(--yellow);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px
}
.brand{display:flex;align-items:center;gap:14px;min-width:0}
.brand-mark{
  width:54px;height:54px;border-radius:10px;background:#07823f;
  border:1px solid rgba(255,255,255,.18);
  display:grid;place-items:center;font-weight:800;font-style:italic;font-size:13px;
  box-shadow:inset 0 -12px 20px rgba(0,0,0,.08);
  position:relative;overflow:hidden
}
.brand-mark::before{
  content:"";position:absolute;width:38px;height:22px;border-radius:50%;background:#d72b32;transform:rotate(-8deg)
}
.brand-mark{color:#fff}
.brand-mark::after{
  content:"Natto";position:relative;z-index:2;font-weight:800;font-size:12px;letter-spacing:-.3px;transform:rotate(-6deg)
}
.brand h1{margin:0 0 4px;font-family:"Roboto Slab",Georgia,serif;font-size:clamp(22px,2.2vw,34px);line-height:1.05;letter-spacing:-.4px}
.brand p{margin:0;color:#d9efe4;font-size:12px}
.mode-badge{
  flex:0 0 auto;padding:11px 18px;border:1px solid rgba(255,255,255,.24);border-radius:999px;
  font-size:11px;font-weight:800;letter-spacing:.7px;color:#ffd23f;background:rgba(255,255,255,.04)
}

.page-shell{max-width:1060px;margin:28px auto 60px;padding:0 18px}
.layout{display:grid;grid-template-columns:360px minmax(0,1fr);gap:20px;align-items:start}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.form-panel{padding:24px 22px 20px}
.result-panel{overflow:hidden}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.2px;color:var(--green-700)}
.eyebrow.neutral{color:#69736e}
h2{font-size:17px;margin:6px 0 6px}
.helper{font-size:12px;line-height:1.45;color:var(--muted);margin:0 0 18px}

.field{display:block;margin:0 0 14px}
.field>span{display:block;font-size:10px;font-weight:800;margin:0 0 7px}
.field input,.field select{
  width:100%;height:42px;border:1px solid #cbd6cf;border-radius:8px;background:#fbfdfb;
  padding:0 12px;font:inherit;font-size:13px;color:var(--ink);outline:none;transition:.15s ease
}
.field input:focus,.field select:focus{border-color:#2a9a61;box-shadow:0 0 0 3px rgba(42,154,97,.12)}
.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.compact-field{max-width:152px}

.profile-strip{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:center;
  background:var(--green-100);border-radius:7px;padding:10px 12px;margin:-2px 0 14px
}
.profile-strip>div,.cost-edit{display:flex;justify-content:space-between;align-items:center;gap:6px}
.profile-strip span{font-size:10px;color:#47594f}
.profile-strip strong{font-size:11px}
.cost-edit{margin:0}
.cost-edit input{
  width:48px;background:transparent;border:0;border-bottom:1px dashed #7dab91;
  padding:0;height:20px;font-weight:800;color:#2f4d3d;text-align:right;outline:none
}
.money-prefix{margin-left:auto;font-weight:700}
.input-unit{position:relative}
.input-unit input{padding-right:44px}
.input-unit span{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-size:10px;color:#758078;font-weight:700}

.action-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:26px}
.btn{
  height:42px;border:0;border-radius:9px;font:inherit;font-size:12px;font-weight:800;cursor:pointer;
  transition:transform .12s ease,filter .12s ease
}
.btn:hover{filter:brightness(.98);transform:translateY(-1px)}
.btn.primary{background:linear-gradient(135deg,#0a8c4a,#05803f);color:white}
.btn.secondary{background:#edf5f0;color:#314438}

.result-header{padding:24px 22px 18px;border-bottom:1px solid var(--line);display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.result-header h2{font-size:21px;margin:5px 0 2px;letter-spacing:.3px}
.result-header p{margin:0;font-size:12px;color:#68746c}
.status-pill{font-size:10px;font-weight:800;letter-spacing:.3px;padding:7px 11px;border-radius:999px;white-space:nowrap}
.status-pill.bad{color:#b6252d;background:var(--red-050)}
.status-pill.good{color:#087343;background:#e6f6ed}
.status-pill.warn{color:#865d00;background:#fff7da}

.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:18px 22px 12px}
.summary-card{border:1px solid var(--line);border-radius:9px;padding:13px 14px;min-height:89px;background:#fff}
.summary-card span,.metric span,.economic-bottom span,.decision-row span,.decision-eyebrow{
  display:block;font-size:9px;font-weight:800;color:#708077;margin-bottom:7px
}
.summary-card strong{display:block;font-size:18px;color:#078a4c;margin-bottom:5px}
.summary-card small{font-size:9px;color:#738078}
.danger-text{color:var(--red)!important}
.warn-text{color:#d89f05!important}

.details-layout{display:grid;grid-template-columns:minmax(0,1fr) 228px;gap:12px;padding:4px 22px 14px}
.economic-card,.decision-card{border:1px solid var(--line);border-radius:12px;padding:17px}
.economic-card h3,.decision-card h3{margin:0 0 13px;font-size:13px}
.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:18px}
.metric{background:#f7faf8;border-radius:8px;padding:10px 11px}
.metric strong{font-size:16px;color:#12884e}

.occupancy-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}
.occupancy-head strong{font-size:9px}
.occupancy-head b{font-size:14px;color:var(--red)}
.progress{height:12px;border-radius:999px;background:#e5ece8;overflow:hidden}
.progress>div{height:100%;width:50%;background:var(--red);border-radius:inherit;transition:width .25s ease,background .2s ease}
.progress-caption{display:flex;justify-content:space-between;gap:10px;font-size:9px;color:#65746b;margin-top:7px}

.economic-bottom{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}
.economic-bottom>div{background:#f7faf8;border-radius:8px;padding:11px}
.economic-bottom strong{font-size:12px;line-height:1.35}

.decision-card{background:var(--red-050);border-color:#f2c8ca}
.decision-card.good{background:#eef9f3;border-color:#bee5ce}
.decision-card.warn{background:#fff9e9;border-color:#eedb9d}
.decision-eyebrow{color:#c72a33!important;margin-bottom:6px}
.decision-card.good .decision-eyebrow{color:#087343!important}
.decision-card.warn .decision-eyebrow{color:#9b6b00!important}
.decision-card h3{font-size:16px;color:#ce3037;margin-bottom:7px}
.decision-card.good h3{color:#087343}
.decision-card.warn h3{color:#9b6b00}
.decision-card p{font-size:10px;line-height:1.45;color:#6e5658;margin:0 0 14px}
.decision-row{padding:10px 0;border-top:1px solid rgba(150,70,73,.14)}
.decision-row strong{font-size:12px}
.recommendation{background:#fff;border-radius:8px;padding:10px 11px;font-size:10px;font-weight:700;line-height:1.35;margin-top:5px}

.result-footer{display:flex;justify-content:space-between;gap:15px;padding:0 22px 17px;font-size:8px;color:#77837c}

.toast{
  position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;
  padding:10px 14px;background:#1d2b23;color:white;border-radius:9px;font-size:12px;box-shadow:0 8px 25px rgba(0,0,0,.18);
  transition:.2s ease
}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-width:900px){
  .layout{grid-template-columns:1fr}
  .form-panel{max-width:none}
  .details-layout{grid-template-columns:1fr}
  .decision-card{order:2}
}
@media(max-width:640px){
  body{border:0}
  .topbar{padding:14px 16px;align-items:flex-start}
  .brand-mark{width:46px;height:46px}
  .brand h1{font-size:20px}
  .brand p{font-size:10px}
  .mode-badge{display:none}
  .page-shell{padding:0 10px;margin-top:16px}
  .field-grid,.summary-grid,.metric-grid,.economic-bottom{grid-template-columns:1fr}
  .summary-grid{padding:14px}
  .details-layout{padding:0 14px 14px}
  .result-header{padding:18px 14px}
  .result-footer{padding:0 14px 14px;flex-direction:column}
  .compact-field{max-width:none}
}
@media print{
  body{background:white;border:0}
  .topbar,.form-panel,.toast{display:none!important}
  .page-shell{max-width:none;margin:0;padding:0}
  .layout{display:block}
  .result-panel{box-shadow:none;border:0}
  .result-footer{padding-bottom:0}
}
