/* Календарь периода: блокнот с кольцами, выезжает из иконки в шапке. */

.ft-cal {
    --ft-cal-grad: linear-gradient(135deg, #7aa6ff 0%, #4a80fb 35%, #3462ea 65%, #2846c4 100%);
    --ft-cal-hi: var(--prt);
    --ft-cal-soft: var(--prs);
    --dur: 780ms;
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 1.2;
}

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

.ft-cal.is-open {
    z-index: 30;
}

.ft-cal button:not(.ft-cal__trig) {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

/* ---------- триггер: иконка ↔ срок ---------- */
.ft-cal__trig {
    interpolate-size: allow-keywords;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 44px;
    width: 44px;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--bd) !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tx);
    position: relative;
    transition:
        width .46s cubic-bezier(.22, .9, .28, 1),
        padding .46s cubic-bezier(.22, .9, .28, 1),
        color .2s,
        border-color .2s,
        box-shadow .25s,
        background .2s;
}

.ft-cal.has .ft-cal__trig {
    width: max-content;
    justify-content: flex-start;
    padding: 0 26px 0 12px;
    color: var(--tx);
}

.ft-cal__trig:hover,
.ft-cal.is-open .ft-cal__trig,
.ft-cal__trig:focus-visible {
    color: var(--tx);
    border: 1px solid var(--bd) !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.ft-cal.has.is-open .ft-cal__trig {
    color: var(--tx);
}

.ft-cal__ico,
.ft-cal__txt {
    transition: opacity .22s ease, transform .35s cubic-bezier(.2, .85, .2, 1);
}

.ft-cal__ico {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: none;
}

.ft-cal__ico svg {
    width: 18px;
    height: 18px;
}

.ft-cal.has .ft-cal__ico {
    position: absolute;
    left: 8px;
    opacity: 0;
    transform: scale(.62);
    pointer-events: none;
}

.ft-cal__txt {
    opacity: 0;
    transform: translateY(4px);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.015em;
    pointer-events: none;
}

.ft-cal:not(.has) .ft-cal__txt {
    position: absolute;
    width: max-content;
}

.ft-cal.has .ft-cal__txt {
    opacity: 1;
    transform: none;
    pointer-events: none;
    transition-delay: .06s;
    animation: ftLabelIn .38s cubic-bezier(.2, .85, .2, 1);
}

@keyframes ftLabelIn {
    0% { opacity: 0; transform: translateY(5px); filter: blur(2px); }
    100% { opacity: 1; transform: none; filter: none; }
}

.ft-cal__clear {
    position: absolute;
    right: 5px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--mu);
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .2, 1.2), background .2s, color .2s;
}

.ft-cal.has .ft-cal__clear {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition-delay: .12s;
}

.ft-cal__clear svg {
    width: 12px;
    height: 12px;
}

.ft-cal__clear:hover {
    background: color-mix(in srgb, var(--tx) 10%, transparent);
    color: var(--tx);
}

/* ---------- подложка и поповер ---------- */
.ft-cal__dim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
    border: 0;
    transform: none;
    animation: none;
}

.ft-cal__pop {
    position: fixed;
    z-index: 41;
    width: 332px;
    padding: 24px 10px 10px;
    visibility: hidden;
    transform-origin: var(--ox, 24px) var(--oy, 0px);
    isolation: isolate;
}

.ft-cal__pop:focus {
    outline: none;
}

.ft-cal__pop.is-placed {
    visibility: visible;
    animation: ftPopIn .36s cubic-bezier(.2, .85, .24, 1.04);
}

.ft-cal__pop.is-placed.is-up {
    animation-name: ftPopInUp;
}

.ft-cal__pop.is-placed.is-closing {
    animation: ftPopOut .18s ease forwards;
}

.ft-cal__pop.is-placed.is-up.is-closing {
    animation-name: ftPopOutUp;
}

@keyframes ftPopIn {
    0% { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: none; }
}

@keyframes ftPopInUp {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: none; }
}

@keyframes ftPopOut {
    to { opacity: 0; transform: translateY(-4px); }
}

