@font-face {
  font-family: Inter;
  src: url('/assets/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-024F, U+2000-206F
}

@font-face {
  font-family: Inter;
  src: url('/assets/inter-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116
}

:root {
  color-scheme: dark;
  --bg: #101011;
  --panel: #19191b;
  --raised: #232325;
  --text: #f1eee6;
  --muted: #999895;
  --line: #303033;
  --accent: #651c32;
  --accent-hover: #832842;
  --olive: #c4c89c;
  --soft: #303327;
  --error: #f2a1a7;
  --shadow: 0 24px 100px #0007;
  font-family: Inter, system-ui, sans-serif;
  font-synthesis: none
}

:root[data-theme=light] {
  color-scheme: light;
  --bg: #f5f1e9;
  --panel: #fffcf6;
  --raised: #eee9df;
  --text: #211d1e;
  --muted: #706963;
  --line: #dcd6cc;
  --olive: #606b3f;
  --soft: #e5e8d7;
  --error: #a7233b;
  --shadow: 0 24px 100px #342a2520
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5
}

button,
input,
select,
textarea {
  font: inherit
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent
}

button,
a {
  touch-action: manipulation
}

button {
  cursor: pointer
}

button:disabled {
  opacity: .5;
  cursor: wait
}

a {
  color: inherit;
  text-decoration: none
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px
}

h1,
h2,
h3,
p {
  margin: 0
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -.045em
}

h1 {
  font-size: 42px;
  font-weight: 600
}

h2 {
  font-size: 30px;
  font-weight: 550
}

h3 {
  font-size: 18px;
  font-weight: 550
}

small {
  font-size: 12px
}

svg.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round
}

img,
video {
  max-width: 100%
}

.muted {
  color: var(--muted)
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 650
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--text);
  min-height: 42px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap
}

.btn:hover {
  filter: brightness(1.13)
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.btn.primary:hover {
  background: var(--accent-hover)
}

.btn.olive {
  background: var(--olive);
  color: var(--bg);
  border-color: var(--olive)
}

.btn.ghost {
  background: transparent;
  border-color: transparent
}

.btn.small {
  min-height: 33px;
  padding: 6px 11px;
  font-size: 12px
}

.btn.icon-only {
  width: 40px;
  padding: 8px
}

.btn.danger {
  color: var(--error)
}

.row {
  display: flex;
  gap: 12px;
  align-items: center
}

.between {
  justify-content: space-between
}

.wrap {
  flex-wrap: wrap
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.055em;
  white-space: nowrap
}

.brand img {
  width: 35px;
  height: 35px
}

.brand-ai {
  color: var(--accent);
  font-weight: 800
}

:root[data-theme=dark] .brand-ai {
  color: #f4b3c2
}

.brand-domain {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: .02em
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--olive);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em
}

.badge.neutral {
  color: var(--muted);
  background: var(--raised)
}

.badge.error {
  background: #83284222;
  color: var(--error)
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--olive)
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--line);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin 1s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.boot {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center
}

.boot p {
  font-size: 22px
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--muted)
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  min-height: 43px
}

.field textarea {
  resize: vertical
}

.field input[type=range] {
  padding: 0;
  border: 0;
  min-height: 24px;
  accent-color: var(--olive)
}

.field input[type=color] {
  padding: 4px;
  width: 52px
}

.field input[type=checkbox] {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent)
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0
}

.empty {
  padding: 65px 20px;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 17px;
  max-width: 540px;
  margin: auto
}

.empty>svg {
  width: 40px;
  height: 40px;
  color: var(--olive)
}

.empty p {
  color: var(--muted);
  max-width: 400px
}

.loading {
  padding: 80px;
  display: flex;
  justify-content: center
}

.error-box {
  padding: 14px;
  background: #83284218;
  color: var(--error);
  border-radius: 8px
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6
}

.progress {
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden
}

.progress>i {
  display: block;
  height: 100%;
  background: var(--olive);
  transition: width .3s
}

.section-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 13px
}

/* Public experience */
.public-header {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: auto;
  padding: 0 56px;
  border-bottom: 1px solid var(--line)
}

