/* Файл хранит дизайн-систему Unscroll: шрифт, цвета дня и вечера, базовую раскладку, 3D-сцену и общие компоненты. */

/* ------------------------------------------------ ШРИФТ ------------------------------------------------ */

@font-face {
    font-family: "Nunito Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("../$fonts/nunito-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: "Nunito Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("../$fonts/nunito-cyrillic-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Nunito Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("../$fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Nunito Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("../$fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------ ЦВЕТА ------------------------------------------------ */

:root {
    /* небо днем: яркое, как у Zenly */
    --sky-top: #3B8CFF;
    --sky-middle: #7EC8FF;
    --sky-bottom: #FFD6E8;

    --ink: #1E1A33;
    --ink-soft: #4A4466;
    --muted: #7A7496;
    --line: rgba(30, 26, 51, 0.08);
    --surface: rgba(255, 255, 255, 0.94);
    --surface-solid: #FFFFFF;
    --surface-soft: #F5F3FF;
    --surface-press: #ECE8FF;
    --glass: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.9);

    --violet: #7B61FF;
    --violet-deep: #5B42E0;
    --pink: #FF4F9A;
    --pink-deep: #E0287A;
    --yellow: #FFC93C;
    --yellow-deep: #E8A600;
    --mint: #22CFA0;
    --mint-deep: #11A57E;
    --orange: #FF8A3D;
    --orange-deep: #E5661A;
    --red: #FF5B5B;
    --red-deep: #E03C3C;
    --sky: #3BA8FF;
    --sky-deep: #1D86DB;
    /* глубокий оранжевый: на нем читается белый текст */
    --orange-deep: #E2641C;
    --lilac: #B79CFF;

    --fire: #FF6B3D;
    --important: #FFB020;
    --later: #12AC80;

    --shadow-card: 0 12px 34px rgba(60, 40, 140, 0.16), 0 2px 6px rgba(60, 40, 140, 0.08);
    --shadow-float: 0 18px 44px rgba(40, 30, 110, 0.24);
    --radius-card: 28px;
    --radius-button: 20px;
    --font: "Nunito Variable", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tabbar-height: 76px;
    --panel-width: 560px;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* вечер, День рефлексии и сон: спокойная сумеречная сцена */
.app[data-theme="evening"] {
    --sky-top: #0C0D22;
    --sky-middle: #1F1A47;
    --sky-bottom: #5A3F78;
    --ink: #F1EEFB;
    --ink-soft: #D2CCEA;
    --muted: #9E97C0;
    --line: rgba(255, 255, 255, 0.09);
    --surface: rgba(22, 20, 46, 0.94);
    --surface-solid: #1A1838;
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-press: rgba(255, 255, 255, 0.11);
    --glass: rgba(22, 20, 46, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-card: 0 14px 40px rgba(6, 4, 24, 0.45);
    --shadow-float: 0 18px 44px rgba(6, 4, 24, 0.55);
}

/* ------------------------------------------------ БАЗА ------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--sky-middle);
}

body {
    font-family: var(--font);
    font-weight: 600;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 3px solid var(--violet);
    outline-offset: 3px;
}

/* ------------------------------------------------ ЭКРАН ------------------------------------------------ */

.app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-middle) 55%, var(--sky-bottom) 100%);
    /* цвет текста задается здесь, а не только у body: в темной теме палитра переопределена на .app */
    color: var(--ink);
    transition: filter 1.2s var(--ease-out);
}

/* срыв: Unscroll становится чёрно-белым до Дня рефлексии */
.app[data-bw="1"] {
    filter: grayscale(1) contrast(0.96);
}

