:root{--paper:#f7f5ef;--white:#fffefb;--ink:#303b33;--muted:#6d756c;--green:#456452;--red:#b84332;--line:#dedfd4;--soft:#edf0e6;--mono:Consolas,"Courier New",monospace;color:var(--ink);background:var(--paper);font-family:"Yu Gothic",Meiryo,sans-serif;font-size:14px}
*{box-sizing:border-box}body{max-width:820px;margin:0 auto;padding:26px 24px;line-height:1.85;-webkit-font-smoothing:antialiased}button,input{font:inherit}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline;text-underline-offset:4px}[hidden]{display:none!important}::selection{background:#dce6d1}
.site-header{margin-bottom:28px}.topline{font-size:10px;color:var(--muted);border-bottom:1px dashed #c9cec1;padding-bottom:10px}.topline:before{content:"";display:inline-block;width:7px;height:7px;background:var(--green);border-radius:50%;margin-right:8px}.brandrow{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 0;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:11px;color:var(--ink)}.brand:hover{text-decoration:none}.brand-mark{width:40px;height:40px;display:block;object-fit:cover;border-radius:12px;flex-shrink:0}.brand-text{font-size:25px;font-weight:900;letter-spacing:-1px}.brand-text small{font-size:inherit;color:var(--red)}.back-link{font-size:12px;white-space:nowrap}
.tool-intro{padding:24px 26px;margin-bottom:24px;border:1px solid #d0d8c7;border-radius:10px;background-color:#e6ecdc;background-image:linear-gradient(#52634b0a 1px,transparent 1px),linear-gradient(90deg,#52634b0a 1px,transparent 1px);background-size:22px 22px}.eyebrow{font:10px var(--mono);letter-spacing:1px;color:var(--green);margin:0 0 8px}h1{font-size:28px;line-height:1.5;letter-spacing:-1px;margin:0 0 9px}h1 .sub{font-size:14px;font-weight:500;color:var(--green);white-space:nowrap}.intro-note{font-size:12px;color:#5c675c;line-height:1.9;margin:0}
.panel{border:1px solid var(--line);border-radius:10px;background:var(--white);padding:24px;margin:0 0 20px;min-width:0}h2{display:flex;align-items:center;gap:9px;font-size:16px;margin:0 0 18px;line-height:1.6}h2:before{content:"";width:4px;height:17px;background:var(--green);border-radius:2px;flex-shrink:0}
button{min-height:44px;border:1px solid var(--green);border-radius:7px;padding:9px 15px;background:var(--green);color:var(--white);font-weight:700;cursor:pointer;line-height:1.6}button:hover{filter:brightness(.94)}button:disabled{opacity:.45;cursor:default;filter:none}.secondary{background:var(--soft);border-color:var(--line);color:var(--ink)}button.bonus-bb{background:var(--red);border-color:var(--red);font-size:17px;padding-inline:21px}button.bonus-rb{font-size:17px;padding-inline:21px}.bonus-bb{color:var(--red);font-weight:700}.bonus-rb{color:var(--green);font-weight:700}button.bonus-bb,button.bonus-rb{color:var(--white)}
label{display:block;font-size:12px;color:var(--muted);font-weight:600}input{display:block;max-width:100%;width:120px;min-height:48px;padding:8px 11px;margin-top:6px;border:1px solid #b8c2b1;border-radius:7px;background:var(--white);color:var(--ink);font-size:22px;font-weight:650;line-height:1.3;font-variant-numeric:tabular-nums}.history-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.history-actions input{width:104px;margin:0}.history-actions .secondary{font-size:12px}.history-value{border-block:1px dashed var(--line);background:var(--soft);padding:13px 16px;font-size:14px;margin:20px 0 12px}.history-value strong{font:700 27px var(--mono);color:var(--green);margin:0 4px}.history-help{font-size:12px;color:var(--muted)}summary{cursor:pointer}small{font-size:12px;line-height:1.9}#history-error{color:var(--red);font-size:12px;margin-top:8px}#history-error:empty{display:none}.history-list{max-height:240px;overflow:auto;margin-top:16px}.history-list:has(tbody:empty){display:none}.history-list th{position:sticky;top:0}
#form{display:grid;grid-template-columns:1fr 1fr;gap:18px 16px}.c-field{grid-column:1/-1}#C{width:150px}#lend,#exchange{width:100%;max-width:160px}#form>button{display:none}.restore{font-size:12px;margin-top:8px}#state{font-size:12px;color:var(--muted);margin:18px 0 8px}
table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:14px;font-variant-numeric:tabular-nums}th,td{text-align:right;padding:13px 7px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}th{background:var(--soft);color:var(--green);font-size:12px;font-weight:700;line-height:1.5}th:first-child,td:first-child{text-align:left}tbody tr:nth-child(even){background:#f7f8f2}.results-table th:nth-child(1){width:14%}.results-table th:nth-child(2){width:26%}.results-table th:nth-child(3){width:22%}.results-table th:nth-child(4){width:18%}.results-table th:nth-child(5){width:20%}.results-table td:nth-child(2),.results-table td:nth-child(3){font-weight:700}.results-table td:last-child{font-size:12px;white-space:nowrap;letter-spacing:-.04em}.results-table th{white-space:nowrap}.plus{color:#1266bb}.minus{color:var(--red)}.muted{color:var(--muted)}.time-note{display:block;margin-top:14px;font-size:11px;color:var(--muted)}details.panel>summary{font-size:13px;font-weight:600;color:var(--green)}details.panel p{color:var(--muted)}.scroll{overflow:auto}.details{font-size:12px;min-width:560px}.details th{font-size:10px}.details th,.details td{padding:9px 5px}
.site-footer{border-top:1px solid var(--line);padding:24px 0 8px;display:flex;align-items:center;flex-wrap:wrap;gap:18px}.site-footer nav{display:flex;flex-wrap:wrap;gap:16px;font-size:11px}.site-footer small{font:10px var(--mono);color:var(--muted)}
dialog{width:min(420px,calc(100% - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:26px;color:var(--ink);background:var(--white);box-shadow:0 20px 80px #26352a30}dialog::backdrop{background:#24302888}dialog p{font-size:13px;line-height:1.9}dialog .install-note{font-size:12px;color:var(--muted)}dialog button{margin:4px 6px 0 0}
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid var(--red);outline-offset:3px}
@media(max-width:520px){body{padding:18px 14px}.brand-text{font-size:22px}.brand-mark{width:35px;height:35px}.brandrow{gap:10px;padding:17px 0}.back-link{font-size:11px}.tool-intro{padding:20px 18px;margin-bottom:18px}h1{font-size:25px}h1 .sub{font-size:12px}.panel{padding:18px 14px;margin-bottom:16px}.history-actions input{width:88px}.history-actions .secondary{padding-inline:10px}.history-value{padding:12px}table{font-size:12px}th,td{padding:11px 3px}.results-table th{font-size:10px;letter-spacing:-.05em}.results-table td:last-child{font-size:10px}.site-footer{gap:15px}.site-footer nav{width:100%}}
@media(max-width:360px){body{padding-inline:10px}.panel{padding-inline:10px}.brand-text{font-size:20px}.brand{gap:8px}.results-table{font-size:11px}.results-table th{font-size:9px}.results-table td:last-child{font-size:9px}h1 .sub{display:block;margin-top:3px}}

/* Shared pixel arcade look; keep the estimate table and value colors legible. */
:root{--paper:#e9eddf;--white:#fffdf3;--ink:#233a38;--muted:#526660;--green:#247363;--line:#a8b9aa;--soft:#dcead8;background-color:var(--paper);background-image:radial-gradient(#c5d2c0 1px,transparent 1px);background-size:16px 16px}
.site-header{margin-bottom:26px;border:3px solid #203d3b;background:#244841;box-shadow:6px 6px 0 #9eb9a6}.topline{padding:6px 14px;border:0;border-bottom:2px solid #17332f;background:#17332f;color:#d2ebcf;font-family:var(--mono)}.topline:before{width:8px;height:8px;border-radius:0;background:#f8cb62}.brandrow{padding:13px 16px;border:0}.brand{color:#fff8da}.brand-text{font-family:var(--mono);text-shadow:3px 3px 0 #142d29}.brand-text small{color:#f8cb62}.brand-mark{border:3px solid #fff5c9;border-radius:0;image-rendering:pixelated}.back-link{padding:6px 11px;border:2px solid #17332f;background:#f8cb62;color:#233a38;font-family:var(--mono);font-weight:700;text-decoration:none;box-shadow:3px 3px 0 #142d29}
.tool-intro{border:3px solid #203d3b;border-radius:0;background-color:#1f403d;background-image:linear-gradient(90deg,#ffffff06 50%,transparent 50%),linear-gradient(#ffffff06 50%,transparent 50%);background-size:18px 18px;box-shadow:6px 6px 0 #9eb9a6}.eyebrow{display:inline-block;padding:3px 7px;border:1px solid #a4dabc;background:#2e6956;color:#eaffda;font-weight:700}h1{color:#fff8da;font-family:"MS Gothic","Yu Gothic",sans-serif;text-shadow:3px 3px 0 #102a2a}h1 .sub{color:#e2edbe}.intro-note{color:#d9ecd5}
.panel{border:2px solid #203d3b;border-radius:0;background:#fffdf3;box-shadow:5px 5px 0 #a8bfaa}h2{font-family:"MS Gothic","Yu Gothic",sans-serif}h2:before{content:"▶";width:auto;height:auto;background:none;color:#d65d46;border-radius:0;font:12px var(--mono)}
button{border:2px solid #203d3b;border-radius:0;background:#f8cb62;color:#233a38;box-shadow:3px 3px 0 #b7ad80;font-family:var(--mono)}button:hover{filter:brightness(1.05)}button.bonus-bb{background:#b84332;border-color:#203d3b;color:#fff}button.bonus-rb{background:#247363;border-color:#203d3b;color:#fff}.secondary{background:#e3eed9;border-color:#29433e;color:#233a38;box-shadow:3px 3px 0 #a4b7a3}input{border:2px solid #a8b9aa;border-radius:0;background:#fffdf3}.history-value{border-color:#a8b9aa;background:#e3eed9}.history-value strong{color:#176453}
th{background:#315c50;color:#fff8da}tbody tr:nth-child(even){background:#f2f5ea}.plus{color:#1266bb}.minus{color:#b84332}.time-note,details.panel p{color:#526660}.site-footer{border-top:3px solid #203d3b;background:#e0e8d8;padding:16px 12px}.site-footer a{color:#176453;font-weight:700}dialog{border:3px solid #203d3b;border-radius:0;background:#fffdf3;box-shadow:8px 8px 0 #142f2c}
@media(max-width:520px){.site-header{box-shadow:4px 4px 0 #9eb9a6}.topline{padding:5px 9px}.brandrow{padding:10px}.brand-mark{width:35px;height:35px}.brand-text{font-size:19px}.back-link{font-size:10px;padding:5px 7px}.tool-intro{box-shadow:4px 4px 0 #9eb9a6}.panel{box-shadow:4px 4px 0 #a8bfaa}}
