:root {
    --bg: #ededf2;
    --card: #d9d9df;
    --card-active: #cfcfd6;
    --text: #1f1f23;
    --text-muted: #8f8f8f;
    --text-strong: #38383d;
    --button-text: #f2f2f5;
    --button-bg: #373737;
    --back: #c1c1c1;
    --radius: 18px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1f;
        --card: #26262c;
        --card-active: #303038;
        --text: #e6e6ea;
        --text-muted: #66666b;
        --text-strong: #ffffff;
        --button-text: #e6e6ea;
        --button-bg: #3a3a42;
        --back: #484849;
    }
}

body,
html {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overscroll-behavior: none;
    height: 100%;
}

* {
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.app {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.header {
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 14px;
    text-align: center;
    font-weight: bold;
}

.subheader {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-strong);
    font-weight: bold;
}

.subheader::before,
.subheader::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--text-muted);
    margin: 0 10px;
}

.card {
    padding: 22px;
    border-radius: var(--radius);
    background: var(--card);
    font-size: 20px;
    font-weight: 400;
    transition:
        background 0.12s ease,
        transform 0.05s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card.hover {
    background: var(--card-active);
}
.card.active {
    background: var(--card-active);
    transform: scale(0.99);
}

.card .sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.card + .card {
    margin-top: 4px;
}

.card + .subheader {
    margin-top: 4px;
}

input,
button,
select,
textarea {
    border: none;
    background: var(--card);
    color: var(--text);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 18px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    margin-top: 8px;
    transition:
        background 0.12s ease,
        transform 0.05s ease;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 9L12 15L18 9' stroke='%231f1f23' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 24px;
    cursor: pointer;
}

select.hover {
    background-color: var(--card-active);
}

@media (prefers-color-scheme: dark) {
    select {
        background-image: url("data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 9L12 15L18 9' stroke='%23e6e6ea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    }
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select.active {
    background-color: var(--card-active);
}

textarea {
    resize: vertical;
}

button {
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: bold;
    cursor: pointer;
}

button.hover {
    opacity: 0.9;
}

button.active {
    transform: scale(0.98);
    opacity: 0.9;
}

button:disabled {
    opacity: 0.5;
}

#back {
    position: fixed;
    top: 7px;
    left: 10px;
    align-items: center;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background-color: var(--back);
    color: var(--text);
    font-weight: 500;
    transition:
        background-color 0.2s,
        transform 0.1s;
}

hr {
    border: none;
    border-top: 1px solid var(--text-muted);
    margin: 16px 0 8px 0;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-color: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: var(--card-active);
    border-radius: 3px;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--button-bg);
    margin-top: -9px;
    transition: transform 0.1s ease;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: var(--card-active);
    border-radius: 3px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    border: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--button-bg);
}

#version {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.8em;
    color: var(--text-muted);
}

.nomargin {
    margin: 0 !important;
}

.row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