@keyframes ftPopOutUp {
    to { opacity: 0; transform: translateY(4px); }
}

/* ---------- кольца ---------- */
.ft-cal__rings {
    position: absolute;
    top: 2px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    z-index: 30;
    pointer-events: none;
}

.ft-cal__ring {
    width: 18px;
    height: 40px;
    display: block;
    overflow: hidden;
    transform-origin: 50% 90%;
    animation: ftJig .6s ease-out;
}

.ft-cal__ring:nth-child(odd) { animation-delay: .04s; }

@keyframes ftJig {
    0% { transform: none; }
    25% { transform: translateY(-2px) rotate(-3deg); }
    55% { transform: translateY(.8px) rotate(1.5deg); }
    100% { transform: none; }
}

/* ---------- блокнот ---------- */
.ft-cal__book {
    position: relative;
    perspective: 1100px;
    perspective-origin: 50% -20%;
    transform: translateZ(0);
    isolation: isolate;
    --dur: 780ms;
}

.ft-cal__book.fast { --dur: 440ms; }

.ft-cal__book::before,
.ft-cal__book::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: -4px;
    height: 30px;
    border-radius: 0 0 14px 14px;
    background: #0c1324;
    border: 1px solid #1a2440;
    border-top: 0;
    z-index: 0;
    pointer-events: none;
}

.ft-cal__book::after {
    left: 10px;
    right: 10px;
    bottom: -8px;
    background: #0a1020;
}

.ft-cal__page {
    position: relative;
    z-index: 1;
    border-radius: 14px;
    padding: 32px 8px 8px;
    background:
        radial-gradient(120% 70% at 12% 0%, rgba(120, 150, 255, .08), transparent 55%),
        linear-gradient(165deg, #17213a 0%, #111a2e 50%, #0d1526 100%);
    border: 1px solid #2a3756;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .05) inset,
        0 24px 50px -14px rgba(0, 0, 0, .9);
}

.ft-cal__page.is-drop {
    animation: ftDrop .28s ease;
}

.ft-cal__page.is-settle {
    animation: ftSettle .45s cubic-bezier(.3, 1.6, .5, 1);
}

@keyframes ftDrop {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes ftSettle {
    0% { transform: translateY(2px); }
    100% { transform: none; }
}

.ft-cal__holes {
    position: absolute;
    top: 11px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.ft-cal__holes i {
    position: relative;
    width: 18px;
    height: 13px;
    display: block;
}

.ft-cal__holes i::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 3px;
    top: 2px;
    bottom: 1px;
    border-radius: 2px;
    background: #03060d;
    box-shadow: inset 0 2px 3px #000, 0 1px 0 rgba(255, 255, 255, .07);
}

.ft-cal__holes i::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 5px;
    bottom: 3px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(180deg, #c9cfdb, #6f778a);
    opacity: .7;
}

.ft-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 8px;
}

.ft-cal__title {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tx);
}

.ft-cal__title .yr {
    color: var(--mu);
    font-weight: 500;
}

.ft-cal__nav {
    display: flex;
    align-items: center;
    gap: 1px;
}

.ft-cal__nav button {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: var(--ft-cal-hi);
    transition: background .2s, transform .2s cubic-bezier(.2, .8, .2, 1.2);
}

.ft-cal__nav button:hover:not(:disabled) {
    background: var(--ft-cal-soft);
}

.ft-cal__nav button:active:not(:disabled) {
    transform: scale(.92);
}

.ft-cal__nav button:disabled {
    opacity: .28;
    cursor: default;
}

.ft-cal__nav .today {
    width: auto;
    padding: 0 7px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--mu);
}

.ft-cal__nav svg {
    width: 14px;
    height: 14px;
}

.ft-cal__wd {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding-bottom: 4px;
}

.ft-cal__wd span {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: #5a6680;
}

.ft-cal__wd span:nth-child(n+6) {
    color: #5f7fd6;
}

.ft-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 3px;
}

.ft-cal__d {
    position: relative;
    height: 30px;
    display: grid;
    place-items: center;
    user-select: none;
}

