/* Studio styles: game-core pages (overview, settings, files, math). Owned by that page group; shared styles live in ../studio.css.
   Geometry from docs/studio-reference/dom/{10,12,13,15,20,21,55,56}-*.dom.txt and the 10-05 audit screens. */

/* ---------------------------------------------------------------- dialogs (dom/55, dom/56: 18px/18px w600 title, 6px gap, 36px round close) */
.dialog.gc-dlg .dialog-head { gap: 6px; padding-right: 36px; }
.dialog.gc-dlg .dialog-title { font-weight: 600; line-height: 1.15; }
.gc-note { font-size: 13px; line-height: 18px; }

/* ---------------------------------------------------------------- Files */
.gc-files { gap: 40px; }
.gc-search { height: 36px; font-size: 14px; }
.gc-search::-webkit-search-cancel-button { filter: invert(.6); }
.gc-stream { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gc-stream-head { display: flex; align-items: baseline; gap: 12px; }
.gc-stream-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.gc-stream-empty { margin: 0; }
.gc-files .empty { border: 0; min-height: 220px; }
.gc-files-table { table-layout: fixed; min-width: 520px; }
.gc-files-table th { padding: 0 16px; }
.gc-files-table th:first-child { padding-left: 20px; }
.gc-files-table th.gc-dl { width: 64px; padding: 0 20px 0 16px; }
.gc-files-table td { height: 56px; padding: 0 16px; }
.gc-files-table td:first-child { padding-left: 20px; }
.gc-files-table td:last-child { padding: 0 20px 0 0; }
.gc-files-table .gc-type, .gc-files-table .gc-size { width: 112px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-files-table td.gc-type, .gc-files-table td.gc-size { color: var(--muted-foreground); }
.gc-files-table .gc-dl { width: 64px; }
.gc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gc-path { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gc-file-icon, .gc-thumb { width: 32px; height: 32px; border-radius: 6px; flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.gc-file-icon { background: var(--chip-bg); color: var(--muted-foreground); }
.gc-thumb { background: var(--background); }
.gc-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Import files (dom/55: two 221×48 outline pills, 18px w700) */
.gc-import-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gc-import-btn { height: 48px; font-size: 16px; line-height: 24px; padding: 0 24px; }

/* Publish new version (audit 101-publish-dialog.png) */
.gc-publish-rows { display: flex; flex-direction: column; gap: 8px; }
.gc-publish-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; cursor: pointer; }
.gc-publish-row.on { background: var(--secondary); }
.gc-publish-row.off { opacity: .45; cursor: not-allowed; }
.gc-publish-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.gc-publish-status { display: block; color: var(--muted-foreground); font-size: 14px; }
.gc-checkbox { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0; border-radius: 5px; border: 1px solid var(--control-border); background: var(--input-bg); display: inline-grid; place-content: center; cursor: inherit; }
.gc-checkbox:checked { background: var(--primary); border-color: var(--primary); }
.gc-checkbox:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--primary-foreground); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.gc-checkbox:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Share (dom/56: Front/Math 162×40 selects + 114×40 "Create link", labels 16px/16px w500) */
.gc-share-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.gc-share-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gc-share-label { font-size: 14px; line-height: 16px; font-weight: 500; }
.gc-share-form .select-trigger { font-size: 14px; padding: 8px 12px; }
.gc-share-new { border: 1px solid var(--success); background: var(--success-tint-12); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.gc-share-new-head { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 18px; }
.gc-share-new-head .icon { margin-top: 2px; }
.gc-share-url-row { display: flex; gap: 8px; align-items: center; }
.gc-share-url { height: 32px; font-family: var(--font-mono); font-size: 12px; }
.gc-share-list { display: flex; flex-direction: column; gap: 6px; }
.gc-share-list-title { font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.gc-share-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.gc-share-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 12px; border-radius: 10px; background: var(--input-bg); }
.gc-share-item > .icon { color: var(--muted-foreground); }
.gc-share-ver { display: block; font-weight: 600; font-size: 14px; }
.gc-share-meta { display: block; font-size: 12px; }
.gc-share-del:hover { color: var(--danger); }

/* ---------------------------------------------------------------- jobs panel (audit 100/102/104: 380px card, bottom-right) */
.gc-jobs {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 100px);
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); animation: popover-in .14s var(--ease-brand-out); font-size: 14px;
}
.gc-jobs-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.gc-jobs-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 20px; }
.gc-jobs-btn { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--foreground); }
.gc-jobs-btn:hover { background: var(--secondary); }
.gc-jobs-body { overflow-y: auto; min-height: 0; }
.gc-jobs-list { list-style: none; margin: 0; padding: 0; }
.gc-jobs-list > li + li { border-top: 1px solid var(--border); }
.gc-job-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.gc-job-icon { color: var(--muted-foreground); padding-top: 3px; display: inline-flex; }
.gc-job-title { font-weight: 600; font-size: 14px; line-height: 20px; }
.gc-job-line { color: var(--muted-foreground); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.gc-job-line.danger { color: var(--danger); }
.gc-job-state { display: inline-flex; padding-top: 3px; color: var(--muted-foreground); }
.gc-job-state.done { color: var(--success); }
.gc-job-state.failed { color: var(--danger); }
.gc-review-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.gc-review-counts { font-size: 13px; line-height: 18px; }
.gc-review-list { list-style: none; margin: 0; padding: 4px 0; background: var(--background); border-radius: 10px; max-height: 240px; overflow-y: auto; }
.gc-review-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: 13px; }
.gc-review-item + .gc-review-item { border-top: 1px solid var(--hairline); }
.gc-review-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-review-size { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }
.gc-badge { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.gc-badge-upload { background: var(--primary-tint-12); color: var(--primary-300); }
.gc-badge-move { background: var(--warning-tint-12); color: var(--warning); }
.gc-badge-delete { background: var(--danger-tint-12); color: var(--danger); }
.gc-badge-skip { background: var(--secondary); color: var(--muted-foreground); }
.gc-review-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gc-review-foot .btn-sm { height: 30px; padding: 0 11px; }
.gc-check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

@media (max-width: 767px) {
  .gc-files-table { min-width: 0; }
  .gc-files-table .gc-type, .gc-files-table .gc-dl { display: none; }
  .gc-files-table td:nth-child(3) { padding-right: 16px; }
  .gc-import-choices { grid-template-columns: 1fr; }
  .gc-share-form { grid-template-columns: 1fr 1fr; }
  .gc-share-create { grid-column: 1 / -1; }
  .gc-jobs { right: 16px; bottom: 16px; }
}

/* ---------------------------------------------------------------- Overview (dom/10: three 281×284 cards, values all at the same height) */
.gc-head .page-head-row { flex-wrap: wrap; }
.gc-head .page-title { flex: 1 0 auto; max-width: 100%; }
.gc-head .page-actions { flex-wrap: wrap; }
.gc-stats-wrap { container-type: inline-size; }
.gc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gc-stats .chart-axis { gap: 8px; }
.gc-stats .chart-axis span:last-child { text-align: right; }
@container (max-width: 420px) { .gc-stats { grid-template-columns: minmax(0, 1fr); } }
.gc-stats .stat-card.profit .stat-value { margin-top: 0; margin-bottom: 0; }

/* ---------------------------------------------------------------- Settings (dom/15: 672px form, 40px inputs, 16px/16px w500 labels) */
.gc-settings { gap: 0; }
.gc-settings-form { width: 672px; max-width: 100%; display: flex; flex-direction: column; gap: 24px; }
.gc-field { display: flex; flex-direction: column; gap: 6px; min-height: 72px; }
.gc-label { font-size: 14px; line-height: 16px; font-weight: 500; padding-top: 1px; }
.gc-input { height: 40px; font-size: 14px; padding: 8px 12px; }
.gc-input:disabled { opacity: .6; cursor: not-allowed; }
.gc-settings-actions { display: flex; justify-content: flex-end; }
.gc-danger { width: 672px; max-width: 100%; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gc-danger-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--danger); }
.gc-danger p { margin-top: 4px; }
.gc-delete { color: var(--background); }

