/* ================= Дневник тренировок — mobile first ================= */
:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --dark: #0f172a;
    --accent: #f97316;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --blue: #2563eb;
    --amber: #d97706;
    --radius: 16px;
    --tabbar-h: 62px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    font-size: 15px;
    overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding-top: var(--safe-t);
}

.topbar-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 12px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.topbar-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.today-btn {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.today-btn:active { transform: scale(.96); }

/* ------------------------------------------------------------ layout */
main {
    max-width: 820px;
    margin: 0 auto;
    padding: 12px 12px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin: 22px 4px 10px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.card-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; }

/* ------------------------------------------------------------ week strip */
.weekstrip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.wday {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 2px 7px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: .15s;
}
.wday:active { transform: scale(.95); }
.wday .wd-name { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.wday .wd-num { font-size: 17px; font-weight: 700; margin-top: 1px; }
.wday.today .wd-num { color: var(--accent); }
.wday.active {
    background: var(--dark);
    border-color: var(--dark);
    color: #fff;
}
.wday.active .wd-name { color: #94a3b8; }
.wday.active.today .wd-num { color: #fdba74; }
.wday .wd-dot {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: transparent;
}
.wday .wd-dot.done { background: var(--green); }
.wday .wd-dot.partial { background: var(--accent); }
.wday .wd-dot.rest { background: #94a3b8; }
.wday.active .wd-dot.done { background: #4ade80; }

/* ------------------------------------------------------------ day picker */
.daypick {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.daypick::-webkit-scrollbar { display: none; }

.daypick button {
    flex: 1 0 auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}
.daypick button.active { background: var(--dark); border-color: var(--dark); color: #fff; }

/* ------------------------------------------------------------ progress */
.progress-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ring { width: 56px; height: 56px; flex: 0 0 56px; position: relative; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .track { fill: none; stroke: #e2e8f0; stroke-width: 5; }
.ring .bar { fill: none; stroke: var(--green); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring span {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

.progress-meta { min-width: 0; flex: 1; }
.progress-meta h2 { margin: 0; font-size: 15px; font-weight: 700; }
.progress-meta p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-done { background: var(--green-soft); color: #14532d; }
.pill-progress { background: #ffedd5; color: #7c2d12; }
.pill-rest { background: #e2e8f0; color: #475569; }

/* ------------------------------------------------------------ exercises */
.exercise-list { display: flex; flex-direction: column; gap: 10px; }

.ex-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.ex-card.type-superset { border-left: 4px solid #22c55e; }
.ex-card.type-cardio { border-left: 4px solid #eab308; }
.ex-card.complete { background: #f6fdf8; border-color: #bbf7d0; }

.ex-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    cursor: pointer;
}

.ex-thumb {
    width: 54px; height: 44px;
    flex: 0 0 54px;
    border-radius: 10px;
    background: #eef2f7 center/cover no-repeat;
    border: 1px solid var(--line);
}

.ex-main { flex: 1; min-width: 0; }
.ex-name { font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.ex-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .4px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 5px;
    vertical-align: 1px;
}
.tag-superset { background: #bbf7d0; color: #14532d; }
.tag-cardio { background: #fef08a; color: #713f12; }

.ex-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
.ex-count.full { background: var(--green-soft); color: #14532d; }

/* чипы подходов */
.sets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 12px 12px;
}

.set-chip {
    flex: 1 1 62px;
    min-width: 62px;
    min-height: 44px;
    border: 1.5px solid var(--line);
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    padding: 4px;
    transition: .12s;
}
.set-chip:active { transform: scale(.94); }
.set-chip .sc-n { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.set-chip .sc-v { font-size: 12px; font-weight: 700; }
.set-chip.done {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}
.set-chip.done .sc-n { color: rgba(255, 255, 255, .8); }

/* ------------------------------------------------------------ поля */
.session-tools { margin-top: 16px; }

.field { display: block; margin-bottom: 10px; }
.field > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 5px 4px;
}
.field input, .field textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 15px;
    outline: none;
    resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: #94a3b8; }

.session-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.btn {
    border: none;
    border-radius: 13px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    min-height: 46px;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--dark); color: #fff; }
.btn-primary.is-done { background: var(--green); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-danger-ghost { background: transparent; color: #b91c1c; border: 1px solid #fecaca; }
.btn-sm { padding: 9px 13px; font-size: 13.5px; min-height: 40px; border-radius: 11px; }

/* ------------------------------------------------------------ программа */
.strategy-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-bottom: 16px;
}
.strategy-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 12px 14px;
}
.strategy-card h3 { margin: 0 0 3px; font-size: 13.5px; }
.strategy-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

.day-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}
.day-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-radius: 999px;
    margin-bottom: 5px;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #166534; }
.day-title { font-size: 15.5px; font-weight: 700; margin-bottom: 12px; }

.plan-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 0;
    border-top: 1px solid #f1f5f9;
    cursor: pointer;
}
.plan-row:first-of-type { border-top: none; }
.plan-num {
    width: 26px;
    flex: 0 0 26px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
}
.plan-main { flex: 1; min-width: 0; }
.plan-name { font-size: 14px; font-weight: 620; line-height: 1.25; }
.plan-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plan-go { color: #cbd5e1; font-size: 18px; }

.start-day-btn { width: 100%; margin-top: 12px; }

.footer-note { text-align: center; font-size: 12px; color: #94a3b8; margin: 18px 0 4px; }

/* ------------------------------------------------------------ календарь */
.cal-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 10px 14px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month { font-size: 15px; font-weight: 700; text-transform: capitalize; }
.cal-nav {
    width: 38px; height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #f8fafc;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}
.cal-week, .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-week span {
    text-align: center;
    font-size: 10.5px;
    color: var(--muted);
    text-transform: uppercase;
    padding-bottom: 4px;
}
.cal-day {
    aspect-ratio: 1 / 1;
    border-radius: 11px;
    border: 1px solid transparent;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}
.cal-day.blank { background: transparent; cursor: default; }
.cal-day.today { border-color: var(--accent); color: var(--accent); }
.cal-day.done { background: var(--green); color: #fff; }
.cal-day.partial { background: #ffedd5; color: #7c2d12; }
.cal-day.rest { background: #e2e8f0; color: #475569; }
.cal-day .cd-mark { font-size: 8.5px; font-weight: 800; letter-spacing: .2px; opacity: .85; }

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-done { background: var(--green); }
.dot-partial { background: #fdba74; }
.dot-rest { background: #cbd5e1; }

.hist-row {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 11px 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.hist-date { font-size: 13px; font-weight: 700; width: 62px; flex: 0 0 62px; }
.hist-main { flex: 1; min-width: 0; }
.hist-title { font-size: 13.5px; font-weight: 620; }
.hist-note { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    padding: 28px 16px;
}

/* ------------------------------------------------------------ статистика */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-bottom: 12px;
}
.stat-tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
}
.stat-val { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat-lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.bar-row { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.bar-name { font-size: 12px; flex: 0 0 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--dark); border-radius: 999px; }
.bar-val { font-size: 11.5px; color: var(--muted); width: 26px; text-align: right; }

/* ------------------------------------------------------------ tabbar */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: var(--safe-b);
}
.tab {
    background: none;
    border: none;
    padding: 8px 2px 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    cursor: pointer;
    min-height: var(--tabbar-h);
    justify-content: center;
}
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: 10.5px; font-weight: 600; }
.tab.active { color: var(--dark); }

/* ------------------------------------------------------------ sheet */
.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 60;
    animation: fade .2s;
}
@keyframes fade { from { opacity: 0 } }

.sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 61;
    background: var(--bg);
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: rise .26s cubic-bezier(.2, .9, .3, 1);
    box-shadow: 0 -8px 40px rgba(15, 23, 42, .2);
}
@keyframes rise { from { transform: translateY(100%) } }

.sheet-grabber {
    padding: 9px 0 5px;
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
    cursor: grab;
    touch-action: none;
}
.sheet-grabber::before {
    content: "";
    width: 42px; height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
}

.sheet-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 14px calc(24px + var(--safe-b));
}

.sheet-title { font-size: 18px; font-weight: 750; margin: 4px 0 2px; line-height: 1.2; }
.sheet-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* галерея */
.gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-bottom: 6px;
    padding-bottom: 2px;
}
.gallery::-webkit-scrollbar { display: none; }
.gal-item {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: center;
    border-radius: 14px;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
}
.gal-item img { display: block; width: 100%; height: 210px; object-fit: contain; background: #eef2f7; }
.gal-item.photo img { object-fit: cover; }
.gal-del {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, .6);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
.gal-hint { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0 0 12px; }

.upload-row { display: flex; gap: 8px; margin-bottom: 14px; }
.upload-row .btn { flex: 1; }

.info-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; margin-bottom: 10px; }
.info-block h4 { margin: 0 0 5px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.info-block p { margin: 0; font-size: 14px; }
.info-block ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; }
.info-block li { margin-bottom: 4px; }

.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.meta-tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px 8px;
    text-align: center;
}
.meta-tile b { display: block; font-size: 16px; }
.meta-tile span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }

/* строки подходов в карточке */
.set-line {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 8px 10px;
    margin-bottom: 7px;
}
.set-line.done { background: #f0fdf4; border-color: #bbf7d0; }
.set-check {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    border: 1.5px solid var(--line);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
}
.set-line.done .set-check { background: var(--green); border-color: var(--green); color: #fff; }
.set-inputs { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.set-inputs label { position: relative; display: block; }
.set-inputs input {
    width: 100%;
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 10px;
    padding: 9px 10px 9px 42px;
    font-size: 15px;
    outline: none;
    min-height: 40px;
}
.set-inputs input:focus { border-color: #94a3b8; background: #fff; }
.set-inputs .u {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    pointer-events: none;
}

.hist-mini { font-size: 12.5px; color: var(--muted); }
.hist-mini div { padding: 4px 0; border-top: 1px solid #f1f5f9; }
.hist-mini div:first-child { border-top: none; }
.hist-mini b { color: var(--text); }

/* ------------------------------------------------------------ таймер */
.rest-timer {
    position: fixed;
    left: 10px; right: 10px;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
    z-index: 70;
    background: var(--dark);
    color: #fff;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .28);
    animation: rise .22s;
    max-width: 800px;
    margin: 0 auto;
}
.rest-ring { position: relative; width: 44px; height: 44px; flex: 0 0 44px; }
.rest-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.rest-track { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 4; }
.rest-bar { fill: none; stroke: #fb923c; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .95s linear; }
.rest-ring span {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.rest-text { flex: 1; min-width: 0; }
.rest-text b { display: block; font-size: 13.5px; }
.rest-text span { font-size: 11.5px; color: #94a3b8; }
.rest-close {
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* ------------------------------------------------------------ toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 76px);
    transform: translateX(-50%);
    background: rgba(15, 23, 42, .93);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 90;
    animation: fade .2s;
    max-width: 88vw;
    text-align: center;
}

/* ------------------------------------------------------------ планшет / десктоп */
@media (min-width: 700px) {
    body { font-size: 15.5px; }
    main { padding: 18px 18px calc(var(--tabbar-h) + 30px); }
    .strategy-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .session-actions { flex-direction: row; }
    .session-actions .btn { flex: 1; }
    .sheet { max-width: 640px; margin: 0 auto; border-radius: 22px; bottom: 20px; max-height: 88vh; }
    .sheet-backdrop { animation: fade .18s; }
    .gal-item { flex: 0 0 78%; }
    .ex-thumb { width: 64px; height: 50px; flex: 0 0 64px; }
    .set-chip { flex: 0 0 78px; }
}

/* ------------------------------------------------------------ вход */
.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(24px + var(--safe-b));
}

.auth-wrap { width: 100%; max-width: 380px; }

.auth-card {
    background: var(--card);
    border-radius: 22px;
    padding: 26px 20px 22px;
    box-shadow: 0 20px 50px rgba(2, 6, 23, .35);
}

.auth-logo { width: 54px; height: 54px; display: block; margin: 0 auto 14px; border-radius: 14px; }
.auth-title { margin: 0 0 5px; font-size: 20px; font-weight: 750; text-align: center; }
.auth-sub { margin: 0 0 20px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.4; }

.auth-field { display: block; position: relative; margin-bottom: 12px; }
.auth-field > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 5px 4px;
}
.auth-field input {
    width: 100%;
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 12px;
    padding: 13px 46px 13px 13px;
    font-size: 16px;
    outline: none;
    min-height: 48px;
}
.auth-field input:focus { border-color: #94a3b8; background: #fff; }

.auth-eye {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 16px;
    opacity: .35;
    cursor: pointer;
}
.auth-eye.on { opacity: .9; }

.auth-hint { font-size: 11.5px; color: var(--muted); margin: -4px 4px 14px; line-height: 1.4; }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--muted);
    margin: 2px 4px 16px;
    cursor: pointer;
}
.auth-remember input { width: 19px; height: 19px; accent-color: #0f172a; }

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-submit { width: 100%; }
.auth-submit:disabled { opacity: .6; }

.auth-foot { text-align: center; font-size: 12px; color: #94a3b8; margin: 16px 0 0; }

/* ------------------------------------------------------------ настройки */
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 38px;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.94); }

.set-group { margin-bottom: 10px; }
.set-group .field:last-child { margin-bottom: 0; }

.auth-ok {
    background: var(--green-soft);
    border: 1px solid #bbf7d0;
    color: #14532d;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
