:root {
  color-scheme: dark;
  font: 16px/1.48 Inter, "Avenir Next", system-ui, sans-serif;
  background: #121317;
  color: #f6f3ee;
  --panel: #1d1e25;
  --line: #3c3e48;
  --muted: #b9bac5;
  --accent: #ffae85;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select, input { font: inherit; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.bar { border-bottom: 1px solid var(--line); }
.bar-content { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; text-decoration: none; }
.bar-content > a:last-child, .footer { color: var(--muted); font-size: .875rem; }
.intro { margin: clamp(36px, 6vw, 64px) 0 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5.4vw, 4.45rem); letter-spacing: -.055em; line-height: 1.06; }
h2 { font-size: 1.02rem; }
.intro p { margin-top: 12px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 307px; gap: 15px; align-items: start; }
.left { min-width: 0; display: grid; gap: 12px; }
.viewer, .timeline, .controls { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); padding: 17px; }
.viewer-head, .timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#preview-name, #total-time { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; min-width: 0; }
.stage { min-height: 300px; background: #111215; border-radius: 8px; display: grid; place-items: center; padding: 12px; }
.stage canvas, .stage video { max-width: 100%; max-height: 424px; width: auto; height: auto; display: block; }
.stage video { aspect-ratio: auto; }
#empty { min-height: 230px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 17px; color: var(--muted); }
.photo-mark { width: 56px; height: 45px; border: 1px solid #797483; border-radius: 8px; background: linear-gradient(28deg, #5b5866 36%, transparent 37%), linear-gradient(150deg, transparent 64%, #4c4a57 65%); }
.controls { padding: 18px; }
button, .primary { background: #292b34; border: 1px solid #545661; border-radius: 7px; min-height: 41px; padding: 7px 11px; color: #fff; cursor: pointer; font-weight: 700; }
button:hover:not(:disabled) { background: #363945; }
button:disabled { cursor: default; opacity: .5; }
.primary { display: block; background: var(--accent); border-color: transparent; color: #25150f; text-decoration: none; text-align: center; }
.primary:hover:not(:disabled) { background: #ffbf9d; }
.file-actions { display: flex; align-items: center; gap: 9px; margin: 12px 0 7px; flex-wrap: wrap; }
.text-button { background: transparent; border-color: transparent; text-decoration: underline; color: #ffe0d2; padding-inline: 0; min-height: 36px; }
.text-button:hover:not(:disabled) { background: transparent; }
.subtle { color: var(--muted); font-size: .8rem; }
fieldset { border: 0; padding: 0; min-width: 0; margin: 18px 0; }
label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
input, select { min-width: 0; width: 100%; min-height: 42px; padding: 5px 9px; border-radius: 7px; border: 1px solid #555862; background: #17181e; color: inherit; }
select + label { margin-top: 12px; }
.duration-hint { margin: 4px 0 12px; }
.actions { display: grid; gap: 8px; }
#progress { width: 100%; margin-top: 9px; accent-color: var(--accent); }
#status { min-height: 2.6em; margin: 12px 0 5px; font-size: .87rem; overflow-wrap: anywhere; }
#photos { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
#photos li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.photo-select { display: flex; align-items: center; justify-content: start; gap: 10px; min-width: 0; text-align: left; }
.photo-select canvas { border-radius: 4px; flex: none; width: 42px; height: 36px; }
.photo-select span { overflow-wrap: anywhere; font-size: .84rem; }
.photo-select[aria-pressed="true"] { border-color: #ebaa9d; }
.photo-time { width: 72px; }
.photo-time input { min-height: 38px; }
.row-actions { display: flex; gap: 3px; }
.row-actions button { width: 33px; min-height: 37px; padding: 5px; }
.footer { display: flex; gap: 20px; padding-block: 25px; }
.document { max-width: 780px; padding-block: 44px; }
.document h1 { margin-bottom: 30px; }
.document section + section { margin-top: 27px; }
.document p, .document ol { margin-top: 9px; color: var(--muted); }
@media (max-width: 790px) {
  .shell { width: calc(100% - 32px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .controls { grid-row: 1; }
  .stage { min-height: 200px; }
}
@media (max-width: 400px) {
  .photo-time { width: 62px; }
  .photo-select { padding-inline: 5px; gap: 5px; }
  .photo-select canvas { width: 32px; height: 31px; }
  .row-actions button { width: 29px; }
}
