:root {
  --qlg-bg: #070b10;
  --qlg-surface: #0e151d;
  --qlg-surface-2: #131d27;
  --qlg-border: rgba(255, 255, 255, 0.11);
  --qlg-muted: #93a4b7;
  --qlg-text: #edf7ff;
  --qlg-cyan: #00e7ff;
  --qlg-green: #26e596;
  --qlg-red: #ff536f;
  --qlg-amber: #ffbf3f;
}

[hidden] { display: none !important; }

.qlg-shell {
  min-height: 100vh;
  background: var(--qlg-bg);
  color: var(--qlg-text);
}

.qlg-site-main {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.qlg-product-header,
.qlg-project-bar,
.qlg-area-heading,
.qlg-preview-layout,
.qlg-inspector-head,
.qlg-control-card header,
.qlg-score-row,
.qlg-take-row,
.qlg-compact-actions,
.qlg-output-actions {
  display: flex;
  align-items: center;
}

.qlg-product-header {
  justify-content: space-between;
  gap: 32px;
  padding: 28px 30px;
  border: 1px solid var(--qlg-border);
  border-radius: 22px 22px 0 0;
  background: radial-gradient(circle at 18% 0, rgba(0, 231, 255, 0.12), transparent 38%), linear-gradient(135deg, #101923, #090e14);
}

.qlg-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--qlg-cyan);
  font: 700 0.72rem/1.2 "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.qlg-product-header h1,
.qlg-area-heading h2,
.qlg-panel-shell h3 {
  margin: 0;
}

.qlg-product-header h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  letter-spacing: -0.045em;
}

.qlg-product-header h1 span {
  margin-right: 0.35em;
  color: var(--qlg-cyan);
  font-weight: 900;
}

.qlg-product-header p,
.qlg-area-heading p,
.qlg-boundary-note p,
.qlg-output-panel p {
  margin: 7px 0 0;
  color: var(--qlg-muted);
}

.qlg-header-actions,
.qlg-project-actions,
.qlg-add-buttons,
.qlg-preset-row,
.qlg-inspector-actions,
.qlg-guide-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qlg-shell button,
.qlg-shell input,
.qlg-shell select {
  font: inherit;
}

.qlg-shell button {
  min-height: 44px;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--qlg-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--qlg-text);
  cursor: pointer;
}

.qlg-shell button:hover:not(:disabled) {
  border-color: rgba(0, 231, 255, 0.55);
  background: rgba(0, 231, 255, 0.08);
}

.qlg-shell button:focus-visible,
.qlg-shell input:focus-visible,
.qlg-shell select:focus-visible {
  outline: 3px solid rgba(0, 231, 255, 0.4);
  outline-offset: 2px;
}

.qlg-shell button:disabled { opacity: 0.45; cursor: not-allowed; }

.qlg-panic {
  border-color: rgba(255, 83, 111, 0.7) !important;
  background: rgba(255, 83, 111, 0.13) !important;
  color: #ffdce2 !important;
  font-weight: 900 !important;
}

.qlg-panic-large { min-width: 220px; min-height: 58px !important; }
.qlg-danger-secondary { color: #ffb9c5 !important; }

.qlg-project-bar {
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: solid var(--qlg-border);
  border-width: 0 1px 1px;
  background: #0b1118;
}

.qlg-project-bar > label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 290px;
}

.qlg-project-bar > label span,
.qlg-project-meta,
.qlg-canvas-toolbar,
.qlg-help,
.qlg-control-card small,
.qlg-list-item small {
  color: var(--qlg-muted);
  font-size: 0.8rem;
}

.qlg-project-bar input,
.qlg-field input,
.qlg-field select,
.qlg-control-body input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--qlg-border);
  border-radius: 8px;
  background: #070c11;
  color: var(--qlg-text);
}

.qlg-project-meta { display: flex; gap: 18px; white-space: nowrap; }
.qlg-plan-badge { padding:4px 7px; border:1px solid rgba(0,231,255,.35); border-radius:999px; color:#aaf5ff; background:rgba(0,231,255,.07); font-weight:800; }

.qlg-connection {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border: solid var(--qlg-border);
  border-width: 0 1px 1px;
  background: #0b1118;
  color: var(--qlg-muted);
  font-size: 0.84rem;
}

.qlg-connection > span,
.qlg-transport-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8ca0b5;
}