.ft-cal__n {
    position: relative;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--tx);
    transition: background .15s, color .15s, transform .2s cubic-bezier(.2, .8, .2, 1.25), box-shadow .2s;
}

.ft-cal__d.day { cursor: pointer; }

.ft-cal__d.day:hover .ft-cal__n { background: rgba(255, 255, 255, .07); }

.ft-cal__d.day:active .ft-cal__n { transform: scale(.92); }

.ft-cal__d.we .ft-cal__n { color: #aab8dc; }

.ft-cal__d.off { pointer-events: none; }

.ft-cal__d.off .ft-cal__n { opacity: .32; }

.ft-cal__d.today .ft-cal__n::after {
    content: "";
    position: absolute;
    bottom: 2px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ft-cal-hi);
}

.ft-cal__d.in::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 1px;
    bottom: 1px;
    left: 0;
    right: 0;
    background: var(--ft-cal-grad);
    background-size: 700% 600%;
    background-position: calc(var(--c) * 100% / 6) calc(var(--r) * 100% / 5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

.ft-cal__d.in.capL::before {
    left: 2px;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.ft-cal__d.in.capR::before {
    right: 2px;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.ft-cal__d.in .ft-cal__n { color: #fff; }
.ft-cal__d.in.we .ft-cal__n { color: #e3ebff; }
.ft-cal__d.in:hover .ft-cal__n { background: rgba(255, 255, 255, .15); }

.ft-cal__d.preview::before { opacity: .42; }

.ft-cal__d.edge .ft-cal__n {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
    transform: scale(1.04);
}

.ft-cal__d.sel .ft-cal__n {
    background: var(--ft-cal-grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 108, 246, .5);
    transform: scale(1.06);
}

.ft-cal__d.edge.today .ft-cal__n::after,
.ft-cal__d.sel.today .ft-cal__n::after { background: #fff; }

/* ---------- перелистывание ---------- */
.ft-cal__flipper {
    position: absolute;
    inset: 0;
    z-index: 20;
    transform-origin: 50% 15px;
    transform-style: preserve-3d;
    pointer-events: none;
    will-change: transform;
}

.ft-cal__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
}

.ft-cal__front { overflow: hidden; }

.ft-cal__front::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: 14px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 35%, rgba(170, 195, 255, .16) 50%, transparent 65%);
    background-size: 100% 300%;
    background-position: 0 100%;
    opacity: 0;
}

.ft-cal__front::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    border-radius: 14px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .15));
    opacity: 0;
}

.ft-cal__back {
    transform: rotateX(180deg);
    background: linear-gradient(0deg, #1b2742, #10182b);
    border: 1px solid #2a3756;
    overflow: hidden;
}

.ft-cal__back::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, .025) 18px 19px);
}

.ft-cal__back::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 50%);
}

.ft-cal__flipper.up { animation: ftFlipUp var(--dur) cubic-bezier(.45, 0, .2, 1) forwards; }
.ft-cal__flipper.up .ft-cal__face { animation: ftFadeOut var(--dur) linear forwards; }
.ft-cal__flipper.up .ft-cal__front::before { animation: ftSweep var(--dur) ease-in-out forwards; }
.ft-cal__flipper.up .ft-cal__front::after { animation: ftDarken var(--dur) ease-in forwards; }

@keyframes ftFlipUp {
    0%   { transform: rotateX(0); }
    14%  { transform: rotateX(-6deg) translateZ(2px); }
    55%  { transform: rotateX(92deg) translateZ(16px); }
    100% { transform: rotateX(180deg); }
}