.public-header nav {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 12px
}

.hero {
  max-width: 1440px;
  margin: auto;
  padding: 68px 56px 60px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center
}

.hero h1 {
  font-size: clamp(48px, 5.5vw, 84px);
  font-weight: 550;
  line-height: 1.01;
  margin: 22px 0 26px;
  letter-spacing: -.065em
}

.hero h1 em {
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--olive)
}

.hero-copy>p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 460px
}

.hero .row {
  margin-top: 30px
}

.hero-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px
}

.hero-art {
  height: 535px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr .63fr;
  gap: 15px;
  align-items: center
}

.hero-screen {
  border-radius: 16px;
  overflow: hidden;
  height: 460px;
  position: relative;
  background: var(--raised)
}

.hero-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.hero-screen:after {
  content: '';
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, #000a);
  pointer-events: none
}

.hero-caption {
  position: absolute;
  bottom: 65px;
  left: 15px;
  right: 15px;
  color: white;
  text-align: center;
  z-index: 1;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -.05em;
  text-shadow: 0 2px 12px #000
}

.hero-caption span {
  color: #d1d5a5
}

.hero-stamp {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 10px;
  color: white;
  background: #0006;
  padding: 6px 9px;
  border-radius: 5px;
  z-index: 2
}

.hero-side {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding-top: 60px
}

.note-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px 16px
}

.note-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0
}

.note-card .big {
  font-size: 30px;
  letter-spacing: -.05em
}

.wave {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 18px
}

.wave i {
  display: block;
  flex: 1;
  background: var(--olive);
  border-radius: 3px;
  opacity: .75
}

.floating-track {
  position: absolute;
  bottom: 3px;
  left: -22px;
  right: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 18px;
  box-shadow: var(--shadow)
}

.track-bars {
  display: flex;
  gap: 5px;
  margin-top: 11px
}

.track-bars i {
  display: block;
  height: 23px;
  background: var(--accent);
  border-radius: 3px;
  flex: 1
}

.track-bars i:nth-child(2) {
  flex: 2;
  background: #60674a
}

.track-bars i:nth-child(3) {
  flex: .5
}

.public-section {
  max-width: 1328px;
  margin: 20px auto 0;
  padding: 60px 0;
  border-top: 1px solid var(--line)
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 35px
}

.feature {
  padding: 28px;
  background: var(--panel);
  border-radius: 13px
}

.feature .number {
  font-size: 12px;
  color: var(--olive);
  margin-bottom: 32px
}

.feature h3 {
  font-size: 23px;
  margin-bottom: 15px
}

.feature p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75
}

.faq {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 20px 0
}

.faq summary {
  cursor: pointer;
  font-size: 15px
}

.faq details p {
  color: var(--muted);
  margin-top: 15px;
  line-height: 1.75
}

.public-footer {
  border-top: 1px solid var(--line);
  padding: 35px 56px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-size: 12px
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr
}

.auth-art {
  position: relative;
  overflow: hidden
}

.auth-art>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  opacity: .65
}

.auth-art .brand {
  color: #f5f1e9
}

.auth-art .brand-ai {
  color: #f4b3c2
}

.auth-art>div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 45px;
  background: linear-gradient(#10101166, transparent, #101011)
}

.auth-art h2 {
  font-size: 60px;
  color: #f1eee6;
  max-width: 470px
}

.auth-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px
}

.auth-form {
  width: 100%;
  max-width: 360px
}

.auth-form h1 {
  font-size: 36px;
  margin: 25px 0 12px
}

.auth-form form {
  margin: 30px 0 20px
}

.auth-form .btn.primary {
  width: 100%
}

.auth-switch {
  font-size: 13px;
  color: var(--muted);
  text-align: center
}

.auth-switch a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px
}

/* Workspace */
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  background: var(--bg)
}

.sidebar>.brand {
  margin: 0 8px 34px
}

.sidebar .create {
  width: 100%;
  margin-bottom: 28px
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 4px
}

.nav-item:hover {
  color: var(--text);
  background: var(--panel)
}

.nav-item.active {
  background: var(--raised);
  color: var(--text)
}

