/* Layout: one phone column (max 520px), screens swap in place, fixed tab bar. Same tokens as the client cabinet; documents sit on white "paper". */
:root {
    --bg: #F5F1FA;
    --surface: #FFFFFF;
    --surface-2: #EEE7F8;
    --ink: #1D1430;
    --muted: #6D6482;
    --line: #E3DAEF;
    --brand: #6C22F0;
    --accent: #6C22F0;
    --accent-ink: #FFFFFF;
    --accent-soft: #EEE5FF;
    --cream: #FFF7EA;
    --lilac: #A475FF;
    --ok: #1F8A62;
    --ok-soft: #DCF2E8;
    --danger: #C2364B;
    --warn: #9A5700;
    --warn-soft: #FFF0D6;
    --paper: #FFFFFF;
    --paper-ink: #1D1430;
    --paper-muted: #6D6482;
    --paper-line: #E3DAEF;
    --shadow: 0 1px 2px rgba(40, 20, 80, .06), 0 10px 28px rgba(70, 30, 140, .09);
    --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --r-xl: 28px;
    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 12px;
    --tabbar-h: 64px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #110C1A; --surface: #1B1427; --surface-2: #261C37; --ink: #F2ECFA; --muted: #A69CBA;
        --line: #30254A; --accent: #8F5BFF; --accent-ink: #FFFFFF; --accent-soft: #2B1F48;
        --ok: #4CC793; --ok-soft: #163126; --danger: #FF7085; --warn: #F2B35C; --warn-soft: #33240E;
        --paper: #F7F4FB; --paper-ink: #1D1430; --paper-muted: #6D6482; --paper-line: #DDD3EB;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .38);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #110C1A; --surface: #1B1427; --surface-2: #261C37; --ink: #F2ECFA; --muted: #A69CBA;
    --line: #30254A; --accent: #8F5BFF; --accent-ink: #FFFFFF; --accent-soft: #2B1F48;
    --ok: #4CC793; --ok-soft: #163126; --danger: #FF7085; --warn: #F2B35C; --warn-soft: #33240E;
    --paper: #F7F4FB; --paper-ink: #1D1430; --paper-muted: #6D6482; --paper-line: #DDD3EB;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .38);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    background: var(--bg); color: var(--ink);
    font-family: var(--font-body); font-size: 15px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

.app {
    max-width: 520px; margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 14px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px));
}
.app.with-bar { padding-bottom: calc(var(--tabbar-h) + 110px + env(safe-area-inset-bottom, 0px)); }
.app.no-tabbar { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.screen { display: grid; gap: 18px; animation: enter .34s var(--ease) both; }
@keyframes enter { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 15px; max-width: 46ch; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.head { display: grid; gap: 6px; padding-top: 4px; }
.head-row { display: flex; align-items: center; gap: 10px; }
.head-row .title { flex: 1; min-width: 0; }
.icon-btn {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink);
    transition: transform .15s var(--ease);
}
.icon-btn:active { transform: scale(.94); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.demo-note { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 8px 12px; text-align: center; }

/* Greeting + hero */
.greet { display: flex; align-items: center; gap: 12px; }
.greet-text { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.greet-text small { color: var(--muted); font-size: 13px; }
.greet-text b { font-size: 17px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 17px; }
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--brand); color: var(--cream);
    border-radius: var(--r-xl); padding: 20px 18px 18px;
    display: grid; gap: 12px; box-shadow: 0 14px 34px rgba(108, 34, 240, .28);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: var(--lilac); opacity: .55; }
.hero::before { width: 150px; height: 150px; top: -62px; right: -48px; }
.hero::after { width: 190px; height: 120px; bottom: -70px; left: -60px; opacity: .4; }
.hero-logo { width: 48%; max-width: 210px; height: auto; display: block; }
.hero-text { font-size: 14.5px; line-height: 1.45; max-width: 34ch; opacity: .94; }
.ask { display: flex; gap: 8px; background: var(--surface); border-radius: 18px; padding: 6px 6px 6px 14px; align-items: center; }
.ask input, .search input { border: 0; border-radius: 0; background: none; box-shadow: none; }
.ask input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--ink); padding: 8px 0; }
.ask input:focus, .search input:focus { outline: none; box-shadow: none; }
.ask input::placeholder { color: var(--muted); }
.ask .btn { padding: 10px 14px; border-radius: 13px; }
.ask:focus-within { box-shadow: 0 0 0 4px rgba(255, 247, 234, .35); }
.hint-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hint-chips button {
    font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; color: var(--cream);
    background: rgba(255, 247, 234, .14); border: 1px solid rgba(255, 247, 234, .24);
}
.ask-result { font-size: 13.5px; background: rgba(255, 247, 234, .14); border-radius: 12px; padding: 9px 12px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; border: 1px solid var(--line); text-align: left; width: 100%; }
.card.raised { box-shadow: var(--shadow); border-color: transparent; }
button.card { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
button.card:active { transform: scale(.985); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row > * { min-width: 0; }
.pill { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.meta { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.list { display: grid; gap: 10px; }
.section { display: grid; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 13.5px; padding: 4px 0; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action { display: grid; gap: 10px; align-content: space-between; min-height: 104px; padding: 14px 12px; }
.action .ico { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.action .ico svg.i { width: 20px; height: 20px; }
.action.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.action.primary .ico { background: rgba(255, 255, 255, .18); color: var(--accent-ink); }
.action b { display: block; font-size: 14px; line-height: 1.25; }

.proj { display: grid; gap: 8px; }
.proj-name { font-weight: 700; font-size: 15.5px; }
.due { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.due .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.due.soon .dot { background: var(--warn); }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink); }

.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.doc-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.doc-row b { display: block; font-size: 14.5px; line-height: 1.3; }
.doc-row .meta { font-size: 12.5px; }

/* Templates */
.seg { --i: 0; --n: 4; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); background: var(--surface-2); border-radius: 16px; padding: 4px; }
.seg::before {
    content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px;
    width: calc((100% - 8px) / var(--n)); border-radius: 12px; background: var(--surface);
    box-shadow: 0 1px 3px rgba(30, 10, 70, .12);
    transform: translateX(calc(100% * var(--i))); transition: transform .32s var(--ease);
}
.seg button { position: relative; border: 0; background: none; padding: 9px 2px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--muted); transition: color .2s; }
.seg button[aria-selected="true"] { color: var(--ink); }
.tpl { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.tpl .doc-ico { width: 44px; height: 44px; border-radius: 14px; }
.tpl b { display: block; font-size: 15px; line-height: 1.3; }
.tpl small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.tpl svg.i { color: var(--muted); width: 20px; height: 20px; }
.tpl.locked .doc-ico { background: var(--surface-2); color: var(--muted); }
.legal-mark { display: inline-flex; gap: 5px; align-items: center; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 8px; }
.upload { display: grid; gap: 12px; border: 1.5px dashed var(--line); background: transparent; }
.upload-top { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.upload-top .doc-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Clients */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 0 14px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg.i { color: var(--muted); width: 20px; height: 20px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); padding: 12px 0; }
.search input:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; transition: all .2s var(--ease); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.client { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.client .avatar { width: 44px; height: 44px; font-size: 16px; }
.client b { display: block; font-size: 15px; line-height: 1.3; }
.client svg.i { color: var(--muted); width: 20px; height: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 7px; }
.kv { display: grid; margin: 0; }
.kv div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv div:first-child { border-top: 0; padding-top: 2px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Form */
form, .form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .flabel { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto { font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 7px; border-radius: 7px; }
input[type="text"], input[type="date"], input[type="time"], textarea, select {
    width: 100%; font: inherit; font-size: 16px; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 13px;
    transition: border-color .2s, box-shadow .2s; resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field.filled input, .field.filled textarea, .field.filled select { background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > * { min-width: 0; }
.scene { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.scene-top { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.scene input { padding: 9px 11px; font-size: 15px; border-radius: 11px; }

.btn {
    border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 700; font-size: 15.5px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .15s var(--ease), opacity .2s, background-color .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.block { width: 100%; }
.btn.small { padding: 9px 13px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .45; }
.btn svg.i { width: 19px; height: 19px; }
.btn-col { display: grid; gap: 8px; width: 100%; }

.notice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); font-size: 13.5px; line-height: 1.45; }
.notice svg.i { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg.i, .notice.warn b { color: var(--warn); }
.notice b { display: block; font-size: 14px; }

/* Steps of the create screen */
.stepper { display: grid; gap: 10px; }
.step-h { display: flex; align-items: center; gap: 10px; }
.step-h .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--accent-soft); color: var(--accent); flex: none; }
.step-h b { font-size: 15.5px; }
.opts { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.opt {
    border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md);
    padding: 11px 10px; text-align: left; display: grid; gap: 2px; min-width: 0;
    transition: border-color .2s, background-color .2s, transform .15s var(--ease);
}
.opt:active { transform: scale(.98); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt b { font-size: 14.5px; }
.opt small { color: var(--muted); font-size: 12px; line-height: 1.3; }

/* Paper preview */
.sheet-wrap { border-radius: var(--r-lg); background: var(--surface-2); padding: 14px; overflow: hidden; }
.sheet {
    background: var(--paper); color: var(--paper-ink); border-radius: 6px;
    box-shadow: 0 2px 10px rgba(30, 10, 70, .14);
    padding: 22px 20px 20px; font-size: 11.5px; line-height: 1.45; display: grid; gap: 12px;
    min-height: 360px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--brand); line-height: 1.15; }
.wordmark small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 9px; letter-spacing: .12em; color: var(--paper-muted); }
.sheet-no { text-align: right; font-size: 9.5px; color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.sheet h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.25; }
.sheet .sub { color: var(--paper-muted); font-size: 10.5px; margin-top: 2px; }
.sheet dl { display: grid; margin: 0; }
.sheet dl div { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--paper-line); }
.sheet dl div:first-child { border-top: 0; }
.sheet dt { color: var(--paper-muted); }
.sheet dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sheet .empty-val { color: var(--danger); font-weight: 600; }
.sheet .tbl-wrap { overflow-x: auto; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 10px; min-width: 300px; }
.sheet th { text-align: left; font-weight: 700; color: var(--paper-muted); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; padding: 4px 5px; border-bottom: 1.5px solid var(--paper-ink); }
.sheet td { padding: 5px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.sheet td:first-child { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.sheet .h5 { font-weight: 800; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.sheet .price-box { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: color-mix(in srgb, var(--brand) 8%, var(--paper)); border-radius: 6px; padding: 10px 12px; }
.sheet .price-box b { font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.sign div { display: grid; gap: 14px; font-size: 10px; color: var(--paper-muted); }
.sign i { display: block; border-bottom: 1px solid var(--paper-ink); height: 1px; }
.sheet-foot { border-top: 1px solid var(--paper-line); padding-top: 8px; color: var(--paper-muted); font-size: 9px; display: flex; justify-content: space-between; gap: 10px; }

/* Bottom action bar */
.bar-wrap {
    position: fixed; left: 0; right: 0; z-index: 20;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 22px 10px;
    background: linear-gradient(to bottom, transparent, var(--bg) 40%);
    pointer-events: none;
}
.actionbar {
    max-width: 488px; margin: 0 auto; pointer-events: auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--surface); border-radius: 20px; padding: 10px 10px 10px 16px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.actionbar small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.actionbar strong { font-size: 15px; }

/* Done */
.done-screen { text-align: center; justify-items: center; padding-top: 16px; }
.done-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.done-mark svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-mark path { stroke-dasharray: 30; stroke-dashoffset: 0; animation: draw .6s .15s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 30; } }
.done-screen .lead { margin: 0 auto; }
.done-screen .card { text-align: left; }
.file { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.file .doc-ico { width: 44px; height: 44px; border-radius: 14px; }
.file .doc-ico.pdf { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* Locked / denied */
.state { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 36px 8px; }
.state .ico-big { width: 76px; height: 76px; border-radius: 26px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.state .ico-big svg.i { width: 34px; height: 34px; }
.state .lead { margin: 0 auto; }
.plan-preview { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.plan-preview div { aspect-ratio: 1; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; max-width: 100%; }
.plan-preview div.on { background: var(--accent-soft); color: var(--accent); }

/* Tab bar */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tabbar-in { max-width: 488px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tab { border: 0; background: none; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 700; transition: color .2s; }
.tab[aria-current="page"] { color: var(--accent); }
.tab svg { transition: transform .25s var(--ease); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }

.toast {
    position: fixed; z-index: 40; left: 0; right: 0; margin: 0 auto; width: fit-content;
    bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; text-align: center;
    background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
    animation: enter .25s var(--ease) both;
}
.foot-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

@media (max-width: 340px) {
    .actions { grid-template-columns: 1fr; }
    .action { min-height: 0; grid-template-columns: auto 1fr; align-items: center; }
    .opts { grid-template-columns: 1fr; }
    .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Рабочая версия: загрузка, вход, ошибки */
.loading { color: var(--muted); text-align: center; padding: 48px 0; }
.login-box { display: grid; justify-items: center; gap: 14px; min-height: 48px; }
.form-error { color: var(--danger); font-size: 13.5px; background: color-mix(in srgb, var(--danger) 10%, transparent); padding: 10px 12px; border-radius: 12px; }
.status-chips .chip { padding: 6px 11px; font-size: 13px; }
.btn.busy { opacity: .6; pointer-events: none; }
.empty-card { text-align: center; color: var(--muted); padding: 22px 16px; display: grid; gap: 12px; justify-items: center; }