@keyframes ftFadeOut {
    0%, 72% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes ftSweep {
    0% { opacity: 0; background-position: 0 100%; }
    25% { opacity: 1; }
    60% { opacity: 1; background-position: 0 0; }
    100% { opacity: 0; background-position: 0 0; }
}

@keyframes ftDarken {
    0%, 14% { opacity: 0; }
    55% { opacity: .85; }
    100% { opacity: .9; }
}

.ft-cal__flipper.down { animation: ftFlipDown var(--dur) cubic-bezier(.3, .05, .25, 1) forwards; }
.ft-cal__flipper.down .ft-cal__face { animation: ftFadeIn var(--dur) linear forwards; }
.ft-cal__flipper.down .ft-cal__front::after { animation: ftLighten var(--dur) ease-out forwards; }

@keyframes ftFlipDown {
    0%   { transform: rotateX(180deg); }
    45%  { transform: rotateX(88deg) translateZ(16px); }
    78%  { transform: rotateX(-8deg); }
    90%  { transform: rotateX(2.5deg); }
    100% { transform: rotateX(0); }
}

@keyframes ftFadeIn {
    0% { opacity: 0; }
    22%, 100% { opacity: 1; }
}

@keyframes ftLighten {
    0%, 40% { opacity: .85; }
    78%, 100% { opacity: 0; }
}

.ft-cal__shade {
    position: absolute;
    inset: 0;
    z-index: 15;
    border-radius: 14px;
    pointer-events: none;
    transform-origin: 50% 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, .25) 70%, transparent);
    opacity: 0;
}

.ft-cal__shade.out { animation: ftShadeOut var(--dur) ease-out forwards; }
.ft-cal__shade.in { animation: ftShadeIn var(--dur) ease-in forwards; }

@keyframes ftShadeOut {
    0%, 14% { opacity: .9; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(.15); }
}

@keyframes ftShadeIn {
    0% { opacity: 0; transform: scaleY(.15); }
    70% { opacity: .85; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(1); }
}

/* ---------- подвал ---------- */
.ft-cal__foot {
    margin-top: 14px;
    padding: 10px;
    border-radius: 14px;
    background: linear-gradient(165deg, #131d33, #0d1526);
    border: 1px solid #2a3756;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ft-cal__pop.is-placed .ft-cal__foot {
    animation: ftFoot .44s .05s both cubic-bezier(.2, .85, .24, 1);
}

@keyframes ftFoot {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.ft-cal__seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #0a1020;
    border: 1px solid rgba(186, 204, 236, .55);
    border-radius: 999px;
    padding: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.ft-cal__pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: #e9eefb;
    transition: transform .32s cubic-bezier(.4, .15, .2, 1);
}

.ft-cal__seg[data-mode="range"] .ft-cal__pill { transform: translateX(100%); }

.ft-cal__seg button {
    position: relative;
    z-index: 1;
    height: 26px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--mu);
    transition: color .25s;
}

.ft-cal__seg button.on { color: #0b1324; }

.ft-cal__presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    overflow: hidden;
    max-height: 70px;
    opacity: 1;
    transition: max-height .3s ease, opacity .25s ease, margin .3s ease;
}

.ft-cal__presets.hide {
    max-height: 0;
    opacity: 0;
    margin-top: -9px;
}

.ft-cal__presets button {
    font-size: 10.5px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #2a3756;
    color: #b9c3d8;
    transition: border-color .2s, color .2s, background .2s, transform .2s;
}

.ft-cal__presets button:hover {
    border-color: var(--pr);
    color: #fff;
    background: var(--ft-cal-soft);
}

.ft-cal__presets button:active { transform: scale(.96); }

.ft-cal__inputs {
    display: grid;
    grid-template-columns: 1fr 14px 1fr;
    align-items: center;
    gap: 4px;
}

.ft-cal__inputs.single { grid-template-columns: 1fr; }

.ft-cal__inputs.single .ft-cal__sep,
.ft-cal__inputs.single .ft-cal__end { display: none; }

.ft-cal__sep {
    text-align: center;
    color: #5a6680;
    font-size: 12px;
}

.ft-cal__inp {
    position: relative;
    height: 32px;
    border: 1px solid #2a3756;
    border-radius: 8px;
    background: #0a1020;
    transition: border-color .2s, box-shadow .2s;
}

.ft-cal__inp label {
    position: absolute;
    top: -6px;
    left: 8px;
    padding: 0 4px;
    font-size: 9.5px;
    line-height: 11px;
    color: var(--mu);
    background: #111a2e;
}

