:root {
    color-scheme: light;
    --background: #f8f5ee;
    --surface: #ffffff;
    --text: #28231d;
    --muted: #655d52;
    --accent: #b57a14;
    --accent-strong: #8b5d12;
    --line: #e6ded1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

.app {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: max(26px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

header {
    margin-bottom: 22px;
}

h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: 0;
}

header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.4;
}

.calculator {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span,
.quick h2 {
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 14px;
    font-size: 20px;
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 23px, calc(100% - 14px) 23px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

.selectors {
    display: grid;
    grid-template-columns: 1fr 46px 1fr;
    align-items: end;
    gap: 10px;
}

.swap {
    width: 46px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent-strong);
    font-size: 26px;
    font-weight: 700;
}

.result {
    display: block;
    min-height: 42px;
    margin-top: 8px;
    color: #1e1a16;
    font-size: 29px;
    font-weight: 800;
    line-height: 1.18;
}

.detail {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.38;
}

.quick {
    margin-top: 30px;
}

.quick h2 {
    margin: 0 0 10px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick button {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
}

button:active {
    transform: translateY(1px);
}

@media (max-width: 390px) {
    .app {
        padding-left: 14px;
        padding-right: 14px;
    }

    h1 {
        font-size: 28px;
    }

    .selectors {
        grid-template-columns: 1fr;
    }

    .swap {
        width: 100%;
    }

    .quick-buttons {
        grid-template-columns: 1fr;
    }
}