.qlg-connection[data-state="ready"] > span,
.qlg-connection[data-state="synced"] > span,
.qlg-connection[data-state="connected"] > span { background: var(--qlg-green); box-shadow: 0 0 12px rgba(38,229,150,.5); }
.qlg-connection[data-state="syncing"] > span { background: var(--qlg-amber); }
.qlg-connection[data-state="offline"] > span { background: var(--qlg-red); }
.qlg-connection[data-state="readonly"] > span,
.qlg-connection[data-state="capacity"] > span { background: var(--qlg-amber); }
.qlg-connection button { min-height: 36px; margin-left: auto; padding: 6px 12px; }

.qlg-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  max-width: 430px;
  padding: 14px 18px;
  border: 1px solid var(--qlg-border);
  border-radius: 10px;
  background: #121c26;
  box-shadow: 0 18px 60px rgba(0,0,0,.4);
}

.qlg-notice[data-kind="warning"] { border-color: rgba(255,191,63,.55); }
.qlg-notice[data-kind="error"] { border-color: rgba(255,83,111,.65); }
.qlg-notice[data-kind="success"] { border-color: rgba(38,229,150,.55); }
.qlg-notice a,
.qlg-asset-warning a,
.qlg-pro-note a { color:#8ff4ff; }
.qlg-asset-warning { padding:10px 18px; border:solid rgba(255,191,63,.32); border-width:0 1px 1px; background:rgba(255,191,63,.055); color:#d8e2eb; font-size:.82rem; }
.qlg-asset-warning code { color:#fff2bd; }

.qlg-work-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--qlg-border);
  border-radius: 14px;
  background: var(--qlg-border);
}

.qlg-work-nav button {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 72px;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: var(--qlg-surface);
}

.qlg-work-nav button > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--qlg-border);
  border-radius: 50%;
  color: var(--qlg-muted);
}

.qlg-work-nav button small { color: var(--qlg-muted); }
.qlg-work-nav button.is-active { background: rgba(0,231,255,.09); box-shadow: inset 0 -3px var(--qlg-cyan); }
.qlg-work-nav button.is-active > span { border-color: var(--qlg-cyan); color: var(--qlg-cyan); }

.qlg-work-area {
  padding: 24px;
  border: 1px solid var(--qlg-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 240px), #090f15;
}

