:root {
  --blue: #2563eb; --blue-d: #1d4ed8; --blue-l: #dbe7ff;
  --bg: #f3f6fc; --card: #ffffff; --text: #0f1530; --muted: #6b7385; --line: #e6eaf3; --chip: #eef3ff;
  --ok: #22c55e; --bad: #ef4444; --shadow: 0 6px 22px rgba(30, 50, 120, .08);
  --c-red: #e8553a; --c-red-bg: #fbe6e1; --c-pur: #8b3fe0; --c-pur-bg: #ece3fa; --c-grn: #6b9a30; --c-grn-bg: #e6efdb; --c-blu: #2563eb; --c-blu-bg: #dde8ff;
}
:root[data-theme="dark"] {
  --bg: #0d1220; --card: #172033; --text: #eaf0fb; --muted: #94a0b8; --line: #26324e; --chip: #1c2a4a; --blue-l: #1e3a8a; --shadow: none;
  --c-red-bg: #3a1f26; --c-pur-bg: #2b2148; --c-grn-bg: #202f1d; --c-blu-bg: #1b2a50;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.i { width: 22px; height: 22px; flex: none; } .i.big { width: 30px; height: 30px; } .flip { transform: scaleX(-1); }
.app { max-width: 720px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 22px; margin: 0 auto 12px; }
.logo.small { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; margin: 0; }
.top-btns { display: flex; gap: 8px; }
.icon-btn { border: 0; background: var(--card); width: 42px; height: 42px; border-radius: 14px; box-shadow: var(--shadow); display: grid; place-items: center; }
.greeting { font-size: 28px; line-height: 1.2; margin: 14px 0 16px; letter-spacing: -.01em; }
.greeting mark { background: var(--blue); color: #fff; padding: 0 10px; border-radius: 10px; }
.h2 { font-size: 20px; margin: 22px 2px 10px; } .h3 { margin: 0 0 10px; }
.muted { color: var(--muted); } .center { text-align: center; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 16px; }
.btn.primary, .btn.create { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.create { width: 100%; border-radius: 999px; padding: 15px; font-size: 17px; margin-top: 18px; box-shadow: 0 8px 20px rgba(37, 99, 235, .3); }
.btn.create.inline { width: auto; margin: 0; padding: 12px 22px; }
.btn.danger { color: var(--bad); }
.card { background: var(--card); border-radius: 22px; padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }

/* голос */
.voice-card { background: var(--card); border-radius: 26px; padding: 10px; box-shadow: var(--shadow); }
.seg { display: flex; background: var(--chip); border-radius: 16px; padding: 4px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 12px; color: var(--muted); }
.seg button.active { background: var(--blue); color: #fff; font-weight: 600; }
.mic { width: 100%; border: 0; border-radius: 20px; padding: 16px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; box-shadow: 0 8px 22px rgba(37, 99, 235, .3); user-select: none; -webkit-user-select: none; touch-action: none; flex-wrap: wrap; }
.mic.rec { background: linear-gradient(135deg, #ef4444, #b91c1c); animation: pulse 1.2s infinite; }
.mic .live { flex-basis: 100%; text-align: center; font-weight: 400; font-size: 14px; opacity: .92; max-height: 3.2em; overflow: hidden; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, .18); } }

/* категории */
.cats { display: grid; gap: 10px; }
.cat { display: flex; align-items: center; gap: 14px; border: 0; text-align: left; padding: 14px; border-radius: 22px; width: 100%; }
.cat .tile { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
.cat .tile .i { width: 28px; height: 28px; }
.cat b { font-size: 18px; } .cat .sub { color: var(--muted); font-size: 14px; display: block; }
.cat .badge { margin-left: 8px; font-size: 13px; font-weight: 700; padding: 1px 9px; border-radius: 10px; background: rgba(255, 255, 255, .6); }
.cat.red { background: var(--c-red-bg); } .cat.red .tile { background: var(--c-red); } .cat.red .badge { color: var(--c-red); }
.cat.pur { background: var(--c-pur-bg); } .cat.pur .tile { background: var(--c-pur); } .cat.pur .badge { color: var(--c-pur); }
.cat.grn { background: var(--c-grn-bg); } .cat.grn .tile { background: var(--c-grn); } .cat.grn .badge { color: var(--c-grn); }
.cat.blu { background: var(--c-blu-bg); } .cat.blu .tile { background: var(--c-blu); } .cat.blu .badge { color: var(--c-blu); }
.back { border: 0; background: transparent; color: var(--blue); display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; }

/* блоки задач со свайпом всего блока */
.section-title { margin: 20px 4px 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.section-title.late { color: var(--bad); }
.swipe { position: relative; margin: 10px 0; border-radius: 24px; overflow: hidden; }
.swipe .bg { position: absolute; inset: 0; display: flex; border-radius: 24px; }
.swipe .bg > div { flex: 1; display: flex; align-items: center; padding: 0 26px; }
.swipe .bg .r { background: var(--ok); justify-content: flex-start; }
.swipe .bg .l { background: var(--bad); justify-content: flex-end; }
.sw-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s; }
.sw-ico svg { width: 32px; height: 32px; }
.r .sw-ico { background: #16a34a; } .l .sw-ico { background: #b91c1c; }
.task { position: relative; background: var(--card); border-radius: 24px; padding: 14px; display: flex; align-items: center; gap: 14px; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .22s ease; box-shadow: var(--shadow); }
.task.dragging { transition: none; }
.task .tile { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; flex: none; }
.tile.t-red { background: var(--c-red); } .tile.t-blu { background: var(--c-blu); } .tile.t-pur { background: var(--c-pur); } .tile.t-grn { background: var(--c-grn); }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.task .note { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.task .meta .i { width: 16px; height: 16px; } .task .meta .late { color: var(--bad); font-weight: 600; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .acts { display: none; gap: 6px; }
@media (hover: hover) { .task .acts { display: flex; } }
.task .acts button { border: 1px solid var(--line); background: var(--bg); width: 34px; height: 34px; border-radius: 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px; }
.alldone { text-align: center; padding: 26px 14px; } .alldone .big { font-size: 44px; } .alldone h2 { margin: 6px 0; }

/* анимация после свайпа */
.burst { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; pointer-events: none; }
.burst .disc { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; animation: pop .75s cubic-bezier(.2, 1.4, .4, 1) both; box-shadow: 0 16px 50px rgba(0, 0, 0, .3); }
.burst .disc.ok { background: var(--ok); } .burst .disc.no { background: var(--bad); }
.burst svg { width: 90px; height: 90px; } .burst path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .18s ease-out forwards; }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 55% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.burst.out .disc { animation: out .25s ease-in forwards; } @keyframes out { to { transform: scale(.6); opacity: 0; } }

/* нижняя панель */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(94vw, 460px); display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 999px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 34px rgba(30, 50, 120, .18); z-index: 10; }
:root[data-theme="dark"] .tabbar { background: rgba(23, 32, 51, .9); }
.tabbar button { border: 0; background: var(--chip); color: var(--muted); height: 52px; min-width: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; transition: .2s; }
.tabbar button b { display: none; font-size: 15px; font-weight: 600; }
.tabbar button.active { background: var(--blue-l); color: var(--blue); flex: 1.6; }
.tabbar button.active b { display: inline; }
:root[data-theme="dark"] .tabbar button.active { color: #bcd2ff; }
.tabbar button.plus { background: var(--blue); color: #fff; width: 60px; height: 60px; min-width: 60px; padding: 0; box-shadow: 0 8px 20px rgba(37, 99, 235, .4); }
.tabbar button.plus .i { width: 28px; height: 28px; }
/* 7 кнопок (с «Здоровьем»): кнопки уже, чтобы панель помещалась и на 6,1" iPhone (390 px) */
.tabbar { gap: 4px; padding: 7px; }
.tabbar button { min-width: 44px; padding: 0 8px; }
@media (max-width: 380px) { .tabbar button { min-width: 42px; padding: 0 6px; } .tabbar button.plus { width: 54px; height: 54px; min-width: 54px; } }

/* шторки */
.sheet { border: 0; padding: 12px 20px 22px; width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 30px 30px 0 0; background: var(--card); color: var(--text); box-shadow: 0 -10px 50px rgba(0, 0, 0, .25); animation: up .28s ease-out; }
.sheet::backdrop { background: rgba(10, 20, 50, .45); }
@keyframes up { from { transform: translateY(60px); opacity: .4; } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; }
.tabs2 { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs2 button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--chip); color: var(--blue); padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.tabs2 button.active { background: var(--blue); color: #fff; }
.lbl { display: block; font-weight: 700; margin: 12px 0 6px; }
.sheet input[type=text] { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 13px 14px; outline: none; }
.sheet input[type=text]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.dashed-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dashed { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1.5px dashed #c9d3e8; border-radius: 14px; padding: 10px 12px; color: var(--muted); }
.dashed input { border: 0; background: transparent; outline: none; max-width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.chip { border: 1px solid var(--blue); color: var(--blue); background: transparent; border-radius: 999px; padding: 6px 13px; }
.chip.on { background: var(--blue); color: #fff; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.small-mic { margin-bottom: 8px; }
#voiceHint { font-size: 14px; margin: 6px 0 4px; }

/* чат */
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-log { height: min(52vh, 440px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 2px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.bubble.assistant { align-self: flex-start; background: var(--chip); border-bottom-left-radius: 5px; }
.bubble.wait { opacity: .65; }
.bubble .speak { display: block; margin-top: 6px; border: 0; background: transparent; color: var(--blue); padding: 0; }
.applied { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chat-form { display: flex; gap: 8px; margin-top: 8px; } .chat-form input { flex: 1; }

/* календарь */
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; }
.cal-month { font-size: 32px; margin: 0; text-transform: capitalize; } .cal-nav { display: flex; gap: 8px; }
.week { display: flex; justify-content: space-between; gap: 4px; margin: 16px 0 6px; }
.day { flex: 1; border: 0; background: transparent; border-radius: 18px; padding: 10px 0 8px; text-align: center; }
.day small { display: block; color: var(--muted); text-transform: capitalize; } .day span { display: block; font-size: 20px; font-weight: 600; margin: 4px 0 6px; }
.day.today small, .day.today span { color: var(--blue); }
.day.sel { background: var(--blue); box-shadow: 0 8px 18px rgba(37, 99, 235, .3); } .day.sel small, .day.sel span { color: #fff; }
.dots { display: flex; justify-content: center; gap: 3px; min-height: 7px; } .dots i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-sub { display: flex; justify-content: space-between; align-items: center; } .cal-sub .h2 { margin: 18px 2px 10px; }
.chips2 { display: flex; gap: 6px; } .chips2 span { background: var(--chip); border-radius: 12px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.hour { display: flex; gap: 12px; margin-top: 4px; } .hour .t { width: 52px; color: var(--muted); font-size: 14px; padding-top: 10px; flex: none; }
.hour .col { flex: 1; border-top: 1px solid var(--line); padding-top: 8px; min-width: 0; }
.ev { background: var(--card); border-radius: 20px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); display: block; }
.ev .row1 { display: flex; align-items: center; gap: 10px; } .ev .mini { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.ev b { font-size: 17px; overflow-wrap: anywhere; } .ev .note { color: var(--muted); margin: 4px 0 6px; font-size: 14px; }
.ev .meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; } .ev .meta .i { width: 16px; height: 16px; }

/* почта */
.mail-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail-num { margin: 6px 0; } .mail-num mark { background: var(--blue); color: #fff; padding: 0 8px; border-radius: 8px; }
.mail-row { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; } .mail-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .btn { margin-top: 8px; } .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: inline-block; }
.voices { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); background: #0f172a; color: #fff; border-radius: 16px; padding: 12px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); z-index: 60; max-width: 92vw; }
.toast-undo { border: 0; background: transparent; color: #93c5fd; font-weight: 700; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(92vw, 360px); background: var(--card); border-radius: 26px; padding: 26px; box-shadow: var(--shadow); display: grid; gap: 12px; text-align: center; }
.login-card h1 { margin: 0; } .login-card input { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 12px; }
.login-card .btn.primary { margin: 0; } .error { color: var(--bad); min-height: 1.2em; margin: 0; }
.soon { color: var(--muted); }

/* v3: нижняя панель без подписей, большие карточки, микрофон в панели */
.tabbar { justify-content: space-between; }
.tabbar button { flex: 1; min-width: 0; padding: 0; }
.tabbar button.active { flex: 1; background: var(--blue-l); color: var(--blue); }
.tabbar button.plus { flex: none; }
.tabbar button.tmic { touch-action: none; user-select: none; -webkit-user-select: none; }
.tabbar button.tmic.rec { background: var(--bad); color: #fff; animation: pulse 1.1s infinite; }
.listening { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); width: min(92vw, 420px); background: #0f172a; color: #fff; border-radius: 22px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; z-index: 70; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); }
.l-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1.1s infinite; flex: none; }
#listeningText { max-height: 4.2em; overflow: hidden; }
.big-block { padding: 18px 16px 16px; align-items: flex-start; flex-wrap: wrap; }
.big-block .tile { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.big-block .title { font-size: 21px; line-height: 1.25; }
.big-block .note { white-space: normal; font-size: 15px; margin-top: 4px; }
.big-block .meta { font-size: 15px; margin-top: 10px; }
.big-block .foot { flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.big-block .foot .hintline { color: var(--muted); font-size: 13px; }
.pencil { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--chip); color: var(--muted); display: grid; place-items: center; flex: none; }
.pencil .i { width: 22px; height: 22px; }
.sheet-title { margin: 0 0 12px; }
.btn.wide { width: 100%; margin-top: 10px; }
.today-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 6px; } .today-head h2 { margin: 0; font-size: 24px; } .today-head span { color: var(--muted); }

/* v4 */
html, body { overflow-x: hidden; touch-action: pan-y pinch-zoom; }
.app { min-width: 0; } .view, .card, main { min-width: 0; max-width: 100%; }
.mail-row, .mail-item { overflow: hidden; } .mail-item div { overflow-wrap: anywhere; }
.big-block .tile { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.cat.amb { background: #fdf0d5; } .cat.amb .tile { background: #e8a317; } .cat.amb .badge { color: #b07a0b; }
:root[data-theme="dark"] .cat.amb { background: #3a2e14; }
.note-form { display: flex; gap: 8px; margin: 4px 0 14px; } .note-form input { flex: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; outline: none; }
.note-item { background: var(--card); border-radius: 20px; padding: 14px 16px; margin: 8px 0; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; }
.note-item .nt { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; } .note-item .nd { color: var(--muted); font-size: 13px; margin-top: 6px; }
.note-item button { border: 0; background: var(--chip); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); }

/* v5: календарь */
.btn.pick { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 10px 16px; background: var(--blue-l); color: var(--blue); border-color: transparent; font-weight: 600; }
.week { touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden; }
.week.sl { animation: slL .26s ease-out; } .week.sr { animation: slR .26s ease-out; }
@keyframes slL { from { transform: translateX(60px); opacity: .2; } } @keyframes slR { from { transform: translateX(-60px); opacity: .2; } }
.timeline { touch-action: pan-y; min-height: 40vh; }
.ev { cursor: pointer; } .ev .note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-head { display: flex; gap: 10px; margin-bottom: 12px; } .pick-head select { flex: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 12px; font-weight: 600; }
.pk-week, .pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.pk-week span { color: var(--muted); font-size: 13px; padding: 4px 0; }
.pk-grid button { border: 0; background: transparent; height: 44px; border-radius: 14px; font-size: 16px; position: relative; }
.pk-grid button.out { color: var(--muted); opacity: .45; } .pk-grid button.today { color: var(--blue); font-weight: 700; }
.pk-grid button.sel { background: var(--blue); color: #fff; font-weight: 700; }
.pk-grid button i { position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--blue); } .pk-grid button.sel i { background: #fff; }
.dt-title { margin: 0 0 6px; overflow-wrap: anywhere; font-size: 24px; }
.dt-note { margin: 14px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-height: 40vh; overflow-y: auto; }
.dt-acts { display: grid; gap: 10px; } .dt-acts .btn { width: 100%; }
/* v6: плавные анимации */
.swipe { transition: height .32s ease, margin .32s ease; }
.task { will-change: transform, opacity; }
.week, .timeline { will-change: transform, opacity; }
.week.sl, .week.sr { animation: none; }

/* v7: плашки (уведомление и «Слушаю…») — на всю ширину экрана, полупрозрачные, не по центру */
.toast, .listening {
  left: 12px; right: 12px; transform: none; width: auto; max-width: none;
  bottom: calc(86px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 18px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.toast { justify-content: space-between; }
.toast span:first-child { flex: 1; min-width: 0; }
@media (min-width: 560px) { .toast, .listening { left: 50%; right: auto; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); } }

.mail-actions { display: flex; gap: 8px; margin-top: 8px; }
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 16px 0 24px; align-items: center; }
.pager button { border: 0; background: var(--card); box-shadow: var(--shadow); min-width: 42px; height: 42px; border-radius: 14px; font-weight: 600; }
.pager button.on { background: var(--blue); color: #fff; } .pager span { color: var(--muted); }

/* v8: инвестиции */
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.on { background: #dcfce7; color: #15803d; } .pill.off { background: #fee2e2; color: #b91c1c; }
:root[data-theme="dark"] .pill.on { background: #14351f; color: #6ee7a0; } :root[data-theme="dark"] .pill.off { background: #3b1a1a; color: #fca5a5; }
.inv-seg { margin-top: 4px; }
.banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; font-size: 14px; font-weight: 600; margin: 10px 0; }
.banner.sb { background: #fef3c7; color: #92400e; } .banner.rl { background: #dcfce7; color: #166534; }
:root[data-theme="dark"] .banner.sb { background: #3a2e14; color: #fcd34d; } :root[data-theme="dark"] .banner.rl { background: #14351f; color: #86efac; }
.total-card { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; border-radius: 26px; padding: 18px; box-shadow: 0 10px 26px rgba(37, 99, 235, .3); }
.total-card.sb { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 10px 26px rgba(217, 119, 6, .3); }
.total-card .lbl2 { opacity: .85; font-size: 14px; } .total-card .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 8px; }
.total-card .row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; } .total-card .row b { display: block; font-size: 16px; }
.up { color: #16a34a; } .down { color: #dc2626; } .total-card .up, .total-card .down { color: #fff; }
.trade-btn { margin-top: 14px; }
.pos { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 14px; margin: 8px 0; box-shadow: var(--shadow); }
.pos .tk { width: 42px; height: 42px; border-radius: 12px; background: var(--chip); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.pos .mid { flex: 1; min-width: 0; } .pos .mid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos .mid span, .pos .rt span { color: var(--muted); font-size: 13px; } .pos .rt { text-align: right; } .pos .rt b { display: block; }
.acc { background: var(--card); border-radius: 22px; padding: 14px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.acc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; } .acc-top b { font-size: 17px; }
.acc-top .sum { text-align: right; } .acc-top .sum span { display: block; font-size: 13px; }
.acc .pos { box-shadow: none; background: var(--bg); }
.chip-st { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--chip); color: var(--muted); }
.chip-st.filled { background: #dcfce7; color: #15803d; } .chip-st.open { background: #dbeafe; color: #1d4ed8; } .chip-st.rejected, .chip-st.error, .chip-st.refused { background: #fee2e2; color: #b91c1c; }
.jr { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; } .jr:last-child { border-bottom: 0; }
.badge-sb { font-size: 12px; background: #fef3c7; color: #92400e; padding: 3px 8px; border-radius: 8px; vertical-align: middle; }
.inp { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; margin-top: 2px; }
.stepper { display: flex; gap: 8px; } .stepper button { width: 50px; border: 0; background: var(--chip); border-radius: 14px; font-size: 22px; } .stepper input { flex: 1; text-align: center; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; background: var(--card); font-size: 18px; font-weight: 700; }
#tradeSheet .seg { margin: 6px 0 0; }
.order-card .big { font-size: 26px; font-weight: 800; margin: 6px 0; } .order-card .rows div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.order-card .timer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 8px; }
.order-card .ok-title { color: #16a34a; } .order-card .bad-title { color: #dc2626; }