.sidebar-bottom {
  margin-top: auto
}

.storage {
  padding: 18px 12px;
  font-size: 11px;
  color: var(--muted)
}

.storage .progress {
  margin: 10px 0;
  height: 3px
}

.account {
  padding: 18px 8px 0;
  border-top: 1px solid var(--line)
}

.avatar {
  width: 33px;
  height: 33px;
  background: var(--soft);
  color: var(--olive);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px
}

.account strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis
}

.account small {
  font-size: 10px;
  color: var(--muted)
}

.workspace {
  min-width: 0
}

.topbar {
  height: 75px;
  border-bottom: 1px solid var(--line);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.crumb {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0
}

.crumb strong {
  font-weight: 450;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.workspace-content {
  padding: 38px 36px;
  max-width: 1600px;
  margin: auto
}

.workspace-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px
}

.workspace-title h1 {
  font-size: 35px;
  margin: 8px 0 10px
}

.workspace-title p {
  color: var(--muted);
  font-size: 13px
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 32px
}

.stat {
  padding: 18px 23px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between
}

.stat span {
  color: var(--muted);
  font-size: 12px
}

.stat strong {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -.05em
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 23px
}

.tabs {
  display: flex;
  gap: 5px
}

.tab {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 7px
}

.tab.active {
  background: var(--raised);
  color: var(--text)
}

.search {
  position: relative;
  max-width: 255px
}

.search input {
  padding-left: 35px;
  font-size: 12px
}

.search svg {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted)
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px
}

.project-card {
  min-width: 0
}

.project-image {
  aspect-ratio: 16/10;
  background: var(--panel);
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  cursor: pointer
}

.project-image>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s
}

.project-image:hover>img {
  transform: scale(1.025)
}

.project-image>.icon {
  width: 36px;
  height: 36px;
  color: var(--muted)
}

.project-image .duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 7px;
  background: #0009;
  color: white;
  font-size: 10px;
  border-radius: 4px
}

.project-image .badge {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: 85%
}

.project-info {
  padding: 12px 2px
}

.project-info h3 {
  font-size: 14px;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.project-info small {
  color: var(--muted);
  font-size: 11px
}

.project-info .btn {
  height: 28px;
  min-height: 28px
}

.project-new {
  min-height: 200px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  background: none;
  font-size: 12px
}

.project-new:hover {
  border-color: var(--olive);
  color: var(--text)
}

.onboarding {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 35px;
  margin-bottom: 30px
}

.onboarding h2 {
  font-size: 31px;
  margin: 14px 0
}

.onboarding p {
  color: var(--muted);
  max-width: 410px;
  margin-bottom: 24px
}

.onboarding-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden
}

.onboarding-art img {
  height: 190px;
  width: 130px;
  object-fit: cover;
  border-radius: 9px;
  transform: rotate(-6deg)
}

.onboarding-art .note-card {
  width: 150px;
  transform: rotate(5deg);
  background: var(--bg)
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px
}

.panel h2 {
  font-size: 22px;
  margin-bottom: 8px
}

.panel form {
  margin-top: 24px
}

.settings-grid .field {
  margin-bottom: 16px
}

.worker-notice {
  display: none;
  padding: 10px 16px;
  background: #83284222;
  color: var(--error);
  font-size: 12px
}

.worker-notice.visible {
  display: block
}

/* Editor */
.editor-shell {
  display: flex;
  flex-direction: column;
  height: 100vh
}

.editor-top {
  height: 68px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 15px
}

.editor-top .brand {
  font-size: 17px
}

.editor-top .brand img {
  width: 28px;
  height: 28px
}

.editor-title {
  border-left: 1px solid var(--line);
  padding-left: 17px;
  font-size: 13px;
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.save-state {
  font-size: 11px;
  color: var(--muted)
}

.editor-layout {
  display: grid;
  grid-template-columns: 280px minmax(280px, 1fr) 278px;
  flex: 1;
  min-height: 0
}

.editor-left {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 20px
}

.editor-right {
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 22px 20px
}

.editor-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel)
}

.clip-item {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--text);
  padding: 12px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 9px
}