.stage {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.stage__canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.app[data-scene="ready"] .stage__canvas {
    opacity: 1;
}

.screens {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.32s var(--ease-out), transform 0.42s var(--ease-out);
}

.screen[data-active="1"] {
    opacity: 1;
    transform: none;
}

.screen[data-transparent="1"] {
    pointer-events: none;
}

.screen[data-transparent="1"] [data-ui] {
    pointer-events: auto;
}

/* непрозрачные экраны: яркий фон и прокручиваемая колонка по центру */
.screen--panel {
    background: linear-gradient(180deg, color-mix(in srgb, var(--sky-top) 22%, #F7F5FF) 0%, #F7F5FF 38%, #FFF6FA 100%);
}

.app[data-theme="evening"] .screen--panel {
    background: linear-gradient(180deg, #1A1B48 0%, #231F55 50%, #2C2257 100%);
}

.screen__scroll {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* под плавающей нижней панелью текст плавно исчезает, а не выглядывает из-под нее */
.app:has(.tabbar:not([data-hidden="1"])) .screen--panel .screen__scroll {
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--safe-bottom) - 96px), transparent calc(100% - var(--safe-bottom) - 44px));
    mask-image: linear-gradient(180deg, #000 calc(100% - var(--safe-bottom) - 96px), transparent calc(100% - var(--safe-bottom) - 44px));
}

.screen__content {
    width: min(100%, var(--panel-width));
    margin: 0 auto;
    padding: calc(var(--safe-top) + 18px) 18px calc(var(--tabbar-height) + var(--safe-bottom) + 28px);
}

.screen__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 18px;
}

.screen__title {
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.screen__header .grow {
    flex: 1;
}

/* ------------------------------------------------ КАРТОЧКИ ------------------------------------------------ */

.card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 18px;
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.card + .card,
.section + .section {
    margin-top: 14px;
}

.card--glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

/* цветная карточка: ровный тон с плотным нижним краем, как у кнопок, без глянцевых градиентов */
.card--tint {
    background: color-mix(in srgb, var(--tint-a, var(--violet)) 11%, var(--surface-solid));
    border: 2px solid color-mix(in srgb, var(--tint-a, var(--violet)) 24%, transparent);
    box-shadow: 0 4px 0 color-mix(in srgb, var(--tint-a, var(--violet)) 30%, transparent);
}

.card__title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 900;
}

.card__hint {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.35;
}

.section__title {
    margin: 22px 4px 10px;
    font-size: 15px;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row--between {
    justify-content: space-between;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.muted {
    color: var(--muted);
}

.big-number {
    font-size: 40px;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------ КНОПКИ ------------------------------------------------ */
/* сочные пружинящие кнопки с объёмом снизу: нажатие проседает, отпускание пружинит */

.btn {
    --btn-a: var(--violet);
    --btn-b: #9A85FF;
    --btn-edge: var(--violet-deep);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    padding: 0 22px;
    border-radius: var(--radius-button);
    font-size: 17px;
    font-weight: 900;
    color: #FFFFFF;
    background: linear-gradient(180deg, var(--btn-b) 0%, var(--btn-a) 100%);
    box-shadow: 0 5px 0 var(--btn-edge), 0 10px 22px color-mix(in srgb, var(--btn-a) 38%, transparent);
    transform: translateY(0);
    transition: transform 0.18s var(--spring), box-shadow 0.18s var(--spring), filter 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.btn:active,
.btn[data-pressed="1"] {
    transform: translateY(4px) scale(0.985);
    box-shadow: 0 1px 0 var(--btn-edge), 0 4px 10px color-mix(in srgb, var(--btn-a) 30%, transparent);
}

.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

.btn--wide {
    width: 100%;
}

.btn--pink { --btn-a: var(--pink); --btn-b: #FF7AB4; --btn-edge: var(--pink-deep); }
.btn--mint { --btn-a: var(--mint); --btn-b: #4CE2B8; --btn-edge: var(--mint-deep); }
.btn--yellow { --btn-a: var(--yellow); --btn-b: #FFD96B; --btn-edge: var(--yellow-deep); color: #4A3200; }
.btn--orange { --btn-a: var(--orange); --btn-b: #FFA66B; --btn-edge: var(--orange-deep); }
.btn--sky { --btn-a: var(--sky); --btn-b: #6CC0FF; --btn-edge: var(--sky-deep); }
.btn--red { --btn-a: var(--red); --btn-b: #FF7F7F; --btn-edge: var(--red-deep); }

.btn--ghost {
    color: var(--ink);
    background: var(--surface-soft);
    box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}

.btn--ghost:active {
    box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}

.btn--small {
    min-height: 40px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 15px;
}

.btn--icon {
    width: 54px;
    min-width: 54px;
    padding: 0;
}

.btn--icon.btn--small {
    width: 40px;
    min-width: 40px;
}

.btn svg {
    width: 22px;
    height: 22px;
    flex: none;
}

.btn--small svg {
    width: 18px;
    height: 18px;
}

.link-button {
    font-weight: 800;
    color: var(--violet);
    padding: 8px 4px;
}

.app[data-theme="evening"] .link-button {
    color: var(--lilac);
}

/* круглая иконка-кнопка в шапках */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s var(--spring);
}

.icon-button:active {
    transform: scale(0.9);
}

.icon-button svg {
    width: 22px;
    height: 22px;
}

/* ------------------------------------------------ ПЛАШКИ ------------------------------------------------ */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px 0 8px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 900;
    color: var(--ink);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 22px rgba(40, 30, 110, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-variant-numeric: tabular-nums;
}

.pill svg {
    width: 26px;
    height: 26px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    background: var(--surface-soft);
    border: 2px solid transparent;
    transition: transform 0.2s var(--spring), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip:active {
    transform: scale(0.94);
}

.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
    color: var(--violet-deep);
    background: color-mix(in srgb, var(--violet) 14%, var(--surface-solid));
    border-color: var(--violet);
}

.app[data-theme="evening"] .chip[aria-pressed="true"],
.app[data-theme="evening"] .chip[aria-checked="true"] {
    color: #FFFFFF;
    background: color-mix(in srgb, var(--violet) 40%, transparent);
}

.chip svg {
    width: 18px;
    height: 18px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #FFFFFF;
    background: var(--violet);
}

.badge--fire { background: var(--fire); }
.badge--important { background: var(--important); color: #4A3200; }
.badge--later { background: var(--later); }
.badge--soft { color: var(--violet-deep); background: color-mix(in srgb, var(--violet) 14%, transparent); }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 0 3px var(--surface-solid);
}

/* ------------------------------------------------ ПОЛЯ ------------------------------------------------ */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field__label {
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
    padding: 0 4px;
}

.input,
.textarea {
    width: 100%;
    min-height: 56px;
    padding: 14px 18px;
    border: 2px solid transparent;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface-soft);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.textarea {
    min-height: 110px;
    resize: none;
    line-height: 1.4;
}

.input:focus,
.textarea:focus {
    border-color: var(--violet);
    background: var(--surface-solid);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--violet) 16%, transparent);
}

.input::placeholder,
.textarea::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.input[aria-invalid="true"] {
    border-color: var(--red);
}

/* ошибка показывается прямо под полем и только при нарушении */
.field__error {
    min-height: 0;
    padding: 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--red);
}

.field__error:empty {
    display: none;
}

/* ползунок */
.slider {
    --value: 50%;
    width: 100%;
    height: 34px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

.slider::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--violet) 0 var(--value), var(--surface-press) var(--value) 100%);
}

.slider::-moz-range-track {
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--violet) 0 var(--value), var(--surface-press) var(--value) 100%);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 34px;
    height: 34px;
    margin-top: -10px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 4px solid var(--violet);
    box-shadow: 0 6px 14px rgba(91, 66, 224, 0.4);
}

.slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 4px solid var(--violet);
}

/* переключатель */
.switch {
    position: relative;
    flex: none;
    width: 58px;
    height: 34px;
    border-radius: 999px;
    background: var(--surface-press);
    transition: background 0.25s ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 3px 8px rgba(30, 26, 51, 0.25);
    transition: transform 0.3s var(--spring);
}

.switch[aria-checked="true"] {
    background: var(--mint);
}

.switch[aria-checked="true"]::after {
    transform: translateX(24px);
}

/* сегменты */
.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 18px;
    background: var(--surface-soft);
}

.segmented button {
    flex: 1;
    min-height: 42px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 15px;
    color: var(--muted);
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.segmented button[aria-selected="true"] {
    color: var(--ink);
    background: var(--surface-solid);
    box-shadow: 0 4px 12px rgba(40, 30, 110, 0.12);
}

/* строка списка */
.list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 60px;
    padding: 10px 4px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: #FFFFFF;
    background: var(--tile, var(--violet));
}

.list-row__icon svg {
    width: 24px;
    height: 24px;
}

.list-row__body {
    flex: 1;
    min-width: 0;
}

.list-row__title {
    font-size: 17px;
    font-weight: 800;
}

.list-row__sub {
    font-size: 14px;
    color: var(--muted);
}

/* ------------------------------------------------ НИЖНЯЯ ПАНЕЛЬ ------------------------------------------------ */

.tabbar {
    position: absolute;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 12px);
    z-index: 30;
    display: flex;
    gap: 2px;
    width: min(calc(100% - 24px), 480px);
    height: 66px;
    padding: 6px;
    border-radius: 26px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    transform: translateX(-50%);
    transition: transform 0.45s var(--spring), opacity 0.3s ease;
}

.tabbar[data-hidden="1"] {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 120%);
}

