* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #8B5CF6 #1c1c1c; }
body { font-family: 'Bricolage Grotesque', sans-serif; overflow-x: hidden; background: #121212; }
.mono { font-family: 'Fira Code', monospace; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; background: #161616; border-bottom: 1px solid #222; }
.brand { font-weight: 800; font-size: clamp(0.95rem, 2.4vw, 1.4rem); letter-spacing: -0.02em; white-space: nowrap; }
.brand-letter { display: inline-block; animation: brandWave 3.2s ease-in-out infinite; }
.brand-letter:hover { color: #06B6D4; filter: hue-rotate(69deg); }
@keyframes brandWave { 0%,100% { transform: translateY(0); } 25% { transform: translateY(-2px); color: #c4b5fd; } 50% { transform: translateY(1px); } }
.brand-sub { font-family: 'Fira Code', monospace; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8B5CF6aa; }
.pill { background: #262626; color: #fff; font-weight: 700; font-size: 0.8rem; padding: 7px 12px; border-radius: 10px; }
.export-btn { background: #06B6D4; color: #00151a; font-weight: 800; font-size: 0.85rem; padding: 8px 16px; border-radius: 10px; transition: transform .15s, box-shadow .15s; display: inline-block; }
.export-btn:hover { box-shadow: 0 0 18px #06B6D480; transform: translateY(-1px); }

.workspace { display: grid; grid-template-columns: 1fr; gap: 0; flex: 1; }
@media (min-width: 1024px) { .workspace { grid-template-columns: minmax(0,1fr) 400px; } .sheet { border-left: 1px solid #222; max-height: calc(100vh - 56px); position: sticky; top: 56px; } }
.left-col { display: flex; flex-direction: column; min-width: 0; }
.stage { display: flex; align-items: center; justify-content: center; padding: 14px; background: radial-gradient(ellipse at center, #1e1e1e 0%, #121212 70%); }
.stage-canvas { display: block; max-width: 100%; max-height: 46vh; width: auto; height: auto; cursor: crosshair; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.6); touch-action: none; }
.transport { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; background: #161616; border-top: 1px solid #222; }
.play-btn { width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 0.9rem; border: 1px solid #333; }
.play-btn:hover { border-color: #06B6D4; color: #06B6D4; }
.icon-btn { color: #bbb; width: 28px; height: 28px; border-radius: 8px; font-size: 0.85rem; }
.icon-btn.lg { width: 36px; height: 36px; font-size: 1.15rem; }
.icon-btn:hover { background: #262626; color: #fff; }

.timeline { display: flex; background: #141414; border-top: 1px solid #222; padding: 4px 0 8px; user-select: none; }
.tl-labels { width: 40px; flex-shrink: 0; }
.tl-lab { display: flex; align-items: center; justify-content: center; color: #777; font-size: 0.8rem; margin-bottom: 3px; }
.tl-tracks { position: relative; flex: 1; margin-right: 44px; }
.tl-ruler { position: relative; cursor: ew-resize; margin-bottom: 3px; }
.tl-ruler span { position: absolute; top: 4px; font-family: 'Fira Code', monospace; font-size: 9px; color: #777; transform: translateX(-50%); }
.tl-main { display: flex; border-radius: 6px; overflow: hidden; cursor: ew-resize; margin-bottom: 3px; border: 2px solid #fff2; }
.tl-cell { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; overflow: hidden; border-right: 1px solid #0004; }
.tl-row { position: relative; background: #1e1e1e; border-radius: 6px; margin-bottom: 3px; }
.tl-add { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #888; font-size: 0.75rem; }
.tl-add:hover { color: #fff; }
.clip { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; display: flex; align-items: center; cursor: grab; overflow: hidden; touch-action: none; min-width: 12px; }
.clip-fx { background: #6d4ee0; }
.clip-text { background: #b45309; }
.clip-media { background: #0e7490; }
.clip-label { font-size: 10px; font-family: 'Fira Code', monospace; color: #fff; white-space: nowrap; padding: 0 12px; background: #0002; border-radius: 3px; pointer-events: none; }
.handle { position: absolute; top: 0; bottom: 0; width: 8px; background: #fff3; cursor: ew-resize; }
.handle:hover { background: #fff8; }
.hl { left: 0; } .hr { right: 0; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; box-shadow: 0 0 6px #fff; }
.tl-plus { position: absolute; right: -40px; top: 30px; width: 32px; height: 32px; background: #fff; color: #111; border-radius: 6px; font-size: 1.3rem; font-weight: 700; }

.toolbar { display: flex; overflow-x: auto; gap: 2px; padding: 8px 6px; background: #161616; border-top: 1px solid #222; }
.tool { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; color: #ccc; font-size: 0.7rem; font-weight: 700; border-radius: 10px; }
.tool-ic { font-size: 1.15rem; line-height: 1; }
.tool:hover { background: #222; }
.tool-on { color: #06B6D4; background: #06B6D414; }

.sheet { background: #181818; display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #222; font-weight: 800; letter-spacing: -0.01em; }
.sheet-body { padding: 14px 16px; overflow-y: auto; flex: 1; }

.control-label { font-family: 'Fira Code', monospace; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: #a78bfa; margin-bottom: 4px; display: block; }
.field { width: 100%; background: #111; border: 1px solid #2c2c2c; border-radius: 10px; padding: 8px 10px; color: #fff; font-size: 0.85rem; resize: none; }
.field:focus { outline: none; border-color: #8B5CF6; }
.chip { padding: 5px 10px; border-radius: 8px; font-size: 0.72rem; font-weight: 700; border: 1px solid #2f2f2f; color: #bbb; background: #1f1f1f; transition: all .15s; }
.chip:hover { border-color: #8B5CF6; color: #fff; }
.chip-on { background: #8B5CF6; border-color: #8B5CF6; color: #fff; }
.chip-on-cyan { background: #06B6D4; border-color: #06B6D4; color: #00151a; }
.chip-rec { border-color: #ef444466; color: #fca5a5; }
.card { background: #1f1f1f; border: 1px solid #2a2a2a; border-radius: 12px; padding: 12px; }
.fx-card { margin-bottom: 2px; border-left: 3px solid #8B5CF6; }
.drag-grip { cursor: grab; color: #555; font-size: 0.8rem; }
.fx-num { font-family: 'Fira Code', monospace; font-size: 10px; background: #8B5CF633; color: #c4b5fd; border-radius: 4px; padding: 1px 5px; }
.apply-btn { background: #8B5CF6; color: #fff; font-weight: 800; font-size: 0.72rem; padding: 5px 14px; border-radius: 8px; }
.apply-btn:hover { background: #7c3aed; }
.toggle { width: 34px; height: 18px; border-radius: 9px; background: #333; position: relative; transition: background .2s; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #999; transition: all .2s; }
.toggle-on { background: #06B6D4; } .toggle-on span { left: 18px; background: #fff; }
.filter-tile { padding: 16px 12px; border-radius: 12px; background: linear-gradient(135deg, #2a2a2a, #1a1a1a); border: 1px solid #333; font-weight: 800; font-size: 0.85rem; color: #ddd; }
.filter-tile:hover { border-color: #06B6D4; }
.tile-hot { background: linear-gradient(135deg, #5b21b6, #0e7490); color: #fff; }
.aspect-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid #333; background: #1f1f1f; font-weight: 800; font-size: .8rem; }
.aspect-on { border-color: #06B6D4; }
.aspect-box { border: 2px solid #aaa; border-radius: 3px; display: block; }
.aspect-on .aspect-box { border-color: #06B6D4; }
.rec-btn { background: #dc2626; color: #fff; font-weight: 800; padding: 12px; border-radius: 12px; }
.rec-btn:disabled { opacity: .6; }
.stop-btn { background: #4b5563; color: #fff; font-weight: 800; padding: 12px; border-radius: 12px; }

.action-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid #222; background: #141414; }

.rec-badge { position: absolute; top: 8px; right: 8px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 4px; animation: recBlink 1s infinite; box-shadow: 0 0 12px rgba(239,68,68,.7); }
@keyframes recBlink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.countdown-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 6rem; color: #fff; text-shadow: 0 0 30px #06B6D4, 0 0 60px #8B5CF6; background: rgba(0,0,0,.35); animation: countPop .6s ease; pointer-events: none; }
@keyframes countPop { 0% { transform: scale(.4); opacity: 0; } 40% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }

.toast-enter { animation: toastIn .3s ease forwards; }
@keyframes toastIn { from { transform: translate(-50%, -10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.code-block { font-family: 'Fira Code', monospace; font-size: 0.68rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; color: #9ca3af; background: #111; padding: 10px; border-radius: 8px; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 20px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: #333; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -6px; box-shadow: 0 0 0 3px #8B5CF6; }
input[type="range"]::-moz-range-track { height: 4px; background: #333; border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #8B5CF6; }
input[type="color"] { -webkit-appearance: none; border: 2px solid #2c2c2c; border-radius: 8px; padding: 0; background: none; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
select.field { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%238B5CF6' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 26px; }