.clip-item.active {
  background: var(--soft);
  border-color: #62684b
}

.clip-item strong {
  display: block;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
  max-height: 36px;
  overflow: hidden
}

.clip-item small {
  color: var(--muted);
  font-size: 10px
}

.transcript {
  font-size: 14px;
  line-height: 2.1;
  color: var(--muted)
}

.word {
  border-radius: 3px;
  padding: 2px 2px;
  cursor: pointer;
  outline-offset: 0
}

.word:hover,
.word.selected {
  background: var(--raised);
  color: var(--text)
}

.word.current {
  background: var(--soft);
  color: var(--olive)
}

.transcript-actions {
  position: sticky;
  bottom: -20px;
  background: var(--bg);
  padding: 12px 0;
  margin-top: 15px;
  border-top: 1px solid var(--line)
}

.viewer-area {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 20px 20px;
  position: relative;
  overflow: hidden
}

.video-frame {
  position: relative;
  overflow: hidden;
  background: #09090a;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9/16;
  border-radius: 7px;
  box-shadow: 0 10px 50px #0003
}

.video-frame video {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block
}

#editor-composition {
  width: 100%;
  height: 100%
}

/* Cropped footage extends beyond its window; page media limits must not shrink it. */
.composition-preview video {
  max-width: none
}

.caption-preview {
  position: absolute;
  left: 5%;
  right: 5%;
  text-align: center;
  transform: translateY(-100%);
  font-weight: 750;
  line-height: 1.15;
  color: white;
  text-shadow: -1px -1px 0 #101011, 1px 1px 0 #101011, 0 2px 5px #000;
  pointer-events: none
}

.caption-preview b {
  font-weight: 750
}

.hook-preview {
  position: absolute;
  top: 12%;
  left: 7%;
  right: 7%;
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 5px #000;
  pointer-events: none
}

.preview-label {
  font-size: 10px;
  color: var(--muted)
}

.viewer-toolbar {
  position: absolute;
  top: 12px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 10px 18px 14px;
  font-size: 11px
}

.player-controls input {
  accent-color: var(--olive);
  max-width: 240px;
  flex: 1;
  min-width: 60px
}

.player-controls .time {
  min-width: 91px;
  font-variant-numeric: tabular-nums
}

.timeline {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--bg);
  max-height: 230px;
  overflow: auto
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px
}

.timeline-track {
  display: flex;
  gap: 4px;
  overflow: auto;
  padding-bottom: 10px;
  min-height: 43px
}

.timeline-block {
  background: var(--accent);
  color: #fff;
  border: 1px solid #a76175;
  border-radius: 4px;
  min-width: 55px;
  max-width: 180px;
  padding: 8px;
  font-size: 10px;
  flex-grow: 1;
  white-space: nowrap
}

.timeline-block.active {
  outline: 2px solid var(--olive);
  outline-offset: 1px
}

.segment-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  align-items: end;
  gap: 8px
}

.segment-controls .field input {
  min-height: 34px;
  padding: 6px;
  font-size: 12px
}

.editor-right .field {
  margin-bottom: 17px
}

.editor-right .field input,
.editor-right .field select {
  min-height: 36px;
  padding: 8px;
  font-size: 12px
}

