:root {
  --bg: #0e0f13;
  --surface: #171920;
  --surface-2: #1f222b;
  --surface-3: #262a35;
  --border: #2a2e3a;
  --border-2: #3a3f4d;
  --text: #e7e9ee;
  --muted: #8d93a3;
  --accent: #e5303f;
  --accent-hover: #f24654;
  --accent-soft: rgba(229, 48, 63, 0.14);
  --x: #ef4b5b;
  --y: #4ade80;
  --z: #60a5fa;
  --radius: 10px;
  --side: 290px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Top bar ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 18px rgba(229, 48, 63, 0.35);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; white-space: nowrap; }
.brand-name small { color: var(--muted); font-weight: 500; margin-left: 4px; }

.project-name {
  min-width: 120px; width: 220px;
  padding: 6px 10px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; font-weight: 600; font-size: 14px;
}
.project-name:hover { border-color: var(--border); }
.project-name:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }

.actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--border-2); background: var(--surface-3); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .tool:focus-visible, .seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-icon { padding: 6px 9px; }
.btn-small { padding: 3px 9px; font-size: 12px; }
.btn-play { min-width: 92px; }
.btn-play.stop { background: #2b2f3b; border-color: var(--border-2); }
.btn-danger:hover:not(:disabled) { background: #3a1b20; border-color: #7a2a33; }

.link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-weight: 600; }
.link-btn:hover { color: var(--text); }

/* ---- Studio layout ---- */

.studio {
  display: flex;
  height: calc(100% - 56px);
}
.studio > .center { flex: 1; min-width: 0; }

/* Side columns: the Library (Add), the Scene list and the Inspector. Each one resizes (drag the handle beside it),
   collapses to a strip, or floats as a window you can move and resize. editor.js (setupPanels) keeps the layout. */
.panel { flex: none; width: var(--w, 290px); min-width: 0; position: relative; }
.assets-col { border-right: 1px solid var(--border); }
.assets-col .add-card { flex: 1; overflow-y: auto; border-bottom: 0; }
.assets-col .add-card > .card-head > h3 { display: none; }
.assets-col .add-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); } /* a wider Library shows more per row */
.assets-col .add-grid.models { max-height: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } /* the column scrolls, not the list */
.panel-bar { display: flex; align-items: center; gap: 2px; min-height: 30px; padding: 3px 6px 3px 12px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); user-select: none; flex: none; }
.panel-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-btn { appearance: none; border: 0; background: none; color: var(--muted); width: 24px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.panel-btn:hover { background: var(--surface-3); color: var(--text); }
.panel.collapsed { width: 30px !important; cursor: pointer; }
.panel.collapsed > :not(.panel-bar) { display: none !important; }
.panel.collapsed .panel-bar { flex-direction: column; height: 100%; padding: 8px 0; border-bottom: 0; writing-mode: vertical-rl; gap: 8px; }
.panel.collapsed .panel-btn[data-pa="float"] { display: none; }
.panel.collapsed .panel-title { flex: 0 1 auto; }
.panel:hover.collapsed { background: var(--surface-2); }
.resizer { flex: none; width: 6px; margin: 0 -3px; position: relative; z-index: 6; cursor: col-resize; }
.resizer::after { content: ''; position: absolute; inset: 0 2px; border-radius: 2px; transition: background 0.12s; }
.resizer:hover::after, .resizer.dragging::after { background: var(--accent, #e5303f); }
.resizer.off { display: none; }
.panel.floating { position: fixed; z-index: 40; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; resize: both; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); min-width: 200px; min-height: 160px; }
.panel.floating .panel-bar { cursor: move; background: var(--surface-2); }
.studio.puzzle-mode #assetsCol, .studio.puzzle-mode .resizer[data-for="assets"] { display: none; }
body.panel-dragging, body.panel-dragging * { cursor: col-resize !important; user-select: none !important; }
body.panel-moving, body.panel-moving * { cursor: move !important; user-select: none !important; }

.side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.side.left { border-right: 1px solid var(--border); }
.side.right { border-left: 1px solid var(--border); }
.studio.playing .side { opacity: 0.45; pointer-events: none; }

.card { padding: 12px; border-bottom: 1px solid var(--border); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card h3, .dialog h3 {
  margin: 0;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
}
.count { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 11px; }

.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.seg-btn {
  appearance: none; border: 0; background: none; padding: 3px 10px; border-radius: 6px;
  color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer;
}
.seg-btn.on { background: var(--surface-3); color: var(--text); }
/* The Add panel has four tabs: on a narrow panel they move under the heading, full width */
.add-card .card-head { flex-wrap: wrap; }
.add-card .card-head .seg { flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.add-card .card-head .seg-btn { flex: 1 0 auto; padding: 3px 8px; white-space: nowrap; }

.add-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.add-btn {
  appearance: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  cursor: pointer; font-size: 10.5px; color: var(--muted); line-height: 1.15; text-align: center;
}
.add-btn:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.add-btn .ico { font-size: 17px; line-height: 1; color: var(--text); }

.add-grid.models { grid-template-columns: repeat(3, 1fr); max-height: 260px; overflow-y: auto; }
.add-group { grid-column: 1 / -1; margin: 6px 2px 0; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.model-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.model-bar .btn { flex: 1 1 auto; text-align: center; text-decoration: none; color: inherit; }
.model-bar .btn-primary { color: #fff; }
.model-hint { grid-column: 1 / -1; }
.model-tile { position: relative; padding: 4px 4px 6px; }
.model-tile .thumb, .model-info .thumb { width: 100%; aspect-ratio: 1; border-radius: 6px; background: #0a0b0e center / contain no-repeat; }
.model-tile .nm { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-tile .x { position: absolute; top: 3px; right: 5px; opacity: 0; color: var(--muted); font-size: 12px; }
.model-tile:hover .x { opacity: 1; }
.model-tile .x:hover { color: var(--accent); }
.model-tile .x.ed { right: auto; left: 5px; }
.model-tile.missing .thumb { opacity: 0.35; }
.model-tile .get { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.model-info { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.model-info .thumb { width: 56px; flex-shrink: 0; }
.model-info b { display: block; }
.model-info span { color: var(--muted); font-size: 11.5px; }
.tex-panel { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.tex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tex-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 76px; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--border); }
.tex-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: #0a0b0e; }
.tex-info .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tex-info .chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.tex-info .chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 10.5px; }
.tex-info .chip .x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 10px; padding: 0 3px; }
.tex-info .chip .x:hover { color: var(--accent); }
.tex-info .none { color: var(--muted); font-size: 11px; }
.tex-add { padding: 3px 4px; font-size: 11.5px; }
.tool-select { height: 28px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; padding: 0 6px; }
.brush-cell { pointer-events: none; }
.studio.puzzle-mode .add-card, .studio.puzzle-mode .list-card, .studio.puzzle-mode .tabs { display: none; }
.studio.board-puzzle #puzzlePanel, .studio.board-breakout #brickPanel, .studio.board-asteroids #rockPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.studio.brand-mode #brandPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
#brandKit { display: flex; flex-direction: column; gap: 6px; }
.bk-sub { margin: 8px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bk-item { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.bk-item-head { display: flex; align-items: center; gap: 8px; }
.bk-item-head img { width: 56px; height: 42px; object-fit: contain; flex: none; border-radius: 6px; background: rgba(255,255,255,.05); }
.bk-item-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-item .x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.bk-item .x:hover { color: var(--accent); }
.bk-link { word-break: break-all; }
.studio.board-blackjack #bjPanel, .studio.board-roulette #rlPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.studio.board-racer #racerPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.studio.board-coaster #coasterPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.studio.board-slingshot #slingPanel { display: flex !important; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.sling-mode { display: grid; grid-template-columns: 1fr 1fr; }
.sling-pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.sling-pieces .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; font-size: 10.5px; }
.sling-pieces .btn.on, .sling-birds .btn.on { border-color: var(--accent); background: rgba(229, 48, 63, 0.18); color: #fff; }
.sling-pieces i { display: block; border-radius: 2px; }
.sling-birds { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sling-birds .bird { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); cursor: pointer; padding: 0; }
.level-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.level-tabs .btn.on, .brick-palette .btn.on { border-color: var(--accent); background: rgba(229, 48, 63, 0.18); color: #fff; }
.brick-grid { width: 100%; height: auto; border-radius: 8px; background: #0c0d12; border: 1px solid var(--border); cursor: crosshair; touch-action: none; }
.brick-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.brick-palette .btn { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 2px; font-size: 11px; }
.brick-palette i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.rock-art { display: flex; flex-direction: column; gap: 8px; }
.tile-list { display: flex; flex-direction: column; gap: 6px; }
.tile-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.tile-row canvas { width: 44px; height: 44px; border-radius: 8px; background: var(--bg); }
.tile-row .fields { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 4px; }
.tile-row .fields .sel { grid-column: 1 / -1; padding: 3px 6px; font-size: 12px; }
.tile-row .inp { padding: 3px 6px; font-size: 12px; }
.tile-row input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.tile-row .x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; }
.tile-row .x:hover { color: var(--accent); }
.diff-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 4px 0 8px; }
.diff-row .btn.on { border-color: var(--accent); color: #fff; background: rgba(229, 48, 63, 0.18); }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.theme-btn { appearance: none; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 8px; border: 1px solid; border-radius: 8px; color: #fff; font: 600 12px/1.2 inherit; text-align: left; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.theme-btn:hover { filter: brightness(1.15); }
.theme-btn .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.audio-thumb { display: grid; place-items: center; font-size: 26px; color: var(--accent); background: var(--panel2, rgba(255,255,255,.04)); }
.rw-rules { display: flex; flex-direction: column; gap: 8px; }
.rw-setup { display: flex; gap: 6px; flex-wrap: wrap; }
.rw-access { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.vp-drop {
  position: absolute; inset: 10px; z-index: 4; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: 14px;
  background: rgba(229, 48, 63, 0.12); color: #fff; font-weight: 700; font-size: 16px; pointer-events: none;
}
.viewport.dropping .vp-drop { display: grid; }
.list-card { flex: 1; display: flex; flex-direction: column; min-height: 0; border-bottom: 0; }
.filter {
  width: 100%; padding: 6px 10px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.filter:focus { outline: none; border-color: var(--accent); }
.entity-list { list-style: none; margin: 0 -6px; padding: 0; overflow-y: auto; flex: 1; }
.entity-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; margin: 1px 0; border-radius: 7px; cursor: pointer;
}
.entity-list li:hover { background: var(--surface-2); }
.entity-list li.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.entity-list .swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); display: grid; place-items: center; font-size: 10px; }
.entity-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-list .tags { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.entity-list .empty { color: var(--muted); cursor: default; }
.entity-list li.member { padding-left: 26px; }
.entity-list li.group-row { font-weight: 600; }
.entity-list .caret { width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; flex-shrink: 0; }
.entity-list .caret:hover { color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- Viewport ---- */

.center { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #000; }
.viewport, .play-host { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.viewport canvas { outline: none; }

.vp-toolbar {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: flex; gap: 6px;
}
.tool-group { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: rgba(23, 25, 32, 0.85); border: 1px solid var(--border); backdrop-filter: blur(6px); }
.tool {
  appearance: none; border: 0; background: none; min-width: 30px; height: 28px; padding: 0 8px;
  border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600;
}
.tool:hover { color: var(--text); background: var(--surface-3); }
.tool.on { color: #fff; background: var(--accent); }
#spaceBtn, #snapBtn { font-size: 12px; }

.vp-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2;
  padding: 4px 12px; border-radius: 999px; background: rgba(14, 15, 19, 0.6); color: var(--muted); font-size: 11.5px;
  pointer-events: none; white-space: nowrap;
}

.vp-loading {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1b1d25 0%, #0a0b0e 75%); color: var(--muted); font-weight: 600;
}
.vp-loading.error { color: #ff8b95; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Console ---- */

.console { background: var(--surface); border-top: 1px solid var(--border); }
.console-head { display: flex; align-items: center; gap: 12px; padding: 6px 12px; }
.console-head .status { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }
.console-log {
  display: none; list-style: none; margin: 0; padding: 0 12px 8px; max-height: 150px; overflow-y: auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.console.open .console-log { display: block; }
.console-log li { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.03); color: #c4c9d4; white-space: pre-wrap; }
.console-log li.error { color: #ff8b95; }
.console-log li.warn { color: #ffd27a; }
.console-log time { color: var(--muted); margin-right: 8px; }

/* ---- Inspector ---- */

.tabs { margin: 10px 12px 0; align-self: flex-start; }
.inspector { flex: 1; overflow-y: auto; padding: 4px 0 30px; }
.insp-empty { padding: 30px 20px; color: var(--muted); text-align: center; }
.insp-empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }

.insp-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); }
.insp-head .row { display: flex; gap: 6px; align-items: center; }
.insp-head .name-input { flex: 1; font-weight: 700; font-size: 14px; }
.kind-pill { font-size: 11px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-3); white-space: nowrap; }
.insp-head .btns { display: flex; gap: 6px; margin-top: 8px; }

details.sec { border-bottom: 1px solid var(--border); }
details.sec > summary {
  list-style: none; cursor: pointer; padding: 10px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; transition: transform 0.15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > .sec-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 7px; }

.field { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; }
.field > label { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field.wide { grid-template-columns: 1fr; }
.field.check { grid-template-columns: 1fr; }
.field.check label { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: normal; cursor: pointer; }

.inp, .sel {
  width: 100%; min-width: 0; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg);
  font-variant-numeric: tabular-nums;
}
.inp:focus, .sel:focus, .code:focus { outline: none; border-color: var(--accent); }
.sel { cursor: pointer; }
input[type="checkbox"], input[type="range"] { accent-color: var(--accent); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field.vec-field { grid-template-columns: 1fr; gap: 4px; }

.vec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.vec .axis { position: relative; }
.vec .axis span {
  position: absolute; left: 0; top: 0; bottom: 0; width: 16px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; cursor: ew-resize; border-radius: 7px 0 0 7px; user-select: none;
}
.vec .axis .inp { padding-left: 19px; padding-right: 4px; }
.vec .ax-x span { color: var(--x); } .vec .ax-y span { color: var(--y); } .vec .ax-z span { color: var(--z); }

.color-row { display: flex; gap: 6px; align-items: center; }
.color-row input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: none; cursor: pointer; }
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-row .inp { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.range-row { display: flex; gap: 8px; align-items: center; }
.range-row input[type="range"] { flex: 1; min-width: 0; }
.range-row output { min-width: 34px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

.code {
  width: 100%; min-height: 220px; resize: vertical; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #0a0b0e; color: #d6e2ff;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; white-space: pre;
}

.beh { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.beh-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-3); }
.beh-head .ico { width: 20px; text-align: center; color: var(--accent); font-weight: 800; }
.beh-head b { flex: 1; }
.beh-head .x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.beh-head .x:hover { color: var(--accent); }
.beh-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.beh-help { margin: 0; color: var(--muted); font-size: 11.5px; }
.add-beh { display: flex; gap: 6px; }
.hint { color: var(--muted); font-size: 11.5px; margin: 0; }
.hint.warn { color: #ffd27a; }
.hint code, .api code { color: var(--text); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.api { margin: 0; padding-left: 16px; color: var(--muted); font-size: 11.5px; }

/* ---- Dialog ---- */

.dialog {
  width: min(860px, calc(100% - 32px)); max-height: calc(100% - 48px);
  padding: 20px 22px 22px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(5, 6, 9, 0.7); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog h2 { margin: 0; font-size: 20px; }
.dialog h3 { margin: 18px 0 10px; }
.dialog h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.games-new { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.games-new .hint { margin: 0; font-size: 12px; }
.template-genres { display: flex; flex-direction: column; gap: 14px; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: -20px; z-index: 2; background: var(--surface); padding: 6px 0; }
.genre-chip { appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.genre-chip small { color: var(--muted); font-size: 11px; }
.genre-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.genre-chip.on small { color: rgba(255,255,255,0.8); }
.genre-chip.empty { opacity: 0.55; }
.genre-head { margin: 4px 0 2px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.genre-head small { color: var(--muted); font-weight: 500; font-size: 12px; }
.genre-sub { margin: 10px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.genre-missing { margin: 8px 0 0; font-size: 12px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tpl {
  appearance: none; text-align: left; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; transition: transform 0.15s, border-color 0.15s;
}
.tpl:hover { transform: translateY(-2px); border-color: var(--accent); }
.tpl .art { height: 74px; position: relative; }
.tpl .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,0.35)); }
.tpl .art i { position: absolute; right: 12px; bottom: 8px; z-index: 1; font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.85); }
.tpl .txt { padding: 10px 12px 12px; }
.tpl b { display: block; font-size: 14px; margin-bottom: 3px; }
.tpl span { color: var(--muted); font-size: 12px; }
.my-games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.my-games li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.my-games li.current { border-color: var(--accent); }
.my-games .nm { flex: 1; font-weight: 600; }
.my-games .when { color: var(--muted); font-size: 12px; }
.my-games .empty { color: var(--muted); border-style: dashed; background: none; }

/* ---- Toast ---- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 20px);
  padding: 9px 16px; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--border-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--accent); }

/* ---- Small screens ---- */

@media (max-width: 1100px) {
  :root { --side: 250px; }
  .brand-name small, #playTabBtn { display: none; }
}
@media (max-width: 860px) {
  html, body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; position: sticky; top: 0; z-index: 20; background: var(--bg); } /* Stop stays reachable while playing */
  .actions { flex-wrap: wrap; margin-left: 0; }
  .project-name { flex: 1; }
  .studio { display: flex; flex-direction: column; height: auto; }
  .panel, .panel.floating, .panel.collapsed { position: static; width: auto !important; height: auto !important; resize: none; box-shadow: none; border-radius: 0; }
  .panel.collapsed > :not(.panel-bar) { display: flex !important; }
  .panel.collapsed .panel-bar { writing-mode: horizontal-tb; flex-direction: row; height: auto; }
  .resizer, .panel-btn { display: none; }
  .center { order: -1; height: 62vh; }
  .side.left, .side.right { border: 0; border-top: 1px solid var(--border); }
  .entity-list { max-height: 260px; }
  .vp-hint { display: none; }
}

/* ---- Real place import (OpenStreetMap) ---- */
.map-dialog { width: min(760px, calc(100% - 32px)); }
.map-search { display: flex; gap: 8px; margin: 12px 0 6px; }
.map-search .inp { flex: 1; min-width: 0; }
.map-results { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; max-height: 150px; overflow: auto; }
.map-results button { width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2, transparent); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.map-results button:hover, .map-results button.on { border-color: var(--accent); background: var(--accent-soft); }
.map-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.map-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.map-row .inp { width: 70px; }
.map-preview { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 14px; align-items: start; }
.map-preview canvas { width: 100%; aspect-ratio: 1; border-radius: 10px; background: #1a1d24; display: block; }
.map-side { display: flex; flex-direction: column; gap: 10px; }
.map-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.map-status.warn { color: #ffd27a; }
.map-layers { display: grid; gap: 6px; }
.map-layers label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.map-layers small, .map-separate small { color: var(--muted); }
.map-separate { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.map-credit { margin-top: 12px; }
.map-credit a { color: inherit; }
.add-wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; text-align: left; }
@media (max-width: 640px) { .map-preview { grid-template-columns: 1fr; } }

/* ---- Floor plan import ---- */
.plan-dialog { width: min(980px, calc(100% - 32px)); }
.plan-url { margin-top: 12px; }
.plan-row { margin-top: 0; }
.plan-row .plan-width { width: 130px; }
.plan-preview { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.plan-preview canvas { width: 100%; height: auto; border-radius: 10px; background: #fff; display: block; cursor: crosshair; }
.plan-legend span { font-size: 14px; }
@media (max-width: 760px) { .plan-preview { grid-template-columns: 1fr; } }

/* ---- Character Creator ---- */
.char-dialog { width: min(920px, calc(100% - 32px)); }
.char-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.char-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.char-controls { display: grid; gap: 6px; }
.char-slots { display: grid; gap: 6px; }
.char-slots .field.covered { opacity: 0.45; }
.char-skin { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.swatch-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.char-preview { display: grid; gap: 8px; }
.char-preview canvas { width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #3a4252, #1a1d24); cursor: grab; display: block; }
.char-anims { justify-self: center; }
.char-mine:empty { display: none; }
.char-mine { margin-top: -4px; align-items: center; }
.char-mine .mine-lab { font-size: 12px; color: var(--muted, #9aa3b2); margin-right: 2px; }
.char-mine .mine { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.char-mine .mine img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; background: #222731; }
.char-mine .mine .x { opacity: 0.6; padding: 0 2px; }
.char-mine .mine .x:hover { opacity: 1; }
.char-tabs { justify-self: start; margin: 4px 0; }
.char-pane { display: grid; gap: 6px; max-height: min(52vh, 460px); overflow-y: auto; padding-right: 4px; }
.char-pane[hidden] { display: none; }
.char-sub { margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted, #9aa3b2); }
.char-sliders { display: grid; gap: 4px; }
.char-slider { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 13px; }
.char-slider input[type=range] { width: 100%; }
.char-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted, #9aa3b2); font-size: 12px; }
.char-slider .ends { grid-column: 2; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted, #9aa3b2); margin-top: -4px; }
.char-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; }
.char-color { display: flex; align-items: center; gap: 4px; padding-bottom: 2px; }
.char-color input[type=color] { width: 28px; height: 28px; padding: 0; border: 2px solid var(--border); border-radius: 50%; background: none; cursor: pointer; }
.char-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.char-color input[type=color]::-webkit-color-swatch { border: none; border-radius: 50%; }
.char-color .reset { font-size: 12px; opacity: 0.7; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; }
.char-color.unset input[type=color] { opacity: 0.35; }
.char-save { justify-content: center; }
@media (max-width: 720px) { .char-body { grid-template-columns: 1fr; } }

.rights-dialog { width: min(520px, calc(100% - 32px)); }
.rights-dialog p { margin: 0 0 12px; line-height: 1.5; }
.rights-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; cursor: pointer; line-height: 1.45; }
.rights-check input { margin-top: 3px; flex: none; }
.rights-btns { justify-content: flex-end; }

/* Video shoot */
.shoot-guide { position: absolute; z-index: 1; pointer-events: none; border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); }
.shoot-guide::before, .shoot-guide::after { content: ''; position: absolute; inset: 33.33% 0; border-top: 1px solid rgba(255, 255, 255, 0.18); border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.shoot-guide::after { inset: 0 33.33%; border: 0; border-left: 1px solid rgba(255, 255, 255, 0.18); border-right: 1px solid rgba(255, 255, 255, 0.18); }
.viewport:has(.shoot-panel.previewing) .shoot-guide::before, .viewport:has(.shoot-panel.previewing) .shoot-guide::after { display: none; }
.shoot-guide-label { position: absolute; top: 6px; right: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.8); text-shadow: 0 1px 2px #000; }
.shoot-guide-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4em; color: #fff; text-align: center; opacity: 0; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.38) 50%, transparent 70%); }
.shoot-guide-title b { font-size: clamp(16px, 4.5cqw, 44px); font-weight: 600; }
.shoot-guide-title span { font-size: clamp(11px, 2.2cqw, 22px); opacity: 0.9; }
.shoot-guide { container-type: inline-size; }
.shoot-guide-fade { position: absolute; inset: 0; background: #000; opacity: 0; }
.viewport.shooting .vp-hint, .viewport.shooting .vp-toolbar { display: none; }
.shoot-panel { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(23, 25, 32, 0.92); border: 1px solid var(--border); backdrop-filter: blur(8px); max-height: 60%; overflow: auto; }
.shoot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shoot-status { flex: 1; color: var(--muted); font-size: 12px; min-width: 160px; }
.shoot-shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.shoot-shot { flex: none; width: 172px; padding: 6px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; }
.shoot-shot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.shoot-shot-head .tool { padding: 1px 5px; font-size: 11px; min-width: 0; }
.shoot-shot canvas { display: block; margin: 0 auto; max-width: 160px; max-height: 90px; border-radius: 5px; cursor: pointer; background: #000; }
.shoot-shot-times { display: flex; gap: 8px; margin-top: 5px; color: var(--muted); }
.shoot-shot-times .inp { width: 46px; padding: 2px 4px; }
.shoot-add { flex: none; width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 9px; border: 1px dashed var(--border); background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.shoot-add b { font-size: 22px; line-height: 1; }
.shoot-add small { color: var(--muted); font-size: 11px; }
.shoot-add:hover { border-color: var(--accent, #e5303f); }
.shoot-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; color: var(--muted); }
.shoot-opts label { display: flex; align-items: center; gap: 5px; }
.shoot-opts .inp { width: 150px; }
.shoot-opts input[type=range] { width: 90px; }
.shoot-panel.previewing .shoot-shots, .shoot-panel.previewing .shoot-opts { display: none; }
.shoot-render { width: min(540px, calc(100% - 32px)); }
.shoot-render canvas { display: block; width: 100%; max-height: 50vh; object-fit: contain; border-radius: 8px; background: #000; margin-bottom: 10px; }
.shoot-bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.shoot-bar div { height: 100%; width: 0; background: var(--accent, #e5303f); transition: width 0.15s; }

/* Controller designer */
.ctrl-dialog { width: min(1100px, calc(100% - 32px)); }
.ctrl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 10px 0; }
.ctrl-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .ctrl-body { grid-template-columns: 1fr; } }
.ctrl-stage { position: relative; min-height: 320px; display: flex; align-items: center; justify-content: center; }
.ctrl-fit { position: relative; overflow: hidden; border-radius: 18px; border: 3px solid #2a2e38; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); background: #23303f; }
.ctrl-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: center / cover no-repeat #3a5068; overflow: hidden; }
.ctrl-frame .r8g-touch { display: block; }
.ctrl-frame [data-c] { cursor: grab; touch-action: none; }
.ctrl-frame [data-c].sel { outline: 3px solid #ffc93c; outline-offset: 3px; }
.ctrl-frame [data-c].dragging { cursor: grabbing; }
.ctrl-frame .r8g-tops .r8g-tb { pointer-events: none; opacity: 0.6; }
.ctrl-panel { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow: auto; }
.ctrl-row { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); font-size: 12px; cursor: pointer; }
.ctrl-row.sel { border-color: #ffc93c; }
.ctrl-row b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.ctrl-row .ctrl-fields { display: none; margin-top: 8px; gap: 6px; flex-direction: column; }
.ctrl-row.sel .ctrl-fields { display: flex; }
.ctrl-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ctrl-row label .inp { width: 90px; }
.ctrl-row input[type=range] { flex: 1; }
.ctrl-global { padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border); font-size: 12px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.ctrl-global label { display: flex; align-items: center; gap: 8px; }
.ctrl-global input[type=range] { flex: 1; }
.ctrl-btns { justify-content: flex-end; }
/* Race tracks list (Game settings → Race) */
.terrain-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.terrain-tools .btn.on { background: #ffc93c; color: #1a1300; border-color: #ffc93c; }
.terrain-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 2px 0 8px; }
.terrain-swatch { height: 38px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 3px; }
.terrain-swatch span { font-size: 9.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.terrain-swatch.on { border-color: #ffc93c; box-shadow: 0 0 0 2px rgba(255,201,60,.35); }
.terrain-real { display: flex; gap: 6px; }
.terrain-real .inp { flex: 1; min-width: 0; }
.tracks-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.track-row { display: grid; grid-template-columns: 18px 1fr 50px 26px; gap: 2px 6px; align-items: center; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; }
.track-row > .hint:last-child { grid-column: 2 / 5; }
.track-row.head { border: 0; background: none; padding: 0 6px; cursor: default; }
.track-row.on { border-color: #ffc93c; }
.track-row .inp { padding: 3px 6px; min-width: 0; }
.track-row .hint { font-size: 10.5px; white-space: nowrap; margin: 0; }

/* ---- Export for iOS ---- */
.ios-dialog { width: min(760px, calc(100% - 32px)); }
.ios-dialog > .hint { margin: 0 0 14px; line-height: 1.5; }
.ios-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.ios-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.ios-grid label small { font-size: 11.5px; color: var(--muted); opacity: 0.85; line-height: 1.35; }
.ios-grid .inp, .ios-grid .sel { width: 100%; box-sizing: border-box; color: var(--text); }
.ios-grid .inp.bad { border-color: #ff6b6b; }
.ios-icon { display: flex; gap: 16px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.ios-icon canvas { width: 112px; height: 112px; border-radius: 24px; flex: none; background: var(--surface-2); }
.ios-icon > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ios-icon .hint { margin: 0; font-size: 12px; }
.ios-radio { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.ios-radio small { color: var(--muted); }
.ios-notes { font-size: 12.5px; line-height: 1.45; margin-bottom: 10px; }
.ios-notes h4 { margin: 4px 0 6px; font-size: 13px; }
.ios-notes ul { margin: 0; padding-left: 18px; color: var(--muted); }
.ios-notes li { margin-bottom: 4px; }
.ios-notes li strong { color: var(--text); }
.ios-notes li.risk strong { color: #ffd27a; }
@media (max-width: 640px) { .ios-grid { grid-template-columns: 1fr; } .ios-icon { flex-direction: column; } }
