:root { color-scheme: light; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif; color: #182d4b; background: #edf2fa; }
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100% - 2rem, 67rem); margin: auto; padding: clamp(1.25rem, 5vw, 3.7rem) 0 1.75rem; }
header { margin-bottom: clamp(1.15rem, 4vw, 2.35rem); }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2.15rem, 7vw, 4.2rem); line-height: 1.06; letter-spacing: -.085em; }
header p { margin-top: .65rem; color: #485e7d; }
.layout { display: grid; grid-template-columns: minmax(19rem, 1.04fr) minmax(0, 1fr); gap: clamp(.7rem, 2.7vw, 1.5rem); align-items: start; }
form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem .65rem; padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid #dae3f0; border-radius: 1rem; background: #fff; }
.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: .38rem; color: #223c60; font-size: .9rem; font-weight: 750; }
.entry, select { min-height: 2.85rem; width: 100%; min-width: 0; border: 1px solid #b9c9dd; border-radius: .55rem; background-color: #f7f9fd; }
.entry { display: flex; align-items: center; padding-right: .65rem; }
.entry:focus-within, select:focus-visible, button:focus-visible { outline: 2px solid #2455a3; outline-offset: 2px; }
.entry:has([aria-invalid="true"]) { border-color: #aa332a; }
.entry span { font-size: .78rem; color: #486282; white-space: nowrap; }
input { min-width: 0; width: 100%; color: #182d4b; border: 0; background: none; outline: none; font: inherit; padding: .62rem .25rem .62rem .65rem; }
input::placeholder { color: #647692; opacity: 1; }
select { appearance: none; color: #182d4b; padding: 0 2rem 0 .65rem; font: inherit; font-weight: 700; background-image: linear-gradient(45deg, transparent 50%, #34567f 50%), linear-gradient(135deg, #34567f 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.actions { display: grid; grid-template-columns: 1.45fr 1fr .9fr; gap: .4rem; }
button { border: 1px solid #c9d5e4; border-radius: .58rem; background: #edf2fa; color: #18365d; min-height: 2.9rem; font: inherit; font-weight: 750; cursor: pointer; }
.primary { border-color: #214c91; background: #214c91; color: white; }
button:hover { filter: brightness(.94); }
#error { color: #8d291e; font-size: .88rem; }
.form-note { color: #485e7d; font-size: .86rem; }
.price-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
#apply-average { padding-inline: .65rem; font-size: .82rem; white-space: nowrap; }
#apply-average:disabled { opacity: .6; cursor: default; }
#price-note { margin-top: .4rem; }
.source-note { margin-top: .95rem; color: #485e7d; font-size: .84rem; }
.source-note a { color: #214c91; }
.result { border-radius: 1rem; background: #132a4c; color: white; padding: clamp(1.05rem, 4vw, 2rem); }
.main-result { padding-bottom: 1.15rem; }
.result h2 { font-size: 1rem; letter-spacing: -.025em; color: #d5e4fb; }
#total { font: 760 clamp(2.45rem, 8.5vw, 4.3rem)/1.06 system-ui, sans-serif; letter-spacing: -.07em; margin: .34rem 0 .55rem; color: #fff; overflow-wrap: anywhere; }
#distance-summary { color: #c6d8f2; font-size: .88rem; }
dl div { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .68rem 0; border-top: 1px solid #436084; }
dt { flex: 0 0 auto; color: #d2e3fa; font-size: .91rem; }
dd { font: 730 1.15rem/1.1 system-ui, sans-serif; text-align: right; overflow-wrap: anywhere; }
.split { border-bottom: 1px solid #436084; }
.split dd { color: #a9ddf9; }
#split-detail { margin-top: .85rem; color: #d8eaff; font-size: .88rem; }
.rounding { margin-top: .9rem; font-size: .8rem; color: #c6d8f2; }
@media (max-width: 700px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 350px) { main { width: calc(100% - 1.25rem); } form { padding: .8rem; } button { font-size: .9rem; } }