.appearance-controls { grid-column: 1 / -1; margin-bottom: 14px; }
.appearance-controls .row > .field { flex: 1; min-width: 0; }
/* Color samples stay independent of the app's light/dark theme. */
.palette-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 18px; }
.palette-choice { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel); min-width: 0; text-align: left; }
.palette-choice:hover { border-color: var(--sample-accent); }
.palette-choice[aria-pressed="true"] { border-color: var(--sample-accent); box-shadow: 0 0 0 1px var(--sample-accent); }
.palette-swatches { display: flex; height: 27px; border-radius: 5px; overflow: hidden; outline: 1px solid #80808033; }
.palette-swatches > i { display: block; flex: 2; }
.palette-swatches > i:nth-child(2) { flex: 1; }
.palette-name { display: block; overflow-wrap: anywhere; font-size: 11px; line-height: 1.3; font-weight: 550; }
.palette-selected { position: absolute; right: 13px; top: 14px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #ffffff; color: #19191B; font-size: 11px; font-weight: 750; visibility: hidden; }
.palette-choice[aria-pressed="true"] .palette-selected { visibility: visible; }
.appearance-sample { position: relative; padding: 18px; margin: 12px 0; border-radius: 8px; background: var(--sample-bg); color: var(--sample-ink); overflow: hidden; }
.appearance-sample small { display: block; font-size: 9px; opacity: .7; }
.appearance-sample strong { display: block; font-size: 23px; font-weight: 650; line-height: 1.12; letter-spacing: -.04em; margin-top: 12px; }
.appearance-sample > i { display: block; width: 70px; height: 5px; border-radius: 2px; background: var(--sample-accent); margin-top: 13px; }

.style-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 20px
}

.preset {
  padding: 16px 4px 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 7px;
  font-size: 10px
}

.preset.active {
  border-color: var(--olive)
}

.preset span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px
}

.preset:nth-child(2) span {
  text-transform: uppercase;
  color: #d1d5a5
}

.preset:nth-child(3) span {
  font-weight: 400
}

.export-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px
}

.export-item small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px
}

.job-panel {
  padding: 13px;
  background: var(--raised);
  border-radius: 8px;
  margin: 12px 0;
  font-size: 12px
}

.job-panel .progress {
  margin: 12px 0
}

.job-panel p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px
}

.analysis-screen {
  max-width: 760px;
  margin: 55px auto;
  padding: 30px
}

.analysis-screen h1 {
  margin: 20px 0
}

.analysis-screen .step {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  color: var(--muted)
}

.analysis-screen .step.done {
  color: var(--text)
}

/* Dialogs, notices, small screens */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #0009;
  backdrop-filter: blur(6px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow)
}

.modal h2 {
  font-size: 27px
}

.modal .intro {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 24px
}

.dropzone {
  border: 1px dashed #65655d;
  background: var(--bg);
  border-radius: 10px;
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--olive);
  background: var(--soft)
}

.dropzone strong {
  font-size: 14px;
  font-weight: 500
}

.dropzone small {
  color: var(--muted);
  font-size: 11px
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 20px 0
}

.mode {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px 11px;
  background: var(--bg);
  color: var(--text);
  text-align: left
}

.mode.active {
  border-color: var(--olive);
  background: var(--soft)
}

.mode strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin: 10px 0 5px
}

.mode small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
  display: block
}

.upload-modes {
  margin: 20px 0
}

.mode-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%
}

.mode-primary strong {
  margin: 0 0 5px
}

.other-modes {
  margin-top: 12px
}

.other-modes > summary {
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer
}

.other-modes > .mode-grid {
  margin: 8px 0 0
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  gap: 12px
}

.upload-state {
  padding: 20px 0
}

.upload-state .progress {
  margin: 15px 0
}

.dialog-video {
  width: 100%;
  max-height: 70vh
}

.mobile-only {
  display: none
}

#toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 40px)
}

.toast {
  padding: 14px 18px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 440px
}

.toast.error {
  border-color: #832842;
  color: var(--error)
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0)
}

@media(min-width:1700px) {
  .editor-layout {
    grid-template-columns: 330px minmax(350px, 1fr) 310px
  }

  .viewer-area {
    padding: 58px 28px 28px
  }

  .editor-right {
    padding: 25px
  }
}

