:root {
  --bg: #111013;
  --surface: #19181c;
  --surface-2: #201f24;
  --border: #2d2b32;
  --border-soft: #252329;
  --text: #e9e6e0;
  --muted: #a39f96;
  --faint: #7a766d;
  --accent: #e0a458;
  --accent-hover: #eab471;
  --accent-ink: #221703;
  --accent-soft: rgba(224, 164, 88, 0.12);
  --accent-border: rgba(224, 164, 88, 0.36);
  --danger: #e2786a;
  --danger-soft: rgba(226, 120, 106, 0.12);
  --danger-border: rgba(226, 120, 106, 0.32);
  --ok: #8fb87e;
  --ok-soft: rgba(143, 184, 126, 0.12);
  --ok-border: rgba(143, 184, 126, 0.32);
  --warn: #d9b45e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  --radius: 8px;
  --radius-lg: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(224, 164, 88, 0.28); }
* { scrollbar-width: thin; scrollbar-color: #35323a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #35323a; border-radius: 8px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 52px; padding: 0 24px; border-bottom: 1px solid var(--border-soft); background: rgba(17, 16, 19, 0.92); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; }
.brand-text strong { font-size: 13.5px; letter-spacing: -0.01em; }
.topnav { display: flex; gap: 2px; }
.topnav a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.active { color: var(--accent); background: var(--accent-soft); }

/* ---------- layout ---------- */
.page { width: min(1200px, calc(100% - 36px)); margin: 0 auto; padding: 26px 0 90px; }
.view { animation: rise 0.22s ease both; }
.hidden { display: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.page-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- basics ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; }
.badge.version { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); font-family: var(--mono); }
.badge.tag { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.badge.queued { color: var(--warn); background: rgba(217, 180, 94, 0.12); border: 1px solid rgba(217, 180, 94, 0.3); }
.badge.current { color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-border); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; }
.btn:hover { background: #26242b; border-color: #3a3740; }
.btn:active { box-shadow: none; }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--surface); border-color: var(--danger-border); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 30px; min-width: 30px; padding: 0; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.field { display: grid; gap: 5px; }
.field > span, .field-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #131217; color: var(--text); font-size: 12.5px; transition: border-color 0.12s, box-shadow 0.12s; }
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.hint { color: var(--faint); font-size: 11px; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-error { min-height: 16px; margin: 2px 0 0; color: var(--danger); font-size: 12px; }
.stack { display: grid; gap: 13px; }

.card { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.card-head .sub { color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.card-body { padding: 15px 16px; display: grid; gap: 12px; }

.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
.empty-note { display: grid; place-items: center; gap: 6px; padding: 36px 20px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); color: var(--faint); font-size: 12.5px; text-align: center; }
.empty-note h4 { margin: 0; color: var(--text); font-size: 13.5px; }
.empty-note ol { margin: 0; padding-left: 20px; text-align: left; color: var(--muted); display: grid; gap: 4px; }

/* ---------- catalog ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.product-grid .empty-note { grid-column: 1 / -1; }
.product-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); transition: border-color 0.15s; }
.product-card:hover { border-color: #3a3740; }
.product-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-card h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.product-card .desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; min-height: 40px; }
.product-card .links { display: flex; gap: 12px; margin-top: auto; padding-top: 8px; }
.link { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.link:hover { text-decoration: underline; }

.detail { margin-top: 22px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.detail-head h2 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head .sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; max-width: 640px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-body { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 22px; padding: 16px 20px 20px; }
.detail-body h4 { margin: 0 0 8px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.detail-body .desc { color: var(--muted); font-size: 12.5px; white-space: pre-wrap; margin: 0; }
.release-list { display: grid; gap: 8px; }
.release-item { padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface-2); }
.release-item .row { display: flex; align-items: baseline; gap: 8px; }
.release-item .ver { color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.release-item .date { color: var(--faint); font-size: 11px; }
.release-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.support-list { display: grid; gap: 6px; }
.support-list a { color: var(--accent); font-size: 12.5px; }

/* ---------- login ---------- */
.login-card { display: grid; place-items: center; min-height: 55vh; }
.login-inner { width: min(360px, 100%); display: grid; gap: 12px; padding: 28px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-inner h1 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.login-inner > p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- admin chrome ---------- */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.admin-head h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.admin-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; margin-bottom: 18px; padding: 3px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); width: fit-content; }
.tab { padding: 7px 16px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background 0.12s, color 0.12s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.stat small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; }
.stat strong { display: block; margin-top: 2px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { display: block; color: var(--faint); font-size: 11px; }
.stat strong.accent { color: var(--accent); }

/* ---------- products tab ---------- */
.products-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.list-col { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.list-col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; font-weight: 700; }
.product-list { display: grid; max-height: 560px; overflow: auto; }
.pl-item { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: none; border-left: 3px solid transparent; background: transparent; cursor: pointer; text-align: left; transition: background 0.12s; }
.pl-item:hover { background: var(--surface-2); }
.pl-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.pl-item strong { font-size: 12.5px; }
.pl-item small { color: var(--faint); font-size: 11px; display: flex; align-items: center; gap: 6px; }

.editor-pane { display: grid; gap: 13px; min-width: 0; }
.editor-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); flex-wrap: wrap; }
.editor-top h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-top .meta { margin: 3px 0 0; color: var(--faint); font-size: 11.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.editor-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.release-row-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface-2); }
.release-row-item .ver { color: var(--accent); font-family: var(--mono); font-size: 12.5px; font-weight: 700; }
.release-row-item .body { min-width: 0; }
.release-row-item .body p { margin: 3px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.release-row-item .date { color: var(--faint); font-size: 11px; white-space: nowrap; }
.link-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; }
.link-row input { min-height: 33px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #131217; color: var(--text); font-size: 12.5px; }
.link-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface-2); }
.kv .label { color: var(--text); font-size: 12px; font-weight: 650; }
.kv code { display: block; margin-top: 2px; color: var(--accent); font-family: var(--mono); font-size: 10.5px; overflow-wrap: anywhere; }
.kv .hint { display: block; margin-top: 2px; color: var(--faint); font-size: 10.5px; }
.kv .actions { display: flex; gap: 6px; flex-shrink: 0; }
details.adv { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
details.adv summary { padding: 10px 13px; color: var(--muted); font-size: 12.5px; font-weight: 650; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; border-radius: var(--radius); }
details.adv summary::before { content: "›"; display: inline-block; color: var(--faint); font-size: 15px; transition: transform 0.15s; }
details.adv[open] summary::before { transform: rotate(90deg); }
details.adv summary:hover { color: var(--text); background: var(--surface-2); }
.adv-body { display: grid; gap: 10px; padding: 4px 13px 13px; }

.editor-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-actions .spacer { flex: 1; }

/* ---------- switches / checks / meters ---------- */
.switch { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #3a3740; transition: background 0.15s; flex-shrink: 0; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c9c5bd; transition: transform 0.15s, background 0.15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--accent-ink); }
.switch:focus-visible .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 12.5px; font-weight: 600; }
.switch-sub { display: block; color: var(--faint); font-size: 11px; font-weight: 400; }

.check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 12.5px; }
.check:hover { border-color: #3a3740; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.check:has(input:disabled) { opacity: 0.5; cursor: default; }

.version-bumps { display: flex; gap: 6px; margin-top: 6px; }
.bump-btn { padding: 4px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 600; cursor: pointer; }
.bump-btn:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.token-chip { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 11.5px; cursor: pointer; }
.token-chip:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.byte-meter { display: flex; align-items: center; gap: 10px; }
.byte-bar { flex: 1; height: 6px; border-radius: 999px; background: #2b2930; overflow: hidden; }
.byte-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.2s, background 0.2s; }
.byte-bar i.warn { background: var(--warn); }
.byte-bar i.over { background: var(--danger); }
.byte-meter span { color: var(--faint); font-size: 10.5px; font-family: var(--mono); white-space: nowrap; }

/* ---------- customers tab ---------- */
.table-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 11px; flex-wrap: wrap; }
.table-toolbar select, .table-toolbar input { min-height: 33px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #131217; color: var(--text); font-size: 12.5px; }
.table-toolbar input { flex: 1; min-width: 200px; }
.table-toolbar input:focus, .table-toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.ctable { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.thead, .crow { display: grid; grid-template-columns: 38px minmax(0, 1.5fr) minmax(0, 1fr) 60px minmax(0, 1fr) 120px; gap: 10px; align-items: center; padding: 0 14px; }
.thead { height: 36px; background: var(--surface-2); color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.crow { min-height: 48px; border-top: 1px solid var(--border-soft); cursor: pointer; transition: background 0.1s; }
.crow:hover { background: var(--surface-2); }
.crow.selected { background: var(--accent-soft); }
.crow input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.cust-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; font-size: 10.5px; font-weight: 800; color: #17161a; flex-shrink: 0; }
.cust-id .names { min-width: 0; }
.cust-id strong { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-id small { display: block; color: var(--faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.ccell { color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccell .tagline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.bulkbar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; width: fit-content; margin: 14px auto 0; padding: 8px; padding-left: 15px; border-radius: 999px; background: #242228; border: 1px solid #383540; color: var(--text); box-shadow: var(--shadow-lg); animation: rise 0.18s ease both; }
.bulkbar .count { font-size: 12.5px; font-weight: 700; margin-right: 2px; }
.bulkbar .btn.ghost { color: var(--faint); }

/* ---------- in-world tab ---------- */
.inworld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent); font-size: 11px; font-weight: 800; flex-shrink: 0; }
.step .txt { color: var(--muted); font-size: 12.5px; min-width: 0; }
.step .txt b { color: var(--text); }
.script-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border-soft); }
.script-row:first-of-type { border-top: none; padding-top: 2px; }
.script-row .info { min-width: 0; flex: 1; }
.script-row strong { display: block; font-size: 13px; }
.script-row small { display: block; color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }

.dropzone { display: grid; place-items: center; gap: 5px; padding: 24px 16px; border: 1.5px dashed #3f3c45; border-radius: var(--radius); background: var(--surface); color: var(--faint); font-size: 12.5px; cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone .dz-icon { font-size: 20px; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 10, 0.6); backdrop-filter: blur(3px); animation: fade 0.14s ease both; }
.modal { width: min(540px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; border-radius: 14px; background: #1c1b20; border: 1px solid #2e2c33; box-shadow: var(--shadow-lg); animation: pop 0.16s ease both; }
.modal.wide { width: min(1120px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 20px 13px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.modal-head .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.modal-x { display: grid; place-items: center; width: 28px; height: 28px; border: none; border-radius: 7px; background: transparent; color: var(--faint); font-size: 15px; cursor: pointer; flex-shrink: 0; }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 17px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal.release-modal { max-height: min(92vh, 980px); }
.modal.release-modal .modal-body { padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr); }
.release-compose { padding: 17px 20px; overflow-y: auto; display: grid; gap: 13px; align-content: start; border-right: 1px solid var(--border-soft); }
.release-side { padding: 17px 20px; overflow-y: auto; display: grid; gap: 12px; align-content: start; background: #17161a; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--border-soft); }
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.98) translateY(6px); } to { opacity: 1; transform: none; } }

.section-label { color: var(--faint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 8px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.chat-bubble { padding: 11px 13px; border: 1px solid var(--border-soft); border-radius: 4px 12px 12px 12px; background: var(--surface-2); color: var(--text); font-size: 12.5px; white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: var(--radius); background: #1c1b20; box-shadow: var(--shadow-lg); font-size: 12.5px; animation: rise 0.18s ease both; }
.toast.error { border-left-color: var(--danger); }
.toast .t-icon { flex-shrink: 0; margin-top: 1px; }
.toast .t-icon svg { width: 14px; height: 14px; display: block; }
.toast.ok .t-icon { color: var(--ok); }
.toast.error .t-icon { color: var(--danger); }

@media (max-width: 1020px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .inworld-grid { grid-template-columns: 1fr; }
  .modal.release-modal .modal-body { grid-template-columns: 1fr; }
  .release-compose { border-right: none; border-bottom: 1px solid var(--border-soft); }
}
@media (max-width: 760px) {
  .page { width: calc(100% - 24px); }
  .topbar { padding: 0 14px; }
  .product-grid { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }
  .product-list { max-height: 220px; }
  .field-row { grid-template-columns: 1fr; }
  .detail-body { grid-template-columns: 1fr; }
  .thead, .crow { grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, 1fr) 90px; }
  .thead > :nth-child(5), .crow > :nth-child(5) { display: none; }
  .link-row { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
}
