/* Titles — lower thirds & title cards */
.stage-col { display: grid; gap: 14px; min-width: 0; }
.stage-panel { overflow: hidden; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.stage-bar .row { gap: 6px; }
.upl { cursor: pointer; }
#guides[aria-pressed=true] { color: var(--accent); border-color: rgba(15,154,150,.4); }

.stage { position: relative; display: grid; place-items: center; padding: clamp(14px, 2.4vw, 34px); background: radial-gradient(120% 90% at 50% 0%, #161614 0%, #0b0b0a 70%); }
.frame { position: relative; width: 100%; max-width: max(min(100%, 480px), calc((100vh - 400px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(0,0,0,.9); background: #000; }
.frame canvas { width: 100%; height: 100%; }
.frame.v { aspect-ratio: 9 / 16; width: auto; height: min(68vh, 760px); }
.frame.sq { aspect-ratio: 1 / 1; width: auto; height: min(62vh, 640px); }
.frame.busy::after { content: ""; position: absolute; inset: 0; background: rgba(20, 19, 18,.35); }

/* timeline */
.tl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border-top: 1px solid var(--line); }
.play { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #141312; display: grid; place-items: center; transition: background .3s, transform .3s var(--ease); }
.play:hover { background: var(--accent); }
.play:active { transform: scale(.94); }
.play svg { width: 18px; height: 18px; fill: currentColor; grid-area: 1 / 1; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.tl-main { min-width: 0; display: grid; gap: 8px; }
.tl-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; }
.tl-meta #tc { color: var(--ink); }
.tl-phase { color: var(--accent); }
.track { position: relative; height: 30px; display: flex; border-radius: 8px; overflow: hidden; background: var(--bg3); cursor: ew-resize; touch-action: none; border: 1px solid var(--line); }
.track > div:not(.head) { position: relative; height: 100%; display: flex; align-items: center; padding-left: 8px; min-width: 0; }
.track i { font-style: normal; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; pointer-events: none; }
.seg-in { background: linear-gradient(90deg, rgba(15,154,150,.04), rgba(15,154,150,.16)); }
.seg-hold { background: rgba(250, 248, 243,.035); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.seg-out { background: linear-gradient(90deg, rgba(15,154,150,.16), rgba(15,154,150,.04)); }
.head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 10px rgba(15,154,150,.7); pointer-events: none; }
.head::before { content: ""; position: absolute; top: -1px; left: -4px; border: 5px solid transparent; border-top-color: var(--accent); }
.tl-r { display: flex; align-items: center; gap: 6px; }
#loop[aria-pressed=true] { color: var(--accent); }
.fps { width: 70px; padding: 7px 26px 7px 10px; font-size: 12.5px; font-family: var(--mono); border-radius: 99px; }

/* export */
.export-panel { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.ex-l { display: grid; gap: 4px; }
.ex-dims { color: var(--soft); font-size: 11px; }
.ex-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* side */
.side .sec h3 output { color: var(--soft); text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12.5px; }
.tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { position: relative; display: grid; gap: 6px; text-align: left; padding: 0; border-radius: 10px; }
.tpl canvas { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 8px; background: #0e0e0d; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .3s; }
.tpl span { font-size: 12px; color: var(--muted); padding: 0 2px 2px; transition: color .3s; line-height: 1.2; }
.tpl:hover canvas { box-shadow: 0 0 0 1px var(--muted); }
.tpl:hover span { color: var(--ink); }
.tpl.on canvas { box-shadow: 0 0 0 1.5px var(--accent), 0 6px 24px -8px rgba(15,154,150,.45); }
.tpl.on span { color: var(--ink); }
.tpl b { position: absolute; top: 6px; left: 7px; font-family: var(--mono); font-weight: 400; font-size: 9px; color: rgba(250, 248, 243,.5); letter-spacing: .08em; }

.swatches { display: flex; gap: 14px; margin-bottom: 12px; }
.sw { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sw span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.presetcols { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.presetcols button { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .3s var(--ease); }
.presetcols button:hover { transform: scale(1.15); }

.lay { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
.pos9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 10px; background: var(--bg3); }
.pos9 button { border-radius: 4px; position: relative; transition: background .25s; }
.pos9 button::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--faint); transition: .25s; }
.pos9 button:hover::after { background: var(--soft); }
.pos9 button.on { background: rgba(15,154,150,.12); }
.pos9 button.on::after { background: var(--accent); box-shadow: 0 0 8px var(--accent); width: 8px; height: 8px; margin: -4px; }
.lay-r .seg button { padding: 5px 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid3 .field > span { flex-direction: column; gap: 2px; }

.chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.chips .chip i { font-style: normal; opacity: .5; padding-left: 2px; }
.chips .chip i:hover { opacity: 1; color: var(--bad); }
.chips .chip .cdot { width: 8px; height: 8px; border-radius: 50%; }
.chips:not(:empty) + .hint { display: none; }

/* progress + modals */
.prog { display: grid; gap: 14px; }
.prog .bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width .15s linear; }
.prog .pl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.prog .big { font-family: var(--serif); font-size: 44px; line-height: 1; }
.prog .big em { color: var(--muted); }
.how { display: grid; gap: 14px; }
.how .app { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.how .app h4 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin-bottom: 4px; }
.how .app h4 em { color: var(--accent); }
.how .app p, .how > p { color: var(--soft); font-size: 13.5px; }
.how .app ol { margin: 6px 0 0 18px; color: var(--soft); font-size: 13.5px; }
.how .note { color: var(--muted); font-size: 12.5px; }
.batch { display: grid; gap: 14px; }
.batch textarea { min-height: 150px; font-family: var(--mono); font-size: 12.5px; }
.batch .row { justify-content: space-between; }
.save-row { display: flex; gap: 8px; }

@media (max-width: 960px) {
  .frame.v { height: min(70vh, 640px); }
  .tpls { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .stage-bar { padding: 10px; }
  .stage-bar > .seg, .stage-bar .row { width: 100%; }
  .stage-bar .row { justify-content: space-between; }
  .tl { grid-template-columns: auto minmax(0, 1fr); padding: 12px; gap: 12px; }
  .tl-r { grid-column: 1 / -1; justify-content: space-between; }
  .tpls { grid-template-columns: 1fr 1fr; }
  .export-panel { padding: 14px; }
  .ex-btns .btn { flex: 1 1 auto; }
  .frame.v { height: 62vh; }
  .frame.sq { height: auto; width: 100%; }
  .lay { grid-template-columns: 96px minmax(0, 1fr); }
}
