:root {
  color-scheme: light;
  --ink: #13263a;
  --muted: #6f8092;
  --line: #e3eaf0;
  --navy: #0c1e31;
  --navy-2: #142b42;
  --ice: #bdebf5;
  --blue: #2369df;
  --red: #e04f5f;
  --green: #41a77b;
  --card-shadow: 0 18px 48px rgba(8, 26, 44, .18);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--navy); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; color: var(--ink); background: radial-gradient(ellipse at 50% -25%, #244662 0, var(--navy) 62%); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(44, 126, 218, .35); outline-offset: 2px; }
.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 0 30px 26px; }

.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #eef7ff; border-bottom: 1px solid rgba(206, 230, 249, .12); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #bceaf5; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.brand-mark svg { width: 31px; fill: none; stroke: #16608c; stroke-width: 1.8; }
.brand-copy { display: grid; gap: 1px; line-height: 1.05; }
.brand-copy strong { font-family: Manrope, sans-serif; font-size: 17px; letter-spacing: .13em; }
.brand-copy small { color: #a6bacb; font-size: 12px; }
.topbar-center { display: flex; justify-content: center; min-width: 180px; }
.save-indicator { display: inline-flex; align-items: center; gap: 8px; color: #b7c9d8; font-size: 13px; white-space: nowrap; }
.save-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #5dc39a; box-shadow: 0 0 0 3px rgba(93,195,154,.14); }
.save-indicator.saving i { background: #f1b75c; box-shadow: 0 0 0 3px rgba(241,183,92,.14); }
.header-actions, .heading-actions, .timeline-controls { display: flex; align-items: center; gap: 8px; }
.button { min-height: 39px; padding: 0 13px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .14s ease, background .14s ease, border-color .14s ease; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-primary { color: #fff; background: #278765; box-shadow: 0 5px 16px rgba(20, 128, 89, .23); }
.button-primary:hover:not(:disabled) { background: #1e7656; }
.button-share { color: #e9f4fb; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.button-share:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.button-install { color: #12304a; background: #bdebf5; border-color: rgba(255,255,255,.28); box-shadow: 0 5px 16px rgba(12,30,49,.22); }
.button-install:hover:not(:disabled) { background: #d2f3f9; }
.button-install[hidden] { display: none; }
.button-quiet { color: #e6f2fa; background: transparent; border-color: rgba(255,255,255,.15); min-width: 48px; }
.button-outline { color: #40556b; background: #fff; border-color: #dce5ec; }
.button-outline:hover:not(:disabled) { background: #f5f9fc; border-color: #c8d6e2; }
.button-dark { color: #fff; background: var(--navy-2); }
.button-dark:hover:not(:disabled) { background: #203c57; }
.button-icon { font-size: 13px; }
.spinner { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-button { width: 37px; height: 37px; padding: 0; display: inline-grid; place-items: center; color: #5f7387; background: #fff; border: 1px solid #dce5ec; border-radius: 9px; font-size: 19px; cursor: pointer; }
.icon-button:hover:not(:disabled) { color: #18344d; background: #f4f8fb; }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.more-button { width: 34px; height: 34px; color: #d5e4f0; border-color: transparent; background: transparent; letter-spacing: 2px; font-size: 13px; }
.more-button:hover { background: rgba(255,255,255,.1); }

.main-content { padding-top: 22px; }
.mode-nav-row { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-tabs { margin-bottom: 0; padding: 5px; display: inline-flex; gap: 5px; border: 1px solid rgba(205,229,244,.16); border-radius: 13px; background: rgba(7,25,40,.52); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.help-open-button { min-height: 38px; color: #dcebf5; border-color: rgba(205,229,244,.18); background: rgba(7,25,40,.52); }
.help-open-button:hover:not(:disabled) { background: rgba(21,52,76,.9); }
.help-open-button > span:first-child { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid rgba(188,234,245,.42); border-radius: 50%; color: #bdebf5; }
.mode-tab { min-width: 225px; padding: 9px 13px; display: flex; align-items: center; gap: 10px; color: #abc0cf; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.mode-tab > span:last-child { display: grid; gap: 2px; }
.mode-tab strong { color: #dceaf4; font-size: 13px; }
.mode-tab small { color: #8198aa; font-size: 11px; }
.mode-tab-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #1a6d93; border-radius: 8px; background: #bdebf5; font-size: 16px; font-weight: 800; }
.mode-tab-icon.live { color: #fff; background: #cf4b5e; box-shadow: inset 0 0 0 8px rgba(255,255,255,.12); font-size: 9px; }
.mode-tab.active { color: #183247; border-color: #dbe8ef; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.mode-tab.active strong { color: #183247; }
.mode-tab.active small { color: #687e8e; }
.live-only { display: none; }
.app-shell.mode-live .edit-only { display: none !important; }
.app-shell.mode-live .live-editor.live-only { display: block; }
.app-shell.mode-live .quick-guide.live-only { display: grid; }
.app-shell.mode-live #png-btn, .app-shell.mode-live #video-btn { display: none; }
.app-shell.mode-live .frame-duration, .app-shell.mode-live .frame-position, .app-shell.mode-live .frame-position-help, .app-shell.mode-live .inspector-frame { display: none; }
.editor-card { overflow: hidden; background: #fff; border: 1px solid rgba(229, 239, 247, .75); border-radius: 15px; box-shadow: var(--card-shadow); }
.editor-heading { min-height: 82px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.title-block { min-width: 210px; flex: 1; }
.title-block label, .eyebrow { display: block; margin-bottom: 5px; color: #8494a3; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.title-block input { width: 100%; padding: 0; color: #1c3145; border: 0; outline: 0; font-family: Manrope, 'DM Sans', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.035em; background: transparent; }
.title-block input:focus-visible { outline: 0; box-shadow: 0 2px 0 #80bce3; }
.divider, .tool-divider { width: 1px; height: 27px; margin: 0 2px; background: #e4eaf0; }

.toolstrip { padding: 11px 17px 9px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.toolstrip-head { margin: 0 4px 8px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.toolstrip-label { color: #98a6b2; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.player-style-control { display: flex; align-items: center; gap: 7px; color: #768996; font-size: 11px; font-weight: 700; }
.player-style-control select { min-height: 30px; padding: 0 27px 0 9px; color: #365166; border: 1px solid #d8e3ea; border-radius: 7px; background: #fff; font-size: 11px; font-weight: 700; }
.tool-buttons { min-height: 48px; display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #cbd8e2 transparent; }
.tool-button { min-width: 68px; padding: 5px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #687b8d; background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tool-button:hover { color: #1f3e59; background: #f0f5f8; }
.tool-button.selected { color: #1d6397; background: #eaf5fb; border-color: #cfe5f1; }
.tool-button.tool-erase { color: #9d5360; }
.tool-button.tool-erase.selected { color: #b43145; background: #fff0f1; border-color: #f2d2d6; }
.tool-glyph { min-width: 20px; height: 19px; display: grid; place-items: center; color: currentColor; font-family: Arial, sans-serif; font-size: 20px; line-height: 1; }
.dashed-glyph { text-decoration: underline dashed; text-underline-offset: -2px; }
.text-glyph { font-family: Manrope, sans-serif; font-size: 18px; font-weight: 800; }
.token-glyph { width: 18px; height: 18px; display: block; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(21,45,67,.2); }
.token-glyph.blue { background: var(--blue); }
.token-glyph.red { background: var(--red); }
.goalie-glyph { width: 18px; height: 18px; display: block; border: 4px solid var(--blue); border-radius: 50%; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px #92a8b9; }
.puck-glyph { width: 17px; height: 8px; display: block; border-radius: 50%; background: #17212a; box-shadow: 0 2px 0 #59636b; }
.cone-glyph { position: relative; width: 20px; height: 19px; display: block; }
.cone-glyph::before { content: ''; position: absolute; left: 5px; top: 0; width: 0; height: 0; border-right: 5px solid transparent; border-bottom: 15px solid #f27a24; border-left: 5px solid transparent; filter: drop-shadow(1px 1px 0 #c44f12); }
.cone-glyph::after { content: ''; position: absolute; left: 1px; bottom: 0; width: 18px; height: 4px; border-radius: 50%; background: #d95b18; box-shadow: inset 0 1px 0 #ffb05f; }
.cone-glyph i { position: absolute; z-index: 1; left: 6px; top: 8px; width: 8px; height: 3px; background: #fff7e8; transform: perspective(8px) rotateX(12deg); }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 256px; min-height: 450px; }
.board-column { min-width: 0; padding: 16px 17px 13px; background: #f4f8fa; }
.board-meta { min-height: 26px; margin: 0 3px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #7b8e9f; font-size: 11px; }
.board-meta > div:first-child { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.board-meta strong { color: #415d72; font-size: 10px; letter-spacing: .09em; }
.live-mark { width: 7px; height: 7px; border-radius: 50%; background: #43aa7c; box-shadow: 0 0 0 3px #ddf2e9; }
.meta-separator { color: #c2cdd6; }
.board-hint { min-width: 0; overflow: hidden; color: #8293a2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 4px 0 4px 8px; color: #9b6971; background: none; border: 0; font-size: 11px; cursor: pointer; white-space: nowrap; }
.text-button:hover { color: #c33d50; text-decoration: underline; }
.rink-frame { position: relative; padding: 7px; border: 1px solid #dce9ee; border-radius: 12px; background: #e9f2f5; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
#board { width: 100%; height: auto; display: block; aspect-ratio: 2 / 1; border-radius: 9px; touch-action: none; cursor: crosshair; }
.empty-hint { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; gap: 4px; color: #30556b; text-align: center; pointer-events: none; opacity: 0; transform: translate(-50%, -50%); transition: opacity .2s; }
.empty-hint.visible { opacity: 1; }
.empty-hint span { padding: 8px 13px; border: 1px solid rgba(48,85,107,.15); border-radius: 99px; background: rgba(255,255,255,.84); font-size: 13px; font-weight: 700; }
.empty-hint small { color: #5f7d8d; font-size: 11px; }
.canvas-footnote { padding: 9px 4px 0; display: flex; justify-content: space-between; gap: 10px; color: #8495a3; font-size: 10px; }

.inspector { min-width: 0; padding: 17px 16px 13px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; }
.inspector-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 13px; border-bottom: 1px solid #edf1f4; }
.inspector-header .eyebrow { margin-bottom: 3px; }
.inspector-header h2 { margin: 0; color: #1a3045; font-family: Manrope, sans-serif; font-size: 15px; font-weight: 800; }
.inspector-frame { margin-top: 1px; padding: 4px 7px; color: #617c91; border-radius: 99px; background: #eff5f8; font-size: 10px; white-space: nowrap; }
.inspector-content { flex: 1; }
.inspector-empty { min-height: 234px; padding: 28px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8192a1; text-align: center; }
.inspect-icon { width: 36px; height: 36px; margin-bottom: 10px; display: grid; place-items: center; color: #54778e; border-radius: 12px; background: #eff6f9; font-size: 21px; }
.inspector-empty p { margin: 0 0 5px; color: #526a7d; font-size: 12px; font-weight: 700; }
.inspector-empty small { max-width: 165px; color: #93a1ad; font-size: 10px; line-height: 1.5; }
.property-form { padding: 13px 0 2px; display: grid; gap: 11px; }
.property-field { display: grid; gap: 5px; color: #728292; font-size: 10px; font-weight: 700; }
.property-field input, .property-field select { width: 100%; min-height: 35px; padding: 7px 9px; color: #2c4256; background: #fbfcfd; border: 1px solid #dfe7ed; border-radius: 7px; font-size: 12px; font-weight: 500; }
.property-field input[type="color"] { height: 36px; padding: 3px; }
.property-field input[type="range"] { min-height: 24px; padding: 0; accent-color: #2477b2; }
.frame-position-help { grid-column: 1 / -1; margin-top: -7px; color: #758894; font-size: 12px; font-weight: 500; line-height: 1.45; }
.property-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.property-form > .full { grid-column: 1 / -1; }
.delete-object { width: 100%; min-height: 35px; margin-top: 4px; color: #b63c4c; background: #fff5f6; border: 1px solid #f1d6da; border-radius: 7px; font-size: 11px; font-weight: 700; cursor: pointer; }
.delete-object:hover { background: #ffecee; }
.detach-puck { width: 100%; min-height: 38px; color: #14658e; background: #edf8fd; border: 1px solid #bfe1ef; border-radius: 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
.detach-puck:hover { background: #dff2fa; }
.inspector-note { margin-top: 12px; padding: 10px 9px; display: flex; gap: 7px; color: #7b8c98; border-radius: 8px; background: #f5f8fa; font-size: 10px; line-height: 1.45; }
.inspector-note span:first-child { color: #4e9b81; }

.timeline { padding: 15px 19px 12px; border-top: 1px solid var(--line); background: #fff; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-title { display: flex; align-items: center; gap: 10px; }
.timeline-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #eaf5fc; border-radius: 10px; background: #244761; font-size: 11px; }
.timeline-title h2 { margin: 0; color: #243b50; font-family: Manrope, sans-serif; font-size: 14px; font-weight: 800; }
.timeline-title p { margin: 2px 0 0; color: #8292a0; font-size: 10px; }
.plus { font-size: 16px; line-height: 1; }
.danger-outline { color: #9c616a; }
.danger-outline:hover:not(:disabled) { color: #b6394b; border-color: #edc4ca; background: #fff8f8; }
.frames-row { min-height: 77px; padding: 12px 0 7px; display: flex; align-items: stretch; gap: 8px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #cfdae2 transparent; }
.frame-card { min-width: 112px; min-height: 57px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; color: #728292; background: #f8fafb; border: 1px solid #e2e9ee; border-radius: 9px; text-align: left; cursor: pointer; }
.frame-card:hover { border-color: #c5d7e3; background: #f2f8fb; }
.frame-card.active { color: #25648c; border-color: #8ec2dd; background: #edf7fb; box-shadow: 0 0 0 2px rgba(76, 163, 205, .1); }
.frame-number { width: 25px; height: 25px; display: grid; place-items: center; color: #5b7588; border-radius: 7px; background: #e8eff3; font-size: 11px; font-weight: 800; }
.frame-card.active .frame-number { color: #fff; background: #438eb5; }
.frame-copy { display: grid; gap: 2px; }
.frame-copy strong { color: #455e71; font-size: 11px; }
.frame-copy small { color: #8b9aa7; font-size: 9px; }
.frame-objects { width: 28px; height: 26px; margin-left: auto; position: relative; }
.frame-objects i { position: absolute; width: 8px; height: 8px; border: 1px solid #fff; border-radius: 50%; background: #2575e0; box-shadow: 0 0 0 1px rgba(22,52,75,.15); }
.frame-objects i:nth-child(1) { top: 2px; left: 3px; }
.frame-objects i:nth-child(2) { top: 11px; left: 14px; background: #e04f5f; }
.frame-objects i:nth-child(3) { top: 4px; right: 1px; width: 5px; height: 5px; background: #17212a; }
.audio-editor { margin-top: 9px; padding-top: 11px; border-top: 1px solid #e8eef2; }
.audio-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audio-title { display: flex; align-items: center; gap: 9px; color: #385469; }
.audio-title > div { display: grid; gap: 2px; }
.audio-title strong { font-size: 14px; }
.audio-title small { color: #7c8e9a; font-size: 12px; }
.audio-icon { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 8px; background: #7a5bc0; font-size: 15px; }
.audio-actions { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.audio-mode { display: grid; gap: 3px; color: #647985; font-size: 12px; font-weight: 700; }
.audio-mode select { min-height: 36px; padding: 0 27px 0 9px; color: #40576a; border: 1px solid #dce5eb; border-radius: 7px; background: #fff; font-size: 12px; }
.record-dot { width: 8px; height: 8px; border-radius: 50%; background: #e04d5f; box-shadow: 0 0 0 3px #fbe6e9; }
#audio-record-btn.recording { color: #fff; border-color: #d74457; background: #d74457; }
#audio-record-btn.recording .record-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); animation: pulse-record 1s infinite; }
@keyframes pulse-record { 50% { opacity: .45; } }
.audio-track { min-height: 54px; margin-top: 9px; position: relative; overflow: hidden; border: 1px solid #e0e7ed; border-radius: 9px; background: repeating-linear-gradient(90deg,#f8fafc 0,#f8fafc calc(10% - 1px),#e9eef2 calc(10% - 1px),#e9eef2 10%); cursor: crosshair; }
.audio-track-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; color: #7f919d; font-size: 12px; text-align: center; pointer-events: none; }
.audio-playhead { width: 2px; position: absolute; z-index: 4; top: 0; bottom: 0; background: #e04659; box-shadow: 0 0 0 1px rgba(255,255,255,.65); pointer-events: none; transform: translateX(-1px); }
.audio-clip { min-width: 28px; height: 36px; padding: 0 8px; position: absolute; top: 8px; z-index: 2; overflow: hidden; color: #fff; border: 1px solid #7550bf; border-radius: 7px; background: linear-gradient(135deg,#7d5cc3,#59409c); box-shadow: 0 3px 8px rgba(82,55,139,.2); cursor: pointer; white-space: nowrap; text-overflow: ellipsis; }
.audio-clip::before { content: ''; position: absolute; inset: 7px 5px; opacity: .25; background: repeating-linear-gradient(90deg,transparent 0 3px,#fff 3px 5px); }
.audio-clip span { position: relative; z-index: 1; font-size: 12px; font-weight: 700; }
.audio-clip.selected { outline: 2px solid #2c7fa9; outline-offset: 2px; }
.audio-playhead { width: 2px; position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; background: #e34559; pointer-events: none; }
.audio-playhead::before { content: ''; width: 8px; height: 8px; position: absolute; top: -1px; left: -3px; border-radius: 50%; background: #e34559; }
.audio-position { margin-top: 7px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; color: #647985; font-size: 12px; font-weight: 700; }
.audio-position input { min-width: 0; accent-color: #7656b9; }
.audio-edit-help { margin: 4px 0 0; color: #758894; font-size: 12px; line-height: 1.45; }
.audio-properties { margin-top: 8px; display: grid; grid-template-columns: minmax(120px,1.4fr) 90px 120px auto auto auto auto; align-items: end; gap: 7px; }
.audio-properties[hidden] { display: none; }
.audio-properties label { display: grid; gap: 3px; color: #647985; font-size: 12px; font-weight: 700; }
.audio-properties input { min-width: 0; min-height: 34px; padding: 5px 8px; color: #40576a; border: 1px solid #dce5eb; border-radius: 7px; background: #fff; font-size: 12px; }
.audio-properties input[type="range"] { padding: 0; accent-color: #7656b9; }
.audio-clip-info { align-self: center; color: #667d8b; font-size: 12px; white-space: nowrap; }
.audio-properties .button { min-height: 34px; padding: 0 9px; font-size: 12px; }
.live-editor { margin-top: 11px; padding-top: 11px; border-top: 1px solid #e8eef2; }
.app-shell.mode-live .live-editor { margin-top: 0; padding-top: 0; border-top: 0; }
.live-page-intro { margin-bottom: 13px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #f0d8dc; border-radius: 10px; background: #fff7f8; }
.live-page-intro > div { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.live-page-intro strong { color: #7d3040; font-size: 14px; }
.live-page-intro p { max-width: 720px; margin: 0; color: #7b6870; font-size: 12px; line-height: 1.45; }
.live-page-dot { width: 10px; height: 10px; border-radius: 50%; background: #d94a5d; box-shadow: 0 0 0 4px #f6d9de; }
.live-icon { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 8px; background: #d94a5d; font-size: 9px; box-shadow: inset 0 0 0 8px rgba(255,255,255,.14); }
#live-record-btn.recording { background: #c73e51; }
.live-track { min-height: 48px; margin-top: 9px; position: relative; display: flex; gap: 4px; overflow-x: auto; border: 1px solid #e1e7ec; border-radius: 9px; background: #f8fafb; }
.live-track-empty { width: 100%; display: grid; place-items: center; padding: 9px; color: #7f919d; font-size: 12px; text-align: center; }
.live-block { min-width: 92px; height: 36px; margin: 6px 0 6px 5px; padding: 0 9px; color: #fff; border: 1px solid #c74658; border-radius: 7px; background: linear-gradient(135deg,#df5869,#b93d51); font-size: 12px; font-weight: 700; cursor: pointer; }
.live-block + .live-block { margin-left: 0; }
.live-block.selected { outline: 2px solid #742333; }
.live-position { margin-top: 6px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: #647985; font-size: 12px; font-weight: 700; }
.live-position input { accent-color: #cf4357; }
.timeline-help { padding-top: 3px; display: flex; justify-content: space-between; gap: 10px; color: #8a99a5; font-size: 10px; }
.timeline-help #animation-length { color: #6c8292; font-weight: 700; white-space: nowrap; }

.quick-guide { padding: 18px 2px 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; color: #e5eef5; }
.quick-guide.live-only { display: none; }
.guide-step { display: flex; align-items: flex-start; gap: 10px; }
.guide-step > span { width: 25px; height: 25px; display: grid; place-items: center; color: #bceaf5; border: 1px solid rgba(188,234,245,.3); border-radius: 8px; font-size: 10px; font-weight: 800; }
.guide-step div { display: grid; gap: 3px; }
.guide-step strong { color: #dcebf5; font-size: 12px; font-weight: 700; }
.guide-step small { color: #9db1c1; font-size: 10px; line-height: 1.4; }
.privacy-note { margin: 16px 0 0; color: #72899d; font-size: 10px; text-align: center; }
.video-preview { position: fixed; z-index: 20; inset: 0; padding: 28px; display: grid; grid-template-rows: auto minmax(0,1fr); place-items: center; background: rgba(5,18,29,.92); }
.video-preview[hidden] { display: none; }
.video-preview-bar { width: min(1120px,100%); padding: 9px 12px; display: flex; align-items: center; gap: 12px; color: #eaf4fa; }
.video-preview-bar strong { font-size: 13px; }
.video-preview-bar span { margin-right: auto; color: #9fb4c3; font-size: 10px; }
.video-preview-bar button { width: 34px; height: 34px; color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.08); font-size: 21px; cursor: pointer; }
#video-preview-player { width: min(1120px,100%); max-height: calc(100vh - 95px); border-radius: 12px; background: #000; box-shadow: 0 20px 70px rgba(0,0,0,.45); cursor: zoom-in; }
#video-preview-player.expanded { width: 100vw; height: 100vh; max-height: none; border-radius: 0; object-fit: contain; cursor: zoom-out; }
.help-modal { position: fixed; z-index: 30; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(5,18,29,.86); backdrop-filter: blur(5px); }
.help-modal[hidden] { display: none; }
.help-panel { width: min(980px,100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #dbe6ee; border-radius: 18px; background: #f7fafc; box-shadow: 0 28px 90px rgba(0,0,0,.42); }
.help-header { position: sticky; z-index: 1; top: 0; padding: 19px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.12); }
.help-header span { color: #9eb9ca; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.help-header h2 { margin: 3px 0 0; font-size: 22px; }
.help-header button { width: 38px; height: 38px; flex: 0 0 auto; color: #fff; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: rgba(255,255,255,.08); font-size: 24px; cursor: pointer; }
.help-grid { padding: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.help-card { padding: 16px 17px; border: 1px solid #dfe8ef; border-radius: 12px; background: #fff; }
.help-card-wide { grid-column: 1 / -1; }
.help-card h3 { margin: 0 0 9px; color: #17354c; font-size: 16px; }
.help-card p { margin: 0; color: #4d6476; font-size: 14px; line-height: 1.55; }
.help-card p + p { margin-top: 7px; }
.help-card ul { margin: 0; padding-left: 19px; color: #4d6476; font-size: 14px; line-height: 1.55; }
.help-card li + li { margin-top: 6px; }
.help-card strong { color: #1a4969; }
.help-note { margin: 0; padding: 0 20px 19px; color: #697f8f; font-size: 13px; line-height: 1.5; text-align: center; }
body.help-open { overflow: hidden; }
.toast { position: fixed; z-index: 5; right: 22px; bottom: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 15px; color: #e9f5fb; border: 1px solid rgba(215,238,249,.15); border-radius: 10px; background: #17354c; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 13px; line-height: 1.45; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #7b2e3e; }

@media (max-width: 1120px) {
  .app-shell { padding-right: 18px; padding-left: 18px; }
  .workbench { grid-template-columns: minmax(0, 1fr) 226px; }
  .button { padding-right: 10px; padding-left: 10px; }
  .topbar-center { display: none; }
}
@media (max-width: 850px) {
  .app-shell { padding: 0 12px 22px; }
  .topbar { min-height: 68px; gap: 10px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .inspector { min-height: 120px; border-top: 1px solid var(--line); border-left: 0; }
  .inspector-empty { min-height: 88px; padding: 13px 6px; }
  .inspector-empty .inspect-icon { display: none; }
  .inspector-note { margin-top: 5px; }
  .property-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .property-field.full { grid-column: 1 / -1; }
  .quick-guide { gap: 8px; }
  .guide-step { gap: 7px; }
  .guide-step small { max-width: 180px; }
}
@media (max-width: 600px) {
  .app-shell { padding: 0 8px 16px; }
  .topbar { min-height: 60px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .brand-mark svg { width: 27px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 10px; }
  .header-actions { gap: 5px; }
  .header-actions .button { min-height: 35px; padding: 0 8px; font-size: 11px; }
  #png-btn { width: 38px; padding: 0; }
  #video-btn { padding-right: 5px; padding-left: 5px; font-size: 10px; }
  #video-btn .button-icon { display: none; }
  .header-actions .button-quiet { min-width: 38px; }
  #preview-video-btn { width: 37px; overflow: hidden; font-size: 0; }
  #preview-video-btn::before { content: '▶'; font-size: 13px; }
  #install-app-btn { width: 37px; padding: 0; overflow: hidden; font-size: 0; }
  #install-app-btn .button-icon { font-size: 17px; }
  .header-actions .button-share { width: 37px; padding: 0; font-size: 0; }
  .header-actions .button-share .button-icon { font-size: 16px; }
  .more-button { display: none; }
  .main-content { padding-top: 9px; }
  .mode-nav-row { margin-bottom: 8px; gap: 6px; }
  .mode-tabs { min-width: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
  .help-open-button { width: 38px; min-width: 38px; padding: 0; }
  .help-button-label { display: none; }
  .mode-tab { min-width: 0; padding: 8px; }
  .mode-tab small { display: none; }
  .mode-tab strong { font-size: 11px; }
  .mode-tab-icon { width: 27px; height: 27px; }
  .editor-card { border-radius: 11px; }
  .editor-heading { min-height: unset; padding: 12px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .title-block { width: 100%; }
  .title-block input { font-size: 18px; }
  .heading-actions { width: 100%; gap: 6px; }
  .heading-actions .button { min-height: 34px; padding: 0 8px; font-size: 11px; }
  .heading-actions .icon-button { width: 34px; height: 34px; }
  .heading-actions .divider { margin: 0; }
  .toolstrip { padding: 9px 8px 7px; }
  .toolstrip-head { align-items: stretch; flex-direction: column; gap: 6px; }
  .player-style-control { justify-content: space-between; }
  .player-style-control select { min-width: 150px; }
  .tool-buttons { gap: 1px; }
  .tool-button { min-width: 65px; padding: 4px 5px; font-size: 10px; }
  .board-column { padding: 10px 8px 8px; }
  .board-meta { margin: 0 2px 7px; font-size: 10px; }
  .board-meta > div:first-child { gap: 5px; }
  .board-hint { display: none; }
  .text-button { font-size: 10px; }
  .rink-frame { padding: 4px; border-radius: 9px; }
  .canvas-footnote { padding-top: 6px; font-size: 9px; }
  .inspector { padding: 11px 12px 10px; }
  .inspector-header { padding-bottom: 8px; }
  .inspector-header h2 { font-size: 14px; }
  .timeline { padding: 11px 11px 9px; }
  .timeline-top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .timeline-controls { width: 100%; gap: 5px; }
  .timeline-controls .button { min-height: 34px; flex: 1; padding: 0 6px; font-size: 10px; }
  .audio-editor-head { align-items: stretch; flex-direction: column; }
  .audio-actions { align-items: stretch; flex-wrap: wrap; }
  .audio-mode { width: 100%; }
  .audio-mode select { width: 100%; }
  .audio-actions .button { flex: 1; min-height: 34px; padding: 0 7px; font-size: 11px; }
  .audio-properties { grid-template-columns: 1fr 1fr; }
  .audio-clip-info { grid-column: 1 / -1; }
  .audio-position { grid-template-columns: 1fr; gap: 3px; }
  .live-position { grid-template-columns: 1fr; gap: 3px; }
  .live-page-intro { align-items: flex-start; flex-direction: column; gap: 6px; }
  .timeline-title p { font-size: 9px; }
  .frames-row { min-height: 68px; padding-top: 9px; }
  .frame-card { min-width: 105px; }
  .timeline-help { font-size: 9px; }
  .quick-guide { padding: 12px 3px 0; grid-template-columns: 1fr; gap: 9px; }
  .guide-step { align-items: center; }
  .guide-step > span { width: 22px; height: 22px; font-size: 9px; }
  .guide-step strong { font-size: 11px; }
  .guide-step small { font-size: 9px; }
  .privacy-note { margin-top: 12px; font-size: 9px; }
  .video-preview { padding: 8px; }
  .video-preview-bar { padding: 6px 2px; }
  .video-preview-bar span { display: none; }
  .help-modal { padding: 8px; }
  .help-panel { max-height: calc(100vh - 16px); border-radius: 13px; }
  .help-header { padding: 14px; }
  .help-header h2 { font-size: 17px; }
  .help-grid { padding: 10px; grid-template-columns: 1fr; gap: 8px; }
  .help-card, .help-card-wide { grid-column: 1; padding: 13px; }
  .help-card h3 { font-size: 15px; }
  .help-card p, .help-card ul { font-size: 14px; }
  .help-note { padding: 2px 14px 15px; }
}

@media (max-width: 360px) {
  .brand-copy small { display: none; }
  #video-btn { width: 38px; padding: 0; font-size: 0; }
  #video-btn .button-icon { display: inline; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
