:root {
    --ink: #001a66;
    --accent: #5b2dff;
    --accent2: #00b3ff;
    --bg: #ffffff;
    --muted: #4c5a7a;
    --line: #b8c2d8;
    --line-focus: #7d8fb3;
    --radius: .9rem
}

* {
    box-sizing: border-box
}

html {
    font-size: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    line-height: 1.4
}

.wrap {
    max-width: 60rem;
    margin-inline: auto;
    padding: 1.25rem 1.25rem
}

h1 {
    font-weight: 800;
    letter-spacing: .2px;
    margin: 0 0 .5rem;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    color: var(--ink)
}

h2,
h3 {
    margin: 1.5rem 0 .5rem;
    font-size: clamp(1.25rem, 3vw, 1.75rem)
}

.lead {
    font-size: clamp(1rem, 2.4vw, 1.125rem)
}

.hint {
    font-size: .95rem;
    color: var(--muted)
}

.accent {
    color: #0b6b2f;
    font-weight: 700
}

.muted {
    color: var(--muted)
}

.card {
    background: #fff;
    border: 1px solid #e6e8f0;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
    display: flex;
    flex-direction: column;
    align-items: center
}

.grid {
    display: inline-grid;
    grid-template-columns: max-content 1fr;
    column-gap: .5rem;
    row-gap: 1rem;
    align-items: center;
    margin-top: .5rem;
    width: max-content
}

label {
    font-weight: 600;
    white-space: nowrap
}

.field {
    display: inline-flex;
    align-items: center
}

.field input[type=text],
.field select {
    width: 100%;
    max-width: 16ch;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    font-size: 1rem;
    background: #fff;
    outline: none
}

.field input[type=text] {
    text-align: right
}

.field select {
    text-align: left
}

.field input[type=text]:focus,
.field select:focus {
    border-color: var(--line-focus);
    box-shadow: 0 0 0 .15rem rgba(125, 143, 179, .18)
}

.unit {
    margin-left: .4rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums
}

.actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    justify-content: center
}

.btn {
    appearance: none;
    border: 0;
    border-radius: .8rem;
    padding: .75rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .2s ease, opacity .2s
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), #7f3bff 45%, var(--accent2));
    color: #fff;
    box-shadow: 0 6px 18px rgba(91, 45, 255, .35)
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18)
}

.btn.ghost {
    background: #f5f7ff;
    color: var(--ink);
    border: 1px solid #e6e8f0
}

.btn.ghost:hover {
    background: #eef1ff
}

#result {
    margin-top: 1rem;
    font-size: 1.1rem;
    text-align: right
}

hr {
    border: 0;
    border-top: 1px solid #e6e8f0;
    margin: 1.25rem 0
}

.content p {
    margin: .5rem 0 0
}

table {
    border-collapse: collapse
}

td,
th {
    padding: .25rem .5rem
}

td.num,
th.num,
input[type=number] {
    text-align: right
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
    display: block
}

@media (max-width:48rem) {
    .card {
        align-items: stretch
    }

    .grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: .5rem;
        width: 100%
    }

    label {
        text-align: left
    }

    .field input[type=text],
    .field select,
    .btn {
        width: 100%;
        max-width: 100%
    }

    .wrap {
        padding: 1rem .75rem
    }
}