/* NiceUI Device Studio — app layout. Shares .gm-* control styles from styles.css. */
.ds [hidden] { display: none !important; }
.ds { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - var(--ap-bar, 52px)); height: calc(100dvh - var(--ap-bar, 52px)); }
.ds-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
.ds-stage { position: relative; min-height: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(circle at 50% 40%, #121318, #08090b); display: grid; place-items: center; padding-bottom: 44px; }
.ds-canvas { display: block; border-radius: 6px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06); cursor: grab; touch-action: none; outline: none; }
.ds-canvas:focus-visible { box-shadow: 0 0 0 2px var(--sky); }
.ds-canvas.dragging { cursor: grabbing; }
.ds-canvas.ds-checker { background: conic-gradient(#26262b 25%, #1a1a1e 0 50%, #26262b 0 75%, #1a1a1e 0) 0 0 / 20px 20px; }
.ds-hint { position: absolute; top: 12px; left: 14px; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); pointer-events: none; }
.ds-stage-bar { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: center; }
.ds-sizes { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(12px); overflow-x: auto; max-width: 100%; }
.ds-sizes button { height: 28px; padding: 0 11px; border-radius: 9px; font-size: 12px; color: rgba(255, 255, 255, 0.7); white-space: nowrap; }
.ds-sizes button[aria-pressed="true"] { background: #fff; color: #000; }
.ds-drop { position: absolute; inset: 10px; border: 2px dashed var(--sky); border-radius: 16px; display: grid; place-items: center; background: rgba(2, 6, 23, 0.7); color: #fff; font-size: 15px; z-index: 3; }
.ds-nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--mute); }
.ds-src { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ds-slots, .ds-samples { display: flex; gap: 8px; flex: none; }
.ds-slot { display: grid; gap: 5px; width: 82px; padding: 5px 5px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); text-align: left; }
.ds-slot[aria-checked="true"] { border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.ds-slot-img { height: 46px; border-radius: 7px; overflow: hidden; background: var(--s3); }
.ds-slot-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ds-slot b { padding: 0 2px; font-size: 11px; font-weight: 500; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-slot[aria-checked="true"] b { color: var(--text); }
.ds-div { width: 1px; align-self: stretch; background: var(--line); flex: none; }
.ds-sample { width: 52px; height: 66px; flex: none; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); opacity: 0.55; transition: opacity 0.2s; }
.ds-sample.fit { opacity: 1; }
.ds-sample[aria-pressed="true"] { border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.ds-sample img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ds-upload { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 11px; background: #fff; color: #000; font-size: 13px; font-weight: 500; cursor: pointer; }
.ds-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ds-upload svg { transform: rotate(-90deg); }
.ds-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--s1); }
.ds-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.ds-scroll .gm-card { background: var(--s2); }
.ds-scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ds-scene { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 7px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--mute); }
.ds-scene b { font-size: 11px; font-weight: 500; line-height: 1.2; text-align: center; }
.ds-scene[aria-pressed="true"] { border-color: var(--sky); color: var(--text); box-shadow: 0 0 0 1px var(--sky); }
.ds-angles { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.ds-angles button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; color: var(--mute); }
.ds-angles button[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: var(--sky-ink); }
.ds-lab { display: block; font-size: 12.5px; color: var(--mute); margin: 2px 0 6px; }
.ds-finishes { display: flex; gap: 7px; margin-bottom: 8px; }
.ds-sw { width: 30px; height: 30px; border-radius: 50%; padding: 3px; border: 1px solid transparent; }
.ds-sw i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.ds-sw[aria-pressed="true"] { border-color: var(--sky); }
.ds-seg { margin: 8px 0 4px; }
.ds-seg button { font-size: 12px; }
.ds-field { display: grid; gap: 5px; margin-top: 8px; font-size: 12.5px; color: var(--mute); }
.ds-field input { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--s1); color: var(--text); font-size: 13px; }
.ds-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--mute); }
.ds-check input { accent-color: var(--sky); width: 16px; height: 16px; }
.ds-bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }
.ds-bg { display: grid; gap: 4px; padding: 3px 3px 5px; border-radius: 9px; border: 1px solid var(--line-2); }
.ds-bg i { display: block; height: 30px; border-radius: 6px; }
.ds-bg b { font-size: 10.5px; font-weight: 500; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-bg[aria-pressed="true"] { border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.ds-row2 { display: grid; gap: 4px; margin-bottom: 4px; }
.ds-export { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--s1); }
.ds-export-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; }
.ds-export-row .ds-seg { margin: 0; }
.ds-export .gm-actions .btn-sky { flex: 1; justify-content: center; }
.ds-export .gm-actions .btn-sky svg { transform: rotate(90deg); }
.ds-export [data-ds-dim] { font: 500 11px var(--mono); opacity: 0.7; margin-left: 2px; }
.ds-export .gm-actions .btn-cmd { padding: 0 12px; }
@media (max-width: 1000px) {
  .ds { height: auto; grid-template-columns: 1fr; }
  .ds-main { grid-template-rows: auto auto; }
  .ds-stage { height: 62vh; }
  .ds-side { border-left: 0; border-top: 1px solid var(--line); }
  .ds-scroll { overflow: visible; }
  .ds-export { position: sticky; bottom: 0; z-index: 5; }
}
@media (max-width: 480px) {
  .ds-scenes { grid-template-columns: repeat(2, 1fr); }
  .ds-hint { display: none; }
}
