:root {
  --bg: #0c0f1a;
  --panel: #141827;
  --panel-2: #191e30;
  --panel-3: #20263a;
  --line: rgba(185, 199, 238, .11);
  --line-strong: rgba(185, 199, 238, .18);
  --text: #edf0fa;
  --muted: #8b94b0;
  --muted-2: #66708d;
  --violet: #9d83ff;
  --violet-2: #7558e6;
  --cyan: #65d7e6;
  --green: #7de2be;
  --red: #ff7e90;
  --shadow: 0 18px 55px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body { min-width: 320px; background-image: radial-gradient(circle at 54% -10%, rgba(119, 91, 221, .15), transparent 32%), radial-gradient(circle at 100% 55%, rgba(58, 153, 180, .06), transparent 22%); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { opacity: .36; cursor: not-allowed; }
.app-frame { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 70px; display: flex; align-items: center; gap: 30px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(12, 15, 26, .91); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand-block { display: flex; align-items: center; gap: 11px; min-width: 246px; }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; position: relative; background: linear-gradient(145deg, #9e83ff, #5b43ba); box-shadow: 0 6px 18px rgba(126, 94, 240, .3); font: 800 24px Impact, "Arial Narrow", sans-serif; color: #fff; }
.brand-mark i { position: absolute; right: -4px; top: -6px; font-size: 12px; color: var(--cyan); font-style: normal; text-shadow: 0 0 10px var(--cyan); }
.brand-name { font: 800 21px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: 1.4px; color: #fff; }
.brand-name b { color: #a38cff; }
.brand-sub { font-size: 8px; letter-spacing: 2.2px; color: #737d9a; margin-top: 5px; font-weight: 700; }
.top-meta { display: flex; align-items: center; gap: 9px; color: #8993ad; font-size: 9px; letter-spacing: 1px; font-weight: 700; white-space: nowrap; flex: 1; }
.status-dot { height: 7px; width: 7px; border-radius: 50%; background: #dda95c; box-shadow: 0 0 10px rgba(221, 169, 92, .6); }
.status-dot.online { background: #6ee1af; box-shadow: 0 0 10px rgba(110, 225, 175, .55); }
.status-dot.offline { background: #ff7e90; box-shadow: 0 0 10px rgba(255, 126, 144, .45); }
.divider-vertical { height: 16px; width: 1px; background: var(--line-strong); margin: 0 7px; }
.local-label { color: #a0acc8; }
.tiny-lock { color: var(--green); font-size: 7px; margin-right: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.btn { border: 1px solid transparent; border-radius: 8px; min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 11px; transition: .18s ease; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); }
.btn-quiet { background: transparent; color: #a4aec8; border-color: transparent; }
.btn-quiet:hover { background: rgba(255,255,255,.05); }
.btn-primary { background: linear-gradient(135deg, #8669ee, #654bc7); box-shadow: 0 7px 18px rgba(113, 83, 215, .18); color: white; }
.btn-secondary { background: #222941; border-color: var(--line-strong); color: #c4cce1; }
.workspace-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(400px, 1fr) 350px; gap: 14px; padding: 14px; max-width: 1920px; width: 100%; margin: 0 auto; }
.panel { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(22, 27, 44, .97), rgba(18, 22, 36, .98)); border-radius: 13px; box-shadow: var(--shadow); min-width: 0; }
.library-panel, .inspector-panel { padding: 17px 16px; display: flex; flex-direction: column; min-height: calc(100vh - 112px); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.eyebrow { font-size: 8px; color: #858fb0; letter-spacing: 1.7px; font-weight: 700; margin-bottom: 4px; }
h2, h3, p { margin: 0; }
h2 { font: 700 21px/1.1 Impact, "Arial Narrow", sans-serif; letter-spacing: .3px; }
h3 { font: 700 14px/1.2 Impact, "Arial Narrow", sans-serif; letter-spacing: .4px; }
.count-chip { min-width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: rgba(156, 130, 255, .12); color: #b8a8ff; font-size: 10px; font-weight: 700; }
.search-wrap { height: 39px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line-strong); background: #101526; border-radius: 8px; }
.search-wrap:focus-within { border-color: rgba(157, 131, 255, .7); box-shadow: 0 0 0 3px rgba(157, 131, 255, .08); }
.search-icon { font-size: 24px; color: #8f80d8; transform: rotate(-15deg); line-height: 1; }
.search-wrap input { width: 100%; min-width: 0; background: none; color: var(--text); border: 0; outline: 0; font-size: 11px; }
.search-wrap input::placeholder { color: #58627f; }
.clear-search { border: 0; background: transparent; color: #8490ad; font-size: 18px; padding: 0 2px; }
.search-foot { display: flex; justify-content: space-between; margin: 8px 1px 10px; color: #626c89; font: 700 7px ui-sans-serif, system-ui, sans-serif; letter-spacing: 1px; }
.search-foot span:last-child { color: #9a8bd8; }
.card-results { display: flex; flex-direction: column; gap: 7px; max-height: min(39vh, 410px); overflow: auto; padding-right: 3px; }
.card-results::-webkit-scrollbar, .frame-strip::-webkit-scrollbar, .asset-list::-webkit-scrollbar { width: 5px; height: 5px; }
.card-results::-webkit-scrollbar-thumb, .frame-strip::-webkit-scrollbar-thumb, .asset-list::-webkit-scrollbar-thumb { background: #353c56; border-radius: 8px; }
.card-result { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid transparent; background: rgba(255,255,255,.018); border-radius: 8px; padding: 8px; color: var(--text); min-height: 57px; }
.card-result:hover { background: rgba(146, 125, 238, .075); border-color: rgba(157, 131, 255, .23); }
.card-result.selected { border-color: rgba(157, 131, 255, .52); background: rgba(135, 105, 229, .12); box-shadow: inset 2px 0 #9c83ff; }
.card-thumb { height: 39px; width: 31px; flex: 0 0 31px; border-radius: 4px; background: linear-gradient(145deg, #4f4b78, #232b49); display: grid; place-items: center; color: #c4b7ff; font-size: 15px; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-result-info { min-width: 0; flex: 1; }
.card-result-info strong { font-size: 10px; display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-result-info span { font-size: 8px; color: #808aa7; display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-result-stats { text-align: right; color: #9cabc8; font-size: 8px; line-height: 1.7; white-space: nowrap; }
.no-results { padding: 22px 8px; color: #75809d; font-size: 10px; text-align: center; line-height: 1.6; }
.skeleton-card { height: 56px; border-radius: 8px; background: linear-gradient(90deg, #1a2034, #252a40, #1a2034); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.library-divider { height: 1px; background: var(--line); margin: 15px 0 14px; }
.section-row { display: flex; align-items: center; justify-content: space-between; }
.icon-button { height: 29px; width: 29px; display: grid; place-items: center; background: #242a40; border: 1px solid var(--line-strong); border-radius: 7px; color: #c8c0ff; font-size: 17px; }
.icon-button:hover { background: #323853; }
.muted { color: var(--muted); }
.small-copy { font-size: 9px; line-height: 1.55; margin: 6px 0 9px; color: #77819d; }
.asset-list { max-height: 156px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.asset-item { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); }
.asset-item.active { border-color: rgba(157,131,255,.4); }
.asset-mini { width: 30px; height: 30px; border-radius: 5px; overflow: hidden; background: #242a3c; flex: 0 0 30px; }
.asset-mini img { width: 100%; height: 100%; object-fit: cover; }
.asset-info { min-width: 0; flex: 1; }
.asset-info strong { display: block; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-info span { display: block; font-size: 7px; color: #737e99; margin-top: 3px; }
.asset-use { background: transparent; border: 0; color: #9b89ef; font-size: 9px; padding: 4px; }
.library-bottom { display: flex; align-items: center; gap: 9px; border: 1px solid rgba(107, 210, 175, .15); background: rgba(89, 197, 157, .045); border-radius: 8px; padding: 10px; margin-top: auto; }
.local-storage-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(102, 217, 177, .1); color: var(--green); }
.library-bottom strong { display: block; font-size: 9px; color: #c6eadc; }
.library-bottom span { display: block; margin-top: 3px; color: #778b91; font-size: 8px; line-height: 1.4; }
.main-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
.stage-panel { display: flex; flex-direction: column; padding: 17px; flex: 1 1 auto; min-height: 470px; }
.stage-topline, .timeline-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.subtle-tag { font: 700 8px "DM Sans", sans-serif; color: #8f83d0; letter-spacing: 1px; border: 1px solid rgba(157,131,255,.23); border-radius: 4px; padding: 4px 6px; vertical-align: 2px; margin-left: 5px; }
.stage-tools { display: flex; align-items: center; gap: 6px; color: #828ca9; }
.zoom-label { font: 700 8px "DM Sans", sans-serif; letter-spacing: 1px; margin-right: 2px; }
.mini-button { width: 27px; height: 27px; border: 1px solid var(--line-strong); border-radius: 6px; background: #20263a; color: #aab4cf; display: inline-grid; place-items: center; font-size: 12px; }
.mini-button:hover:not(:disabled) { background: #303751; color: #fff; }
.zoom-value { font-size: 9px; width: 35px; text-align: center; color: #c2c9dd; }
.tool-separator { width: 1px; height: 17px; background: var(--line-strong); margin: 0 4px; }
.stage-wrap { position: relative; margin-top: 13px; flex: 1 1 auto; min-height: 360px; border: 1px solid rgba(151, 165, 203, .12); border-radius: 9px; overflow: hidden; background: radial-gradient(ellipse at center, rgba(111, 97, 180, .105), transparent 55%), #0e1321; display: flex; align-items: center; justify-content: center; }
.stage-wrap::before, .stage-wrap::after { content: ""; position: absolute; pointer-events: none; border: 1px solid rgba(157, 131, 255, .11); width: 40%; height: 55%; }
.stage-wrap::before { left: 5%; top: 5%; border-right: 0; border-bottom: 0; }
.stage-wrap::after { right: 5%; bottom: 5%; border-left: 0; border-top: 0; }
.stage-guides { position: absolute; left: 13px; right: 13px; top: 11px; display: flex; justify-content: space-between; z-index: 2; color: #63708d; font: 700 7px ui-sans-serif, system-ui, sans-serif; letter-spacing: 1.1px; }
.checkerboard { width: min(70%, 440px); aspect-ratio: 1; position: relative; border-radius: 3px; overflow: hidden; background-color: #252b3d; background-image: linear-gradient(45deg, #30364a 25%, transparent 25%), linear-gradient(-45deg, #30364a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #30364a 75%), linear-gradient(-45deg, transparent 75%, #30364a 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; box-shadow: 0 8px 40px rgba(0,0,0,.35); transition: width .2s ease; }
.checkerboard.no-grid { background-image: none; background-color: #1a2031; }
#previewCanvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; transition: transform .18s ease; }
#previewCanvas.flip-preview { transform: scaleX(-1); }
.empty-stage { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 30px; background: rgba(13, 17, 30, .16); }
.empty-glyph { font-size: 39px; color: #8e7adb; text-shadow: 0 0 24px rgba(157, 131, 255, .55); margin-bottom: 15px; }
.empty-stage strong { font: 700 17px "Barlow Condensed", sans-serif; letter-spacing: .3px; color: #dce1f2; }
.empty-stage span { max-width: 280px; color: #78839f; font-size: 9px; line-height: 1.65; margin-top: 7px; }
.stage-corner { position: absolute; bottom: 11px; color: #56617e; font: 700 7px ui-sans-serif, system-ui, sans-serif; letter-spacing: 1px; }
.stage-corner-a { left: 13px; }
.stage-corner-b { right: 13px; color: #70bda3; }
.stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; }
.stage-character { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar-orb { width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #5867a5, #242b4c 70%); border: 1px solid rgba(173, 165, 255, .28); color: #d3c7ff; }
.stage-character strong { display: block; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 230px; }
.stage-character span { color: #77819c; display: block; font-size: 8px; margin-top: 3px; }
.stage-frame-info { display: flex; gap: 8px; align-items: center; color: #7c87a4; font: 700 8px "DM Sans", sans-serif; letter-spacing: .8px; }
.tiny-sep { color: #545e78; }
.timeline-panel { padding: 15px 17px 13px; flex: 0 0 245px; min-height: 220px; display: flex; flex-direction: column; }
.timeline-actions { display: flex; align-items: center; gap: 5px; }
select, input[type="text"], input[type="number"], input[type="password"] { color: #dce3f7; background: #101627; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; min-width: 0; }
select { height: 31px; padding: 0 26px 0 9px; font-size: 9px; max-width: 170px; }
select:focus, input:focus, textarea:focus { border-color: rgba(157,131,255,.68); box-shadow: 0 0 0 2px rgba(157,131,255,.08); }
.danger-mini { color: #e48d9a; }
.timeline-toolbar { display: flex; align-items: center; gap: 16px; margin: 14px 0 11px; }
.play-controls { display: flex; align-items: center; gap: 5px; }
.play-button { width: 30px; height: 28px; border: 0; border-radius: 6px; color: #fff; background: linear-gradient(135deg, #8065e4, #5c49ae); box-shadow: 0 4px 11px rgba(110, 83, 211, .2); font-size: 10px; }
.fps-control { display: flex; align-items: center; gap: 7px; color: #8490ad; font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.fps-control input { width: 70px; accent-color: #9379ed; }
.fps-control b { color: #c6baff; font-size: 10px; min-width: 10px; }
.timeline-hint { color: #727d98; font-size: 8px; flex: 1; text-align: right; }
.frame-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 7px; min-height: 103px; }
.frame-tile { width: 78px; flex: 0 0 78px; border: 1px solid var(--line-strong); border-radius: 7px; background: #101627; overflow: hidden; position: relative; cursor: pointer; }
.frame-tile.active { border-color: #9c83ff; box-shadow: 0 0 0 2px rgba(156,131,255,.12); }
.frame-tile img { width: 100%; height: 72px; object-fit: contain; display: block; background-color: #242a3b; background-image: linear-gradient(45deg, #30364a 25%, transparent 25%), linear-gradient(-45deg, #30364a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #30364a 75%), linear-gradient(-45deg, transparent 75%, #30364a 75%); background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.frame-tile.flip img { transform: scaleX(-1); }
.frame-tile span { display: block; height: 22px; padding: 4px 5px; color: #8c97b2; font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-index { position: absolute; left: 4px; top: 4px; background: rgba(9,12,22,.8); padding: 2px 4px; border-radius: 3px; color: #c9bcff; font-size: 7px; }
.empty-timeline { display: flex; align-items: center; gap: 10px; justify-content: center; color: #697591; width: 100%; font-size: 9px; border: 1px dashed rgba(142, 154, 190, .19); border-radius: 7px; min-height: 84px; }
.empty-timeline span { font-size: 18px; color: #8a7bd3; }
.inspector-panel { overflow-y: auto; gap: 0; padding-bottom: 12px; }
.inspector-panel::-webkit-scrollbar { width: 5px; }
.inspector-panel::-webkit-scrollbar-thumb { background: #343b55; border-radius: 8px; }
.inspector-heading { margin-bottom: 8px; }
.ai-pill { border: 1px solid rgba(101,215,230,.18); background: rgba(101,215,230,.06); border-radius: 20px; padding: 5px 8px; font-size: 7px; letter-spacing: .8px; color: #83dce6; font-weight: 700; white-space: nowrap; }
.ai-pill i { height: 5px; width: 5px; display: inline-block; background: var(--cyan); border-radius: 50%; margin-right: 4px; box-shadow: 0 0 7px var(--cyan); }
.inspector-section { border-top: 1px solid var(--line); padding: 12px 0 13px; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-number { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: rgba(150, 129, 255, .12); color: #b6a6ff; font: 700 10px "Barlow Condensed", sans-serif; }
.selected-card { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); }
.selected-card-art { height: 68px; width: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 4px; overflow: hidden; background: linear-gradient(155deg, #5f5b88, #172443); color: #d5cfff; font-size: 18px; }
.selected-card-art img { width: 100%; height: 100%; object-fit: cover; }
.selected-card-info { min-width: 0; }
.selected-card-info strong { font: 700 14px "Barlow Condensed", sans-serif; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.selected-card-info > span { color: #828da9; font-size: 8px; display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-line { display: flex; gap: 10px; margin-top: 8px; font-size: 8px; font-weight: 700; color: #b2a5f0; }
.ref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.ref-row label, .field label, .prompt-field label { color: #8e99b4; font-size: 8px; font-weight: 700; letter-spacing: .3px; }
.ref-row select { max-width: 175px; height: 28px; font-size: 8px; }
.ref-preview-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; padding: 7px; border-radius: 7px; background: rgba(255,255,255,.025); }
.ref-thumb { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 5px; color: #ac9cff; font-size: 9px; background-color: #252a3d; background-image: linear-gradient(45deg, #30364a 25%, transparent 25%), linear-gradient(-45deg, #30364a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #30364a 75%), linear-gradient(-45deg, transparent 75%, #30364a 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; overflow: hidden; }
.ref-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ref-preview-row strong { display: block; color: #bdc5da; font-size: 8px; }
.ref-preview-row span { display: block; color: #737e99; font-size: 7px; margin-top: 3px; line-height: 1.4; }
.check-row { display: flex; align-items: center; gap: 6px; color: #929db7; font-size: 8px; cursor: pointer; }
.check-row input { accent-color: var(--violet); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field select { width: 100%; max-width: none; }
.field input[type="text"], .field input[type="number"], .field input[type="password"] { height: 31px; padding: 0 9px; font-size: 9px; width: 100%; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.compact-grid { margin-top: 9px; }
.prompt-field { margin-top: 10px; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: #a38fff; font-size: 8px; font-weight: 700; }
.text-button:hover { color: #d2c8ff; }
textarea { width: 100%; resize: vertical; min-height: 82px; padding: 9px; color: #d7def2; background: #101627; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; font-size: 9px; line-height: 1.5; }
textarea::placeholder { color: #5d6886; }
.prompt-note { color: #697490; font-size: 7px; line-height: 1.5; margin-top: 4px; }
.btn-generate { width: 100%; height: 39px; margin-top: 10px; background: linear-gradient(100deg, #896df0, #5b47ba); border: 1px solid rgba(193, 176, 255, .2); box-shadow: 0 7px 20px rgba(105, 82, 210, .2); color: #fff; font-size: 10px; letter-spacing: .7px; }
.btn-generate .sparkle { font-size: 15px; color: #e2d9ff; }
.btn-arrow { margin-left: auto; font-size: 15px; }
.generation-progress { margin-top: 10px; }
.progress-head { display: flex; justify-content: space-between; gap: 10px; color: #8f9ab5; font-size: 8px; margin-bottom: 5px; }
.progress-head b { color: #c6baff; }
.progress-track { height: 5px; background: #282e45; border-radius: 8px; overflow: hidden; }
.progress-track span { height: 100%; width: 0; display: block; background: linear-gradient(90deg, #6d59cb, #76d8db); border-radius: 8px; transition: width .2s ease; }
.quota-note { display: flex; align-items: flex-start; gap: 6px; color: #687692; font-size: 7px; line-height: 1.5; letter-spacing: .15px; margin-top: 8px; }
.quota-note span:first-child { color: #79d8cb; font-size: 11px; line-height: 1; }
.edit-section .field { margin-bottom: 8px; }
.edit-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.edit-buttons .btn { min-height: 29px; padding: 0 5px; font-size: 8px; }
.delete-frame { margin-top: 8px; color: #e58b9a; }
.slicing-section .field { margin-bottom: 6px; }
.full-width { width: 100%; min-height: 32px; font-size: 8px; letter-spacing: .5px; margin-top: 5px; }
.footerbar { height: 28px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); color: #66718d; font: 700 7px ui-sans-serif, system-ui, sans-serif; letter-spacing: .8px; }
.footerbar b { color: #9b89ef; }
.footer-help { border: 0; background: transparent; color: #9f91e0; font: inherit; letter-spacing: inherit; }
.modal { border: 1px solid rgba(177, 163, 246, .24); border-radius: 13px; background: #171d2e; color: var(--text); width: min(500px, calc(100vw - 26px)); padding: 0; box-shadow: 0 22px 80px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(5, 8, 16, .72); backdrop-filter: blur(5px); }
.modal-card { padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-card > .muted { font-size: 10px; line-height: 1.6; margin-bottom: 14px; }
.modal-card code { background: #252c43; padding: 2px 4px; border-radius: 3px; color: #c8bcff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-footnote { color: #77829e; font-size: 8px; margin-top: 12px; }
.help-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 11px; margin: 0; }
.help-steps li { padding-left: 3px; color: #a99aff; }
.help-steps b { display: block; color: #e2e6f5; font-size: 10px; }
.help-steps span { display: block; color: #8994ae; font-size: 9px; line-height: 1.55; margin-top: 3px; }
.notice-block { display: flex; flex-direction: column; gap: 5px; margin-top: 16px; padding: 11px; border: 1px solid rgba(231, 184, 108, .17); border-radius: 8px; background: rgba(231,184,108,.045); }
.notice-block b { font-size: 9px; color: #eac58f; }
.notice-block span { color: #978a7c; font-size: 8px; line-height: 1.5; }
.toast-region { position: fixed; right: 19px; bottom: 42px; z-index: 50; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { max-width: 330px; color: #e5eafa; background: #242c42; border: 1px solid rgba(174, 164, 229, .2); border-left: 3px solid #9b83ff; padding: 10px 13px; border-radius: 7px; box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: 9px; line-height: 1.5; animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1250px) {
  .workspace-grid { grid-template-columns: 235px minmax(350px,1fr) 315px; gap: 10px; padding: 10px; }
  .library-panel, .inspector-panel { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 15px; gap: 15px; }
  .brand-block { min-width: 205px; }
  .btn-quiet span { display: none; }
}
@media (max-width: 1000px) {
  .workspace-grid { grid-template-columns: 230px minmax(0,1fr); }
  .inspector-panel { grid-column: 1 / -1; min-height: unset; display: grid; grid-template-columns: 1fr 1.3fr; column-gap: 16px; }
  .inspector-heading { grid-column: 1 / -1; }
  .inspector-section { padding-right: 8px; }
  .slicing-section { grid-column: 1 / -1; }
  .stage-panel { min-height: 430px; }
  .top-meta { display: none; }
}
@media (max-width: 680px) {
  .topbar { height: auto; min-height: 64px; padding: 9px 12px; flex-wrap: wrap; gap: 8px; }
  .brand-block { flex: 1; min-width: 170px; }
  .brand-name { font-size: 18px; }
  .top-actions { gap: 4px; }
  .top-actions .btn { min-height: 31px; padding: 0 8px; font-size: 9px; }
  .top-actions .btn span { display: none; }
  .workspace-grid { display: flex; flex-direction: column; padding: 8px; gap: 9px; }
  .library-panel { min-height: unset; }
  .card-results { max-height: 210px; }
  .asset-list { max-height: 80px; }
  .library-bottom { margin-top: 12px; }
  .stage-panel { min-height: 410px; padding: 12px; }
  .stage-wrap { min-height: 300px; }
  .checkerboard { width: min(82%, 340px); }
  .stage-frame-info { font-size: 7px; }
  .timeline-panel { flex-basis: auto; min-height: 210px; padding: 12px; }
  .timeline-toolbar { gap: 9px; flex-wrap: wrap; }
  .timeline-hint { width: 100%; text-align: left; }
  .inspector-panel { display: flex; min-height: unset; }
  .inspector-section { padding-right: 0; }
  .footerbar { height: auto; min-height: 30px; padding: 7px 10px; flex-wrap: wrap; font-size: 6px; }
  .footerbar span:nth-child(2) { display: none; }
}
