/* Brain Cut — тёмная тема монтажки. Акцент — «запись» (#ff5c39 → #ff3d5e). */
:root {
  --bg: #0d0e12; --bg2: #121318; --surface: #191a21; --surface2: #22242d; --surface3: #2b2e39; --line: #2c2e39;
  --text: #f2f3f7; --muted: #9a9dab; --faint: #6b6f7e;
  --accent: #ff5c39; --accent2: #ff3d5e; --accent-soft: rgba(255, 92, 57, .14);
  --ok: #3ddc97; --danger: #ff4d5e; --amber: #f5b83d; --teal: #39c6b5; --violet: #8c7bff; --pink: #f06292;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --grad: linear-gradient(135deg, #ff7a45 0%, #ff3d5e 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 15px/1.4 Onest, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
input, textarea { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: var(--safe-t); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 650; background: var(--surface2); transition: transform .12s var(--ease), background .2s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px -8px rgba(255, 61, 94, .7); }
.btn.ghost { background: var(--surface2); }
.btn.ghost.on { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.full { width: 100%; }
.btn.big { height: 54px; font-size: 17px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--text); transition: background .15s, transform .12s; }
.icon-btn:active:not(:disabled) { background: var(--surface2); transform: scale(.92); }
.icon-btn.sm { width: 34px; height: 34px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface2); font-weight: 650; font-size: 13px; color: var(--text); }