.tabbar__blob {
    position: absolute;
    top: 6px;
    left: 6px;
    height: calc(100% - 12px);
    border-radius: 20px;
    background: linear-gradient(180deg, #9A85FF, var(--violet));
    box-shadow: 0 8px 18px rgba(91, 66, 224, 0.4);
    transition: transform 0.5s var(--spring), width 0.3s ease, background 0.3s ease;
}

.tabbar__item {
    position: relative;
    z-index: 1;
    /* ширина по подписи плюс равная доля остатка: длинное «Полезное» не вылезает за подложку */
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 4px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
    transition: color 0.25s ease, transform 0.25s var(--spring);
}

.tabbar__item svg {
    width: 25px;
    height: 25px;
    transition: transform 0.4s var(--spring);
}

.tabbar__item[aria-selected="true"] {
    color: #FFFFFF;
}

.tabbar__item[aria-selected="true"] svg {
    transform: translateY(-1px) scale(1.08);
}

.tabbar__item:active {
    transform: scale(0.92);
}

.tabbar__dot {
    position: absolute;
    top: 7px;
    right: calc(50% - 20px);
}

/* ------------------------------------------------ ЛИСТЫ И ОКНА ------------------------------------------------ */

.layer {
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 18, 60, 0.36);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.sheet {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(100%, var(--panel-width));
    max-height: calc(100% - var(--safe-top) - 24px);
    border-radius: 32px 32px 0 0;
    background: var(--surface-solid);
    box-shadow: 0 -12px 40px rgba(30, 20, 90, 0.25);
    transform: translate(-50%, 104%);
    transition: transform 0.48s var(--spring);
    pointer-events: auto;
}

.sheet[data-open="1"] {
    transform: translate(-50%, 0);
}

.sheet[data-full="1"] {
    height: calc(100% - var(--safe-top) - 24px);
}

.sheet__handle {
    flex: none;
    width: 46px;
    height: 6px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: var(--surface-press);
}

.sheet__header {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px 4px 22px;
}

.sheet__title {
    flex: 1;
    margin: 0;
    font-size: 24px;
    font-weight: 900;
}

.sheet__body {
    position: relative;
    flex: 1;
    min-height: 0;
}

.sheet__content {
    padding: 8px 22px calc(var(--safe-bottom) + 24px);
}

.sheet__footer {
    flex: none;
    padding: 10px 22px calc(var(--safe-bottom) + 18px);
}

/* полноэкранный оверлей: перехват, День рефлексии, подарок, фокус */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
}