/* ---------------------------------------------------------------- Math (dom/20-stb-math-v2.dom.txt, dom/21-stb-math-v1.dom.txt) */
.gc-math { gap: 24px; }
.gc-math-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gc-math-sec + .gc-math-sec { margin-top: 8px; }
.gc-sec-title {
  position: relative; display: flex; align-items: center; gap: 8px; padding-left: 12px; font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .1em;
}
.gc-sec-title::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--primary); }
.gc-h3 { margin: 0; }
.gc-valid { display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.gc-valid.ok, .gc-ok-text, .gc-score.ok, .gc-check.ok { color: var(--success); }
.gc-valid.bad, .gc-bad-text, .gc-score.bad, .gc-check.bad, .gc-blocking { color: var(--danger); }
.gc-version { width: 192px; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; color: var(--muted-foreground); font-size: 14px; }
.gc-version:hover { color: var(--foreground); }
.gc-version .icon { color: var(--muted-foreground); }
.gc-opt-title { display: block; }
.gc-opt-sub { display: block; font-size: 12px; color: var(--muted-foreground); }

.gc-ctable { min-width: 560px; }
.gc-chead, .gc-crow-btn, .gc-crow-mode { display: grid; grid-template-columns: minmax(0, 1fr) 192px 192px; gap: 8px; }
.gc-chead { padding: 0 12px 8px; border-bottom: 1px solid var(--hairline); align-items: end; }
.gc-chead-label { font-size: 13px; line-height: 18px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .1em; }
.gc-star { font-size: 14px; line-height: 20px; font-weight: 600; }
.gc-star-sub { font-size: 11px; line-height: 16px; color: var(--muted-foreground); }
.gc-crow { border-bottom: 1px solid var(--hairline); }
.gc-crow:last-child { border-bottom: 0; }
.gc-crow-btn { width: 100%; padding: 10px 12px; text-align: left; align-items: center; border-radius: 8px; }
.gc-crow-btn:hover { background: var(--grey-850); }
.gc-crow-name { display: flex; align-items: center; gap: 6px; font-weight: 500; min-width: 0; }
.gc-chev { display: inline-flex; color: var(--muted-foreground); transition: transform .14s; }
.gc-chev.open { transform: rotate(90deg); }
.gc-gauge { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); white-space: nowrap; min-width: 0; }
.gc-gauge-v { font-size: 13px; line-height: 18px; color: var(--foreground); }
.gc-gauge-l { font-size: 10px; line-height: 15px; color: var(--muted-foreground); }
.gc-check { display: inline-flex; flex: none; }
.gc-crow-detail { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.gc-crow-mode { padding: 6px 0 6px 20px; align-items: center; font-size: 13px; border-top: 1px dashed var(--hairline); }
.gc-crow-mode-name { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gc-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.gc-mode { text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .14s, background .14s; }
.gc-mode:hover { background: var(--grey-800); }
.gc-mode.selected { box-shadow: inset 0 0 0 1.5px var(--primary); }
.gc-mode-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.gc-mode-id { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.gc-mode-name { font-weight: 700; font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gc-pill { display: inline-flex; align-items: center; height: 26px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; line-height: 18px; font-weight: 600; }
.gc-vol { display: inline-flex; align-items: center; height: 26px; padding: 2px 8px; border-radius: 999px; font-size: 13px; line-height: 18px; font-weight: 600; flex: none; }
.gc-vol.low { color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.gc-vol.high { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.gc-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.gc-k { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.gc-v { font-size: 14px; line-height: 20px; font-weight: 600; }

.gc-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.gc-card-head { display: flex; align-items: center; gap: 8px; padding: 24px 24px 8px; }
.gc-card-head .gc-sec-title { flex: 1; min-width: 0; }
.gc-card-body { padding: 24px; margin: 0; }
.gc-small { font-size: 13px; line-height: 18px; }
.gc-math-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.gc-metrics { display: flex; flex-direction: column; gap: 20px; }
.gc-volrow { display: flex; align-items: center; gap: 8px; }
.gc-volnum { font-size: 16px; line-height: 24px; font-weight: 700; }
.gc-volbar { position: relative; height: 8px; margin-top: 8px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--success) 55%, transparent), color-mix(in srgb, var(--warning) 55%, transparent) 55%, color-mix(in srgb, var(--danger) 55%, transparent)); }
.gc-volbar span { position: absolute; top: 0; width: 6px; height: 8px; border-radius: 999px; background: var(--foreground); }
.gc-tiles { display: grid; gap: 8px; }
.gc-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gc-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gc-tile { background: var(--secondary); border-radius: 8px; padding: 12px; min-width: 0; }
.gc-tile-v { font-size: 14px; line-height: 20px; font-weight: 700; margin-top: 4px; }
.gc-breakdown { display: flex; flex-direction: column; gap: 8px; }
.gc-bdbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--secondary); }
.gc-seg.dead, .gc-dot.dead { background: color-mix(in srgb, var(--danger) 70%, transparent); }
.gc-seg.sub, .gc-dot.sub { background: color-mix(in srgb, var(--warning) 70%, transparent); }
.gc-seg.win, .gc-dot.win { background: color-mix(in srgb, var(--success) 70%, transparent); }
.gc-bdlegend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }
.gc-bdlegend span { display: inline-flex; align-items: center; gap: 4px; }
.gc-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.gc-score { font-size: 14px; line-height: 20px; font-weight: 500; }
.gc-checks { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.gc-checkrow { display: flex; gap: 12px; align-items: flex-start; }
.gc-checkrow .gc-check { margin-top: 2px; }
.gc-check-title { font-weight: 500; }
.gc-expect { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 13px; line-height: 18px; }
.gc-expect .gc-ok-text, .gc-expect .gc-bad-text { font-weight: 500; }
.gc-blocking { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.gc-critical .gc-card-body { display: flex; flex-direction: column; gap: 16px; }
.gc-fail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.gc-fail { display: flex; gap: 12px; align-items: flex-start; }
.gc-fail .gc-check { margin-top: 2px; }
.gc-fail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-fail-title { font-weight: 500; }
.gc-mode-tag { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 10px; line-height: 15px; font-weight: 600; color: var(--muted-foreground); }
.gc-fail-vals { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; line-height: 18px; }
.gc-fail-vals .gc-bad-text { font-weight: 500; }
.gc-dtable-wrap { border-radius: 8px; overflow: hidden; }
.gc-dtable { width: 100%; border-collapse: collapse; }
.gc-dtable th { background: var(--secondary); text-align: left; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted-foreground); padding: 12px 24px; white-space: nowrap; }
.gc-dtable td { padding: 12px 24px; font-size: 14px; line-height: 20px; border-top: 1px solid var(--hairline); white-space: nowrap; }
.gc-dtable tbody tr:nth-child(odd) td { background: var(--background); }
.gc-dtable tbody tr:nth-child(even) td { background: var(--muted-50); }
.gc-dtable td.gc-pink { color: var(--primary); font-weight: 500; }
.gc-stable td { white-space: normal; }
.gc-stable td:last-child, .gc-stable th:last-child { width: 195px; }
.gc-cbar { height: 12px; margin-top: 4px; border-radius: 999px; background: var(--secondary); overflow: hidden; min-width: 120px; }
.gc-cbar span { display: block; height: 100%; }

@media (max-width: 767px) {
  .gc-tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gc-version { width: 160px; }
  .gc-card-head, .gc-card-body { padding-left: 16px; padding-right: 16px; }
  .gc-dtable th, .gc-dtable td { padding: 10px 14px; }
}
