/* ── Reset & base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #222222);
    padding: 16px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
    max-width: 400px;
    width: 100%;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--tg-theme-text-color, #222222);
}

.subtitle {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    margin-bottom: 24px;
}

/* ── Form groups ───────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tg-theme-text-color, #222222);
}

select,
input[type="range"] {
    width: 100%;
}

select {
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 10px;
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    color: var(--tg-theme-text-color, #222222);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
}

/* ── Duration slider ───────────────────────────────────────── */
.duration-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.duration-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--tg-theme-hint-color, #cccccc);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.duration-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    cursor: pointer;
    border: 2px solid var(--tg-theme-bg-color, #ffffff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.duration-row input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    cursor: pointer;
    border: 2px solid var(--tg-theme-bg-color, #ffffff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#duration-value {
    min-width: 36px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: var(--tg-theme-button-color, #3390ec);
}

/* ── Save button ───────────────────────────────────────────── */
.btn-save {
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    cursor: pointer;
    transition: opacity 0.15s ease;
    margin-top: 8px;
}

.btn-save:hover {
    opacity: 0.9;
}

.btn-save:active {
    opacity: 0.7;
}