.overlay[data-open="1"] {
    opacity: 1;
    transform: none;
}

/* ------------------------------------------------ УВЕДОМЛЕНИЯ ------------------------------------------------ */

.toasts {
    position: absolute;
    top: calc(var(--safe-top) + 12px);
    left: 50%;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(calc(100% - 24px), 420px);
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    background: var(--surface-solid);
    box-shadow: var(--shadow-float);
    animation: toast-in 0.5s var(--spring);
}

.toast svg {
    width: 26px;
    height: 26px;
    flex: none;
}

.toast--coins {
    color: #5A3D00;
    background: linear-gradient(180deg, #FFE38A, #FFC93C);
}

.toast--error {
    color: #FFFFFF;
    background: var(--red);
}

.toast[data-leaving="1"] {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.9); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

.confetti {
    position: absolute;
    inset: 0;
    z-index: 90;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ------------------------------------------------ ЗАГРУЗКА И ОШИБКА ------------------------------------------------ */

.loader {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.loader__dot {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: loader-pulse 1.1s ease-in-out infinite;
}

.app:not([data-state="loading"]) .loader {
    opacity: 0;
}

@keyframes loader-pulse {
    0%, 100% { transform: scale(0.6); opacity: 0.35; }
    50% { transform: scale(1); opacity: 0.9; }
}

.status {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 95;
    width: min(420px, calc(100% - 48px));
    margin: 0;
    transform: translate(-50%, -50%);
    padding: 18px 22px;
    border-radius: 22px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-float);
    text-align: center;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 800;
    color: var(--ink);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.4;
}

.empty svg {
    width: 54px;
    height: 54px;
    color: var(--lilac);
}

.skeleton {
    border-radius: 18px;
    background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface-press) 50%, var(--surface-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.2s linear infinite;
}

@keyframes skeleton {
    to { background-position: -200% 0; }
}

/* ------------------------------------------------ КАСАНИЕ ------------------------------------------------ */

.ripples {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ripple {
    position: absolute;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.6);
    animation: ripple-out 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes ripple-out {
    from { transform: scale(0.3); opacity: 1; }
    to { transform: scale(1.4); opacity: 0; }
}

/* ------------------------------------------------ ПРОКРУТКА ------------------------------------------------ */
/* видимые полосы рисует scrollbars.js; нативные скрыты только там, где компонент уже работает */

.scroll-area {
    position: absolute;
    inset: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.scroll-area[data-custom-scroll="1"] {
    scrollbar-width: none;
}

.scroll-area[data-custom-scroll="1"]::-webkit-scrollbar {
    display: none;
}

.scrollbar {
    position: absolute;
    z-index: 4;
    border-radius: var(--scrollbar-radius, 999px);
    background: var(--scrollbar-track, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: none;
}

.scrollbar[data-visible="1"],
.scrollbar:hover,
.scrollbar[data-dragging="1"] {
    opacity: 1;
}

.scrollbar__thumb {
    position: absolute;
    border-radius: inherit;
    background: var(--scrollbar-thumb, rgba(43, 33, 64, 0.28));
    transition: background 0.2s ease;
}

.scrollbar:hover .scrollbar__thumb,
.scrollbar[data-dragging="1"] .scrollbar__thumb {
    background: var(--scrollbar-thumb-hover, rgba(43, 33, 64, 0.46));
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.12s !important;
    }
}
