:root {
  --navy: #1f2a5c; --gold: #e8b73a; --brown: #8a5a00; --ink: #222; --body: #333; --muted: #5a6378;
  --line: #d5d9e3; --sec: #f1f2f7; --base: #eaf1fb; --green: #2e7d32; --red: #b3261e;
  --bg: #f6f7fb; --card: #fff;
  font-family: Calibri, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--body);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
h1, h2, .callout strong, table th { font-family: Georgia, "Times New Roman", serif; }

.top { background: var(--navy); color: #fff; padding: 28px 0 22px; }
.top h1 { margin: 0 0 6px; font-size: 30px; }
.top .sub { margin: 0; color: #cfd6ee; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 18px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
select, input[type=number] { font: inherit; font-size: 15px; color: var(--ink); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
button { font: inherit; font-weight: 700; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
button.primary { background: var(--navy); color: var(--gold); border: 1px solid var(--navy); }
button.primary:disabled { opacity: .6; cursor: wait; }
button.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); align-self: end; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }

.pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 18px 0; }
.pickers .panel { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.picker.base { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.picker.off > label, .picker.off .row2 { opacity: .4; pointer-events: none; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.picker-head .toggle { flex-direction: row; align-items: center; gap: 8px; font-size: 17px; color: var(--navy); }
.picker-head em { font-style: normal; font-size: 12px; color: var(--brown); background: #fbf3dc; padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.row2 .min { padding-bottom: 9px; }

.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-head h2 { margin: 0; color: var(--navy); }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 7px 10px; }
thead th { background: var(--navy); color: #fff; text-align: center; }
thead th:first-child { text-align: left; }
thead th.base { color: var(--gold); }
tbody th { text-align: left; color: var(--ink); font-weight: 700; white-space: nowrap; }
td { text-align: center; color: var(--body); }
td.base { background: var(--base); color: var(--navy); font-weight: 700; }
tr.sec td { background: var(--sec); color: var(--brown); text-align: left; font: 700 11px Georgia, serif; letter-spacing: 2px; }
tr.strong td { font-weight: 700; }
tr.savings td:not(.base) { color: var(--green); font-weight: 700; }
tr.savings td.neg { color: var(--red); }

.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.callout { background: #eef6ee; border: 1px solid #c8e0c9; border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.callout strong { color: var(--green); font-size: 22px; }
.callout.neg { background: #fbeeee; border-color: #e8c4c1; }
.callout.neg strong { color: var(--red); }
.notes { font-size: 12px; color: #666; padding-left: 18px; margin: 14px 0 0; }
.notes li:last-child { list-style: none; margin-left: -18px; }
.foot { font-size: 12px; color: var(--muted); margin: 0 0 32px; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .top h1 { font-size: 24px; }
}

/* ---- storage tool additions ---- */
.settings .seg { display: inline-flex; background: var(--sec); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.settings .seg button { font: inherit; border: 0; background: transparent; color: var(--body); padding: 7px 14px; border-radius: 5px; cursor: pointer; font-weight: 600; }
.settings .seg button.on { background: var(--navy); color: #fff; }
.settings input[type=number] { width: 120px; }
.units { margin: 0 0 4px auto; font-size: 12px; color: var(--muted); align-self: end; }

.pv .dot { width: 11px; height: 11px; border-radius: 50%; }
.pv .tag { font-size: 10px; font-weight: 700; color: var(--brown); background: #fbf3dc; padding: 1px 5px; border-radius: 4px; margin-left: 6px; letter-spacing: .4px; }
.pv.partner { background: #fffdf7; }
.pv-head { display: flex; align-items: center; gap: 9px; }
.pv-name { font-weight: 700; color: var(--navy); font-size: 16px; }
.pv-sub { color: var(--muted); font-size: 12px; }
.pv-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pv-body label { font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--sec); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font-size: 11px; color: var(--body); }
.chip.warn { background: #fff4e5; border-color: #ffd8a8; color: #8a4b00; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.perf { font-size: 13px; font-weight: 600; color: var(--ink); max-width: 60%; }
.perf span, .rate span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.rate { font-size: 18px; font-weight: 700; color: var(--navy); text-align: right; }
.nosupport { background: #fff8f7; border: 1px solid #f3d6d2; border-radius: 8px; padding: 12px; font-size: 13px; }
.nosupport b { display: block; color: #a4362c; margin-bottom: 4px; }
.nosupport span { color: var(--body); }

.result-head .muted { font-size: 13px; }
table td.na { color: var(--muted); font-style: italic; }
.notes li.plain { list-style: disc; color: var(--muted); }
.disclaimer { margin-top: 20px; background: #fafbfc; }
.disclaimer h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink); margin: 0 0 8px; }
.disclaimer ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--body); }
.disclaimer li { margin: 3px 0; }
.pv-body .hint { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.pv-body input[type=number] { width: 100%; }
h2.small { font-size: 16px; color: var(--navy); margin: 0 0 8px; }
.svc-notes details { border-top: 1px solid var(--line); padding: 8px 0; }
.svc-notes summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 14px; }
.svc-notes ul { margin: 6px 0; padding-left: 20px; font-size: 13px; color: var(--body); }
.svc-notes .links { font-size: 13px; margin: 4px 0 0; }
.svc-notes .links a, .disclaimer a { color: #0052cc; text-decoration: none; }
.svc-notes .links a:hover, .disclaimer a:hover { text-decoration: underline; }
.disclaimer .more { font-size: 13px; margin: 8px 0 14px; }
.tier-desc { display: block; font-size: 12px; font-weight: 400; color: var(--body); background: #f7f8fc; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-top: 4px; line-height: 1.4; }
tr.desc td { font-size: 12px; font-weight: 400; color: var(--body); text-align: left; line-height: 1.4; }
tr.desc td.base { font-weight: 600; color: var(--navy); }
.fallback { background: #fff4e5; border: 1px solid #ffd8a8; border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #7a4b00; line-height: 1.4; }
.fallback b { display: block; }
.settings .hint { font-size: 11px; font-weight: 400; color: var(--muted); }
.so-box { background: #eef4ff; border: 1px solid #c9dafc; border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--ink); line-height: 1.5; }
.toggle-perf .switch-row { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 14px; padding: 8px 0; }
.toggle-perf input { width: 18px; height: 18px; accent-color: #1f2a5c; cursor: pointer; }
.disc-box { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; background: #f7f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.disc-box[hidden] { display: none; }
.disc-box .disc-title { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.disc-box label { font-size: 13px; }
.disc-box input { width: 90px; }
.info { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%; background: #1F2A5C; color: #fff; font: italic 700 11px Georgia, serif; cursor: help; vertical-align: 2px; }
.info-pop { display: none; position: absolute; top: 24px; left: -10px; z-index: 20; width: 270px; padding: 10px 12px; background: #fff; color: #333; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); font: 400 13px/1.45 system-ui, sans-serif; text-align: left; }
.info:hover .info-pop, .info:focus .info-pop, .info:focus-within .info-pop { display: block; }

/* ---- assumptions panel (redesign) ---- */
.settings { display: block; padding: 18px 22px 20px; }
.set-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.set-title { margin: 0; font-size: 18px; color: var(--navy); }
.link-btn { border: 0; background: none; color: var(--navy); font: 600 13px system-ui, sans-serif; cursor: pointer; padding: 6px 10px; border-radius: 6px; }
.link-btn:hover { background: var(--sec); }
.set-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 18px; }
.set-group { background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.grp-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--brown); margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.unit-input { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; width: fit-content; }
.unit-input:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,42,92,.12); }
.settings .unit-input input { border: 0; outline: 0; width: 80px; padding: 8px 10px; font: 600 15px system-ui, sans-serif; background: transparent; }
.unit-input > span { display: flex; align-items: center; padding: 0 10px; background: var(--sec); color: var(--muted); font-size: 12px; font-weight: 600; border-left: 1px solid var(--line); }
.field .hint b { color: var(--ink); }
.switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sw { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.sw:hover { border-color: #aab2c8; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.knob { flex: none; position: relative; width: 36px; height: 20px; border-radius: 20px; background: #c9ceda; transition: background .15s; }
.knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.sw input:checked + .knob { background: var(--navy); }
.sw input:checked + .knob::after { transform: translateX(16px); }
.sw input:focus-visible + .knob { box-shadow: 0 0 0 3px rgba(31,42,92,.25); }
.sw:has(input:checked) { border-color: var(--navy); background: var(--base); }
.sw-text { display: flex; flex-direction: column; line-height: 1.25; }
.sw-text b { font-size: 13px; color: var(--ink); }
.sw-text small { font-size: 11.5px; color: var(--muted); }
.sw-on { font-style: normal; font-size: 11px; color: var(--muted); opacity: .85; margin-top: 4px; line-height: 1.35; }
.disc-box { margin-top: 14px; background: var(--base); border-color: #c7d6ee; }
.disc-box label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.disc-box .unit-input input { width: 60px; }
@media (max-width: 900px) {
  .set-grid { grid-template-columns: 1fr; }
  .switches { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .fields { grid-template-columns: 1fr; } }
.settings label.sw { flex-direction: row; align-items: center; }
.disc-box label { flex-direction: column; }
