:root {
  color-scheme: dark;
  --ink: #0c1110;
  --ink-2: #121a17;
  --ink-3: #1a2520;
  --panel: rgba(24, 34, 30, .86);
  --panel-solid: #18221e;
  --line: rgba(230, 220, 187, .12);
  --line-strong: rgba(230, 220, 187, .24);
  --ivory: #f3efe3;
  --muted: #9baaa3;
  --emerald: #37c98b;
  --emerald-soft: rgba(55, 201, 139, .13);
  --gold: #d7bd77;
  --gold-soft: rgba(215, 189, 119, .12);
  --red: #ef7169;
  --blue: #6ca7df;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 18px;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--ink); color: var(--ivory); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; overflow: hidden; position: relative; background: radial-gradient(circle at 30% 20%, #234b3b 0, transparent 30%), linear-gradient(145deg, #09100d 15%, #14241d 58%, #0a0f0d 100%); }
.login-shell::before { content: ""; position: absolute; inset: 0; opacity: .23; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.login-ambient { position: absolute; border-radius: 50%; filter: blur(8px); opacity: .42; }
.login-ambient--one { width: 430px; height: 430px; background: rgba(43, 173, 116, .2); top: -220px; right: 8%; }
.login-ambient--two { width: 300px; height: 300px; background: rgba(215, 189, 119, .11); bottom: -150px; left: 12%; }
.login-card { position: relative; width: min(510px, calc(100vw - 48px)); padding: 42px 46px 34px; border: 1px solid var(--line-strong); border-radius: 28px; background: linear-gradient(155deg, rgba(29, 43, 36, .94), rgba(13, 20, 17, .96)); box-shadow: 0 40px 120px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.05); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(215,189,119,.55); border-radius: 14px; color: var(--gold); font-family: Georgia, serif; font-weight: 700; background: radial-gradient(circle at 35% 25%, #29493c, #101813 68%); box-shadow: inset 0 0 18px rgba(215,189,119,.08); }
.brand-lockup div { display: flex; flex-direction: column; gap: 3px; }
.brand-lockup strong { letter-spacing: .02em; font-size: 18px; }
.brand-lockup div span { color: var(--gold); font-size: 9px; letter-spacing: .3em; }
.login-copy { margin: 48px 0 32px; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: .22em; font-weight: 800; margin: 0 0 12px; }
.login-copy h1 { font-size: 30px; line-height: 1.3; letter-spacing: -.035em; margin: 0 0 13px; }
.login-copy > p:last-child { color: var(--muted); margin: 0; font-size: 14px; }
.login-form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #bdc8c2; font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; color: var(--ivory); background: rgba(6, 11, 9, .58); border: 1px solid var(--line-strong); border-radius: 11px; outline: none; padding: 12px 13px; transition: border-color .16s, box-shadow .16s, background .16s; }
input:focus, select:focus, textarea:focus { border-color: rgba(55,201,139,.62); box-shadow: 0 0 0 3px rgba(55,201,139,.11); background: rgba(8,14,11,.8); }
small { color: #77877f; font-weight: 500; }
.form-error { color: #ff928b; font-size: 12px; min-height: 16px; margin: 0; }
.login-foot { margin: 25px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: #718078; text-align: center; font-size: 10px; letter-spacing: .04em; }

.button { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 750; font-size: 12px; transition: transform .15s, background .15s, border-color .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button--wide { width: 100%; min-height: 46px; }
.button--primary { color: #07120d; background: linear-gradient(135deg, #56daa0, #2dba7f); box-shadow: 0 8px 24px rgba(42,184,123,.18); }
.button--ghost { background: rgba(255,255,255,.025); border-color: var(--line-strong); color: #d8ded9; }
.button--danger { background: rgba(239,113,105,.11); border-color: rgba(239,113,105,.35); color: #ff9b95; }
.button--small { min-height: 32px; border-radius: 9px; padding: 0 11px; font-size: 11px; }
.icon-button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 20px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; background: radial-gradient(circle at 85% 0, rgba(44,101,76,.14), transparent 28%), #0e1412; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 18px 18px; background: rgba(10,16,13,.92); border-right: 1px solid var(--line); }
.brand-lockup--compact { padding: 0 8px 25px; }
.brand-lockup--compact .brand-mark { width: 39px; height: 39px; border-radius: 12px; font-size: 13px; }
.nav-list { display: grid; gap: 5px; margin-top: 18px; overflow-y: auto; scrollbar-width: thin; }
.nav-section { padding: 0 13px 5px; color: #596861; font-size: 8px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.nav-section--spaced { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #84928b; cursor: pointer; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: #d8dfda; background: rgba(255,255,255,.025); }
.nav-item.is-active { color: #eaf3ed; border-color: rgba(55,201,139,.17); background: linear-gradient(90deg, rgba(55,201,139,.14), rgba(55,201,139,.035)); }
.nav-icon { width: 19px; color: var(--emerald); text-align: center; }
.sidebar-note { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.sidebar-note div, .operator-card div { min-width: 0; display: grid; gap: 3px; }
.sidebar-note strong, .operator-card strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-note span:not(.live-dot), .operator-card div span { color: #75847c; font-size: 9px; }
.live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.operator-card { display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 9px; margin-top: 10px; padding: 11px 9px; }
.operator-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(215,189,119,.2); font-weight: 850; }

.workspace { min-width: 0; }
.topbar { min-height: 105px; display: flex; align-items: center; justify-content: space-between; padding: 24px 34px; border-bottom: 1px solid var(--line); background: rgba(14,20,18,.68); backdrop-filter: blur(14px); }
.breadcrumb { margin: 0 0 7px; color: #75827c; font-size: 10px; letter-spacing: .06em; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.topbar-actions { display: flex; gap: 9px; }
.content { padding: 30px 34px 50px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { position: relative; overflow: hidden; padding: 19px; min-height: 108px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(27,39,34,.86), rgba(18,27,23,.72)); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.metric::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; top: -52px; right: -35px; background: var(--emerald-soft); }
.metric--danger { border-color: rgba(239,113,105,.25); background: linear-gradient(145deg, rgba(57,31,28,.78), rgba(26,23,21,.76)); }
.metric--danger::after { background: rgba(239,113,105,.12); }
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 13px; font-size: 26px; letter-spacing: -.03em; }
.metric small { display: block; margin-top: 3px; color: #718079; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 14px 44px rgba(0,0,0,.12); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.search { width: 230px; min-height: 36px; padding: 8px 12px; }
.table-wrap { overflow: auto; }
.table-wrap table { min-width: 900px; }
.table-wrap .data-table { min-width: 980px; }
table { width: 100%; border-collapse: collapse; }
th { color: #718078; font-size: 9px; letter-spacing: .1em; text-align: left; padding: 12px 16px; background: rgba(0,0,0,.1); }
td { padding: 14px 16px; border-top: 1px solid rgba(230,220,187,.07); font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: rgba(55,201,139,.035); }
.data-table tbody tr { cursor: default; }
.cell-sub { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.muted, .legend { color: var(--muted); font-size: 10px; }
.legend { display: flex; align-items: center; gap: 8px; }
.action-cell { white-space: nowrap; }
.action-cell .button + .button { margin-left: 5px; }
.game-title { display: flex; align-items: center; gap: 11px; }
.game-glyph { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--gold); background: radial-gradient(circle at 35% 20%, #2c4c3e, #111a16 72%); border: 1px solid var(--line-strong); font-family: Georgia, serif; }
.game-title strong { display: block; font-size: 12px; }
.game-title span { color: var(--muted); font-size: 10px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; color: #9caf9f; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #829189; }
.status--ACTIVE { color: #70e3af; background: rgba(55,201,139,.09); border-color: rgba(55,201,139,.2); }
.status--ACTIVE::before { background: var(--emerald); }
.status--QA, .status--SIMULATED { color: #8bbcea; background: rgba(108,167,223,.09); border-color: rgba(108,167,223,.2); }
.status--QA::before, .status--SIMULATED::before { background: var(--blue); }
.status--MAINTENANCE, .status--RETIRED { color: #dfa895; }
.status--DRAFT { color: #d8c383; }
.status--ASSET-READY { color: #70e3af; background: rgba(55,201,139,.09); border-color: rgba(55,201,139,.2); }
.status--ASSET-READY::before { background: var(--emerald); }
.status--ASSET-INCOMPLETE { color: #d8c383; background: rgba(215,189,119,.08); border-color: rgba(215,189,119,.18); }
.status--ASSET-INCOMPLETE::before { background: var(--gold); }
.status--ASSET-INVALID { color: #ff9b95; background: rgba(239,113,105,.09); border-color: rgba(239,113,105,.22); }
.status--ASSET-INVALID::before { background: var(--red); }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ivory); margin-bottom: 7px; }

.detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(120deg, rgba(38,72,57,.52), rgba(20,29,25,.82)); }
.detail-title { display: flex; align-items: center; gap: 15px; }
.detail-title .game-glyph { width: 52px; height: 52px; font-size: 16px; }
.detail-title h2 { margin: 0 0 5px; font-size: 20px; }
.detail-title p { margin: 0; color: var(--muted); font-size: 11px; }
.detail-actions { display: flex; gap: 8px; }
.tabs { display: flex; gap: 2px; padding: 0 5px; border-bottom: 1px solid var(--line); }
.tab { padding: 14px 15px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7f8d86; font-size: 11px; font-weight: 750; cursor: pointer; }
.tab.is-active { color: var(--ivory); border-bottom-color: var(--emerald); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; }
.section-body { padding: 18px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.kv { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.1); }
.kv span { color: var(--muted); font-size: 9px; }
.kv strong { display: block; margin-top: 6px; font-size: 12px; }
.config-list { display: grid; gap: 9px; }
.config-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.11); }
.config-card__top { display: flex; justify-content: space-between; align-items: center; }
.config-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.config-card__stats div { padding: 8px; border-radius: 8px; background: rgba(255,255,255,.025); }
.config-card__stats span { display: block; color: var(--muted); font-size: 8px; }
.config-card__stats strong { display: block; margin-top: 4px; font-size: 10px; }
.config-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 17px 21px; border-left: 1px solid var(--line-strong); }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; left: -4px; top: 4px; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.timeline-item strong { font-size: 10px; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.editor { min-height: 390px; resize: vertical; font: 11px/1.55 "SFMono-Regular", Consolas, monospace; tab-size: 2; }
.editor-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 11px; }
.visual-editor { min-height: 130px; }
.symbol-frequency { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.symbol-frequency span { display: flex; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(0,0,0,.1); font-size: 8px; }
.symbol-frequency strong { color: var(--ivory); }
.advanced-editor { margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.1); }
.advanced-editor summary { color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 750; }
.advanced-editor .editor { width: 100%; margin-top: 12px; }
.math-spin-result { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(260px,1fr); gap: 14px; margin-top: 14px; }
.math-spin-board { display: grid; gap: 5px; padding: 9px; border: 1px solid rgba(215,189,119,.3); border-radius: 11px; background: rgba(0,0,0,.2); }
.math-spin-cell { min-height: 42px; display: grid; place-items: center; border-radius: 7px; color: #dbece4; background: rgba(37,75,61,.72); font: 9px "SFMono-Regular", Consolas, monospace; }

.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.asset-card { display: grid; gap: 15px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(26,38,33,.88), rgba(17,25,22,.78)); box-shadow: 0 14px 44px rgba(0,0,0,.12); }
.asset-card header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.asset-card h2 { margin: 0; font-size: 16px; }
.asset-card .eyebrow { margin-bottom: 6px; }
.asset-card footer { align-self: end; }
.asset-spec { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 0; }
.asset-spec div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.1); }
.asset-spec dt { color: var(--muted); font-size: 8px; }
.asset-spec dd { margin: 5px 0 0; overflow: hidden; color: var(--ivory); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.asset-warning, .asset-ready { display: grid; gap: 4px; padding: 11px 12px; border-radius: 10px; color: #d9c998; background: rgba(215,189,119,.08); border: 1px solid rgba(215,189,119,.17); font-size: 9px; }
.asset-warning--danger { color: #ffaaa4; background: rgba(239,113,105,.08); border-color: rgba(239,113,105,.18); }
.asset-ready { color: #8ddfba; background: rgba(55,201,139,.07); border-color: rgba(55,201,139,.17); }
.asset-warning span, .asset-ready span { color: var(--muted); }
.asset-workspace { display: grid; gap: 16px; }
.asset-upload-panel .section-body { padding-top: 4px; }
.asset-source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; padding: 18px; }
.asset-source-grid > .empty-state { grid-column: 1 / -1; }
.asset-source-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.13); }
.asset-source-card img { width: 100%; height: 150px; display: block; object-fit: contain; background: radial-gradient(circle, rgba(55,201,139,.08), rgba(0,0,0,.23)); }
.asset-source-card__body { display: grid; gap: 8px; padding: 12px; }
.asset-source-card__body > div { display: flex; align-items: center; gap: 8px; }
.asset-source-card__body strong { font-size: 10px; }
.asset-source-card__body p, .asset-source-card__body small { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.asset-source-card__body code { overflow: hidden; color: #a8d8c1; font: 8px/1.5 "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.content-preview-grid { display: grid; grid-template-columns: 220px minmax(320px, .8fr) minmax(360px, 1fr); gap: 14px; padding: 18px; }
.catalog-preview, .hero-preview, .slot-preview { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background-color: #08110e; }
.catalog-preview { padding: 10px; }
.catalog-preview__art { height: 126px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); }
.catalog-preview__art img { width: 100%; height: 100%; object-fit: cover; }
.catalog-preview strong, .catalog-preview small { display: block; margin-top: 9px; }
.catalog-preview small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.hero-preview { min-height: 188px; display: grid; align-content: end; padding: 18px; background-position: center; background-size: cover; }
.hero-preview span, .hero-preview small { color: #aab8b0; font-size: 8px; }
.hero-preview strong { margin: 6px 0; font-size: 18px; }
.slot-preview { min-height: 188px; display: grid; place-items: center; padding: 16px; background-position: center; background-size: cover; }
.slot-preview-board { width: min(100%, 420px); display: grid; gap: 4px; padding: 8px; border: 2px solid rgba(215,189,119,.62); border-radius: 12px; background: rgba(3,11,9,.72); }
.slot-preview-cell { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: rgba(26,52,43,.88); }
.slot-preview-cell img { width: 90%; height: 90%; object-fit: contain; }
.slot-preview-cell span { color: var(--muted); font-size: 12px; }

.section-tabs { display: flex; gap: 4px; padding: 0 19px; border-bottom: 1px solid var(--line); }
.section-tab { position: relative; padding: 12px 10px 11px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 10px; font-weight: 760; }
.section-tab span { margin-left: 5px; padding: 2px 6px; border-radius: 8px; color: #83928a; background: rgba(255,255,255,.045); font-size: 8px; }
.section-tab::after { content: ''; position: absolute; right: 9px; bottom: -1px; left: 9px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.section-tab.is-active { color: var(--ivory); }
.section-tab.is-active::after { background: var(--emerald); box-shadow: 0 0 8px rgba(55,201,139,.35); }
.flag-list { display: grid; }
.flag-row { display: grid; grid-template-columns: minmax(260px,.9fr) minmax(320px,1.4fr) 88px; align-items: center; gap: 20px; padding: 15px 19px; border-top: 1px solid var(--line); }
.flag-row:first-child { border-top: 0; }
.flag-row.is-disabled { background: rgba(239,113,105,.025); }
.flag-state { display: flex; align-items: center; gap: 11px; }
.flag-state > div { display: grid; gap: 4px; }
.flag-state strong { font-size: 11px; }
.signal { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.signal.is-on { background: var(--emerald); box-shadow: 0 0 11px rgba(55,201,139,.6); }
.signal.is-off { background: var(--red); box-shadow: 0 0 11px rgba(239,113,105,.5); }
.flag-meta { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.flag-meta small { font-size: 8px; }

.safety-hero { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 20px; margin-bottom: 18px; padding: 25px 28px; border: 1px solid rgba(215,189,119,.18); border-radius: var(--radius); background: linear-gradient(120deg, rgba(41,54,47,.8), rgba(20,27,24,.86)); }
.safety-hero h2 { margin: 0 0 8px; font-size: 20px; }
.safety-hero p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.safety-lock { width: 82px; height: 82px; justify-self: end; display: grid; place-items: center; border: 1px solid rgba(215,189,119,.28); border-radius: 24px; color: var(--gold); background: var(--gold-soft); text-align: center; font-size: 12px; font-weight: 850; line-height: 1.4; }
.narrow-layout { display: grid; grid-template-columns: minmax(460px, .95fr) minmax(330px, .65fr); gap: 16px; max-width: 1080px; }
.form-stack { display: grid; gap: 14px; }
.guide-panel { align-self: start; }
.rule-list { display: grid; gap: 11px; }
.rule-list div { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; }
.rule-list strong { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--gold); background: var(--gold-soft); font-size: 9px; }
.rule-list span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.safety-note { display: grid; gap: 5px; padding: 13px; border: 1px solid rgba(108,167,223,.18); border-radius: 11px; color: #9dc6ec; background: rgba(108,167,223,.07); font-size: 10px; }
.safety-note span { color: var(--muted); }
.maintenance-result { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 13px; }
.maintenance-result div { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.1); }
.maintenance-result span { color: var(--muted); font-size: 8px; }
.maintenance-result strong { display: block; margin-top: 5px; font-size: 15px; }

.compact-select { width: 120px; min-height: 36px; padding: 8px 10px; }
.audit-list { display: grid; }
.audit-event { display: grid; grid-template-columns: 78px minmax(0,1fr) 150px; gap: 16px; padding: 16px 19px; border-top: 1px solid var(--line); }
.audit-event:first-child { border-top: 0; }
.audit-source { align-self: start; padding: 6px 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.audit-source--CATALOG { color: #8ddfba; border-color: rgba(55,201,139,.2); background: rgba(55,201,139,.07); }
.audit-source--MATH { color: #9dc6ec; border-color: rgba(108,167,223,.2); background: rgba(108,167,223,.07); }
.audit-source--OPS { color: #dbc88d; border-color: rgba(215,189,119,.2); background: rgba(215,189,119,.07); }
.audit-main { min-width: 0; }
.audit-title { display: flex; align-items: center; gap: 9px; }
.audit-title strong { font-size: 11px; }
.audit-title span { color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; }
.audit-main p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.audit-main details { margin-top: 10px; }
.audit-main summary { color: #8fa097; cursor: pointer; font-size: 9px; }
.diff-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.diff-grid pre { max-height: 240px; overflow: auto; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: #aab8b0; background: rgba(0,0,0,.18); font: 8px/1.5 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; }
.audit-who { display: grid; align-content: start; justify-items: end; gap: 4px; text-align: right; }
.audit-who strong { font-size: 10px; }
.audit-who span, .audit-who time { color: var(--muted); font-size: 8px; }

.modal { padding: 0; border: 0; border-radius: 22px; color: var(--ivory); background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(1,5,3,.72); backdrop-filter: blur(5px); }
.modal-card { width: 680px; max-height: 88vh; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line-strong); border-radius: 22px; overflow: hidden; background: #151f1b; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { overflow: auto; padding: 21px 22px; }
.modal-foot { justify-content: flex-end; gap: 8px; border: 0; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.span-2 { grid-column: span 2; }
.inline-fields { display: flex; align-items: center; gap: 8px; }
.inline-fields b { color: var(--muted); }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 17px; border: 1px solid rgba(55,201,139,.3); border-radius: 12px; color: #dff8eb; background: rgba(19,51,38,.96); box-shadow: var(--shadow); font-size: 12px; }
.toast.is-error { color: #ffe0dd; border-color: rgba(239,113,105,.34); background: rgba(63,27,25,.97); }
.skeleton { min-height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.055), rgba(255,255,255,.025)); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (max-width: 1250px) { .metric-grid { grid-template-columns: repeat(2,1fr); } .detail-grid, .narrow-layout { grid-template-columns: 1fr; } .asset-grid { grid-template-columns: 1fr; } .content-preview-grid { grid-template-columns: 220px 1fr; } .slot-preview { grid-column: 1 / -1; } }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand-lockup--compact { padding: 0; }
  .nav-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
    overflow: visible;
  }
  .nav-section { grid-column: 1 / -1; padding-top: 5px; }
  .nav-section--spaced { margin-top: 5px; }
  .nav-item { justify-content: center; padding: 10px 8px; text-align: center; }
  .sidebar-note { grid-column: 1; margin-top: 0; }
  .operator-card { grid-column: 2; margin-top: 0; }
  .topbar { min-height: auto; padding: 18px 20px; }
  .content { padding: 20px 20px 40px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-actions { width: 100%; flex-wrap: wrap; }
  .panel-actions .search { flex: 1 1 220px; width: auto; }
  .flag-row { grid-template-columns: minmax(0, 1fr) 88px; gap: 10px 16px; }
  .flag-meta { grid-column: 1 / -1; grid-row: 2; }
  .audit-event { grid-template-columns: 68px minmax(0, 1fr); }
  .audit-who { grid-column: 2; justify-items: start; text-align: left; }
  .modal-card { width: min(680px, calc(100vw - 24px)); }
}

@media (max-width: 600px) {
  .login-card { width: calc(100vw - 24px); padding: 30px 24px 26px; }
  .login-copy { margin: 34px 0 26px; }
  .login-copy h1 { font-size: 26px; }
  .sidebar { grid-template-columns: 1fr; }
  .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-note, .operator-card { grid-column: 1; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .content { padding: 16px 12px 32px; }
  .detail-hero, .asset-card header { align-items: stretch; flex-direction: column; }
  .detail-title { align-items: flex-start; }
  .detail-actions { flex-wrap: wrap; }
  .tabs, .section-tabs { overflow-x: auto; }
  .tab, .section-tab { flex: none; }
  .kv-grid, .config-card__stats, .form-grid, .maintenance-result,
  .diff-grid, .asset-spec { grid-template-columns: 1fr; }
  .math-spin-result { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .flag-row { grid-template-columns: 1fr; }
  .flag-row > .button { width: 100%; }
  .flag-meta { grid-row: auto; }
  .safety-hero { grid-template-columns: 1fr; padding: 20px; }
  .safety-lock { justify-self: start; }
  .audit-event { grid-template-columns: 1fr; gap: 10px; }
  .audit-who { grid-column: 1; }
  .inline-fields { flex-wrap: wrap; }
  .content-preview-grid { grid-template-columns: 1fr; }
  .slot-preview { grid-column: auto; }
  .modal-card { max-height: calc(100vh - 24px); }
}
