:root {
  color-scheme: dark;
  --bg: #090b0a;
  --panel: rgba(23, 26, 24, .72);
  --panel-solid: #171a18;
  --line: rgba(255, 255, 255, .095);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f4f6f4;
  --muted: #8f9691;
  --accent: #b6f542;
  --surface-radius: 18px;
  --script-size: 38px;
  --script-color: #f5f7f5;
  --prompter-background: #050706;
  --script-line-height: 1.38;
  --script-column-width: 86%;
  --script-align: left;
  --script-weight: 610;
  --script-mirror: 1;
  --focus-zone-center: 38%;
  --focus-zone-height: clamp(96px, 15vh, 132px);
  --focus-zone-dim: .46;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 0; min-height: 100%; margin: 0; overflow-x: clip; background: var(--bg); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: radial-gradient(ellipse 70% 42% at 50% -12%, rgba(182, 245, 66, .045), transparent 72%), var(--bg);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, textarea, input { font: inherit; }
button { color: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease, opacity 150ms ease, box-shadow 150ms ease; }
button:focus-visible, textarea:focus-visible, input:focus-visible, .prompter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  width: min(100%, 1060px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 46px auto minmax(240px, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.topbar, .brand, .brand-name, .heading, .actions, .sliders label, .header-actions { display: flex; align-items: center; }
.topbar { justify-content: space-between; min-width: 0; box-shadow: inset 0 -1px rgba(255,255,255,.065); }
.header-actions { gap: 7px; }
.brand { min-width: 0; gap: 10px; }
.brand-logo { width: 44px; height: 44px; flex: 0 0 44px; overflow: visible; background: transparent; }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 6px rgba(182,245,66,.2)); }
.brand-name { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; line-height: 1; }
.brand-name strong { font-size: 13px; font-weight: 430; letter-spacing: .16em; }
.brand-name span { color: #8e9690; font-size: 6px; font-weight: 400; letter-spacing: .3em; }

.focus-button, .recording-button, .settings-button, .scripts-button, .import-button, .ai-studio-button {
  position: relative; height: 34px; min-height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(30,33,31,.66);
  box-shadow: inset 0 1px rgba(255,255,255,.035); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.focus-button:hover, .recording-button:hover, .settings-button:hover, .scripts-button:hover, .import-button:hover, .ai-studio-button:hover { border-color: rgba(182,245,66,.18); background: rgba(38,41,39,.76); box-shadow: inset 0 1px rgba(255,255,255,.04), 0 0 12px rgba(182,245,66,.075); }
.focus-button::after, .recording-button::after, .settings-button::after, .scripts-button::after, .ai-studio-button::after { content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px; height: 1px; border-radius: 1px; background: var(--accent); opacity: 0; transform: scaleX(.45); transition: opacity 180ms ease, transform 180ms ease; }
.focus-button[aria-pressed="true"], .recording-button[aria-pressed="true"], .settings-button[aria-expanded="true"], .scripts-button[aria-expanded="true"], .ai-studio-button[aria-expanded="true"] { border-color: rgba(182,245,66,.14); color: #e7eddf; background: rgba(34,38,35,.72); }
.focus-button[aria-pressed="true"]::after, .recording-button[aria-pressed="true"]::after, .settings-button[aria-expanded="true"]::after, .scripts-button[aria-expanded="true"]::after, .ai-studio-button[aria-expanded="true"]::after { opacity: .9; transform: scaleX(1); }
.focus-button svg, .settings-button svg, .scripts-button svg, .import-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.focus-button em, .recording-button em, .settings-button em, .scripts-button em, .import-button em, .ai-studio-button em { font-size: 13px; font-style: normal; font-weight: 600; }
.ai-studio-button > span { font-size: 14px; }
.recording-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a58; }

.editor, .controls {
  min-width: 0; padding: 13px 14px; border: 1px solid rgba(255,255,255,.075); border-radius: var(--surface-radius); background: rgba(22,25,23,.74);
  box-shadow: inset 0 1px rgba(255,255,255,.025), inset 0 -1px rgba(0,0,0,.16), 0 10px 32px rgba(0,0,0,.1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.heading { justify-content: space-between; margin-bottom: 10px; padding: 0 2px 9px; border-bottom: 1px solid rgba(255,255,255,.055); }
.heading > div { display: flex; align-items: baseline; gap: 8px; }
.editor-meta { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 11px; text-align: right; }
.save-status { display: inline-flex; align-items: center; gap: 4px; color: #666d68; font-size: 8.5px; font-weight: 430; font-variant-numeric: tabular-nums; transition: color 180ms ease, opacity 180ms ease; }
.save-status::before { content: ""; }
.save-status.saved::before { content: "✓"; color: #89928b; }
.save-status.saving { color: #a6ada8; }.save-status.saved { color: #707772; }.save-status.error { color: #ff7773; }
.heading label { color: #f0f3f0; font-size: 15px; font-weight: 620; letter-spacing: -.015em; }
.eyebrow { color: var(--accent); font-size: 8px; font-weight: 680; letter-spacing: .14em; text-transform: uppercase; }
#characterCount { color: #9ba29d; font-size: 10px; font-weight: 520; font-variant-numeric: tabular-nums; }
.editor-surface { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.055); border-radius: 13px; background: rgba(255,255,255,.025); box-shadow: inset 0 1px 6px rgba(0,0,0,.13); transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease; }
.editor-surface:focus-within { border-color: rgba(182,245,66,.22); background: rgba(255,255,255,.03); box-shadow: 0 0 0 2px rgba(182,245,66,.035), inset 0 1px 6px rgba(0,0,0,.11); }
.editor-surface::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: 11px; width: 2px; border-radius: 2px; background: rgba(182,245,66,.52); opacity: 0; transform: scaleY(.5); transition: opacity 180ms ease, transform 180ms ease; }
.editor-surface:focus-within::before { opacity: 1; transform: scaleY(1); }
textarea {
  display: block; width: 100%; height: clamp(64px,7.5vh,82px); min-height: 64px; max-height: 12vh; padding: 12px 18px; resize: vertical;
  border: 0; border-radius: inherit; outline: 0; color: #e9ecea; background: transparent;
  font-size: 15px; font-weight: 420; line-height: 1.55; letter-spacing: -.006em; caret-color: var(--accent);
}
textarea:focus-visible { outline: 0; }
textarea::placeholder { color: #606662; opacity: 1; }
textarea { scrollbar-width: thin; scrollbar-color: rgba(150,158,152,.34) transparent; }
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(150,158,152,.3); background-clip: padding-box; }
textarea::-webkit-scrollbar-thumb:hover { background: rgba(182,245,66,.32); background-clip: padding-box; }

.prompter {
  position: relative; min-width: 0; min-height: 0; overflow: hidden; isolation: isolate; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--surface-radius);
  background: radial-gradient(ellipse 64% 42% at 50% 39%, rgba(182,245,66,.035), transparent 72%), radial-gradient(ellipse 100% 75% at 50% 40%, rgba(28,35,30,.29) 0%, rgba(7,9,8,.4) 68%, rgba(3,4,3,.62) 100%), var(--prompter-background);
  box-shadow: inset 0 1px rgba(255,255,255,.045), inset 0 0 74px rgba(115,145,121,.022), 0 16px 48px rgba(0,0,0,.25);
}
.prompter::selection, .script::selection { background: rgba(182,245,66,.24); }
.prompter::before, .prompter::after { content: ""; position: absolute; z-index: 2; left: 0; right: 0; pointer-events: none; }
.prompter::before { top: 0; height: 31%; background: linear-gradient(#040605 0%, rgba(4,6,5,.67) 28%, rgba(4,6,5,.18) 77%, transparent); }
.prompter::after { bottom: 0; height: 39%; background: linear-gradient(transparent, rgba(3,5,4,.2) 28%, rgba(3,5,4,.7) 78%, #030504 100%); }
.prompter-label { position: absolute; z-index: 4; top: 14px; left: 16px; display: flex; align-items: center; gap: 6px; color: #7b847d; font-size: 8px; font-weight: 650; letter-spacing: .14em; pointer-events: none; }
.prompter-label span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .52; box-shadow: 0 0 4px rgba(182,245,66,.1); }
.focus-zone {
  position: absolute; z-index: 3; top: var(--focus-zone-center); left: 0; width: 100%; height: var(--focus-zone-height); transform: translateY(-50%);
  border-top: 1px solid rgba(182,245,66,.11); border-bottom: 1px solid rgba(182,245,66,.09); background: rgba(255,255,255,.012);
  pointer-events: none;
}
.focus-zone::before, .focus-zone::after { content: ""; position: absolute; z-index: 0; left: 0; width: 100%; height: 100vh; pointer-events: none; }
.focus-zone::before { bottom: 100%; background: linear-gradient(to bottom, rgba(0,0,0,var(--focus-zone-dim)) 0%, rgba(0,0,0,var(--focus-zone-dim)) 58%, transparent 100%); }
.focus-zone::after { top: 100%; background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,var(--focus-zone-dim)) 42%, rgba(0,0,0,var(--focus-zone-dim)) 100%); }
.focus-zone > span { position: absolute; z-index: 1; top: 50%; right: 7%; left: 7%; height: 42%; transform: translateY(-50%); border-radius: 18px; background: radial-gradient(ellipse at center, rgba(255,255,255,.018), transparent 72%); opacity: 1; transition: opacity 160ms ease; }
html[data-focus-zone-enabled="false"] .focus-zone { display: none; }
html[data-focus-zone-lines="false"] .focus-zone { border-color: transparent; }
html[data-focus-zone-active="false"] .focus-zone > span { opacity: 0; }
.prompter[aria-label="Остановить прокрутку"] .prompter-label span { opacity: .92; animation: live-dot-pulse 1.7s ease-in-out infinite; }
@keyframes live-dot-pulse { 0%,100% { opacity: .65; transform: scale(.9); box-shadow: 0 0 3px rgba(182,245,66,.1); } 50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 7px rgba(182,245,66,.2); } }
.focus-line { position: absolute; z-index: 4; top: var(--focus-zone-center); left: 0; width: 20px; height: 1px; background: rgba(182,245,66,.8); opacity: .72; box-shadow: 0 0 6px rgba(182,245,66,.18); }
.script {
  padding: 29vh 0 42vh; color: var(--script-color); font-size: var(--script-size); font-weight: var(--script-weight);
  line-height: var(--script-line-height); letter-spacing: -.025em;
  transform: translate3d(0,0,0); will-change: transform;
}
.script-content { width: var(--script-column-width); margin: 0 auto; text-align: var(--script-align); white-space: pre-wrap; overflow-wrap: anywhere; transform: scaleX(var(--script-mirror)); transform-origin: center top; transition: padding 180ms ease; }
html:has(input[name="textAlign"][value="left"]:checked) .script-content { padding-left: clamp(50px,6.5vw,82px); }
html:has(input[name="textAlign"][value="center"]:checked) .script-content { padding-left: 0; }
.tap-hint {
  position: absolute; z-index: 4; left: 50%; bottom: 14px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 4px 8px; border: 1px solid rgba(255,255,255,.045); border-radius: 999px; color: #69706b; background: rgba(18,21,19,.5);
  font-size: 8.5px; white-space: nowrap; pointer-events: none; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); transition: opacity .2s;
}
.tap-hint.hidden { opacity: 0; }
.tap-hint-mobile { display: none; }

.controls { padding-top: 10px; padding-bottom: 10px; display: grid; grid-template-columns: minmax(250px,.78fr) minmax(315px,1.08fr) minmax(160px,.48fr); gap: 14px; }
.actions { min-width: 0; gap: 8px; }
.actions button {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 11px;
  color: #cbd0cc; background: rgba(255,255,255,.035); font-size: 12px; font-weight: 620; box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.actions button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.075); }
.actions button:active, .focus-button:active, .recording-button:active, .settings-button:active, .scripts-button:active, .import-button:active, .ai-studio-button:active { transform: scale(.98); transition-duration: 100ms; }
.actions button:disabled { color: #737a75; opacity: .58; }
.actions .start { border-color: transparent; color: #10140c; background: var(--accent); box-shadow: inset 0 1px rgba(255,255,255,.2), 0 2px 7px rgba(182,245,66,.045); }
.actions .start:hover { border-color: transparent; background: #c0fa53; }
.button-icon { margin-right: 4px; font-size: 11px; }
.sliders { min-width: 0; padding: 0 2px 0 5px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sliders label { min-width: 0; gap: 9px; }
.control-name { width: 69px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; color: #989f9a; font-size: 10px; font-weight: 530; }
.control-name svg { width: 12px; height: 12px; flex: 0 0 12px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linejoin: round; }
.type-icon { width: 15px; flex: 0 0 15px; color: #a7ada9; font-size: 9px; font-weight: 650; letter-spacing: -.04em; }
.sliders input { min-width: 42px; width: 100%; height: 28px; margin: 0; padding: 0; border: 0; outline: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.sliders input::-webkit-slider-runnable-track { height: 3px; overflow: hidden; border: 0; border-radius: 999px; background: rgba(255,255,255,.105); box-shadow: inset 0 1px 2px rgba(0,0,0,.28); }
.sliders input::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6.5px; appearance: none; -webkit-appearance: none; border: 1px solid rgba(0,0,0,.22); border-radius: 50%; background: #f4f6f4; box-shadow: -407px 0 0 400px rgba(182,245,66,.68), 0 0 7px rgba(182,245,66,.17); transition: transform 160ms ease, background-color 160ms ease; }
.sliders input:hover::-webkit-slider-thumb { background: #fff; transform: scale(1.07); }
.sliders input:active::-webkit-slider-thumb { transform: scale(.94); }
.sliders input::-moz-range-track { height: 3px; border-radius: 999px; background: rgba(255,255,255,.105); box-shadow: inset 0 1px 2px rgba(0,0,0,.28); }
.sliders input::-moz-range-progress { height: 3px; border-radius: 999px; background: rgba(182,245,66,.68); }
.sliders input::-moz-range-thumb { width: 16px; height: 16px; border: 1px solid rgba(0,0,0,.22); border-radius: 50%; background: #f4f6f4; box-shadow: 0 0 7px rgba(182,245,66,.17); }
.sliders input:focus-visible { outline: none; }
.sliders input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(182,245,66,.15), 0 2px 7px rgba(0,0,0,.45); }
.sliders output { width: 28px; color: var(--accent); font-size: 11px; font-weight: 620; text-align: right; font-variant-numeric: tabular-nums; }
.voice-follow-control { min-width: 0; }
.voice-follow-control > button { width: 100%; min-width: 0; min-height: 44px; padding: 6px 9px; display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; color: #aeb4af; background: rgba(255,255,255,.035); cursor: pointer; pointer-events: auto; touch-action: manipulation; position: relative; z-index: 1; }
.voice-follow-control > button > * { pointer-events: none; }
.voice-follow-control > button:hover { border-color: rgba(182,245,66,.16); background: rgba(255,255,255,.05); }
.voice-follow-control > button:focus-visible { outline: 2px solid rgba(182,245,66,.6); outline-offset: 2px; }
.voice-follow-control > button[aria-pressed="true"], .voice-follow-control > button.active { border-color: rgba(182,245,66,.22); color: #e4eadf; background: rgba(182,245,66,.045); box-shadow: inset 0 -1px rgba(182,245,66,.4); }
.voice-follow-title { display: grid; justify-items: start; line-height: 1; }
.voice-follow-title > span { font-size: 10px; font-weight: 620; white-space: nowrap; }
.voice-follow-title small { margin-top: 3px; color: #7f9b4e; font-size: 6px; font-weight: 720; letter-spacing: .14em; }
.voice-follow-short { display: none; }
.voice-follow-meter { width: 33px; height: 12px; display: flex; align-items: flex-end; gap: 2px; }
.voice-follow-meter i { width: 5px; height: 4px; border-radius: 1px; background: #666d68; opacity: .2; transition: height 100ms ease, opacity 100ms ease, background-color 140ms ease; }
.voice-follow-meter i:nth-child(2) { height: 6px; }.voice-follow-meter i:nth-child(3) { height: 8px; }.voice-follow-meter i:nth-child(4) { height: 10px; }.voice-follow-meter i:nth-child(5) { height: 12px; }
.voice-follow-meter i.active { opacity: .55; }
.voice-follow-control > button[data-state="speaking"] .voice-follow-meter i.active { background: var(--accent); opacity: .9; }
.voice-follow-copy { min-width: 0; display: grid; gap: 2px; }
.voice-follow-copy strong { color: #929a94; font-size: 9px; font-weight: 580; white-space: nowrap; }
.voice-follow-copy small { max-width: 98px; color: #5f6661; font-size: 7px; line-height: 1.25; }
#voiceFollowProfile { color: #7f8c78; font-size: 6.5px; letter-spacing: .04em; }
.voice-follow-control > button[data-state="error"] .voice-follow-copy strong { color: #ff8581; }
.voice-follow-control > button[data-state="speaking"] .voice-follow-copy strong { color: #cde99a; }
.focus-status { display: none; }
.recording-controls { display: none; }
.visually-hidden { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.toast-region { position: fixed; z-index: 70; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: min(360px, calc(100vw - 28px)); display: grid; gap: 8px; pointer-events: none; }
.toast { min-height: 50px; padding: 10px 9px 10px 12px; display: grid; grid-template-columns: 7px minmax(0,1fr) 32px; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; color: #e5e8e5; background: rgba(25,28,26,.96); box-shadow: 0 14px 40px rgba(0,0,0,.4); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); opacity: 0; transform: translateX(12px) scale(.985); transition: opacity 180ms ease, transform 180ms ease; pointer-events: auto; }
.toast.toast-visible { opacity: 1; transform: translateX(0) scale(1); }.toast.toast-leaving { opacity: 0; transform: translateX(8px) scale(.985); }
.toast-marker { width: 7px; height: 7px; border-radius: 50%; background: #8e9690; }.toast-success .toast-marker { background: var(--accent); }.toast-info .toast-marker { background: #70d7ff; }.toast-warning .toast-marker { background: #ffd85a; }.toast-error .toast-marker { background: #ff6864; }
.toast-message { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }.toast-close { width: 32px; height: 32px; border: 0; border-radius: 9px; color: #8f9691; background: transparent; font-size: 20px; }.toast-close:hover { color: #f0f2f0; background: rgba(255,255,255,.06); }

.dialog-backdrop { position: fixed; z-index: 80; inset: 0; padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: grid; place-items: center; background: rgba(0,0,0,.58); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); opacity: 0; transition: opacity 180ms ease; }
.dialog-backdrop.dialog-visible { opacity: 1; }.dialog-backdrop.dialog-leaving { opacity: 0; }
.app-dialog { width: min(420px,100%); max-height: 100%; padding: 20px; overflow-y: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 21px; background: rgba(22,25,23,.98); box-shadow: 0 28px 90px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.04); opacity: 0; transform: translateY(10px) scale(.975); transition: opacity 190ms ease, transform 190ms ease; }
.dialog-visible .app-dialog { opacity: 1; transform: translateY(0) scale(1); }.dialog-leaving .app-dialog { opacity: 0; transform: translateY(7px) scale(.985); }
.app-dialog h2 { margin: 0; color: #f2f4f2; font-size: 19px; font-weight: 690; letter-spacing: -.025em; }.dialog-body { margin-top: 9px; }.dialog-body p { margin: 0 0 15px; color: #969d98; font-size: 12px; line-height: 1.5; }
.dialog-body input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; outline: 0; color: #f1f3f1; background: rgba(0,0,0,.3); font-size: 16px; caret-color: var(--accent); transition: border-color 170ms ease, box-shadow 170ms ease; }.dialog-body input:focus { border-color: rgba(182,245,66,.42); box-shadow: 0 0 0 3px rgba(182,245,66,.07); }.dialog-body input[aria-invalid="true"] { border-color: rgba(255,104,100,.55); }
.dialog-validation { min-height: 17px; margin-top: 5px; display: block; color: #ff7773; font-size: 10px; }.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }.dialog-actions button { min-width: 105px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; color: #d7dbd7; background: rgba(255,255,255,.055); font-size: 12px; font-weight: 640; }.dialog-actions .dialog-confirm { border-color: transparent; color: #10140c; background: var(--accent); }.dialog-actions .dialog-confirm.danger { color: #fff; background: #d94e4a; }

.settings-backdrop { position: fixed; z-index: 29; inset: 0; background: rgba(0,0,0,.3); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.settings-backdrop[hidden] { display: none; }
.settings-panel { position: fixed; z-index: 30; top: max(68px, calc(env(safe-area-inset-top) + 54px)); right: max(16px, env(safe-area-inset-right)); width: min(390px, calc(100vw - 24px)); max-height: calc(100vh - 84px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 84px - env(safe-area-inset-bottom)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 21px; background: rgba(21,24,22,.94); box-shadow: 0 24px 80px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.04); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.985); transform-origin: top right; transition: opacity 180ms ease, transform 180ms ease, visibility 180ms; }
.settings-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.settings-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 17px 17px 13px; border-bottom: 1px solid rgba(255,255,255,.07); }
.settings-header h2 { margin: 3px 0 0; font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.settings-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: #b8bdb9; background: rgba(255,255,255,.055); font-size: 22px; line-height: 1; }
.settings-body { min-height: 0; padding: 15px 17px 8px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.settings-panel fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.settings-panel legend, .settings-range > span { width: 100%; margin-bottom: 9px; padding: 0; color: #a8aea9; font-size: 11px; font-weight: 620; letter-spacing: .015em; }
.color-options { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.color-options label { position: relative; min-width: 0; display: grid; justify-items: center; gap: 5px; cursor: pointer; }
.color-options label > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.color-options em { color: #858c87; font-size: 9px; font-style: normal; }
.color-swatch, .custom-color input[type="color"] { width: 38px; height: 38px; display: block; border: 2px solid transparent; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 2px 8px rgba(0,0,0,.2); transition: transform 160ms ease, border-color 160ms ease; }
.color-options input[type="radio"]:checked + .color-swatch { border-color: var(--accent); transform: scale(.92); }
.swatch-white { background: #f5f7f5; }.swatch-green { background: #b6f542; }.swatch-yellow { background: #ffd85a; }.swatch-blue { background: #70d7ff; }.swatch-black { background: #050706; }.swatch-gray { background: #171a18; }
.custom-color input[type="color"] { padding: 0; overflow: hidden; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.custom-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.custom-color:has(input[type="radio"]:checked) input[type="color"] { border-color: var(--accent); transform: scale(.92); }
.settings-range { display: block; margin-bottom: 18px; }
.settings-range > span { display: flex; justify-content: space-between; }
.settings-range output { color: var(--accent); font-variant-numeric: tabular-nums; }
.settings-range input { width: 100%; height: 30px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; }
.settings-range input::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.settings-range input::-webkit-slider-thumb { width: 21px; height: 21px; margin-top: -8.5px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 50%; background: #f4f6f4; box-shadow: 0 2px 8px rgba(0,0,0,.48); }
.settings-range input::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); }.settings-range input::-moz-range-thumb { width: 21px; height: 21px; border: 0; border-radius: 50%; background: #f4f6f4; }
.segmented { display: grid; grid-template-columns: repeat(2,1fr); gap: 3px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.3); }
.segmented.three { grid-template-columns: repeat(3,1fr); }.segmented.four { grid-template-columns: repeat(4,1fr); }
.segmented label { min-width: 0; cursor: pointer; }.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 34px; padding: 0 7px; display: grid; place-items: center; border-radius: 8px; color: #8f9691; font-size: 10px; text-align: center; transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.segmented input:checked + span { color: #f2f4f2; background: rgba(255,255,255,.1); box-shadow: 0 1px 4px rgba(0,0,0,.24); }
.switch-row { min-height: 52px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span { display: grid; gap: 3px; }.switch-row strong { font-size: 12px; font-weight: 620; }.switch-row small { color: #767d78; font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }.switch-row i { position: relative; width: 46px; height: 28px; flex: 0 0 46px; border-radius: 99px; background: rgba(255,255,255,.13); transition: background-color 180ms ease; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35); transition: transform 180ms ease; }
.switch-row input:checked + i { background: var(--accent); }.switch-row input:checked + i::after { transform: translateX(18px); }
.reset-settings { min-height: 48px; margin: 8px 17px max(15px, env(safe-area-inset-bottom)); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; color: #b9bfba; background: rgba(255,255,255,.045); font-size: 12px; font-weight: 620; }
.reset-settings:hover { background: rgba(255,255,255,.075); }
.countdown-settings { margin-top: 8px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.countdown-settings .switch-row { margin-bottom: 4px; }
.countdown-duration { margin: 4px 0 10px; display: grid; gap: 8px; }
.countdown-duration > span { color: #858c87; font-size: 10px; font-weight: 620; }
.voice-follow-settings { padding-top: 16px !important; border-top: 1px solid rgba(255,255,255,.07) !important; }
.settings-note { margin: -3px 0 9px; color: #717873; font-size: 9px; line-height: 1.35; }
.voice-sensitivity-options { grid-template-columns: repeat(2,1fr); }
.voice-follow-settings .reset-settings { width: 100%; min-height: 44px; margin: 8px 0 0; }
.focus-zone-options { margin: 0 0 13px; display: grid; gap: 7px; }
.focus-zone-options > span { color: #a8aea9; font-size: 10px; font-weight: 620; }
.voice-follow-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice-follow-grid label { min-width: 0; display: grid; gap: 4px; color: #a8aea9; font-size: 10px; }
.voice-follow-grid label small { color: #6f7671; font-size: 8px; }
.voice-follow-grid select { width: 100%; min-width: 0; min-height: 44px; padding: 0 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; outline: 0; color: #dfe3df; background: #242825; font-size: 10px; }
.voice-follow-grid select:focus-visible { outline: 2px solid rgba(182,245,66,.45); outline-offset: 2px; }
.voice-threshold { display: none; margin-top: 12px; }
.voice-follow-settings:has(input[value="custom"]:checked) .voice-threshold { display: grid; }

.countdown-overlay[hidden] { display: none; }
.countdown-overlay {
  position: fixed; z-index: 200; inset: 0; min-width: 0; padding: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
  display: grid; place-items: center; overflow: hidden; color: #f1f5ef; background: rgba(0,3,1,.72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; pointer-events: auto; transition: opacity 220ms ease;
}
.countdown-overlay.active { opacity: 1; }
.countdown-value {
  max-width: 100%; color: rgba(242,249,239,.88); font-size: clamp(88px,min(28vw,42vh),250px); font-weight: 610; line-height: .82; letter-spacing: -.065em; text-align: center; font-variant-numeric: tabular-nums;
  opacity: 0; transform: scale(.92); will-change: opacity,transform;
}
.countdown-value.start-label { font-size: clamp(44px,min(13vw,20vh),104px); font-weight: 670; letter-spacing: .11em; }
.countdown-value.pulse { animation: countdown-value-in 240ms cubic-bezier(.2,.75,.3,1) both; }
.countdown-cancel {
  position: absolute; left: 50%; bottom: max(20px,env(safe-area-inset-bottom)); min-width: 112px; min-height: 46px; padding: 0 18px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; color: rgba(239,243,239,.78); background: rgba(27,31,28,.64); font-size: 12px; font-weight: 630; transform: translateX(-50%); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: color 180ms ease,background-color 180ms ease,transform 150ms ease;
}
.countdown-cancel:hover { color: #fff; background: rgba(42,47,43,.78); }
.countdown-cancel:active { transform: translateX(-50%) scale(.97); }
.countdown-cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes countdown-value-in { from { opacity: 0; transform: scale(.92); } 55% { opacity: 1; transform: scale(1.025); } to { opacity: .88; transform: scale(1); } }

.scripts-backdrop { position: fixed; z-index: 29; inset: 0; background: rgba(0,0,0,.34); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.scripts-backdrop[hidden] { display: none; }
.scripts-panel { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(410px, calc(100vw - 24px)); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid rgba(255,255,255,.11); background: rgba(18,21,19,.96); box-shadow: 24px 0 80px rgba(0,0,0,.48), inset -1px 0 rgba(255,255,255,.025); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); visibility: hidden; transform: translateX(-102%); transition: transform 220ms cubic-bezier(.22,.8,.3,1), visibility 220ms; }
.scripts-panel.open { visibility: visible; transform: translateX(0); }
.scripts-header { flex: 0 0 auto; min-height: 72px; padding: 14px 17px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); }
.scripts-header h2 { margin: 3px 0 0; font-size: 19px; font-weight: 680; letter-spacing: -.025em; }
.scripts-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: #b8bdb9; background: rgba(255,255,255,.055); font-size: 22px; line-height: 1; }
.scripts-toolbar { flex: 0 0 auto; padding: 13px 15px 7px; }
.scripts-toolbar button { width: 100%; min-height: 46px; border: 0; border-radius: 12px; color: #11150d; background: var(--accent); font-size: 13px; font-weight: 680; box-shadow: inset 0 1px rgba(255,255,255,.32); }
.scripts-toolbar button span { margin-right: 5px; font-size: 17px; vertical-align: -1px; }
.scripts-list { min-height: 0; padding: 7px 15px 18px; display: grid; align-content: start; gap: 8px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.script-card { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 38px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: rgba(255,255,255,.035); transition: border-color 170ms ease, background-color 170ms ease, transform 170ms ease; }
.script-card:hover { border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.052); transform: translateY(-1px); }
.script-card.active { border-color: rgba(182,245,66,.3); background: rgba(182,245,66,.052); box-shadow: inset 2px 0 var(--accent); }
.script-card-main { min-width: 0; padding: 13px 5px 12px 13px; cursor: pointer; }
.script-card-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.script-card-top { min-width: 0; display: flex; align-items: center; gap: 7px; }
.script-card-title { min-width: 0; overflow: hidden; color: #edf0ed; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.active-marker { flex: 0 0 auto; padding: 3px 6px; border-radius: 99px; color: var(--accent); background: rgba(182,245,66,.1); font-size: 8px; font-weight: 720; letter-spacing: .025em; text-transform: uppercase; }
.script-card p { min-height: 30px; margin: 6px 0 8px; display: -webkit-box; overflow: hidden; color: #858c87; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.script-card time { display: block; color: #777e79; font-size: 10px; font-variant-numeric: tabular-nums; }
.script-actions { align-self: start; width: 34px; height: 36px; margin: 7px 5px 0 0; border: 0; border-radius: 9px; color: #868d88; background: transparent; font-size: 12px; letter-spacing: 1px; }
.script-actions:hover, .script-actions[aria-expanded="true"] { color: #e1e4e1; background: rgba(255,255,255,.07); }
.script-menu { position: absolute; z-index: 4; top: 42px; right: 7px; width: 164px; padding: 5px; display: grid; gap: 2px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: rgba(28,31,29,.98); box-shadow: 0 14px 34px rgba(0,0,0,.45); transform-origin: top right; animation: menu-in 170ms ease both; }
.script-menu button { min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; color: #d3d7d3; background: transparent; font-size: 11px; text-align: left; transition: color 150ms ease, background-color 150ms ease, transform 120ms ease; }
.script-menu button:hover { background: rgba(255,255,255,.07); }
.script-menu button:active { transform: scale(.98); }
.script-menu button.danger { color: #ff7773; }
.scripts-empty { padding: 42px 24px; border: 1px dashed rgba(255,255,255,.1); border-radius: 14px; text-align: center; }.scripts-empty strong { font-size: 13px; }.scripts-empty p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes mode-in { from { opacity: .45; transform: scale(.995); } to { opacity: 1; transform: scale(1); } }

.ai-backdrop { position: fixed; z-index: 39; inset: 0; background: rgba(0,0,0,.36); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.ai-backdrop[hidden] { display: none; }
.ai-panel { position: fixed; z-index: 40; inset: 0 0 0 auto; width: min(420px, calc(100vw - 24px)); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid rgba(255,255,255,.11); background: rgba(18,21,19,.97); box-shadow: -24px 0 80px rgba(0,0,0,.48), inset 1px 0 rgba(255,255,255,.025); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); visibility: hidden; opacity: 0; transform: translateX(102%); transition: transform 220ms cubic-bezier(.22,.8,.3,1), opacity 180ms ease, visibility 220ms; }
.ai-panel.open { visibility: visible; opacity: 1; transform: translateX(0); }
.ai-panel-header { min-height: 72px; padding: 14px 17px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); }
.ai-panel-header h2 { margin: 3px 0 0; font-size: 19px; font-weight: 690; letter-spacing: -.025em; }
.ai-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: #b8bdb9; background: rgba(255,255,255,.055); font-size: 22px; line-height: 1; }
.ai-panel-body { min-height: 0; padding: 16px 15px 22px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ai-command-section + .ai-command-section { margin-top: 22px; }
.ai-command-section h3 { margin: 0 0 9px 2px; color: #838a85; font-size: 10px; font-weight: 720; letter-spacing: .09em; text-transform: uppercase; }
.ai-command-grid { display: grid; gap: 7px; }
.ai-quick-actions { margin-bottom:8px; }.ai-quick-command { min-height:72px; border-color:rgba(182,245,66,.24); background:linear-gradient(135deg,rgba(182,245,66,.1),rgba(182,245,66,.035)); }.ai-quick-command::after { width:10px; height:10px; border-color:var(--accent); background:var(--accent); box-shadow:inset 0 0 0 3px #19200d; }.ai-quick-command strong { color:#e8f7cd; font-size:13px; }
.ai-command { position: relative; min-height: 58px; padding: 10px 36px 10px 12px; display: grid; gap: 3px; border: 1px solid rgba(255,255,255,.075); border-radius: 12px; color: #e6e9e6; background: rgba(255,255,255,.035); text-align: left; transition: border-color 170ms ease, background-color 170ms ease, transform 140ms ease; }
.ai-command::after { content: ""; position: absolute; top: 50%; right: 14px; width: 8px; height: 8px; border: 1px solid #626a64; border-radius: 50%; transform: translateY(-50%); transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.ai-command:hover { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.052); transform: translateY(-1px); }
.ai-command.active { border-color: rgba(182,245,66,.3); background: rgba(182,245,66,.055); }
.ai-command.active::after { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px #19200d; }
.ai-command strong { font-size: 12px; font-weight: 650; }.ai-command span { color: #79807b; font-size: 10px; line-height: 1.35; }
.ai-command:disabled { opacity: .45; transform: none; }
.ai-panel-footer { flex: 0 0 auto; padding: 11px 15px max(13px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.07); background: rgba(18,21,19,.94); }
.ai-language-field { margin-bottom: 10px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; }
.ai-language-field[hidden] { display: none; }
.ai-language-field > span { color: #929994; font-size: 10px; font-weight: 620; }
.ai-language-field select { min-width: 0; width: 100%; min-height: 38px; padding: 0 32px 0 11px; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; outline: 0; color: #e6e9e6; background: #232724; font-size: 12px; appearance: auto; }
.ai-language-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-generate { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; color: #11150d; background: var(--accent); font-size: 13px; font-weight: 690; }
.ai-generate:disabled { color: #777d79; background: rgba(255,255,255,.065); opacity: 1; }.ai-generate em { font-style: normal; }
.ai-spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(17,21,13,.25); border-top-color: #11150d; border-radius: 50%; animation: ai-spin .7s linear infinite; }.ai-panel.loading .ai-spinner { display: block; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

.media-backdrop, .media-result-backdrop { position: fixed; z-index: 92; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.media-backdrop[hidden], .media-result-backdrop[hidden], .media-workspace[hidden], .media-result-dialog[hidden] { display:none; }
.media-workspace { position: fixed; z-index: 93; inset: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) auto; width: min(560px,calc(100vw - 24px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 22px; color: var(--text); background: rgba(20,23,21,.98); box-shadow: 0 30px 90px rgba(0,0,0,.62); opacity: 0; transform: translateX(24px); pointer-events: none; transition: transform 200ms ease,opacity 180ms ease; }
.media-workspace.open { opacity: 1; transform: translateX(0); pointer-events: auto; }
.media-workspace-header, .media-result-dialog > header { flex: 0 0 auto; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.media-workspace h2, .media-result-dialog h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.025em; }
.media-icon-button { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; color: #cbd0cc; background: rgba(255,255,255,.045); font-size: 24px; }
.media-workspace .button, .media-result-dialog .button { min-height:44px; padding:0 14px; border:1px solid var(--line); border-radius:11px; color:#d9ddd9; background:rgba(255,255,255,.055); font-size:12px; font-weight:650; }.media-workspace .button:hover, .media-result-dialog .button:hover { border-color:var(--line-strong); background:rgba(255,255,255,.085); }.media-workspace .button:active, .media-result-dialog .button:active, .media-icon-button:active { transform:scale(.975); }.media-workspace .button.primary, .media-result-dialog .button.primary { border-color:transparent; color:#11150d; background:var(--accent); }.media-workspace .button:disabled, .media-result-dialog .button:disabled { opacity:.42; transform:none; }
.media-workspace-body { min-height: 0; padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.media-privacy { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(182,245,66,.12); border-radius: 11px; color: #aeb6b0; background: rgba(182,245,66,.025); font-size: 11px; line-height: 1.45; }
.media-source-card { padding: 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(0,0,0,.18); }
.media-source-heading { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }.media-source-heading div { display: grid; gap: 3px; }.field-label { color: #858d87; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }.media-source-heading strong { font-size: 14px; }
.record-dot { padding: 5px 8px; border-radius: 999px; color: #ffb0ad; background: rgba(255,76,70,.12); font-size: 10px; font-weight: 700; }.record-dot::before { content:""; width: 6px; height: 6px; margin-right: 5px; display: inline-block; border-radius: 50%; background: #ff514b; animation: media-pulse 1s ease infinite; }@keyframes media-pulse { 50% { opacity: .35; } }
.media-timer { margin-bottom: 12px; color: #f0f3f0; font: 600 28px/1 ui-monospace,SFMono-Regular,monospace; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.media-device-row { margin-bottom:14px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:9px; }.media-device-row label { min-width:0; display:grid; gap:6px; color:#969e98; font-size:11px; }.media-device-row select { width:100%; min-width:0; height:44px; padding:0 10px; border:1px solid rgba(255,255,255,.1); border-radius:11px; outline:0; color:#e8ebe8; background:#242825; }.media-device-row select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.media-vu-meter { --vu-level:0; height:7px; margin:0 0 14px; overflow:hidden; border:1px solid rgba(255,255,255,.07); border-radius:999px; background:rgba(255,255,255,.055); }.media-vu-meter span { display:block; width:100%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent) 0 72%,#ffd85a 88%,#ff6964 100%); transform:scaleX(var(--vu-level)); transform-origin:left center; transition:transform 70ms linear; }.media-vu-meter:not(.active) span { opacity:.45; }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; }.media-actions .button, .media-uploader .button { min-height: 44px; }
.button.danger { border-color: rgba(255,81,75,.22); color: #ff9c98; background: rgba(255,81,75,.08); }
.media-recorder audio, .media-uploader audio, .media-uploader video { width: 100%; max-width: 100%; margin-top: 12px; border-radius: 10px; }.media-uploader video { max-height: 220px; background: #000; }
.media-uploader > span { margin-left: 10px; color: #929a94; font-size: 11px; overflow-wrap: anywhere; }
.media-fields { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.media-fields label { min-width: 0; display: grid; gap: 7px; color: #969e98; font-size: 11px; }.media-fields select { width: 100%; min-width: 0; height: 44px; padding: 0 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; outline:0; color: #e8ebe8; background: #242825; }.media-fields select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.media-toggle { margin-top: 14px; padding: 13px; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: rgba(255,255,255,.025); cursor: pointer; }.media-toggle input { position: absolute; opacity: 0; }.media-toggle .toggle-track { width: 42px; height: 24px; padding: 3px; border-radius: 999px; background: #3a3f3b; transition: background 180ms ease; }.media-toggle .toggle-track::after { content:""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #e3e7e3; transition: transform 180ms ease; }.media-toggle input:checked + .toggle-track { background: var(--accent); }.media-toggle input:checked + .toggle-track::after { transform: translateX(18px); background: #11150d; }.media-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }.media-toggle strong,.media-toggle small { display:block; }.media-toggle strong { font-size: 12px; }.media-toggle small { margin-top: 4px; color: #858d87; font-size: 10px; line-height: 1.4; }
.media-smart-settings { margin-top:14px; padding:14px; border:1px solid rgba(182,245,66,.14); border-radius:14px; background:rgba(182,245,66,.025); }.media-smart-heading { margin-bottom:12px; display:grid; gap:4px; }.media-smart-heading strong { font-size:13px; }.media-smart-grid { display:grid; gap:10px; }.media-smart-grid label { display:grid; gap:6px; color:#969e98; font-size:11px; }.media-smart-grid select { width:100%; min-width:0; height:44px; padding:0 10px; border:1px solid rgba(255,255,255,.1); border-radius:11px; color:#e8ebe8; background:#242825; }
.media-error { margin: 12px 0 0; color: #ff9c98; font-size: 12px; }.media-workspace-footer { padding: 13px 18px max(13px,env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid rgba(255,255,255,.07); }.media-process { min-width: 205px; }.media-process em { font-style: normal; }.media-workspace.processing .media-process .ai-spinner { display:block; }
.media-result-backdrop { z-index: 96; }.media-result-dialog { position: fixed; z-index: 97; inset: 50% auto auto 50%; width: min(760px,calc(100vw - 28px)); max-height: min(760px,calc(100dvh - 28px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 22px; color: var(--text); background: #151816; box-shadow: 0 30px 100px rgba(0,0,0,.7); opacity: 0; transform: translate(-50%,-48%) scale(.985); pointer-events: none; transition: transform 190ms ease,opacity 180ms ease; }.media-result-dialog.open { opacity: 1; transform: translate(-50%,-50%) scale(1); pointer-events:auto; }
.media-result-tabs { padding: 10px 14px; display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid rgba(255,255,255,.07); }.media-result-tabs button { min-height: 40px; padding: 0 12px; flex: 0 0 auto; border: 1px solid transparent; border-radius: 10px; color: #959c97; background: transparent; font-size: 11px; }.media-result-tabs button.active { border-color: rgba(182,245,66,.17); color: #dff5b8; background: rgba(182,245,66,.07); }
.media-result-content { min-height: 0; padding: 14px; display: grid; grid-template-rows: minmax(220px,1fr) auto; gap: 9px; overflow: hidden; }.media-result-content textarea { width:100%; min-height:220px; max-height:none; resize:none; }.media-result-tools { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }.media-result-dialog > footer { padding: 13px 14px max(13px,env(safe-area-inset-bottom)); display:flex; justify-content:flex-end; gap:8px; border-top:1px solid rgba(255,255,255,.07); }

.ai-preview-backdrop { position: fixed; z-index: 90; inset: 0; padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: grid; place-items: center; background: rgba(0,0,0,.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity 180ms ease; }
.ai-preview-backdrop.visible { opacity: 1; }.ai-preview-backdrop.leaving { opacity: 0; }
.ai-preview { width: min(940px,100%); max-height: 100%; padding: 18px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: #151816; box-shadow: 0 30px 100px rgba(0,0,0,.65), inset 0 1px rgba(255,255,255,.04); transform: translateY(10px) scale(.985); transition: transform 190ms ease; }
.visible .ai-preview { transform: translateY(0) scale(1); }.ai-preview header { flex: 0 0 auto; padding: 2px 2px 15px; }.ai-preview h2 { margin: 3px 0 0; font-size: 19px; font-weight: 690; letter-spacing: -.025em; }
.ai-comparison { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow: hidden; }
.ai-compare-pane { min-width: 0; min-height: 220px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: rgba(0,0,0,.2); }.ai-compare-pane.proposed { border-color: rgba(182,245,66,.18); background: rgba(182,245,66,.025); }
.ai-compare-pane h3 { flex: 0 0 auto; margin: 0; padding: 11px 13px; border-bottom: 1px solid rgba(255,255,255,.065); color: #929994; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }.ai-compare-pane.proposed h3 { color: #b9d77f; }
.ai-compare-text { min-height: 0; padding: 14px; overflow: auto; color: #d8dcd8; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-overflow-scrolling: touch; }
.ai-preview-actions { flex: 0 0 auto; padding-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }.ai-preview-actions button { min-width: 110px; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; color: #d5d9d5; background: rgba(255,255,255,.055); font-size: 12px; font-weight: 650; }.ai-preview-actions .ai-apply { border-color: transparent; color: #11150d; background: var(--accent); }

.app.focus-mode { width: 100%; max-width: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); grid-template-rows: 1fr; gap: 0; }
.focus-mode .editor, .focus-mode .controls, .focus-mode .brand { display: none; }
.focus-mode .topbar { position: fixed; z-index: 10; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.focus-mode .focus-button { width: 44px; height: 44px; justify-content: center; padding: 0; border-color: rgba(255,255,255,.11); color: var(--accent); background: rgba(18,21,19,.7); }
.focus-mode .focus-button em { display: none; }
.focus-mode .prompter { border: 0; border-radius: 0; box-shadow: none; }
.focus-mode .prompter, .recording-mode .prompter { animation: mode-in 180ms ease both; }
.focus-mode .focus-zone { left: -2%; width: 104%; }
.focus-mode .prompter-label { top: max(16px, env(safe-area-inset-top)); }
.focus-mode .focus-status { display: block; position: fixed; z-index: 10; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); padding: 7px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; color: var(--accent); background: rgba(18,21,19,.72); font-size: 11px; pointer-events: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

.app.recording-mode {
  width: 100%; max-width: none; height: 100vh; height: 100dvh; padding: 0; display: block; overflow: hidden; background: #000;
}
.recording-mode .topbar, .recording-mode .editor, .recording-mode .controls, .recording-mode .focus-status, .recording-mode .settings-panel, .recording-mode .settings-backdrop, .recording-mode .scripts-panel, .recording-mode .scripts-backdrop { display: none; }
.recording-mode .prompter { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; background: radial-gradient(ellipse 100% 75% at 50% 40%, rgba(20,25,21,.32) 0%, rgba(3,5,4,.35) 68%, rgba(0,0,0,.62) 100%), var(--prompter-background); box-shadow: inset 0 0 90px rgba(115,145,121,.02); }
.recording-mode .prompter-label, .recording-mode .tap-hint { display: none; }
.recording-mode .focus-zone { left: 0; width: 100%; }
.recording-mode .script { padding-top: 36vh; padding-bottom: 50vh; }
.recording-mode .recording-controls {
  position: fixed; z-index: 20; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px; width: max-content; max-width: calc(100% - max(24px, env(safe-area-inset-left)) - max(24px, env(safe-area-inset-right)));
  padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 17px; background: rgba(22,25,23,.72);
  box-shadow: 0 12px 40px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.035); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 1; transition: opacity 220ms ease, transform 180ms ease;
}
.recording-mode.recording-controls-idle .recording-controls { opacity: .1; }
.recording-controls button { min-width: 106px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.055); font-size: 13px; font-weight: 650; transition: transform 150ms ease, background-color 180ms ease, border-color 180ms ease; }
.recording-controls button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.085); }
.recording-controls button:active { transform: scale(.97); }
.recording-controls button span { margin-right: 5px; }
.recording-controls button em { font-style: normal; }
.recording-controls .recording-play { border-color: transparent; color: #10140c; background: var(--accent); }

@media (max-width: 760px) {
  .app { grid-template-rows: 44px auto minmax(210px, 1fr) auto; gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .controls { grid-template-columns: 1fr; gap: 11px; }
  .voice-follow-control > button { min-height: 44px; }
  .voice-follow-full { display: none; }
  .voice-follow-short { display: inline; }
  .voice-follow-copy small { max-width: none; }
  #voiceFollowProfile { display: none; }
  .voice-follow-grid { grid-template-columns: 1fr; }
  .editor, .controls { padding: 10px; border-radius: 16px; }
  textarea { height: clamp(58px,9vh,70px); min-height: 58px; max-height: 12vh; padding: 11px 15px; }
  html:has(input[name="textAlign"][value="left"]:checked) .script-content { padding-left: clamp(28px,8vw,44px); }
  .tap-hint-desktop { display: none; }
  .tap-hint-mobile { display: inline; }
  .settings-button { width: 40px; padding: 0; justify-content: center; }
  .settings-button em { display: none; }
  .scripts-button { width: 40px; padding: 0; justify-content: center; }
  .scripts-button em { display: none; }
  .import-button { width: 40px; padding: 0; justify-content: center; }
  .import-button em { display: none; }
  .ai-studio-button { width: 40px; padding: 0; justify-content: center; }
  .ai-studio-button em { display: none; }
  .toast-region { left: 50%; right: auto; transform: translateX(-50%); }
  .ai-panel { width: calc(100vw - 12px); }
  .ai-preview { padding: 14px; }
  .ai-comparison { grid-template-columns: 1fr; overflow-y: auto; }
  .ai-compare-pane { min-height: 190px; max-height: 40vh; }
  .media-workspace { inset: max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)); width:auto; border-radius:18px; }
  .media-workspace-body { padding:13px; }.media-workspace-header { padding:13px; }.media-fields { grid-template-columns:1fr; }.media-workspace-footer { padding:11px 13px max(11px,env(safe-area-inset-bottom)); }.media-workspace-footer .button { min-height:48px; }.media-process { min-width:0; flex:1; }
  .media-result-dialog { width:calc(100vw - 12px); max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom))); }.media-result-dialog > footer { display:grid; grid-template-columns:1fr 1fr; }.media-result-dialog > footer [data-result-new] { grid-column:1/-1; }.media-result-dialog > footer .button { min-height:48px; min-width:0; }
}

@media (max-width: 460px) {
  .brand-name { display: none; }
  .header-actions { gap: 5px; }
  .focus-button, .recording-button, .settings-button, .scripts-button, .import-button, .ai-studio-button { width: 42px; min-height: 42px; }
  .focus-button { width: 40px; padding: 0; justify-content: center; }
  .focus-button em { display: none; }
  .recording-button { width: 40px; padding: 0; justify-content: center; }
  .recording-button em { display: none; }
  .heading .eyebrow { display: none; }
  .actions button { min-height: 46px; padding: 0 7px; }
  .actions button span:not(.button-icon) { font-size: 12px; }
  .sliders { grid-template-columns: 1fr; gap: 9px; }
  .control-name { width: 62px; }
  .prompter { border-radius: 18px; }
  .recording-mode .prompter { border-radius: 0; }
  .recording-mode .recording-controls { width: calc(100% - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right))); justify-content: stretch; }
  .recording-controls button { flex: 1; min-width: 0; min-height: 52px; padding: 0 8px; }
  .recording-controls button em { display: block; font-size: 11px; }
  .recording-controls button span { display: block; margin: 0 0 2px; }
  .scripts-panel { width: calc(100vw - 12px); }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }.dialog-actions.three-actions { grid-template-columns:1fr; }.dialog-actions button { min-width: 0; }
  .ai-preview-actions { display: grid; grid-template-columns: 1fr 1fr; }.ai-preview-actions button { min-width: 0; }
  .media-device-row { grid-template-columns:1fr; }.media-device-row .button { width:100%; }
}

@media (max-width: 340px) {
  .app { padding-left: max(7px, env(safe-area-inset-left)); padding-right: max(7px, env(safe-area-inset-right)); }
  .header-actions { gap: 3px; }
  .brand { display: none; }
  .header-actions { width: 100%; justify-content: space-between; }
  .focus-button, .recording-button, .settings-button, .scripts-button, .import-button, .ai-studio-button { width: 44px; min-height: 42px; }
}

@media (max-height: 680px) and (max-width: 760px) {
  .app { grid-template-rows: 42px auto minmax(150px, 1fr) auto; gap: 7px; }
  .editor, .controls { padding: 8px; }
  .heading { margin-bottom: 6px; }
  textarea { height: 52px; min-height: 52px; max-height: 11vh; padding: 9px 10px; }
  .actions button { min-height: 42px; }
  .controls { gap: 7px; }
  .sliders { gap: 6px 12px; }
}

@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  button:active, .actions button:active { transform: none !important; }
  .prompter[aria-label="Остановить прокрутку"] .prompter-label span { animation: none !important; transform: none; }
  .sliders input:hover::-webkit-slider-thumb, .sliders input:active::-webkit-slider-thumb { transform: none; }
}
