.workspace { display: grid; grid-template-columns: minmax(228px, .72fr) minmax(470px, 1.65fr) minmax(310px, .94fr); gap: 12px; align-items: start; }
.frames-panel, .settings { position: sticky; top: 12px; height: calc(100vh - 24px); min-height: 660px; overflow: hidden; }
.frames-panel { display: flex; flex-direction: column; }
.frames-panel footer { min-height: 43px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10px; }
.frames-panel footer span { display: flex; align-items: center; gap: 7px; }
.frames-panel footer i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.frames-panel footer strong { color: var(--muted); }
.batch-delay { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.batch-delay label { display: block; margin-bottom: 7px; color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.batch-delay > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; }
.batch-delay input { width: 100%; }
.batch-delay span { color: var(--dim); font-size: 10px; }
.batch-delay button { height: 31px; padding: 0 9px; color: var(--accent); }
.frame-list { min-height: 0; padding: 8px; overflow-y: auto; scrollbar-width: thin; }
.frame-card { position: relative; display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 9px; margin-bottom: 6px; padding: 7px; border: 1px solid transparent; border-radius: 9px; background: #111511; cursor: pointer; }
.frame-card:hover { border-color: var(--line-strong); }
.frame-card.active { border-color: rgba(167,255,53,.52); background: rgba(167,255,53,.045); }
.frame-card.dragging { opacity: .4; }
.frame-thumb { position: relative; height: 48px; overflow: hidden; border-radius: 6px; background: #070907; }
.frame-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-number { position: absolute; left: 3px; top: 3px; padding: 2px 4px; border-radius: 4px; color: white; background: rgba(0,0,0,.68); font-size: 8px; }
.frame-info { min-width: 0; display: grid; align-content: center; gap: 5px; }
.frame-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cfd7cc; font-size: 10px; }
.frame-info label { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 9px; }
.frame-info input { width: 60px; height: 25px; padding: 3px 5px; }
.add-more { width: calc(100% - 16px); min-height: 37px; margin: 0 8px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px dashed #344031; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
.add-more:hover { border-color: var(--accent); color: var(--accent); }
.add-more svg { width: 15px; }

.editor { overflow: hidden; }
.source-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.source-title > span { min-width: 43px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(167,255,53,.3); border-radius: 6px; color: var(--accent); background: rgba(167,255,53,.06); font-size: 10px; font-weight: 800; }
.source-title div { min-width: 0; display: grid; gap: 2px; }
.source-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.source-title small { color: var(--dim); font-size: 9px; }
.preview-stage { position: relative; height: clamp(330px, 43vw, 600px); overflow: hidden; display: grid; place-items: center; background: #050605; touch-action: none; }
.preview-stage.checkerboard { background-color: #090b09; background-image: linear-gradient(45deg,#111511 25%,transparent 25%), linear-gradient(-45deg,#111511 25%,transparent 25%), linear-gradient(45deg,transparent 75%,#111511 75%), linear-gradient(-45deg,transparent 75%,#111511 75%); background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; }
#preview-canvas { display: block; max-width: calc(100% - 34px); max-height: calc(100% - 34px); width: auto; height: auto; object-fit: contain; box-shadow: 0 10px 38px rgba(0,0,0,.52); cursor: default; }
#preview-canvas.text-draggable { cursor: grab; }
#preview-canvas.text-dragging { cursor: grabbing; }
.placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--dim); font-size: 12px; }
.placeholder svg { width: 34px; }
.processing { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: rgba(6,8,6,.92); backdrop-filter: blur(7px); }
.engine-bars { height: 42px; display: flex; align-items: end; gap: 5px; margin-bottom: 17px; }
.engine-bars i { width: 5px; height: 16px; border-radius: 3px; background: var(--accent); animation: engine 1s ease-in-out infinite; }
.engine-bars i:nth-child(2) { height: 32px; animation-delay: -.2s; }.engine-bars i:nth-child(3) { height: 23px; animation-delay: -.4s; }
@keyframes engine { 50% { transform: scaleY(.45); opacity: .55; } }
.processing strong { font-size: 16px; }.processing > span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.progress { width: min(370px,80%); height: 5px; margin: 22px 0 8px; overflow: hidden; border-radius: 5px; background: #252b24; }
.progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.progress-info { width: min(370px,80%); display: flex; justify-content: space-between; color: var(--dim); font-size: 10px; }.progress-info b { color: var(--accent); }
.btn.cancel { min-height: 35px; margin-top: 20px; color: var(--danger); }

.transport { min-height: 62px; display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #0b0e0b; }
.transport-btn, .play-btn { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.transport-btn { width: 34px; height: 34px; }.transport-btn svg { width: 16px; }
.play-btn { width: 39px; height: 39px; border-color: var(--accent); color: #11170b; background: var(--accent); }.play-btn svg { width: 18px; fill: currentColor; stroke-width: 0; }.play-btn .pause-icon { display: none; }.play-btn.playing .play-icon { display: none; }.play-btn.playing .pause-icon { display: block; }
.scrubber-wrap { min-width: 0; flex: 1; display: grid; gap: 5px; }
.scrubber-wrap input { width: 100%; accent-color: var(--accent); }.scrubber-wrap div { display: flex; justify-content: flex-end; gap: 5px; color: var(--dim); font-size: 8px; }.scrubber-wrap b { color: var(--muted); }
.transport select { width: 67px; padding-right: 6px; }
.timeline-tools { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; }
.timeline-tools strong { color: var(--dim); font-size: 9px; letter-spacing: .08em; }.timeline-tools strong span { color: var(--accent); }
.timeline-tools div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }.timeline-tools button { min-height: 28px; padding: 0 8px; }.timeline-tools button:hover { color: var(--accent); }.timeline-tools .danger-text:hover { color: var(--danger); }
.timeline-strip { min-height: 86px; display: flex; gap: 7px; padding: 8px 14px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #0b0e0b; scrollbar-width: thin; }
.timeline-item { position: relative; width: 84px; height: 62px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #050605; cursor: pointer; }
.timeline-item.active { border: 2px solid var(--accent); }.timeline-item img { width: 100%; height: 100%; object-fit: contain; }.timeline-item span { position: absolute; right: 3px; bottom: 3px; padding: 2px 4px; border-radius: 4px; color: white; background: rgba(0,0,0,.7); font-size: 7px; }
.source-stats { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); }
.source-stats span { min-width: 0; display: grid; gap: 2px; padding: 11px 9px; text-align: center; border-right: 1px solid var(--line); }.source-stats span:last-child { border: 0; }.source-stats b { overflow: hidden; text-overflow: ellipsis; color: #cfd6cc; font-size: 10px; }.source-stats small { color: var(--dim); font-size: 8px; text-transform: uppercase; }

.result { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 15px; background: linear-gradient(130deg,rgba(167,255,53,.055),transparent); }
.result-check { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #10150b; background: var(--accent); }.result-check svg { width: 20px; }
.result > div:nth-child(2) { display: grid; align-content: center; }.result em { color: var(--accent); font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: .12em; }.result strong { font-size: 12px; }.result small { color: var(--muted); font-size: 9px; }
.result img { width: min(100%,520px); max-height: 330px; grid-column: 1/-1; justify-self: center; object-fit: contain; border: 1px solid var(--line); background: #050605; }
.result-actions { grid-column: 1/-1; display: flex; gap: 8px; }.result-actions .btn { flex: 1; }

.settings { display: flex; flex-direction: column; }.settings-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset { min-height: 51px; padding: 8px; display: grid; align-content: center; gap: 1px; text-align: left; border: 1px solid var(--line); border-radius: 8px; color: #bfc7bc; background: var(--surface-2); cursor: pointer; }.preset:hover { border-color: #4c5949; }.preset.active { border-color: rgba(167,255,53,.56); color: var(--accent); background: rgba(167,255,53,.055); }.preset b { font-size: 10px; }.preset small { color: var(--dim); font-size: 8px; }
.tabs { position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: repeat(4,1fr); padding: 7px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab { min-height: 33px; border: 0; border-radius: 6px; color: var(--dim); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }.tab.active { color: var(--accent); background: var(--surface-3); }
.dimensions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 7px; }.dimensions label, .two-cols label { display: grid; gap: 5px; color: var(--dim); font-size: 9px; }.dimensions input { width: 100%; }.ratio-lock { width: 30px; height: 31px; border: 1px solid var(--line); border-radius: 7px; color: var(--dim); background: var(--surface-2); cursor: pointer; }.ratio-lock.active { color: var(--accent); border-color: rgba(167,255,53,.4); }
.ratio-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }.ratio-grid button { min-height: 29px; }.ratio-grid button:hover { color: var(--accent); }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.two-cols input, .two-cols select { width: 100%; max-width: none; }.two-cols input[type="color"] { height: 34px; }
.drag-tip { margin: 0; color: var(--dim); font-size: 9px; }
.command { margin: 0 14px 14px; border: 1px solid var(--line); border-radius: 8px; background: #0b0e0b; }.command summary { padding: 10px; color: var(--muted); font-size: 9px; cursor: pointer; }.command summary b { float: right; color: var(--accent); font-size: 7px; }.command code { display: block; padding: 0 10px 10px; overflow-wrap: anywhere; color: #91a28d; font-size: 8px; line-height: 1.5; }
.estimate { margin: 13px; overflow: hidden; border: 1px solid #2d382b; border-radius: 9px; background: linear-gradient(140deg,rgba(167,255,53,.045),transparent); }.estimate header { display: flex; justify-content: space-between; padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; }.estimate header b { color: var(--accent); }.estimate > div:nth-child(2) { display: grid; grid-template-columns: repeat(3,1fr); }.estimate > div:nth-child(2) span { min-width: 0; display: grid; gap: 2px; padding: 11px 6px; text-align: center; }.estimate small { color: var(--dim); font-size: 7px; }.estimate b { overflow: hidden; text-overflow: ellipsis; font-size: 10px; }.estimate p { margin: 0; padding: 10px 11px; color: var(--dim); font-size: 8px; line-height: 1.45; }
.budget-track { position: relative; height: 5px; margin: 4px 11px 0; border-radius: 4px; background: #292f27; }.budget-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }.budget-track span { position: absolute; right: 0; top: 7px; color: var(--dim); font-size: 7px; }
.export-footer { min-height: 92px; margin-top: auto; display: grid; grid-template-columns: 1fr; gap: 10px; padding: 13px; border-top: 1px solid var(--line); background: #0b0e0b; }.engine-status { display: flex; align-items: center; gap: 8px; }.engine-status > i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 11px rgba(167,255,53,.55); }.engine-status span { display: grid; }.engine-status b { font-size: 10px; }.engine-status small { color: var(--dim); font-size: 8px; }.btn.export { width: 100%; }.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

@media (max-width: 1220px) {
  .workspace { grid-template-columns: 240px minmax(430px,1fr); }
  .settings { position: relative; top: auto; width: 100%; height: auto; min-height: 0; grid-column: 1/-1; }
  .settings-scroll { overflow: visible; }
  .preset-grid { grid-template-columns: repeat(5,1fr); }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .frames-panel, .settings { position: relative; top: auto; height: auto; min-height: 0; }
  .frame-list { max-height: 320px; }
  .preview-stage { height: min(72vw,520px); min-height: 280px; }
  .settings { grid-column: auto; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .preview-head { padding: 10px; }
  .transport { flex-wrap: wrap; }.scrubber-wrap { order: 2; flex-basis: 100%; }.transport select { margin-left: auto; }
  .timeline-tools { align-items: flex-start; flex-direction: column; }.timeline-tools div { justify-content: flex-start; }
  .source-stats { grid-template-columns: 1fr 1fr; }.source-stats span:nth-child(2) { border-right: 0; }.source-stats span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tabs { grid-template-columns: 1fr 1fr; }
}