.ft-cal__inp input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: none;
    color: var(--tx);
    font: 500 12px "IBM Plex Sans", sans-serif;
    font-variant-numeric: tabular-nums;
    padding: 0 10px;
    letter-spacing: .02em;
}

.ft-cal__inp input::placeholder { color: #5a6680; }

.ft-cal__inp.focus {
    border-color: var(--pr);
    box-shadow: 0 0 0 3px var(--ft-cal-soft);
}

.ft-cal__inp.focus label { color: var(--ft-cal-hi); }

.ft-cal__inp.err {
    border-color: #e5484d;
    box-shadow: 0 0 0 3px rgba(229, 72, 77, .15);
    animation: ftShake .32s;
}

.ft-cal__inp.err label { color: #ff6b6f; }

@keyframes ftShake {
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.ft-cal__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-cal__hint {
    flex: 1;
    min-width: 0;
    font-size: 10.5px;
    color: #5a6680;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: ftHint .28s ease;
}

@keyframes ftHint {
    from { opacity: .2; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

.ft-cal__btn {
    height: 32px;
    padding: 0 20px;
    min-width: 118px;
    flex: 0 0 auto;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .15s, opacity .2s, color .2s, border-color .2s;
}

.ft-cal__btn:active:not(:disabled) { transform: translateY(1px); }

.ft-cal__btn.ghost {
    border: 1px solid #2a3756;
    color: var(--mu);
}

.ft-cal__btn.ghost:hover { color: #fff; }

.ft-cal__btn.primary {
    background: var(--ft-cal-grad);
    color: #fff;
    box-shadow: 0 6px 16px rgba(59, 108, 246, .4);
}

.ft-cal__btn.primary:disabled {
    opacity: .4;
    box-shadow: none;
    cursor: default;
}

/* ---------- светлая тема ---------- */
html.ft-light .ft-cal__book::before,
html.ft-light .ft-cal__book::after {
    background: #e6ebf3;
    border-color: #d5dce8;
}

html.ft-light .ft-cal__book::after { background: #f4f6fa; }

html.ft-light .ft-cal__page {
    background:
        radial-gradient(120% 70% at 12% 0%, rgba(31, 85, 224, .06), transparent 55%),
        linear-gradient(165deg, #fff 0%, #f6f8fb 52%, #eef1f6 100%);
    border-color: var(--bd);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 18px 40px -18px rgba(19, 26, 43, .28);
}

html.ft-light .ft-cal__back {
    background: linear-gradient(0deg, #e7edf6, #f8fafc);
    border-color: var(--bd);
}

html.ft-light .ft-cal__d.day:hover .ft-cal__n { background: rgba(19, 26, 43, .06); }
html.ft-light .ft-cal__d.we .ft-cal__n { color: #3d5a9a; }
html.ft-light .ft-cal__wd span { color: var(--mu); }
html.ft-light .ft-cal__wd span:nth-child(n+6) { color: #3d5a9a; }

html.ft-light .ft-cal__foot {
    background: linear-gradient(165deg, #fff, #f3f6fb);
    border-color: var(--bd);
    box-shadow: 0 16px 36px -18px rgba(19, 26, 43, .22);
}

html.ft-light .ft-cal__seg {
    background: var(--sf2);
    border-color: color-mix(in srgb, var(--tx) 35%, var(--bd));
}

html.ft-light .ft-cal__pill { background: var(--pr); }
html.ft-light .ft-cal__seg button.on { color: #fff; }

html.ft-light .ft-cal__presets button {
    border-color: var(--bd);
    color: var(--se);
}

html.ft-light .ft-cal__presets button:hover { color: var(--pr); }

html.ft-light .ft-cal__inp {
    background: #fff;
    border-color: var(--bd);
}

html.ft-light .ft-cal__inp label { background: #f7f9fc; }

html.ft-light .ft-cal__btn.ghost {
    border-color: var(--bd);
}

html.ft-light .ft-cal__btn.ghost:hover { color: var(--tx); }

html.ft-light .ft-cal__dim {
    background: transparent;
}

html.ft-light .ft-cal__holes i::before {
    background: #c5cedb;
    box-shadow: inset 0 2px 3px rgba(19, 26, 43, .35), 0 1px 0 rgba(255, 255, 255, .8);
}

@media (prefers-reduced-motion: reduce) {
    .ft-cal__trig,
    .ft-cal__txt,
    .ft-cal__ico,
    .ft-cal__clear,
    .ft-cal__pill,
    .ft-cal__presets,
    .ft-cal__n {
        transition: none !important;
        animation: none !important;
    }

    .ft-cal__pop,
    .ft-cal__page,
    .ft-cal__flipper,
    .ft-cal__shade,
    .ft-cal__ring,
    .ft-cal__foot,
    .ft-cal__dim,
    .ft-cal__back {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
    }
}

/* ---------- телефон: нижний лист (F6) ----------
   Ниже 600px поповер у иконки не помещается без сдвигов и мелких целей: календарь
   открывается нижним листом на всю ширину, один месяц, цели касания — 44px.
   Позиционирование JS остаётся (inline top/left), листу оно не нужно — перебиваем.
   Пресеты «7 дней / Этот месяц / …» уже внутри листа, в подвале режима «Период». */
@media (max-width: 599.98px) {
    .ft-cal__dim {
        background: rgba(4, 8, 20, 0.6);
    }

    .ft-cal__pop {
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0;
        width: auto;
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 30px 12px calc(14px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        border-top: 1px solid var(--bd);
        background: var(--bg);
        box-shadow: 0 -18px 50px -12px rgba(0, 0, 0, 0.7);
        transform-origin: 50% 100%;
    }

    .ft-cal__pop.is-placed,
    .ft-cal__pop.is-placed.is-up {
        animation-name: ftSheetIn;
    }

    .ft-cal__pop.is-placed.is-closing,
    .ft-cal__pop.is-placed.is-up.is-closing {
        animation-name: ftSheetOut;
    }

    @keyframes ftSheetIn {
        0% { opacity: 0; transform: translateY(32px); }
        100% { opacity: 1; transform: none; }
    }

    @keyframes ftSheetOut {
        to { opacity: 0; transform: translateY(32px); }
    }

    .ft-cal__title {
        font-size: 16px;
    }

    .ft-cal__nav button {
        width: var(--ft-tap);
        height: var(--ft-tap);
    }

    /* Общий сброс `.ft-cal button:not(.ft-cal__trig)` специфичнее одиночных классов — поэтому `.ft-cal` впереди. */
    .ft-cal .ft-cal__nav .today {
        width: auto;
        padding: 0 10px;
        font-size: 12px;
    }

    .ft-cal__nav svg {
        width: 18px;
        height: 18px;
    }

    .ft-cal__wd span {
        font-size: 11px;
    }

    .ft-cal__d {
        height: var(--ft-tap);
    }

    .ft-cal__n {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .ft-cal__seg button {
        height: 38px;
        font-size: 13px;
    }

    /* Пресеты — одна лента с прокруткой пальцем: два ряда по 44px отнимали бы высоту листа. */
    .ft-cal__presets {
        max-height: 56px;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        margin-inline: -2px;
        padding: 2px;
    }

    .ft-cal__presets::-webkit-scrollbar {
        display: none;
    }

    .ft-cal__presets.hide {
        max-height: 0;
        margin-top: -9px;
    }

    .ft-cal .ft-cal__presets button {
        flex: none;
        min-height: var(--ft-tap);
        padding: 0 16px;
        border: 1px solid #2a3756;
        border-radius: 999px;
        font-size: 13px;
        white-space: nowrap;
    }

    .ft-cal__inp {
        height: var(--ft-tap);
    }

    /* 16px — иначе iOS Safari приближает страницу при фокусе на поле. */
    .ft-cal__inp input {
        font-size: 16px;
    }

    .ft-cal__actions {
        flex-wrap: wrap;
    }

    .ft-cal__hint {
        flex: 1 0 100%;
        font-size: 12px;
    }

    .ft-cal .ft-cal__btn {
        flex: 1 1 0;
        min-width: 0;
        height: var(--ft-tap);
        padding: 0 12px;
        font-size: 14px;
    }
}