/* ---------- главный экран ---------- */
.home { overflow-y: auto; padding: calc(var(--safe-t) + 6px) 16px calc(var(--safe-b) + 28px); display: block; }
.home > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 11px; }
.logo b { display: block; font: 800 20px/1.05 Unbounded, Onest, sans-serif; letter-spacing: -.01em; }
.logo small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.logo-mark { display: block; filter: drop-shadow(0 6px 14px rgba(255, 61, 94, .35)); }
.hero { display: grid; gap: 10px; margin: 10px auto 26px; }
.new-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 118px; padding: 20px; border-radius: var(--r-xl); background: var(--grad); color: #fff; text-align: left; box-shadow: 0 18px 40px -22px rgba(255, 61, 94, .9); transition: transform .15s var(--ease); }
.new-card::after { content: ''; position: absolute; right: -40px; top: -50px; width: 190px; height: 190px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, .12); }
.new-card::before { content: ''; position: absolute; right: 54px; bottom: -36px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.new-card:active { transform: scale(.98); }
.nc-ic { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 18px; background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.nc-txt b { display: block; font: 800 21px/1.15 Unbounded, Onest, sans-serif; letter-spacing: -.01em; }
.nc-txt small { display: block; margin-top: 4px; font-size: 14px; opacity: .88; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .15s var(--ease), background .2s; }
.mini-card:active { transform: scale(.97); background: var(--surface2); }
.mini-card > span { grid-row: span 2; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; }
.mini-card.auto > span { background: rgba(140, 123, 255, .16); color: var(--violet); }
.mini-card.photo > span { background: rgba(57, 198, 181, .16); color: var(--teal); }
.mini-card b { font-weight: 700; font-size: 15px; }
.mini-card small { color: var(--muted); font-size: 12.5px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-head b { font: 700 17px Onest, sans-serif; }
.sec-head .count { color: var(--faint); font-weight: 600; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.pcard { min-width: 0; }
.pc-open { display: block; width: 100%; border-radius: var(--r-lg); overflow: hidden; transition: transform .15s var(--ease); }
.pc-open:active { transform: scale(.97); }
.pc-cover { position: relative; aspect-ratio: 4 / 5; background: var(--surface2) center / cover no-repeat; border-radius: var(--r-lg); }
.pc-dur { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .6); font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.pc-meta { display: flex; align-items: center; gap: 4px; padding: 8px 2px 0 4px; }
.pc-meta > div { flex: 1; min-width: 0; }
.pc-meta b { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta small { display: block; color: var(--muted); font-size: 12px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 34px 20px; border: 1.5px dashed var(--line); border-radius: var(--r-xl); color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin: 12px 0 6px; }
.empty p { margin: 0 auto; max-width: 340px; font-size: 14px; }
.empty-ic { width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; border-radius: 22px; background: var(--surface2); color: var(--accent); }

/* ---------- редактор ---------- */
.editor { background: var(--bg); }
.ed-top { flex: none; display: flex; align-items: center; gap: 6px; height: 54px; padding: 0 10px 0 4px; }
.ed-name { min-width: 0; max-width: 42vw; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 4px; }
.ed-preview { flex: 1; min-height: 120px; position: relative; display: grid; place-items: center; background: #07080a; overflow: hidden; }
.stage { position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05); }
.stage .view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.selbox { position: absolute; left: 0; top: 0; transform-origin: center; border: 1.5px solid #fff; border-radius: 6px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.sel-h { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #15161b; display: grid; place-items: center; pointer-events: auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); touch-action: none; }
.sel-h.rot { right: -14px; bottom: -14px; }
.sel-h.del { left: -14px; top: -14px; background: var(--surface3); color: #fff; }
.sel-h.edit { right: -14px; top: -14px; }
.guide { position: absolute; background: var(--accent); pointer-events: none; opacity: .9; }
.guide.v { left: 50%; top: 0; bottom: 0; width: 1px; }
.guide.h { top: 50%; left: 0; right: 0; height: 1px; }
.ed-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 50px; padding: 0 10px; }
.ed-time { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ed-time b { color: var(--text); font-weight: 700; }
.ed-bar-mid { display: flex; align-items: center; gap: 10px; }
.ed-bar-end { display: flex; justify-content: flex-end; }
.play-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: #0d0e12; transition: transform .12s var(--ease); }
.play-btn:active { transform: scale(.9); }
.play-btn .ic { margin-left: 1px; }
.playing .play-btn .ic { margin-left: 0; }
.ed-timeline { flex: none; height: 200px; position: relative; background: var(--bg); border-top: 1px solid #191a20; }
.ed-timeline canvas { position: absolute; inset: 0; display: block; }
.ed-tools { flex: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 6px 8px calc(var(--safe-b) + 8px); background: var(--bg2); border-top: 1px solid #191a20; }
.ed-tools::-webkit-scrollbar { display: none; }
.tool { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 6px; border-radius: var(--r); color: var(--text); transition: background .15s, transform .12s; }
.tool span { font-size: 11px; font-weight: 550; color: var(--muted); white-space: nowrap; }
.tool:active { background: var(--surface2); transform: scale(.94); }
.tool.danger { color: var(--danger); }
.tool.danger span { color: var(--danger); }
.tool.back { color: var(--muted); }
.has-sheet .ed-timeline, .has-sheet .ed-tools { display: none; }
.full .ed-top, .full .ed-timeline, .full .ed-tools, .full .sheet { display: none !important; }
.full .ed-preview { background: #000; }

/* ---------- лист инструмента ---------- */
.sheet { flex: none; max-height: 58%; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -12px 40px -20px rgba(0, 0, 0, .8); transform: translateY(30px); opacity: 0; transition: transform .26s var(--ease), opacity .2s; padding-bottom: var(--safe-b); }
.sheet.show { transform: none; opacity: 1; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 18px; }
.sheet-head b { font-size: 16px; font-weight: 700; }
.sheet-head .done { background: var(--grad); color: #fff; width: 38px; height: 38px; }
.sheet-body { overflow-y: auto; padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.sheet-body > *, .tab-pane > *, .modal > * { flex-shrink: 0; }
.sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none; letter-spacing: .01em; margin-bottom: -6px; }
.hint { color: var(--faint); font-size: 12.5px; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 .btn { padding: 0 8px; font-size: 13px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface2); font-size: 13.5px; font-weight: 600; color: var(--text); transition: background .15s, color .15s, transform .12s; }
.chip:active:not(:disabled) { transform: scale(.94); }
.chip.on { background: var(--text); color: #0d0e12; }

.sl-row { display: flex; flex-direction: column; gap: 6px; }
.sl-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); }
.sl-head b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.sl { position: relative; height: 30px; touch-action: none; cursor: pointer; }
.sl::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px; background: var(--surface3); }
.sl.center::after { content: ''; position: absolute; left: 50%; top: 9px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--faint); }
.sl-fill { position: absolute; top: 13px; height: 4px; border-radius: 2px; background: var(--accent); }
.sl-knob { position: absolute; top: 5px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); transition: transform .12s; z-index: 1; }
.sl.drag .sl-knob { transform: scale(1.2); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch-row > span:first-child { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface3); transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

.swatches { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px 2px; }
.swatches::-webkit-scrollbar { display: none; }
.sw { flex: none; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: transform .12s; }
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.sw:active { transform: scale(.88); }

.looks { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -16px; padding: 2px 16px; }
.looks::-webkit-scrollbar { display: none; }
.look { flex: none; width: 70px; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.look canvas { width: 70px; height: 88px; border-radius: 12px; display: block; transition: box-shadow .15s, transform .12s; }
.look span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.look.on canvas { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.look.on span { color: var(--text); }
.look:active canvas { transform: scale(.95); }
.adj-list { display: flex; flex-direction: column; gap: 10px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 7px 12px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--muted); }
.tab.on { color: var(--text); background: var(--surface2); }
.tab-pane { display: flex; flex-direction: column; gap: 14px; }
.field { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--bg2); outline: none; font-size: 16px; }
.field:focus { border-color: var(--accent); }
.text-area { height: auto; min-height: 56px; padding: 12px 14px; resize: none; line-height: 1.35; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.style { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 6px; border-radius: 14px; background: var(--bg2); border: 1.5px solid transparent; }
.style canvas { width: 90px; height: 48px; }
.style span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.style.on { border-color: var(--accent); }
.font-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.font { height: 48px; border-radius: 12px; background: var(--bg2); font-size: 18px; border: 1.5px solid transparent; white-space: nowrap; overflow: hidden; }
.font.on { border-color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; }
.emoji { height: 52px; font-size: 30px; border-radius: 12px; font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; transition: transform .12s, background .15s; }
.emoji:active { transform: scale(.85); background: var(--surface2); }

/* переходы: мини-анимации */
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.tr { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tr span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tr.on span { color: var(--text); }
.tr-ic { position: relative; width: 100%; aspect-ratio: 1.25; border-radius: 12px; overflow: hidden; background: #3a3d4a; display: block; transition: box-shadow .15s; }
.tr.on .tr-ic { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.tr-ic::before, .tr-ic::after { content: ''; position: absolute; inset: 0; }
.tr-ic::before { background: linear-gradient(135deg, #5d6273, #3a3d4a); }
.tr-ic::after { background: var(--grad); animation: 2.2s var(--ease) infinite; }
.tr-none::after { display: none; }
.tr-none::before { background: repeating-linear-gradient(135deg, #2b2e39 0 6px, #22242d 6px 12px); }
.tr-fade::after { animation-name: trFade; }
.tr-black::after { animation-name: trFade; background: #000; }
.tr-white::after { animation-name: trFade; background: #fff; }
.tr-slideL::after { animation-name: trSlideL; }
.tr-slideR::after { animation-name: trSlideR; }
.tr-slideU::after { animation-name: trSlideU; }
.tr-slideD::after { animation-name: trSlideD; }
.tr-wipe::after { animation-name: trWipe; }
.tr-circle::after { animation-name: trCircle; }
.tr-zoom::after { animation-name: trZoom; }
.tr-blur::after { animation-name: trFade; filter: blur(2px); }
.tr-glitch::after { animation: trGlitch 2.2s steps(6) infinite; }
.tr-spin::after { animation-name: trSpin; }
@keyframes trFade { 0%, 20% { opacity: 0 } 50%, 80% { opacity: 1 } 100% { opacity: 0 } }
@keyframes trSlideL { 0%, 15% { transform: translateX(100%) } 45%, 75% { transform: none } 100% { transform: translateX(-100%) } }
@keyframes trSlideR { 0%, 15% { transform: translateX(-100%) } 45%, 75% { transform: none } 100% { transform: translateX(100%) } }
@keyframes trSlideU { 0%, 15% { transform: translateY(100%) } 45%, 75% { transform: none } 100% { transform: translateY(-100%) } }
@keyframes trSlideD { 0%, 15% { transform: translateY(-100%) } 45%, 75% { transform: none } 100% { transform: translateY(100%) } }
@keyframes trWipe { 0%, 15% { clip-path: inset(0 100% 0 0) } 45%, 75% { clip-path: inset(0) } 100% { clip-path: inset(0 0 0 100%) } }
@keyframes trCircle { 0%, 15% { clip-path: circle(0 at 50% 50%) } 45%, 75% { clip-path: circle(75% at 50% 50%) } 100% { clip-path: circle(0 at 50% 50%) } }
@keyframes trZoom { 0%, 15% { transform: scale(1.8); opacity: 0 } 45%, 75% { transform: none; opacity: 1 } 100% { transform: scale(.4); opacity: 0 } }
@keyframes trGlitch { 0% { transform: translateX(80%) } 20% { transform: translateX(-30%) } 40% { transform: translateX(10%) } 60%, 80% { transform: none } 100% { transform: translateX(-100%) } }
@keyframes trSpin { 0%, 15% { transform: rotate(-90deg) scale(0); } 45%, 75% { transform: none } 100% { transform: rotate(90deg) scale(0) } }

/* запись голоса */
.rec-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.rec-btn { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; position: relative; }
.rec-btn::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--danger); transition: inset .2s var(--ease), border-radius .2s; }
.rec-btn.on::after { inset: 22px; border-radius: 6px; }
.rec-btn.on { animation: recPulse 1.4s infinite; }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .5) } 100% { box-shadow: 0 0 0 18px rgba(255, 77, 94, 0) } }
.rec-time { font: 700 22px Onest; font-variant-numeric: tabular-nums; }
.meter { width: 180px; height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); transform-origin: left; transform: scaleX(0); transition: transform .06s; }

/* ---------- окна ---------- */
.modal-wrap, .export-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 5, 8, .6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal-wrap.show, .export-wrap.show { opacity: 1; }
.modal, .export { width: 100%; max-width: 480px; max-height: 92%; overflow-y: auto; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 18px calc(var(--safe-b) + 18px); display: flex; flex-direction: column; gap: 14px; transform: translateY(40px); transition: transform .28s var(--ease); }
.show > .modal, .show > .export { transform: none; }
.modal h3 { margin: 0; font-size: 18px; }
.modal p { margin: 0; font-size: 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-actions { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 8px; border-radius: 12px; font-weight: 600; text-align: left; }
.menu-item:active { background: var(--surface2); }
.menu-item.danger { color: var(--danger); }
@media (min-width: 640px) {
  .modal-wrap, .export-wrap { align-items: center; }
  .modal, .export { border-radius: var(--r-xl); padding-bottom: 20px; }
}
.ex-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -6px 0 0; }
.ex-head b { font-size: 18px; }
.ex-size { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--bg2); font-size: 13.5px; color: var(--muted); }
.ex-size b { color: var(--text); }
.ex-run { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 6px 0; }
.ex-prev-wrap { position: relative; display: grid; place-items: center; width: 220px; height: 220px; }
.ex-prev { max-width: 150px; max-height: 150px; border-radius: 12px; background: #000; opacity: .9; }
.ex-ring { position: absolute; inset: 0; }
.ex-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ex-ring circle { fill: none; stroke-width: 6; }
.ex-ring .bg { stroke: var(--surface3); }
.ex-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.ex-pct { position: absolute; bottom: -2px; font: 800 18px Unbounded, Onest; padding: 2px 10px; border-radius: 99px; background: var(--surface); }
.ex-status { color: var(--muted); font-size: 14px; min-height: 20px; }
.ex-done { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 8px 0 0; }
.ex-done b { font-size: 19px; }
.ex-done p { margin: -4px 0 4px; font-size: 13.5px; word-break: break-all; }
.ex-done .row2 { width: 100%; }
.ex-ok, .ex-bad { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; color: #fff; animation: pop .45s var(--ease); }
.ex-ok { background: var(--ok); box-shadow: 0 10px 30px -10px rgba(61, 220, 151, .7); }
.ex-bad { background: var(--danger); }
@keyframes pop { 0% { transform: scale(.3); opacity: 0 } 70% { transform: scale(1.08) } 100% { transform: none; opacity: 1 } }
.about-logo { display: grid; place-items: center; margin-top: 4px; }
.about-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; }
.about-list .ic { color: var(--ok); margin-top: 2px; }
.about-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--bg2); font-size: 14px; }
.about-row span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.modal.tall { gap: 12px; }

.busy { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(4, 5, 8, .72); backdrop-filter: blur(6px); }
.busy b { font-size: 16px; }
.busy .muted { font-size: 13px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3.5px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 18px; height: 18px; border-width: 2.5px; border-top-color: #fff; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
#toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 96px); z-index: 80; transform: translate(-50%, 20px); max-width: calc(100% - 40px); padding: 11px 18px; border-radius: 999px; background: #f2f3f7; color: #0d0e12; font-weight: 650; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.cap-banner { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); z-index: 90; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: #3a2a12; color: #ffd28a; font-size: 13.5px; }

/* ---------- широкий экран (ПК, планшет) ---------- */
@media (min-width: 980px) and (min-height: 600px) {
  .editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: 56px minmax(0, 1fr) 50px 250px; }
  .ed-top { grid-column: 1 / -1; padding: 0 16px 0 8px; }
  .ed-preview { grid-column: 1; grid-row: 2; }
  .ed-bar { grid-column: 1; grid-row: 3; }
  .ed-timeline { grid-column: 1 / -1; grid-row: 4; height: auto; }
  .ed-tools, .sheet { grid-column: 2; grid-row: 2 / 4; }
  .ed-tools { display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 4px; overflow-y: auto; padding: 12px; border-top: 0; border-left: 1px solid #191a20; }
  .tool { width: auto; }
  .has-sheet .ed-timeline { display: block; }
  .sheet { max-height: none; border-radius: 0; border-left: 1px solid #191a20; box-shadow: none; transform: none; }
  .full .ed-preview { grid-column: 1 / -1; grid-row: 1 / 4; }
  .full .ed-bar { grid-column: 1 / -1; grid-row: 4; align-self: start; }
  .home { padding-top: 20px; }
  .hero { grid-template-columns: 1.4fr 1fr; }
  .hero-row { grid-template-columns: 1fr; }
  .projects { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 16px; }
}
/* ---------- телефон боком: просмотр слева, дорожки и инструменты справа ---------- */
@media (orientation: landscape) and (max-height: 599px) {
  .editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: 44px 42px minmax(0, 1fr) auto; }
  .ed-top { grid-column: 1 / -1; height: 44px; }
  .ed-preview { grid-column: 1; grid-row: 2 / 5; min-height: 0; }
  .ed-bar { grid-column: 2; grid-row: 2; height: 42px; }
  .ed-timeline { grid-column: 2; grid-row: 3; height: auto; min-height: 0; }
  .ed-tools { grid-column: 2; grid-row: 4; padding: 4px 6px 6px; }
  .sheet { grid-column: 2; grid-row: 3 / 5; max-height: none; min-height: 0; border-radius: 18px 18px 0 0; }
  .play-btn { width: 38px; height: 38px; }
  .tool { width: 60px; padding: 5px 0 4px; gap: 3px; }
  .full .ed-preview { grid-column: 1 / -1; grid-row: 1 / 4; }
  .full .ed-bar { grid-column: 1 / -1; grid-row: 4; }
  .home { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hero { grid-template-columns: 1.3fr 1fr; }
  .hero-row { grid-template-columns: 1fr; }
  .new-card { min-height: 0; }
  .modal, .export { max-height: 96%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
