:root{font-family:"Noto Sans KR","Malgun Gothic",system-ui,sans-serif;color:#f6efdc;background:#8e79a3;font-synthesis:none}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100vh;background:#8e79a3}button,input{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #fff3ac;outline-offset:4px}main{max-width:960px;margin:auto;padding:28px 18px 35px}.tabs{display:flex;justify-content:center;gap:5px;margin:0 auto 7px;padding:4px;width:max-content;background:#6e598339;border:1px solid #d3c1e04d;border-radius:8px}.tabs button{border:0;background:none;color:#e4d9ed;font-size:13px;padding:10px 25px;border-radius:5px}.tabs button[aria-selected=true]{background:#f1d26f;color:#574021;box-shadow:0 2px 5px #48354c33;font-weight:700}.frame-shell{width:min(535px,100%);aspect-ratio:2/3;position:relative;margin:0 auto}.frame-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}.frame-content{position:absolute;top:14%;left:18%;right:18%;bottom:14%;display:flex;flex-direction:column;gap:11px}.screen{padding:8px 12px;background:#e8e3cf;color:#423b45;border:1px solid #655374;border-radius:5px;box-shadow:inset 1px 2px 5px #42384a30,0 1px 0 #c9b7d5}.screen-top{height:17px;display:flex;justify-content:space-between;font-size:10px;color:#716776}.screen-top button{border:0;background:none;font-size:8px;color:#726675;padding:0 0 3px}.expression{height:16px;font-family:monospace;text-align:right;font-size:11px;color:#817384;white-space:nowrap;overflow:hidden}output{display:block;text-align:right;font-family:ui-monospace,"Courier New",monospace;font-size:42px;letter-spacing:-2px;line-height:1.25;white-space:nowrap;overflow:hidden}#screen-hint{min-height:12px;font-size:9px;line-height:1.3;color:#885442;text-align:right}.memory-row{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.memory-row button{height:25px;padding:0;border:1px solid #6d567e;background:#a48cb7;color:#f9f1ff;border-radius:3px;font-size:9px;box-shadow:0 2px 0 #6f557f}.keypad{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;flex:1;min-height:0}.key{min-height:34px;border-radius:5px;border:1px solid #776286;background:#e6ddec;color:#4a3956;font-size:23px;box-shadow:0 3px 0 #665075,inset 0 1px 0 #fff9;transition:transform .08s,background .12s}.key:hover{background:#faf3ff}.key:active,.key.pressed{transform:translateY(2px);box-shadow:0 1px 0 #665075}.key.special{font-size:15px;background:#c7b4d5}.key.operator{background:#b39ac4;color:#402c50;font-size:25px}.key.equals{background:#efd071;color:#59421f;border-color:#b08a37;box-shadow:0 3px 0 #8c6b2c,inset 0 1px 0 #fff1a8}.key.equals:active,.key.equals.pressed{box-shadow:0 1px 0 #8c6b2c}.key.thousands{font-size:16px;color:#765923;background:#e4d8b2}.inline-unit{padding-top:12px;border-top:1px solid #d7c5e34d;margin-top:3px}.unit-heading{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#f4ead9;margin-bottom:10px}.unit-heading small{font-size:8px;color:#e0d1e8}.unit-fields{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:9px;align-items:end}.unit-fields label{font-size:9px;color:#eadeef;min-width:0}.unit-fields input{display:block;width:100%;height:34px;padding:6px 8px;margin-top:4px;border:1px solid #6e557f;border-radius:4px;background:#d7c7e1;color:#4a3559;font-size:15px;min-width:0}.unit-fields input::placeholder{color:#8c769a}.unit-fields>span{font-size:17px;color:#e6d29c;line-height:34px;text-align:center}input[type=number]{appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#unit-status{font-size:9px;color:#fff1c0;min-height:12px;margin:5px 0 0}input[aria-invalid=true]{border-color:#a53e30!important}.history-panel{max-width:340px;margin:7px auto 0;border-top:1px solid #c7b4d350;padding:13px 0;color:#e8dbef;font-size:11px}.history-panel summary{cursor:pointer;list-style-position:inside}.history-tools{display:flex;justify-content:flex-end;margin:12px 0}.history-tools button{background:none;border:0;color:#e6d8ef;font-size:10px;text-decoration:underline}.history-entry{display:flex;width:100%;align-items:center;justify-content:space-between;gap:14px;border:0;border-bottom:1px solid #d8c5e133;background:none;padding:12px 2px;color:#fcf0d1}.history-entry small{color:#ddcce9;font-size:11px;font-family:monospace}.history-entry strong{font-size:15px;font-weight:500}.empty-history{font-size:11px;color:#decde9;padding:15px 0}.currency-panel{max-width:820px;margin:35px auto 0;background:#f3edf6;color:#4f3c5d;border:1px solid #bfa8cb;border-radius:10px;padding:30px;box-shadow:0 10px 30px #4c345b26}.currency-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.currency-heading h1{font-size:22px;margin:0 0 9px;font-weight:600}.currency-heading a{font-size:11px;color:#84658e;text-underline-offset:3px}#refresh-rates{border:1px solid #c2a8ce;border-radius:5px;background:#e1d3e9;color:#644b75;font-size:11px;padding:9px 12px}.rates-status{min-height:32px;font-size:11px;line-height:1.7;color:#8a7198;margin:22px 0 18px}.rates-status.error{color:#a14a38}.currency-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.currency-card{padding:20px;background:#fdf9f2;border:1px solid #e0d1e6;border-radius:7px;min-width:0}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.card-heading h2{font-size:14px;font-weight:600;margin:0}.currency-code{font-family:monospace;font-size:11px;color:#a188ac}.rate-label{font-size:10px;color:#987f69;min-height:16px;margin:10px 0 20px}.money-field{display:block;font-size:10px;color:#9a81a7;margin:12px 0 0}.money-field>span{display:block;margin-bottom:6px}.money-input{display:flex;align-items:center;background:#f0e8f5;border:1px solid #dccbe6;border-radius:5px;padding-right:11px}.money-input input{min-width:0;width:100%;height:45px;padding:10px;background:none;border:0;color:#604770;font-size:19px}.money-input input:disabled{cursor:wait}.money-input b{font-size:10px;color:#a087ad;font-weight:400}.card-status{font-size:9px;color:#a24d3d;min-height:12px;margin:9px 0 0}.rate-note{font-size:10px;color:#927d9d;line-height:1.8;margin:18px 0 0}.rate-note+.rate-note{margin-top:5px}@media(max-width:600px){main{padding:21px 10px 25px}.tabs button{font-size:12px;padding:9px 23px}.frame-content{gap:8px}.frame-shell{width:min(470px,100%)}.screen{padding:6px 9px}.screen-top{height:14px}.expression{height:13px;font-size:9px}output{font-size:36px}.keypad{gap:7px}.key{font-size:21px;min-height:27px}.key.special{font-size:12px}.key.thousands{font-size:13px}.key.operator{font-size:22px}.memory-row button{height:21px;font-size:8px}.inline-unit{padding-top:9px;margin-top:0}.unit-heading{margin-bottom:7px;font-size:10px}.unit-fields{gap:6px}.unit-fields input{height:29px;font-size:13px}.unit-fields>span{line-height:29px}.unit-heading small{font-size:7px}#unit-status{font-size:8px;min-height:10px;margin-top:3px}.history-panel{width:64%;margin-top:4px;font-size:10px}.currency-panel{margin-top:25px;padding:22px 17px}.currency-cards{grid-template-columns:1fr;gap:13px}.currency-card{padding:19px}.currency-heading h1{font-size:20px}.rates-status{font-size:10px}}@media(max-width:370px){main{padding-left:4px;padding-right:4px}.frame-content{gap:6px}.screen{padding:5px 8px}output{font-size:30px}.screen-top{height:12px}.expression{height:11px}.keypad{gap:6px}.key{font-size:18px}.inline-unit{padding-top:7px}.unit-heading{margin-bottom:5px}.unit-fields input{height:25px}.memory-row button{height:19px}.unit-fields>span{line-height:25px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@media(max-width:370px){.frame-content{gap:5px}.screen{padding:4px 8px}.screen-top{height:10px}.expression{height:10px;font-size:8px}output{font-size:28px;line-height:1.1}#screen-hint{min-height:9px;font-size:8px;line-height:1.1}.unit-heading{font-size:9px;line-height:1.2}.unit-fields label{font-size:8px;line-height:1.2}.unit-fields input{margin-top:3px}#unit-status{min-height:9px;font-size:8px;line-height:1.1;margin:3px 0 0}}
/* Larger, immediate touch targets for the calculator keys. */
button{touch-action:manipulation}
.screen-top{justify-content:flex-end}
.keypad{grid-template-rows:repeat(5,minmax(42px,1fr)) minmax(48px,1.12fr);gap:8px}
.key{min-height:42px;font-size:26px;user-select:none;-webkit-user-select:none}
.key.clear-key{background:#cbb9d8}
.key.clear-key{grid-column:span 2}
.key.backspace-key{background:#dfc57a;color:#51401e;border-color:#ae8f44}
.key-spacer{visibility:hidden;pointer-events:none}
.key.equals{grid-column:1/-1;min-height:48px;font-size:29px}
.rate-value{font-size:22px;font-weight:650;letter-spacing:-.4px;color:#5f4770;margin:16px 0 4px;font-variant-numeric:tabular-nums}
@media(max-width:600px){.keypad{grid-template-rows:repeat(5,minmax(34px,1fr)) minmax(40px,1.12fr);gap:6px}.key{min-height:34px;font-size:23px}.key.equals{min-height:40px;font-size:26px}.rate-value{font-size:21px}}
@media(max-width:370px){.keypad{grid-template-rows:repeat(5,minmax(31px,1fr)) minmax(36px,1.12fr);gap:5px}.key{min-height:31px;font-size:21px}.key.equals{min-height:36px;font-size:24px}}
.screen-top{height:auto;min-height:22px;justify-content:space-between;align-items:center}
.screen-delete{width:28px;height:22px;padding:0;border:1px solid #9f8ba9;border-radius:4px;background:#d8ccdf;color:#51445a;font-size:15px;line-height:1;touch-action:manipulation}
.keypad{grid-template-rows:repeat(4,minmax(48px,1fr)) minmax(50px,1.05fr)}
.key.clear-key,.key.equals{grid-column:span 2}
.key.equals{min-height:50px}
@media(max-width:600px){.keypad{grid-template-rows:repeat(4,minmax(39px,1fr)) minmax(42px,1.05fr)}.key.equals{min-height:42px}}
@media(max-width:370px){.keypad{grid-template-rows:repeat(4,minmax(35px,1fr)) minmax(38px,1.05fr)}.key.equals{min-height:38px}.screen-top{min-height:20px}.screen-delete{width:26px;height:20px}}