.qlg-area-heading { justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.qlg-area-heading h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.qlg-add-buttons { justify-content: flex-end; max-width: 680px; }
.qlg-add-buttons button small { display: block; color: var(--qlg-muted); font-size: .68rem; }

.qlg-build-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(460px, 2.4fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.qlg-theme-bar {
  margin: -4px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--qlg-border);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.qlg-theme-bar summary { min-height: 30px; cursor: pointer; font-weight: 700; }
.qlg-theme-grid { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:10px; padding-top:12px; }
.qlg-theme-grid label { display:grid; gap:5px; color:var(--qlg-muted); font-size:.76rem; }
.qlg-theme-grid input,
.qlg-theme-grid select { width:100%; min-height:44px; padding:.55rem; border:1px solid var(--qlg-border); border-radius:8px; background:#070c11; color:var(--qlg-text); }

.qlg-panel-shell {
  border: 1px solid var(--qlg-border);
  border-radius: 12px;
  background: var(--qlg-surface);
}

.qlg-graphic-browser,
.qlg-inspector { max-height: 780px; overflow: auto; }
.qlg-graphic-browser > header { display:flex; justify-content:space-between; align-items:center; padding: 15px; border-bottom: 1px solid var(--qlg-border); }

.qlg-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 62px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--qlg-border) !important;
  border-radius: 0 !important;
  text-align: left;
}

.qlg-list-item > span:first-child { display: grid; gap: 2px; }
.qlg-list-item.is-selected { background: rgba(0,231,255,.1) !important; box-shadow: inset 3px 0 var(--qlg-cyan); }

.qlg-live-dot {
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  color: var(--qlg-muted);
  font: 800 .62rem/1 "JetBrains Mono", monospace;
  white-space: nowrap;
}

.qlg-live-dot.is-live { background: rgba(255,83,111,.16); color: #ff9bac; }

.qlg-canvas-column { min-width: 0; }
.qlg-canvas-toolbar { display:flex; justify-content:space-between; padding: 0 3px 8px; }

.qlg-canvas,
.qlg-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--qlg-border);
  border-radius: 11px;
  background: radial-gradient(circle at 50% 50%, #1a2732, #080d12 72%);
}

.qlg-preview-stage { background: repeating-conic-gradient(#141c24 0 25%, #10171e 0 50%) 50% / 24px 24px; }
.qlg-guide-options { padding-top: 9px; color: var(--qlg-muted); font-size: .82rem; }
.qlg-guide-options label { display:flex; align-items:center; gap:7px; }

.qlg-frame {
  position: absolute;
  transform-origin: center;
  overflow: hidden;
  background: transparent;
}

.qlg-build-frame { background: rgba(0,0,0,.12); }
.qlg-guide { position:absolute; pointer-events:none; border: 2px dashed rgba(0,231,255,.32); }
.qlg-title-safe { inset: 10%; }
.qlg-action-safe { inset: 5%; border-color: rgba(255,191,63,.3); }

.qlg-graphic { position: absolute; display: flex; align-items: stretch; cursor: grab; touch-action: none; }
.qlg-graphic:active { cursor: grabbing; }
.qlg-graphic.is-selected::after { content:""; position:absolute; inset:-4px; border: 3px solid var(--qlg-cyan); box-shadow: 0 0 0 2px rgba(0,0,0,.7); pointer-events:none; }
.qlg-build-label { position:absolute; left:0; bottom:calc(100% + 7px); padding: 3px 7px; border-radius: 4px; background:#00b9cc; color:#031015; font:700 13px/1.2 "JetBrains Mono", monospace; white-space:nowrap; }
.qlg-resize-handle { position:absolute; right:var(--qlg-resize-offset,-34px); bottom:var(--qlg-resize-offset,-34px); z-index:8; width:var(--qlg-resize-hit,76px); min-width:var(--qlg-resize-hit,76px); height:var(--qlg-resize-hit,76px); min-height:var(--qlg-resize-hit,76px) !important; padding:0 !important; border:10px solid #071018 !important; border-radius:50% !important; background:var(--qlg-cyan) !important; cursor:nwse-resize !important; }
.qlg-output-asset-missing { display:block; width:100%; height:100%; background:transparent; }

.qlg-panel {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: var(--qlg-padding);
  border-radius: var(--qlg-radius);
  background: var(--qlg-panel);
  color: var(--qlg-primary);
  font-family: var(--qlg-font);
  font-size: var(--qlg-font-size);
  font-weight: var(--qlg-font-weight);
  text-align: var(--qlg-align);
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
  overflow: hidden;
}

.qlg-lower-third { display:flex; flex-direction:column; justify-content:center; border-left: 7px solid var(--qlg-accent); }
.qlg-main-text { line-height:1.05; overflow:hidden; text-overflow:ellipsis; }
.qlg-secondary-text { margin-top:.28em; color: var(--qlg-secondary); font-size:.53em; font-weight:500; line-height:1.15; text-transform:none; }
.qlg-secondary-text:first-child { margin:0 0 .28em; }

.qlg-status { display:flex; align-items:center; justify-content:center; gap:.55em; border-radius:999px; text-transform:uppercase; letter-spacing:.08em; }
.qlg-status > span { width:.55em; height:.55em; flex:0 0 auto; border-radius:50%; background:var(--qlg-accent); box-shadow:0 0 20px var(--qlg-accent); }

.qlg-timer { display:flex; flex-direction:column; justify-content:center; }
.qlg-timer-value { font-size:1.25em; line-height:1; letter-spacing:.03em; }

.qlg-scoreboard { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:.5em; border-top:6px solid var(--qlg-accent); }
.qlg-score-team { display:flex; align-items:center; justify-content:space-between; gap:.5em; min-width:0; }
.qlg-score-team span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qlg-score-team strong { display:grid; place-items:center; min-width:1.65em; padding:.12em .3em; border-radius:.24em; background:var(--team); color:#071018; }
.qlg-score-clock { color:var(--qlg-secondary); font:700 .68em/1 "JetBrains Mono", monospace; }
.qlg-image { width:100%; height:100%; }
.qlg-missing-asset { display:grid; place-items:center; width:100%; height:100%; border:3px dashed rgba(255,255,255,.25); color:var(--qlg-muted); }

.qlg-enter.qlg-anim-slide { animation: qlgSlide var(--qlg-duration, 320ms) ease both; }
.qlg-enter.qlg-anim-fade { animation: qlgFade var(--qlg-duration, 320ms) ease both; }
.qlg-enter.qlg-anim-scale { animation: qlgScale var(--qlg-duration, 320ms) cubic-bezier(.2,.8,.2,1) both; }
@keyframes qlgSlide { from { opacity:0; transform:translateX(-42px); } to { opacity:1; transform:none; } }
@keyframes qlgFade { from { opacity:0; } to { opacity:1; } }
@keyframes qlgScale { from { opacity:0; transform:scale(.84); } to { opacity:1; transform:scale(1); } }

.qlg-inspector { padding: 16px; }
.qlg-inspector-head { justify-content:space-between; gap:10px; margin-bottom:10px; }
.qlg-inspector-actions { padding-bottom:14px; border-bottom:1px solid var(--qlg-border); margin-bottom:14px; }
.qlg-save-actions { position:sticky; top:-16px; z-index:20; padding:10px 0 12px; background:linear-gradient(#0e151d 80%,transparent); }
.qlg-save-primary { border-color:rgba(38,229,150,.65) !important; background:rgba(38,229,150,.14) !important; color:#b9ffdf !important; font-weight:900 !important; }
.qlg-inspector fieldset { margin:16px 0 0; padding:14px; border:1px solid var(--qlg-border); border-radius:9px; }
.qlg-inspector legend { padding:0 6px; font-weight:700; }
.qlg-inspector details { margin-top:16px; padding:12px; border:1px solid var(--qlg-border); border-radius:9px; }
.qlg-inspector summary { min-height:30px; cursor:pointer; font-weight:700; }
.qlg-field-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; margin-top:10px; }
.qlg-field { display:grid; gap:5px; color:var(--qlg-muted); font-size:.76rem; }
.qlg-field-wide { grid-column:1 / -1; }
.qlg-color-field { display:grid; grid-template-columns:1fr 44px; gap:5px; }
.qlg-color-field input { padding:4px; }
.qlg-color-field button { min-width:44px; padding:0; }
.qlg-preset-row button { min-height:44px; padding:.4rem .55rem; font-size:.72rem; text-transform:capitalize; }
.qlg-size-preset-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-bottom:8px; }
.qlg-size-preset-row button { min-height:44px; padding:.45rem .55rem; font-size:.72rem; }
.qlg-check-field { grid-template-columns:22px 1fr; align-items:center; align-self:end; min-height:44px; }
.qlg-check-field input { width:20px; min-height:20px; margin:0; }

.qlg-control-surface { display:grid; gap:28px; }
.qlg-control-group > h3 { margin:0 0 10px; color:var(--qlg-muted); font:800 .78rem/1.2 "JetBrains Mono", monospace; letter-spacing:.1em; text-transform:uppercase; }
.qlg-control-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:12px; }
.qlg-control-card { overflow:hidden; border:1px solid var(--qlg-border); border-radius:12px; background:var(--qlg-surface); }
.qlg-control-card.is-on-air { border-color:rgba(255,83,111,.58); box-shadow:inset 0 3px var(--qlg-red); }
.qlg-control-card header { justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid var(--qlg-border); }
.qlg-control-card header > span:first-child { display:grid; gap:2px; }
.qlg-control-body { display:grid; gap:10px; padding:16px; }
.qlg-control-body label { display:grid; gap:5px; color:var(--qlg-muted); font-size:.78rem; }
.qlg-take-row { gap:8px; padding:12px 16px 16px; }
.qlg-take-row button { flex:1; min-height:50px; font-weight:800; }
.qlg-control-position { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; padding:0 16px; color:var(--qlg-muted); font-size:.72rem; }
.qlg-control-position select { width:100%; min-height:44px; padding:.45rem .58rem; border:1px solid var(--qlg-border); border-radius:8px; background:#070c11; color:var(--qlg-text); }
.qlg-card-admin { display:flex; gap:6px; padding:0 16px 14px; }
.qlg-card-admin button { flex:1; min-height:44px; padding:.45rem .55rem; font-size:.75rem; }
.qlg-take { border-color:rgba(38,229,150,.55) !important; background:rgba(38,229,150,.12) !important; color:#9dffd5 !important; }
.qlg-out { border-color:rgba(255,83,111,.5) !important; background:rgba(255,83,111,.1) !important; color:#ffb4c0 !important; }
.qlg-live-readout { padding:12px; border:1px solid var(--qlg-border); border-radius:8px; background:#05090d; text-align:center; font:800 2rem/1 "JetBrains Mono", monospace; }
.qlg-compact-actions { gap:8px; }
.qlg-compact-actions button { flex:1; }
.qlg-score-controls { display:grid; gap:8px; }
.qlg-score-row { display:grid; grid-template-columns:1fr 44px 54px 44px; gap:7px; }
.qlg-score-row button { min-width:44px; padding:0; font-size:1.25rem; }
.qlg-score-row output { display:grid; place-items:center; font:800 1.4rem/1 "JetBrains Mono", monospace; }

.qlg-preview-layout { align-items:flex-start; gap:16px; }
.qlg-preview-stage { flex:1 1 70%; }
.qlg-output-panel { flex:0 0 340px; padding:18px; }
.qlg-output-panel code { display:block; max-height:120px; margin:14px 0; padding:12px; overflow:auto; border:1px solid var(--qlg-border); border-radius:8px; background:#05090d; color:#aeeeff; word-break:break-all; }
.qlg-output-actions { gap:8px; }
.qlg-output-actions button { flex:1; }
.qlg-output-panel dl { margin:18px 0 0; }
.qlg-output-panel dl div { display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-top:1px solid var(--qlg-border); }
.qlg-output-panel dt { color:var(--qlg-muted); }
.qlg-output-panel dd { margin:0; text-align:right; }
.qlg-preview-count { padding:7px 10px; border-radius:999px; background:rgba(255,83,111,.1); color:#ff9daf; }

.qlg-empty { margin:0; padding:18px; color:var(--qlg-muted); }
.qlg-empty-large { display:grid; place-items:center; gap:6px; min-height:180px; text-align:center; }
.qlg-empty-large strong { color:var(--qlg-text); }
.qlg-boundary-note { margin-top:18px; padding:16px 18px; border:1px solid rgba(255,191,63,.3); border-radius:12px; background:rgba(255,191,63,.05); }

.eg-output-page,
html.eg-output-html,
body.eg-output-page,
.eg-output-root,
.eg-output-layer {
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden;
  overscroll-behavior:none;
  background-color:rgba(0,0,0,0) !important;
  background-image:none !important;
}

.eg-output-root { position:fixed; inset:0; }
.eg-output-page .qlg-panel { -webkit-backdrop-filter:none; backdrop-filter:none; }

@media (max-width: 1180px) {
  .qlg-build-layout { grid-template-columns:220px minmax(0,1fr); }
  .qlg-inspector { grid-column:1 / -1; max-height:none; }
  .qlg-field-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .qlg-theme-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .qlg-site-main { width:min(100% - 20px, 1680px); padding-top:14px; }
  .qlg-product-header,
  .qlg-project-bar,
  .qlg-area-heading,
  .qlg-preview-layout { align-items:stretch; flex-direction:column; }
  .qlg-project-bar > label { min-width:0; }
  .qlg-project-meta { white-space:normal; }
  .qlg-header-actions button,
  .qlg-project-actions button { flex:1 1 145px; }
  .qlg-work-nav button { grid-template-columns:28px 1fr; min-height:64px; padding:.5rem; }
  .qlg-work-nav button small { display:none; }
  .qlg-work-area { padding:16px; }
  .qlg-build-layout { grid-template-columns:1fr; }
  .qlg-graphic-browser { max-height:260px; }
  .qlg-inspector { grid-column:auto; }
  .qlg-field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .qlg-theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .qlg-output-panel { flex-basis:auto; width:auto; }
}

@media (max-width: 520px) {
  .qlg-product-header { padding:20px; }
  .qlg-project-bar { padding:12px; }
  .qlg-project-actions button,
  .qlg-add-buttons button { flex:1 1 calc(50% - 8px); }
  .qlg-work-nav button { display:flex; justify-content:center; gap:7px; min-height:54px; }
  .qlg-work-nav button > span { display:none; }
  .qlg-work-nav button strong { font-size:.78rem; }
  .qlg-canvas-toolbar { display:grid; gap:3px; }
  .qlg-field-grid { grid-template-columns:1fr; }
  .qlg-theme-grid { grid-template-columns:1fr; }
  .qlg-control-grid { grid-template-columns:1fr; }
  .qlg-take-row { flex-wrap:wrap; }
  .qlg-take-row button { flex:1 1 42%; }
}

@media (prefers-reduced-motion: reduce) {
  .qlg-enter { animation:none !important; }
}

/* QLG operator-density and map/asset pass */
.qlg-shell[data-qlg-active-view="control"] .qlg-product-header,
.qlg-shell[data-qlg-active-view="control"] .qlg-project-bar,
.qlg-shell[data-qlg-active-view="control"] .qlg-boundary-note,
.qlg-shell[data-qlg-active-view="preview"] .qlg-product-header,
.qlg-shell[data-qlg-active-view="preview"] .qlg-project-bar,
.qlg-shell[data-qlg-active-view="preview"] .qlg-boundary-note { display:none; }

.qlg-shell[data-qlg-active-view="control"] .qlg-site-main { width:min(1820px, calc(100% - 24px)); padding-top:10px; }
.qlg-shell[data-qlg-active-view="control"] .qlg-connection { border-width:1px; border-radius:10px; padding:7px 12px; }
.qlg-shell[data-qlg-active-view="control"] .qlg-work-nav { margin:8px 0; }
.qlg-shell[data-qlg-active-view="control"] .qlg-work-nav button { min-height:48px; grid-template-columns:26px 1fr; padding:.38rem .7rem; }
.qlg-shell[data-qlg-active-view="control"] .qlg-work-nav button > span { width:23px; height:23px; font-size:.72rem; }
.qlg-shell[data-qlg-active-view="control"] .qlg-work-nav button small { display:none; }
.qlg-shell[data-qlg-active-view="control"] .qlg-work-area { padding:12px; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-site-main { width:min(1820px, calc(100% - 24px)); padding-top:10px; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-connection { border-width:1px; border-radius:10px; padding:7px 12px; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-work-nav { margin:8px 0; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-work-nav button { min-height:48px; grid-template-columns:26px 1fr; padding:.38rem .7rem; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-work-nav button > span { width:23px; height:23px; font-size:.72rem; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-work-nav button small { display:none; }
.qlg-shell[data-qlg-active-view="preview"] .qlg-work-area { padding:12px; }
.qlg-control-heading { position:sticky; top:0; z-index:40; margin:-12px -12px 10px; padding:10px 12px; border-bottom:1px solid var(--qlg-border); background:rgba(7,11,16,.96); backdrop-filter:blur(12px); }
.qlg-control-heading h2 { font-size:1.4rem; }
.qlg-control-heading p { margin-top:2px; font-size:.8rem; }
.qlg-control-heading .qlg-kicker { margin-bottom:2px; font-size:.64rem; }
.qlg-control-heading .qlg-panic-large { min-width:210px; min-height:48px !important; }
.qlg-control-surface { grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:8px; }
.qlg-control-group,
.qlg-control-grid { display:contents; }
.qlg-control-group > h3 { display:none; }
.qlg-control-card { border-radius:9px; }
.qlg-control-card header { padding:7px 9px; }
.qlg-control-card header > span:first-child { display:flex; align-items:baseline; gap:7px; min-width:0; }
.qlg-control-card header strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qlg-control-body { gap:7px; padding:8px 9px; }
.qlg-control-lower-third .qlg-control-body { grid-template-columns:repeat(2,minmax(0,1fr)); }
.qlg-control-body label { gap:3px; font-size:.7rem; }
.qlg-control-body input { min-height:38px; padding:.45rem .58rem; }
.qlg-take-row { gap:6px; padding:6px 9px 9px; }
.qlg-take-row button { min-height:44px; padding:.45rem .6rem; }
.qlg-live-readout { padding:7px; font-size:1.55rem; }
.qlg-compact-actions { gap:6px; }
.qlg-score-controls { gap:5px; }
.qlg-score-row { grid-template-columns:minmax(70px,1fr) 44px 48px 44px; gap:5px; }
.qlg-control-scoreboard { grid-column:span 2; }
.qlg-control-scoreboard .qlg-control-body { grid-template-columns:minmax(260px,1.35fr) minmax(130px,.65fr) minmax(210px,1fr); align-items:center; }
.qlg-control-scoreboard .qlg-live-readout { font-size:1.8rem; }
.qlg-control-summary { display:grid; gap:2px; min-height:38px; align-content:center; }
.qlg-control-summary span { color:var(--qlg-muted); font-size:.72rem; }

.qlg-area-heading { margin-bottom:14px; }
.qlg-add-buttons { max-width:760px; }
.qlg-add-buttons button { min-height:40px; }
.qlg-build-layout { grid-template-columns:minmax(170px,.58fr) minmax(520px,2.7fr) minmax(300px,1.1fr); gap:10px; }
.qlg-graphic-browser > header { padding:10px; }
.qlg-list-item { min-height:52px !important; padding:.48rem .62rem !important; }
.qlg-inspector { padding:12px; }
.qlg-inspector fieldset { margin-top:11px; padding:10px; }
.qlg-inspector details { margin-top:10px; padding:9px; }
.qlg-field-grid { gap:7px; margin-top:7px; }
.qlg-field input,
.qlg-field select { min-height:40px; padding:.5rem .58rem; }
.qlg-preset-row { gap:5px; }
.qlg-preset-row button { flex:1 1 30%; min-height:44px; }

.qlg-map-wrap,
.qlg-map-canvas { position:absolute; inset:0; width:100%; height:100%; overflow:hidden; border-radius:inherit; }
.qlg-map-title { position:absolute; left:3%; top:4%; z-index:5; max-width:72%; padding:.42em .65em; border-left:5px solid var(--qlg-accent); border-radius:calc(var(--qlg-radius) * .5); background:var(--qlg-panel); color:var(--qlg-primary); font-family:var(--qlg-font); font-size:var(--qlg-font-size); font-weight:var(--qlg-font-weight); line-height:1.05; box-shadow:0 8px 24px rgba(0,0,0,.28); }
.qlg-map-marker { position:relative; width:var(--marker-size); height:var(--marker-size); border:3px solid #fff; border-radius:50%; background:var(--marker-color); box-shadow:0 4px 18px rgba(0,0,0,.45); }
.qlg-map-marker::after { content:attr(data-label); position:absolute; left:50%; top:calc(100% + 7px); transform:translateX(-50%); max-width:180px; padding:4px 7px; border-radius:4px; background:rgba(5,9,13,.86); color:#fff; font:700 12px/1.2 "Outfit",sans-serif; white-space:nowrap; }
.qlg-map-marker:not([data-label])::after { display:none; }
.qlg-map-marker.is-pulsing::before { content:""; position:absolute; inset:-2px; border:3px solid var(--marker-color); border-radius:inherit; animation:qlgMarkerPulse 1.4s ease-out infinite; }
@keyframes qlgMarkerPulse { from { opacity:.8; transform:scale(.8); } to { opacity:0; transform:scale(2.2); } }
.qlg-map-fallback { display:grid; place-items:center; background:repeating-linear-gradient(45deg,#17212b 0 1px,#0a1118 1px 28px); color:#d7e5ef; text-align:center; }
.qlg-map-fallback > div { display:grid; gap:5px; padding:18px; }
.qlg-map-fallback span { color:var(--qlg-muted); font-size:.76rem; }
.qlg-map-editor { position:relative; width:100%; height:230px; margin:4px 0 8px; overflow:hidden; border:1px solid var(--qlg-border); border-radius:8px; background:#071018; }
.qlg-map-editor .maplibregl-canvas { cursor:crosshair; }
.qlg-map-editor .maplibregl-ctrl-group button { width:44px; height:44px; }
.qlg-map-editor .maplibregl-ctrl-attrib { font-size:9px; }
.qlg-map-search { display:grid; gap:7px; margin:4px 0 12px; padding:10px; border:1px solid var(--qlg-border); border-radius:8px; background:rgba(255,255,255,.02); }
.qlg-map-search-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.qlg-map-search-row button { min-width:92px; min-height:44px; }
.qlg-map-search-status { min-height:1.2em; margin:0; color:var(--qlg-muted); font-size:.74rem; }
.qlg-map-search-status.is-error { color:#ffb9c5; }
.qlg-map-search-results { display:grid; gap:5px; }
.qlg-map-search-results button { display:grid; gap:2px; width:100%; min-height:50px; padding:8px 10px; text-align:left; }
.qlg-map-search-results strong,
.qlg-map-search-results span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qlg-map-search-results strong { color:var(--qlg-text); font-size:.76rem; }
.qlg-map-search-results span { color:var(--qlg-muted); font-size:.67rem; font-weight:500; }
.qlg-map-search .qlg-help { margin:0; }
.qlg-map-search .qlg-help a { color:#8ff4ff; }
.qlg-marker-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; }
.qlg-marker-heading > span { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.qlg-marker-heading button { min-height:44px; }
.qlg-marker-list { display:grid; gap:6px; }
.qlg-marker-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:start; padding:8px; border:1px solid var(--qlg-border); border-radius:8px; background:rgba(255,255,255,.02); }
.qlg-marker-item details { margin:0 !important; padding:0 !important; border:0 !important; }
.qlg-marker-item summary { display:grid; grid-template-columns:14px minmax(0,1fr) auto; align-items:center; gap:8px; min-height:44px !important; list-style:none; }
.qlg-marker-item summary::-webkit-details-marker { display:none; }
.qlg-marker-item summary > span:nth-child(2) { display:grid; gap:2px; min-width:0; }
.qlg-marker-item summary small { color:var(--qlg-muted); font:500 .65rem/1.2 "JetBrains Mono",monospace; overflow:hidden; text-overflow:ellipsis; }
.qlg-marker-dot { width:12px; height:12px; border:2px solid #fff; border-radius:50%; background:var(--marker-color); }
.qlg-marker-edit { color:#8ff4ff; font-size:.7rem; }
.qlg-remove-marker { min-width:70px; min-height:44px; padding:.4rem .55rem !important; color:#ffb9c5 !important; }
.qlg-asset-preview { display:grid; place-items:center; min-height:130px; margin-bottom:8px; overflow:hidden; border:1px solid var(--qlg-border); border-radius:8px; background:#070c11; color:var(--qlg-muted); }
.qlg-asset-preview img { display:block; max-width:100%; max-height:180px; object-fit:contain; }

.qlg-preview-heading { margin-bottom:10px; }
.qlg-preview-layout { gap:12px; }
.qlg-preview-stage { flex-basis:78%; }
.qlg-output-panel { flex-basis:300px; padding:14px; }
.qlg-output-panel code { margin:9px 0; max-height:90px; }
.qlg-copy-wide { width:100%; background:rgba(0,231,255,.1) !important; border-color:rgba(0,231,255,.5) !important; font-weight:800 !important; }
.qlg-preview-facts { display:grid; gap:0; margin-top:10px; }
.qlg-preview-facts span { display:flex; justify-content:space-between; gap:8px; padding:8px 0; border-top:1px solid var(--qlg-border); }
.qlg-preview-facts small { color:var(--qlg-muted); }

@media (max-width: 1180px) {
  .qlg-build-layout { grid-template-columns:190px minmax(0,1fr); }
  .qlg-control-scoreboard { grid-column:auto; }
  .qlg-control-scoreboard .qlg-control-body { grid-template-columns:1fr; }
}

@media (max-width: 720px) {
  .qlg-control-heading { align-items:stretch; flex-direction:column; }
  .qlg-control-heading .qlg-panic-large { width:100%; }
  .qlg-control-lower-third .qlg-control-body { grid-template-columns:1fr; }
  .qlg-control-grid { grid-template-columns:1fr; }
  .qlg-shell[data-qlg-active-view="control"] .qlg-site-main { width:calc(100% - 12px); }
  .qlg-map-search-row { grid-template-columns:1fr; }
  .qlg-map-search-row button { width:100%; }
  .qlg-marker-heading { align-items:flex-start; flex-direction:column; }
  .qlg-marker-heading > span { width:100%; }
  .qlg-marker-heading > span button { flex:1; }
}

@media (max-width: 820px) {
  .qlg-build-layout { grid-template-columns:1fr; }
  .qlg-graphic-browser { max-height:250px; }
  .qlg-inspector { grid-column:auto; }
  .qlg-map-editor { height:210px; }
}

@media (prefers-reduced-motion: reduce) {
  .qlg-map-marker.is-pulsing::before { animation:none; display:none; }
}