@media(max-width:1150px) {
  .public-header {
    padding: 0 30px
  }

  .hero {
    padding: 50px 30px;
    gap: 25px
  }

  .hero-art {
    height: 460px
  }

  .hero-screen {
    height: 390px
  }

  .hero-side {
    padding-top: 30px
  }

  .note-card {
    padding: 15px 12px
  }

  .public-section {
    margin: 15px 30px;
    padding: 45px 0
  }

  .hero-caption {
    font-size: 22px
  }

  .shell {
    grid-template-columns: 190px minmax(0, 1fr)
  }

  .sidebar {
    padding: 22px 12px
  }

  .workspace-content {
    padding: 30px 24px
  }

  .topbar {
    padding: 0 24px
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .editor-layout {
    grid-template-columns: 230px minmax(240px, 1fr) 240px
  }

  .editor-left {
    padding: 15px
  }

  .editor-right {
    padding: 18px 14px
  }

  .editor-title {
    max-width: 210px
  }

  .save-state {
    display: none
  }

  .onboarding-art .note-card {
    display: none
  }
}

@media(max-width:800px) {
  h1 {
    font-size: 32px
  }

  .public-header {
    height: 70px;
    padding: 0 20px
  }

  .public-header nav {
    display: none
  }

  .public-header .btn {
    padding: 9px 12px
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 40px 22px;
    gap: 30px
  }

  .hero h1 {
    font-size: 58px
  }

  .hero-copy>p {
    font-size: 15px
  }

  .hero-art {
    height: 420px;
    max-width: 470px;
    width: 100%;
    margin: auto;
    grid-template-columns: 1fr .68fr
  }

  .hero-screen {
    height: 370px
  }

  .hero-side {
    padding-top: 0
  }

  .floating-track {
    left: 0;
    right: 20px
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 12px
  }

  .feature {
    padding: 23px
  }

  .feature .number {
    margin-bottom: 18px
  }

  .faq {
    grid-template-columns: 1fr;
    gap: 20px
  }

  .public-footer {
    padding: 25px 22px;
    gap: 20px;
    flex-wrap: wrap
  }

  .auth-screen {
    grid-template-columns: 1fr
  }

  .auth-art {
    display: none
  }

  .auth-content {
    min-height: 100vh;
    padding: 28px
  }

  .shell {
    display: block
  }

  .sidebar {
    display: none
  }

  .mobile-only {
    display: inline-flex
  }

  .topbar {
    padding: 0 18px;
    height: 65px
  }

  .workspace-content {
    padding: 26px 18px
  }

  .workspace-title {
    align-items: start
  }

  .workspace-title h1 {
    font-size: 30px
  }

  .workspace-title>.btn {
    padding: 10px;
    font-size: 0
  }

  .workspace-title>.btn .icon {
    width: 20px
  }

  .stats {
    margin-bottom: 24px
  }

  .stat {
    padding: 13px;
    display: block
  }

  .stat strong {
    display: block;
    font-size: 24px;
    margin-top: 5px
  }

  .stat span {
    font-size: 10px
  }

  .toolbar {
    flex-wrap: wrap
  }

  .search {
    max-width: none;
    width: 100%
  }

  .project-grid {
    gap: 15px
  }

  .project-info h3 {
    font-size: 12px
  }

  .project-info small {
    font-size: 10px
  }

  .onboarding {
    grid-template-columns: 1fr;
    padding: 25px
  }

  .onboarding-art {
    display: none
  }

  .settings-grid {
    grid-template-columns: 1fr
  }

  .editor-shell {
    height: auto;
    min-height: 100dvh
  }

  .editor-top {
    height: 62px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5
  }

  .editor-title {
    max-width: 180px;
    font-size: 11px;
    padding-left: 10px
  }

  .editor-top .brand span {
    display: none
  }

  .editor-top .row {
    gap: 7px
  }

  .editor-top .btn {
    padding: 8px 10px;
    min-height: 36px
  }

  .editor-top .export-label {
    display: none
  }

  .editor-layout {
    display: flex;
    flex-direction: column
  }

  .editor-main {
    order: 0;
    min-height: 530px
  }

  .viewer-area {
    height: 440px;
    flex: none;
    padding: 58px 20px 20px;
    min-height: 0
  }

  .editor-left {
    order: 1;
    border-right: 0;
    border-top: 1px solid var(--line);
    max-height: 430px;
    padding: 20px
  }

  .editor-right {
    order: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 23px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px
  }

  .editor-right>.section-label,
  .editor-right>.style-presets,
  .editor-right>.divider,
  .editor-right>#export-history,
  .editor-right>.hint,
  .editor-right>.job-panel {
    grid-column: 1/-1
  }

  .timeline {
    max-height: 220px
  }

  .player-controls {
    padding-top: 4px
  }

  .caption-preview {
    font-size: 22px
  }

  .analysis-screen {
    margin: 20px auto;
    padding: 25px
  }

  .modal {
    padding: 22px
  }

  .modal-backdrop {
    padding: 12px
  }

  .mode {
    padding: 12px 8px
  }

  .mode strong {
    font-size: 11px
  }

  .mode small {
    font-size: 10px
  }

  .onboarding h2 {
    font-size: 28px
  }
}

@media(max-width:400px) {
  .hero h1 {
    font-size: 48px
  }

  .hero-art {
    height: 370px;
    gap: 9px
  }

  .hero-screen {
    height: 330px
  }

  .hero-caption {
    font-size: 20px
  }

  .hero-side .note-card {
    padding: 12px
  }

  .note-card .big {
    font-size: 24px
  }

  .project-grid {
    grid-template-columns: 1fr
  }

  .editor-title {
    max-width: 125px
  }

  .mode-grid {
    gap: 5px
  }

  .modal {
    padding: 18px
  }

  .editor-right {
    padding: 18px;
    gap: 0 12px
  }

  .segment-controls {
    grid-template-columns: 1fr 1fr auto auto auto;
    gap: 5px
  }

  .segment-controls .btn {
    padding: 6px
  }

  .public-header .brand {
    font-size: 18px
  }

  .public-header .brand img {
    width: 28px;
    height: 28px
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}

.sr-only {
  top: 0;
  left: 0
}

.timeline-header {
  gap: 8px;
  flex-wrap: wrap
}

.timeline-header>.row {
  gap: 4px;
  flex-wrap: wrap
}

.edit-options { display:grid; gap:12px; margin-top:18px; }
.edit-options .row > .field { flex:1; min-width:0; }
.edit-options textarea { width:100%; min-height:85px; resize:vertical; background:var(--panel); color:inherit; border:1px solid var(--line); border-radius:10px; padding:12px; font:inherit; }
.edit-report { grid-column:1/-1; margin-bottom:22px; padding:14px; border:1px solid var(--line); border-radius:12px; }
.edit-report summary { cursor:pointer; font-weight:600; }
.edit-report p { line-height:1.5; margin:10px 0; }
#director-job:empty { display:none; }

.upload-file-row { display:flex; gap:6px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); }
.upload-file-name { min-width:0; flex:1; }
.upload-file-name strong { display:block; overflow-wrap:anywhere; font-size:13px; }
.upload-file-name small { display:block; margin-top:4px; color:var(--muted); }
.timeline-track button small { display:block; max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:5px; }

.graphic-editor,.crop-editor,.cinema-editor{grid-column:1/-1;min-width:0;border-top:1px solid var(--line);padding-top:12px;margin-top:8px}
.graphic-editor>summary,.crop-editor>summary,.cinema-editor>summary{cursor:pointer;font-size:12px;font-weight:600;margin-bottom:12px}
.graphic-fields{display:grid;gap:12px;margin-top:12px}
.graphic-editor .row>.field,.crop-editor .row>.field,.cinema-editor .row>.field{flex:1;min-width:0}
.graphic-item{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;gap:8px;align-items:end;margin-bottom:10px}
.graphic-editor input,.graphic-editor select,.crop-editor input,.cinema-editor input,.cinema-editor select{width:100%;min-width:0}

.cookie-notice {
  position: fixed;
  z-index: 90;
  left: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(430px, calc(100vw - 48px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel, #fff);
  color: var(--text, #202024);
  box-shadow: 0 12px 60px #0002;
}
.cookie-notice strong { font-size: 18px; letter-spacing: -.02em; }
.cookie-notice p { margin: 10px 0 18px; font-size: 14px; line-height: 1.55; }
.cookie-notice a { text-decoration: underline; text-underline-offset: 3px; }
.cookie-notice button { width: 100%; }
@media (max-width: 480px) {
  .cookie-notice { left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); padding: 18px; }
}
.track-choice { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.track-choice > .hint { display: block; margin-top: 8px; }
.track-choice audio { display: block; width: 100%; margin: 16px 0; }
.track-choice [hidden] { display: none; }
