/* ===== KCE Self-Hosted Vazirmatn Font ===== */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Variable.woff2') format('woff2'), local('Vazirmatn');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* ===== /KCE Font ===== */

:root {
  --bg: #0b1120;
  --panel: #111827;
  --card: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #0ea5e9;
  --accent: #14b8a6;
  --purple: #8b5cf6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); direction: rtl; min-height: 100vh; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 16px; }
.brand-dot { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #0ea5e9, #8b5cf6); display: grid; place-items: center; font-size: 18px; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.nav button { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 7px 13px; border-radius: 10px; cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 700; transition: 0.15s; }
.nav button:hover { border-color: var(--primary); }
.nav button.active { background: linear-gradient(135deg, #0284c7, #0f766e); border-color: transparent; }

.main { max-width: 1460px; margin: 0 auto; padding: 16px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 16px; color: #fff; }
.muted { color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--border); background: var(--card); color: #fff; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-family: var(--font); font-size: 12.5px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { border-color: var(--primary); }
.btn-pri { background: #0284c7; border-color: #0284c7; }
.btn-teal { background: #0f766e; border-color: #0f766e; }
.btn-purp { background: #7c3aed; border-color: #7c3aed; }
.btn-warn { background: #b45309; border-color: #b45309; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(14,165,233,0.16); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.35); padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }

/* Play + Debug Workspace */
.play-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .play-shell { grid-template-columns: 1fr; } }
.stage-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.viewport-frame { background: #020617; border: 1px solid var(--border); border-radius: 16px; padding: 14px; min-height: 540px; display: flex; justify-content: center; overflow: auto; }
.viewport-canvas { width: 100%; max-width: 1120px; background: #f8fafc; color: #0f172a; border-radius: 14px; padding: 18px; box-shadow: 0 22px 50px rgba(0,0,0,0.45); transition: max-width 0.25s; }
.viewport-canvas--tablet { max-width: 768px; }
.viewport-canvas--mobile { max-width: 410px; }

.feedback-banner { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; font-weight: 700; }
.finish-banner { background: linear-gradient(135deg, #0f766e, #1d4ed8); color: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* 12-column Game Grid */
.gs-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(42px, auto); gap: 10px; align-items: stretch; }
.gs-el { position: relative; border-radius: 12px; }
.gs-el--tappable { cursor: pointer; outline: 2px dashed rgba(139, 92, 246, 0.55); outline-offset: 2px; transition: transform 0.14s ease, box-shadow 0.14s ease; }
.gs-el--tappable:hover { transform: scale(1.015); box-shadow: 0 10px 24px rgba(139, 92, 246, 0.25); }
.gs-text { line-height: 1.75; white-space: pre-wrap; font-weight: 600; }
.gs-atlas-wrap { position: relative; width: 100%; height: 100%; min-height: 220px; border-radius: 14px; background: radial-gradient(circle at 50% 80%, #e0f2fe, #f8fafc); border: 1px solid #cbd5e1; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 6px; }
.gs-atlas-canvas { max-width: 100%; max-height: 280px; width: auto; height: auto; display: block; }
.gs-atlas-cap { font-size: 12px; font-weight: 800; color: #1e293b; background: rgba(255,255,255,0.88); padding: 2px 10px; border-radius: 99px; margin-top: 4px; }
.gs-tap-pill { position: absolute; top: 8px; left: 8px; background: #7c3aed; color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }

.gs-choices { display: flex; flex-direction: column; gap: 8px; }
.gs-choice-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; background: #fff; color: #0f172a; border: 2px solid #cbd5e1; border-radius: 12px; padding: 11px 14px; font-family: var(--font); font-size: 14.5px; font-weight: 800; cursor: pointer; transition: 0.15s; }
.gs-choice-btn:hover { border-color: #0f766e; background: #f0fdfa; transform: translateX(-2px); }
.gs-choice-btn--revealed { border-color: #7c3aed; background: #f5f3ff; }
.gs-ch-idx { width: 26px; height: 26px; border-radius: 8px; background: #0f766e; color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }

.gs-scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.gs-kpi { background: #fff; border: 1px solid #cbd5e1; border-top: 4px solid #0f766e; border-radius: 11px; padding: 8px; text-align: center; }
.gs-kpi-l { font-size: 11px; color: #64748b; font-weight: 700; }
.gs-kpi-v { font-size: 20px; font-weight: 900; color: #0f172a; margin-top: 2px; }
.gs-prog-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.gs-prog-track { height: 12px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.gs-prog-fill { height: 100%; background: linear-gradient(90deg, #0ea5e9, #0f766e); border-radius: 99px; transition: width 0.35s; }
.gs-timer { display: flex; justify-content: space-between; align-items: center; background: #0f172a; color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 800; }
.gs-badge { background: #fef3c7; color: #92400e; border: 1.5px solid #f59e0b; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 800; }
.gs-card-t { font-size: 12.5px; font-weight: 800; color: #1e3a5f; margin-bottom: 6px; display: block; }
.gs-bar-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.gs-bar-row span { width: 95px; font-weight: 700; }
.gs-bar-tr { flex: 1; height: 14px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.gs-bar-fi { height: 100%; background: #0ea5e9; border-radius: 5px; }
.gs-radar { width: 100%; max-height: 195px; display: block; }
.gs-stars { display: flex; gap: 6px; }
.gs-star { border: 0; background: transparent; font-size: 26px; color: #cbd5e1; cursor: pointer; padding: 0; }
.gs-star.on { color: #f59e0b; }
.gs-slider { width: 100%; accent-color: #0f766e; }
.gs-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; display: block; }
.gs-video { width: 100%; max-height: 240px; border-radius: 12px; background: #000; }
.gs-media-box, .gs-scene-box, .gs-avatar { background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; padding: 10px; font-size: 13px; }
.gs-avatar { display: flex; align-items: center; gap: 10px; }
.gs-avatar-c { width: 42px; height: 42px; border-radius: 50%; background: #e0f2fe; display: grid; place-items: center; font-size: 22px; }
.gs-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; border-radius: 8px; overflow: hidden; }
.gs-tbl th { background: #1e3a5f; color: #fff; padding: 6px; }
.gs-tbl td { border: 1px solid #cbd5e1; padding: 6px; }
.gs-hint-btn { background: #fffbeb; border: 1.5px solid #f59e0b; color: #92400e; padding: 8px 14px; border-radius: 10px; font-family: var(--font); font-weight: 800; cursor: pointer; }
.gs-inp { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 9px; font-family: var(--font); }
.gs-placeholder { border: 1.5px dashed #94a3b8; border-radius: 12px; padding: 14px; text-align: center; color: #64748b; font-size: 12.5px; }

/* Debug Drawer */
.debug-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 82vh; overflow-y: auto; }
.debug-sec { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 9px; }
.debug-sec h4 { margin: 0 0 6px; font-size: 12.5px; color: #7dd3fc; }
.trace-list { max-height: 220px; overflow-y: auto; font-family: ui-monospace, monospace; font-size: 11px; direction: ltr; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.trace-item { background: rgba(15,23,42,0.7); border-left: 3px solid #14b8a6; padding: 4px 6px; border-radius: 4px; word-break: break-word; }
.trace-item--warn { border-left-color: #f59e0b; color: #fde68a; }
.sel, .inp-dark { background: #0f172a; color: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-family: var(--font); font-size: 12.5px; }

/* Atlas Preview Stage */
.checker-stage { background-image: conic-gradient(#334155 25%, #1e293b 0 50%, #334155 0 75%, #1e293b 0); background-size: 18px 18px; border-radius: 14px; border: 1px solid var(--border); padding: 14px; display: flex; justify-content: center; align-items: center; min-height: 260px; }


/* KCE Core Identity & Workspace Switcher Bar */
.identity-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(30, 41, 59, 0.75); border: 1px solid var(--border); padding: 4px 10px; border-radius: 11px; font-size: 12px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(4px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 420px; max-width: 96vw; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 11px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.err-box { background: rgba(239, 68, 68, 0.16); border: 1px solid #ef4444; color: #fecaca; border-radius: 9px; padding: 8px 10px; font-size: 12.5px; }
.pill-tpl { background: rgba(139, 92, 246, 0.2); color: #ddd6fe; border-color: rgba(139, 92, 246, 0.45); }
.pill-ws  { background: rgba(20, 184, 166, 0.2); color: #99f6e4; border-color: rgba(20, 184, 166, 0.45); }


/* ============================================================================
   PHASE 2 — Unity-Style Visual Game Editor & Interactive 2D Flame Board
   ============================================================================ */
.full-w { width: 100%; }
.ed-lbl { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin: 4px 0 3px; }
.ed-ta { width: 100%; resize: vertical; font-family: var(--font); line-height: 1.5; }
.ed-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; }
.ed-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; align-items: end; }
.ed-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; align-items: end; }
.ed-checks { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }

.ed-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 9px 12px; margin-bottom: 10px; }
.ed-status-ok { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); padding: 4px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.ed-status-err { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); padding: 4px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.ed-tpl-warn { background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.45); color: #fde68a; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }

.ed-shell { display: grid; grid-template-columns: 315px minmax(0, 1fr) 295px; gap: 12px; align-items: start; }
@media (max-width: 1240px) { .ed-shell { grid-template-columns: 280px minmax(0, 1fr); } .ed-inspector { grid-column: 1 / -1; } }
@media (max-width: 900px) { .ed-shell { grid-template-columns: 1fr; } }

.ed-left, .ed-inspector { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 10px; max-height: 78vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ed-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #0f172a; padding: 4px; border-radius: 10px; }
.ed-tabs button { border: 0; background: transparent; color: var(--muted); font-family: var(--font); font-size: 11.5px; font-weight: 800; padding: 6px 4px; border-radius: 7px; cursor: pointer; }
.ed-tabs button.on { background: #1e293b; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.ed-left-body { display: flex; flex-direction: column; gap: 8px; }
.ed-sec, .ed-insp-sec { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px; }
.ed-sec h4, .ed-insp-sec h4 { margin: 0 0 7px; font-size: 12px; color: #7dd3fc; }
.ed-insp-empty { text-align: center; padding: 26px 12px; }

.ed-pal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.ed-pal-item { display: flex; align-items: center; gap: 5px; padding: 6px 7px; background: #0f172a; border: 1px solid var(--border); border-radius: 9px; font-size: 11.5px; font-weight: 700; cursor: grab; transition: 0.12s; }
.ed-pal-item:hover { border-color: var(--primary); background: #172554; transform: translateY(-1px); }
.ed-pal-item:active { cursor: grabbing; }
.ed-pal-ic { font-size: 14px; }

.ed-clip-list { display: flex; flex-direction: column; gap: 5px; }
.ed-pal-clip { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(14,165,233,0.16)); border: 1px solid rgba(139,92,246,0.5); border-radius: 9px; font-size: 12px; font-weight: 800; cursor: grab; }
.ed-pal-clip:hover { border-color: #c4b5fd; }

.ed-hier-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.ed-hier-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; background: #0f172a; border: 1px solid transparent; border-radius: 8px; font-size: 12px; cursor: pointer; }
.ed-hier-item:hover { border-color: var(--border); }
.ed-hier-item.on { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.2); }
.ed-hier-t { font-family: ui-monospace, monospace; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }

.ed-rule-card { background: #0f172a; border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 7px; display: flex; flex-direction: column; gap: 4px; }
.ed-mchk-list { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.ed-mchk { display: flex; align-items: center; gap: 6px; font-size: 11.5px; background: #0f172a; padding: 4px 7px; border-radius: 7px; cursor: pointer; }
.ed-mchk code { margin-inline-start: auto; color: var(--muted); font-size: 10px; }
.ed-graph-svg { width: 100%; background: #020617; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; display: block; }

/* Center Canvas */
.ed-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-float-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; background: rgba(15, 23, 42, 0.96); border: 1px solid #475569; border-radius: 11px; padding: 5px 9px; font-size: 12px; }
.ed-fb-id { font-family: ui-monospace, monospace; font-size: 11px; color: #7dd3fc; margin-inline-end: 4px; }
.ed-fb-btn { border: 1px solid #334155; background: #1e293b; color: #fff; border-radius: 7px; padding: 3px 7px; cursor: pointer; font-family: var(--font); font-size: 11.5px; font-weight: 800; }
.ed-fb-btn:hover { border-color: #0ea5e9; }
.ed-fb-btn--purp { background: #6d28d9; border-color: #7c3aed; }
.ed-fb-btn--del { color: #fca5a5; }
.ed-fb-val { font-size: 11.5px; font-weight: 800; min-width: 24px; text-align: center; }
.ed-fb-sep { width: 1px; height: 18px; background: #334155; margin: 0 2px; }
.ed-fb-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; border-radius: 6px; border: 1px solid #334155; cursor: pointer; }
.ed-fb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.ed-vp-wrap { background: #020617; border: 1px solid var(--border); border-radius: 16px; padding: 16px; min-height: 580px; display: flex; justify-content: center; overflow: auto; }
.ed-board { position: relative; width: 100%; max-width: 1060px; min-height: 560px; background: #f8fafc; color: #0f172a; border-radius: 14px; padding: 14px; box-shadow: 0 20px 46px rgba(0,0,0,0.45); transition: max-width 0.2s; }
.ed-board--tablet { max-width: 740px; }
.ed-board--mobile { max-width: 400px; }
.ed-board--drop { outline: 4px dashed #8b5cf6; outline-offset: 4px; }

.ed-col-guides { position: absolute; inset: 14px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; pointer-events: none; z-index: 0; }
.ed-col-guide { background: rgba(148, 163, 184, 0.08); border: 1px dashed rgba(148, 163, 184, 0.25); border-radius: 6px; text-align: center; }
.ed-col-guide span { font-size: 9.5px; color: #94a3b8; font-weight: 700; }

.ed-grid { position: relative; z-index: 1; grid-auto-rows: minmax(52px, auto); }
.ed-el { cursor: move; transition: outline-color 0.12s; border-radius: 10px; }
.ed-el:hover { outline: 2px dashed rgba(139, 92, 246, 0.55); outline-offset: 2px; }
.ed-el--sel { outline: 2.5px solid #7c3aed !important; outline-offset: 3px; box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.16); }
.ed-el--locked { cursor: not-allowed; }
.ed-el-inner { width: 100%; height: 100%; }
.ed-inline-editing { outline: 2px solid #0f766e !important; background: #fff !important; border-radius: 6px; padding: 4px; cursor: text !important; }
.ed-coord-pill { position: absolute; top: -24px; right: 2px; z-index: 30; background: #0f172a; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 99px; white-space: nowrap; pointer-events: none; }

/* Generous 28px Hit-Area Resize Handles (solves sticky handles from Batch 24!) */
.ed-rh { position: absolute; z-index: 35; display: flex; align-items: center; justify-content: center; }
.ed-rh-dot { background: #fff; border: 2.5px solid #7c3aed; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,0.35); transition: transform 0.12s; }
.ed-rh:hover .ed-rh-dot { transform: scale(1.25); background: #7c3aed; }
.ed-rh--end { top: 50%; left: -14px; transform: translateY(-50%); width: 28px; height: 38px; cursor: ew-resize; }
.ed-rh--end .ed-rh-dot { width: 8px; height: 24px; }
.ed-rh--bottom { bottom: -14px; left: 50%; transform: translateX(-50%); width: 38px; height: 28px; cursor: ns-resize; }
.ed-rh--bottom .ed-rh-dot { width: 24px; height: 8px; }
.ed-rh--corner { bottom: -15px; left: -15px; width: 30px; height: 30px; cursor: nesw-resize; }
.ed-rh--corner .ed-rh-dot { width: 14px; height: 14px; }

/* Badge tones & Interactive 2D Flame Card Board + Map */
.gs-badge--info { background: #e0f2fe; color: #075985; border-color: #0284c7; }
.gs-badge--success { background: #dcfce7; color: #166534; border-color: #16a34a; }
.gs-badge--danger { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
.gs-map-nodes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gs-map-node { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #1e293b; }

.gs-flame-board { background: #0f172a; color: #f8fafc; border-radius: 14px; padding: 12px; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.gs-flame-head { font-size: 13px; font-weight: 800; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gs-flame-head span { font-size: 11.5px; font-weight: 500; color: #94a3b8; }
.gs-flame-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; flex: 1; align-items: stretch; }
.gs-flame-drop { border: 2px dashed #38bdf8; background: rgba(14,165,233,0.12); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: 13.5px; color: #7dd3fc; min-height: 120px; transition: 0.15s; }
.gs-flame-drop.over { background: rgba(20,184,166,0.28); border-color: #2dd4bf; transform: scale(1.02); }
.gs-flame-drop small { font-size: 11px; opacity: 0.85; }
.gs-flame-cards { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.gs-flame-card { background: #1e293b; color: #fff; border: 1px solid #334155; border-inline-start: 5px solid #0ea5e9; border-radius: 10px; padding: 9px 11px; font-size: 12.5px; font-weight: 800; cursor: grab; transition: 0.14s; }
.gs-flame-card:hover { background: #334155; transform: translateX(-3px); }


/* ============================================================================
   PHASE 4 — Multi-Category Template Studio & Rich Visual Cards
   ============================================================================ */
.tpl-hero { background: linear-gradient(135deg, #1e1b4b 0%, #0f766e 60%, #0284c7 100%); border: 1px solid rgba(125,211,252,0.28); border-radius: 20px; padding: 20px 22px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; box-shadow: 0 18px 42px rgba(2,6,23,0.45); }
.tpl-hero-txt { max-width: 720px; }
.tpl-hero-txt h1 { margin: 8px 0 6px; font-size: 21px; font-weight: 900; color: #fff; line-height: 1.45; }
.tpl-hero-txt p { margin: 0; font-size: 13px; color: rgba(248,250,252,0.9); line-height: 1.75; }
.tpl-steps { display: flex; flex-direction: column; gap: 7px; min-width: 240px; }
.tpl-step { background: rgba(15,23,42,0.45); border: 1px solid rgba(255,255,255,0.18); border-radius: 11px; padding: 7px 12px; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.tpl-step span { width: 22px; height: 22px; border-radius: 50%; background: #38bdf8; color: #0f172a; display: grid; place-items: center; font-size: 11.5px; font-weight: 900; flex-shrink: 0; }

.tpl-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tpl-cat-pill { display: flex; align-items: center; gap: 9px; text-align: right; background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 9px 11px; border-radius: 13px; cursor: pointer; font-family: var(--font); transition: 0.15s; }
.tpl-cat-pill:hover { border-color: var(--cat-acc, #38bdf8); transform: translateY(-1px); }
.tpl-cat-pill.on { background: var(--cat-grad, linear-gradient(135deg, #0284c7, #0f766e)); border-color: transparent; box-shadow: 0 10px 24px rgba(2,132,199,0.28); }
.tpl-cat-ic { font-size: 21px; line-height: 1; }
.tpl-cat-pill b { display: block; font-size: 12px; font-weight: 800; }
.tpl-cat-pill small { display: block; font-size: 10.5px; opacity: 0.8; margin-top: 1px; }

.tpl-cat-banner { border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,0.25); }
.tpl-cat-banner b { display: block; font-size: 14.5px; font-weight: 900; margin-bottom: 2px; }
.tpl-cat-banner div { font-size: 12.5px; opacity: 0.94; }

.tpl-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tpl-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.tpl-card:hover { transform: translateY(-3px); border-color: #38bdf8; box-shadow: 0 18px 38px rgba(2,6,23,0.45); }
.tpl-card-cover { padding: 14px 16px 12px; color: #fff; display: flex; flex-direction: column; gap: 9px; position: relative; }
.tpl-cover-cat { background: rgba(15,23,42,0.38); padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; backdrop-filter: blur(4px); }
.tpl-cover-meta { font-size: 11px; opacity: 0.9; font-weight: 700; }
.tpl-cover-title { font-size: 16px; font-weight: 900; line-height: 1.45; }
.tpl-cover-mini { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tpl-mini-bar { height: 7px; width: 62%; border-radius: 99px; background: rgba(255,255,255,0.65); }
.tpl-mini-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tpl-mini-row span { height: 22px; border-radius: 6px; background: rgba(255,255,255,0.22); }

.tpl-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-tag { background: rgba(14,165,233,0.12); color: #bae6fd; border: 1px solid rgba(14,165,233,0.28); padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }


/* ============================================================================
   EDITOR LAB v2 — 8-Studio Home Hub + Dedicated Per-Section Studio + Presets
   ============================================================================ */
.hub-hero { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f766e 100%); border: 1px solid rgba(125,211,252,0.28); border-radius: 22px; padding: 24px 26px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: 0 22px 48px rgba(2,6,23,0.5); }
.hub-hero-main { max-width: 720px; }
.hub-hero-main h1 { margin: 4px 0 8px; font-size: 24px; font-weight: 900; color: #fff; }
.hub-hero-main p { margin: 0; font-size: 13.5px; color: rgba(248,250,252,0.9); line-height: 1.8; }
.hub-stats { display: grid; grid-template-columns: repeat(2, minmax(125px, 1fr)); gap: 10px; }
.hub-stat { background: rgba(15,23,42,0.52); border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; padding: 11px 14px; text-align: center; transition: 0.15s; }
.hub-stat:hover { border-color: #38bdf8; }
.hub-stat b { display: block; font-size: 22px; font-weight: 900; color: #fff; }
.hub-stat span { display: block; font-size: 11px; color: #cbd5e1; margin-top: 2px; }

.hub-sec-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hub-sec-title h2 { margin: 0; font-size: 18px; font-weight: 900; }

.hub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1220px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hub-grid { grid-template-columns: 1fr; } }

.hub-card { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.hub-card:hover { transform: translateY(-5px); border-color: var(--hc-acc, #38bdf8); box-shadow: 0 22px 44px rgba(2,6,23,0.55); }
.hub-card-top { padding: 16px 16px 14px; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.hub-card-ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(15,23,42,0.32); border: 1px solid rgba(255,255,255,0.28); display: grid; place-items: center; font-size: 26px; backdrop-filter: blur(4px); }
.hub-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hub-b { background: rgba(255,255,255,0.22); color: #fff; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.hub-b--dark { background: rgba(15,23,42,0.45); }

.hub-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hub-card-body h3 { margin: 0; font-size: 15.5px; font-weight: 900; color: #fff; }
.hub-en { font-size: 11px; color: #7dd3fc; font-weight: 700; letter-spacing: 0.3px; }
.hub-card-body p { margin: 2px 0 4px; font-size: 12px; }
.hub-caps { list-style: none; margin: 2px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: #cbd5e1; }
.hub-enter-btn { margin-top: auto; width: 100%; justify-content: center; padding: 9px 12px; border-radius: 11px; font-size: 12.5px; font-weight: 900; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,0.25); }

/* Dedicated Section Studio View */
.sec-switcher-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; }
.sec-sw-pills { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.sec-sw-btn { border: 1px solid var(--border); background: #0f172a; color: #cbd5e1; padding: 5px 10px; border-radius: 99px; font-family: var(--font); font-size: 11.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: 0.14s; }
.sec-sw-btn:hover { border-color: #38bdf8; color: #fff; }
.sec-sw-btn.on { background: var(--sw-grad); border-color: transparent; color: #fff; font-weight: 900; }

.sec-banner { border-radius: 20px; padding: 20px 22px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; box-shadow: 0 18px 38px rgba(2,6,23,0.4); }
.sec-banner-info { display: flex; align-items: center; gap: 16px; max-width: 760px; }
.sec-banner-ic { width: 64px; height: 64px; border-radius: 18px; background: rgba(15,23,42,0.34); border: 1px solid rgba(255,255,255,0.28); display: grid; place-items: center; font-size: 34px; flex-shrink: 0; }
.sec-banner-info h1 { margin: 5px 0 4px; font-size: 21px; font-weight: 900; }
.sec-banner-info p { margin: 0; font-size: 13px; opacity: 0.94; line-height: 1.7; }
.sec-banner-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sec-create-btn { background: #fff; color: #0f172a; border: 0; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 900; box-shadow: 0 10px 26px rgba(0,0,0,0.25); }
.sec-create-btn:hover { transform: scale(1.02); background: #f8fafc; }
.sec-cta-sub { font-size: 11px; opacity: 0.88; }

.sec-caps-strip { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 9px 13px; margin-bottom: 16px; font-size: 12px; }
.sec-block-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sec-block-head h2 { margin: 0; font-size: 16.5px; font-weight: 900; }

/* Category-Customized Editor Accents & Quick Presets */
.ed-cat-bar { border-radius: 13px; padding: 8px 14px; margin-bottom: 10px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.ed-sec--presets { background: linear-gradient(160deg, rgba(124,58,237,0.16), rgba(14,165,233,0.12)); border-color: rgba(139,92,246,0.45); }
.ed-preset-list { display: flex; flex-direction: column; gap: 5px; }
.ed-preset-btn { width: 100%; text-align: right; background: rgba(15,23,42,0.82); color: #f8fafc; border: 1px solid rgba(139,92,246,0.45); border-radius: 9px; padding: 7px 9px; font-family: var(--font); font-size: 11.5px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.13s; }
.ed-preset-btn:hover { background: #4c1d95; border-color: #c4b5fd; transform: translateX(-2px); }
.ed-pal-item--pri { border-color: rgba(56,189,248,0.55); background: rgba(14,165,233,0.12); }

/* ───────── v2.3: persistent stage, camera, effects ───────── */
.gs-stage-root { position: relative; isolation: isolate; border-radius: inherit; }
.gs-cam { position: relative; z-index: 1; }
.gs-cam--on { overflow: hidden; }
.gs-world { position: relative; }
.gs-fx { width: 100%; height: 100%; transition: transform .18s ease, filter .18s ease; transform-origin: 50% 50%; }
.gs-hv-lift:hover { transform: translateY(-4px); } .gs-hv-grow:hover { transform: scale(1.06); }
.gs-hv-tilt:hover { transform: rotate(-2.5deg) scale(1.03); } .gs-hv-press:active { transform: scale(.96); }
.gs-fxlayer { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; border-radius: inherit; }
.gs-cam-nav { position: absolute; z-index: 70; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; background: rgba(15,23,42,.82); color: #fff; border-radius: 999px; padding: 4px 8px; font-size: 12px; backdrop-filter: blur(6px); }
.gs-cam-nav button { background: transparent; border: 0; color: #fff; font-size: 14px; cursor: pointer; padding: 4px 9px; border-radius: 999px; min-width: 34px; min-height: 30px; }
.gs-cam-nav button:hover { background: rgba(255,255,255,.18); }
.gs-cam-label { min-width: 70px; text-align: center; }

/* ───────── v2.3: editor viewport (zoom/pan), layers, frames ───────── */
.ed-vp { position: relative; background: #020617; border: 1px solid var(--border); border-radius: 16px; height: 74vh; min-height: 560px; overflow: hidden; cursor: default; }
.ed-vp--hand, body.ed-space .ed-vp { cursor: grab; } .ed-vp--panning { cursor: grabbing !important; }
.ed-vp--hand .ed-el, body.ed-space .ed-vp .ed-el { cursor: grab; }
.ed-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.ed-bg { position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ed-vp-tools { position: absolute; z-index: 20; top: 10px; left: 10px; display: flex; gap: 4px; align-items: center; background: rgba(15,23,42,.92); border: 1px solid #475569; border-radius: 10px; padding: 3px 6px; direction: ltr; }
.ed-vp-tools button { background: transparent; border: 0; color: #e2e8f0; cursor: pointer; min-width: 30px; min-height: 28px; border-radius: 7px; font-size: 14px; }
.ed-vp-tools button:hover, .ed-vp-tools button.on { background: rgba(124,58,237,.45); }
.ed-vp-zoom { min-width: 46px; text-align: center; font-size: 12px; color: #e2e8f0; }
.ed-el--multi { outline: 2px solid #38bdf8 !important; outline-offset: 3px; }
.ed-frames { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.ed-frame { position: absolute; border: 2px dashed #f59e0b; border-radius: 8px; background: rgba(245,158,11,.07); }
.ed-frame--start { border-color: #22c55e; background: rgba(34,197,94,.07); }
.ed-frame span { position: absolute; top: -10px; right: 8px; background: #f59e0b; color: #1c1917; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.ed-frame--start span { background: #22c55e; }
.ed-layer { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; }
.ed-layer:hover { background: rgba(148,163,184,.12); } .ed-layer.on { background: rgba(124,58,237,.22); border-color: #7c3aed; } .ed-layer.over { border-color: #38bdf8; background: rgba(56,189,248,.14); }
.ed-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-layer-grip { cursor: grab; color: #64748b; }
.ed-layer-btn { background: transparent; border: 0; color: #cbd5e1; cursor: pointer; padding: 1px 4px; border-radius: 6px; font-size: 12px; }
.ed-layer-btn:hover { background: rgba(148,163,184,.25); } .ed-layer-btn.off { opacity: .55; }

/* ───────── v2.4 — War room / simulation elements ───────── */
.gs-card-t { font-weight: 800; font-size: 13px; color: #0f172a; margin-bottom: 6px; }
.gs-choice-btn--off { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.gs-choice-btn--off:hover { border-color: #cbd5e1; background: #fff; transform: none; }
.gs-ch-hint { display: block; font-weight: 600; font-size: 11.5px; color: #64748b; margin-top: 2px; }
.sim-el { --sim-ok: #059669; --sim-warn: #d97706; --sim-crit: #dc2626; --sim-flat: #64748b; }
.sim-head { background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; border-radius: 14px; padding: 12px 14px; }
.sim-head-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.sim-season { font-size: 22px; }
.sim-season-n { background: rgba(255,255,255,.16); border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
.sim-stage { background: #f59e0b; color: #1c1917; border-radius: 99px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; }
.sim-alert { background: #dc2626; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 800; animation: sim-blink 1.2s ease-in-out infinite; }
.sim-prog { height: 6px; background: rgba(255,255,255,.2); border-radius: 99px; margin: 8px 0 6px; overflow: hidden; }
.sim-prog i { display: block; height: 100%; background: linear-gradient(90deg, #38bdf8, #34d399); border-radius: 99px; transition: width .5s; }
.sim-node-t { font-weight: 800; font-size: 14.5px; margin-top: 6px; }
.sim-node-n { font-size: 12.5px; opacity: .9; line-height: 1.9; margin-top: 2px; }
.sim-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) { .sim-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sim-card { position: relative; background: #fff; border: 1px solid #cbd5e1; border-top: 4px solid var(--sim-ok); border-radius: 11px; padding: 8px 9px 6px; transition: border-color .3s, box-shadow .3s; }
.sim-card.sim-st-warn { border-top-color: var(--sim-warn); background: #fffbeb; }
.sim-card.sim-st-crit { border-top-color: var(--sim-crit); background: #fef2f2; animation: sim-crit-pulse 1.6s ease-in-out infinite; }
.sim-card-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: #334155; }
.sim-ic { font-size: 16px; }
.sim-lb { flex: 1; }
.sim-face { font-size: 22px; line-height: 1; }
.sim-face-sad { animation: sim-shake .9s ease-in-out infinite; }
.sim-face-happy { animation: sim-float 2.4s ease-in-out infinite; }
.sim-card-v { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.sim-card-v b { font-size: 22px; font-weight: 900; color: #0f172a; }
.sim-unit { font-size: 11px; color: #64748b; }
.sim-arrow { font-weight: 900; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.sim-arrow-better { color: var(--sim-ok); } .sim-arrow-worse { color: var(--sim-crit); } .sim-arrow-flat { color: var(--sim-flat); }
.sim-dir-up { animation: sim-up 1.3s ease-in-out infinite; } .sim-dir-down { animation: sim-down 1.3s ease-in-out infinite; }
.sim-bar { height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 5px 0 3px; }
.sim-bar i { display: block; height: 100%; background: var(--sim-ok); border-radius: 99px; transition: width .5s; }
.sim-st-warn .sim-bar i { background: var(--sim-warn); } .sim-st-crit .sim-bar i { background: var(--sim-crit); }
.sim-spark { width: 100%; height: 16px; color: #64748b; display: block; }
.sim-chip { position: absolute; top: -9px; inset-inline-start: 8px; font-size: 10.5px; font-weight: 800; color: #fff; border-radius: 99px; padding: 1px 8px; }
.sim-chip-warn { background: var(--sim-warn); } .sim-chip-crit { background: var(--sim-crit); }
.sim-scene { border-radius: 14px; padding: 10px 12px; color: #fff; background: linear-gradient(160deg, #0f766e, #0369a1); transition: background .5s; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.sim-scene-warn { background: linear-gradient(160deg, #b45309, #7c2d12); }
.sim-scene-crit { background: linear-gradient(160deg, #991b1b, #1c1917); }
.sim-scene-t { font-weight: 800; font-size: 13px; opacity: .95; }
.sim-scene-body { display: flex; align-items: center; justify-content: space-around; gap: 10px; flex: 1; min-height: 70px; }
.sim-scene-ic { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.sim-scene-side { display: flex; flex-direction: column; align-items: center; font-size: 22px; font-weight: 900; }
.sim-scene-side .sim-arrow { margin: 0; background: rgba(255,255,255,.92); border-radius: 99px; padding: 0 8px; }
.sim-scene-x { font-size: 12.5px; line-height: 1.8; text-align: center; opacity: .95; }
.sim-meter { width: 14px; height: 64px; border-radius: 8px; background: rgba(255,255,255,.22); overflow: hidden; display: flex; align-items: flex-end; }
.sim-meter i { display: block; width: 100%; background: #fff; border-radius: 8px; transition: height .6s; }
.sim-an-float { animation: sim-float 2.6s ease-in-out infinite; } .sim-an-pulse { animation: sim-pulse 1.6s ease-in-out infinite; }
.sim-an-blink { animation: sim-blink .9s steps(2, jump-none) infinite; } .sim-an-shake { animation: sim-shake .8s ease-in-out infinite; }
.sim-links, .sim-feed, .sim-pipe { display: flex; flex-direction: column; gap: 5px; }
.sim-link { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr) auto; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; padding: 5px 8px; font-size: 12px; font-weight: 700; color: #334155; }
.sim-link.sim-tone-flat { opacity: .55; }
.sim-link-a { display: flex; align-items: center; justify-content: center; color: #64748b; position: relative; }
.sim-link-a i { flex: 1; background: currentColor; border-radius: 2px; }
.sim-link-a em { font-style: normal; font-size: 11px; margin-inline-start: -3px; }
.sim-tone-better .sim-link-a { color: var(--sim-ok); } .sim-tone-worse .sim-link-a { color: var(--sim-crit); }
.sim-link .sim-arrow { margin: 0; min-width: 54px; justify-content: flex-end; }
.sim-feed-i { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; background: #fff; border: 1px solid #e2e8f0; border-inline-start: 4px solid #94a3b8; border-radius: 9px; padding: 6px 8px; font-size: 12.5px; }
.sim-sev-good { border-inline-start-color: var(--sim-ok); } .sim-sev-warn { border-inline-start-color: var(--sim-warn); } .sim-sev-crit { border-inline-start-color: var(--sim-crit); background: #fef2f2; }
.sim-new { animation: sim-slide .5s ease-out; }
.sim-feed-x { font-size: 11.5px; color: #475569; margin-top: 2px; line-height: 1.8; }
.sim-feed-t { font-size: 10.5px; color: #64748b; background: #f1f5f9; border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.sim-pipe-i { display: flex; justify-content: space-between; gap: 8px; background: #eff6ff; border: 1px dashed #93c5fd; border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 700; color: #1e3a8a; }
.sim-pipe-h { background: #f1f5f9; border: 1px dashed #94a3b8; border-radius: 9px; padding: 5px 9px; font-size: 12px; color: #475569; }
.sim-trend { width: 100%; height: 130px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
.sim-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; font-weight: 700; color: #334155; }
.sim-lg i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-inline-end: 5px; vertical-align: middle; }
.sim-lesson { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 12.5px; line-height: 1.9; color: #451a03; }
.sim-chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; padding: 5px 9px; margin-bottom: 5px; font-size: 12px; }
.sim-chain em { font-style: normal; color: #64748b; }
@keyframes sim-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes sim-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes sim-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes sim-shake { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3px) rotate(-4deg); } 75% { transform: translateX(3px) rotate(4deg); } }
@keyframes sim-up { 0%,100% { transform: translateY(1px); } 50% { transform: translateY(-3px); } }
@keyframes sim-down { 0%,100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }
@keyframes sim-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes sim-crit-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } 50% { box-shadow: 0 0 0 4px rgba(220,38,38,.28); } }
@media (prefers-reduced-motion: reduce) { .sim-card.sim-st-crit, .sim-face, .sim-scene-ic { animation: none !important; } }

/* ===== v2.4 Dashboard: scenario entry + stage cards ===== */
.dsh { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; margin: 0 auto; }
.dsh-hero h2 { margin: 0; font-size: 20px; }
.dsh-sec h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dsh-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.dsh-stage { background: linear-gradient(160deg, #0f172a, #12332f); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dsh-stage p { margin: 0; color: #cbd5e1; font-size: 12.5px; line-height: 1.7; flex: 1; }
.dsh-stage-h { display: flex; align-items: center; gap: 10px; }
.dsh-stage-h small { display: block; color: #5eead4; font-size: 11px; }
.dsh-stage-ic { font-size: 30px; line-height: 1; }
.dsh details { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: rgba(15, 23, 42, .5); }
.dsh summary { cursor: pointer; font-weight: 800; font-size: 13.5px; padding: 4px 0; }
.dsh details[open] > summary { margin-bottom: 8px; }
.dsh-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.dsh-f { display: flex; flex-direction: column; gap: 3px; flex: 1 1 150px; min-width: 0; }
.dsh-f span { font-size: 11px; color: var(--muted); }
.dsh-f.dsh-xs { flex: 0 1 84px; }
.dsh-f.dsh-s { flex: 0 1 140px; }
.dsh-f.dsh-w { flex: 2 1 260px; }
.dsh-f textarea, .dsh-f input, .dsh-f select, .dsh-json { width: 100%; font-family: var(--font); font-size: 12.5px; }
.dsh-json { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; min-height: 220px; }
.dsh-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #cbd5e1; padding-bottom: 6px; }
.dsh-del { padding: 5px 9px; align-self: flex-end; margin-bottom: 8px; }
.dsh-node { border: 1px dashed #475569; border-radius: 12px; padding: 10px; margin-bottom: 10px; background: rgba(2, 6, 23, .35); }
.dsh-choice { border-inline-start: 3px solid #0f766e; padding-inline-start: 10px; margin-bottom: 8px; }
.dsh-sub { font-size: 12px; font-weight: 800; color: #5eead4; margin: 4px 0; }
.dsh-result { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border: 1px solid; font-size: 13px; }
.dsh-result.ok { background: rgba(20, 184, 166, .12); border-color: #14b8a6; }
.dsh-result.bad { background: rgba(239, 68, 68, .12); border-color: #ef4444; }
.dsh-result ul { margin: 4px 0 0; padding-inline-start: 20px; line-height: 1.8; }
.dsh-warn { color: #fde68a; }
@media (max-width: 640px) { .dsh-f, .dsh-f.dsh-xs, .dsh-f.dsh-s, .dsh-f.dsh-w { flex: 1 1 100%; } }
.sim-feed .gs-muted, .sim-pipe .gs-muted { color: #64748b; font-size: 12.5px; padding: 6px 2px; }
.sim-feed-i { color: #0f172a; } .sim-feed-i b { color: #0f172a; }
.sim-chain span { color: #7f1d1d; font-weight: 800; } .sim-chain b { color: #1e293b; }
.sim-links, .sim-pipe, .sim-lesson, .sim-lesson b { color: #0f172a; }

/* ═════════ v2.5 — loop map, loops, management report, profile ═════════ */
.smap { display: flex; flex-direction: column; gap: 6px; color: #0f172a; }
.smap-title { font-weight: 900; font-size: 14px; color: #0f172a; }
.smap-vp { position: relative; width: 100%; overflow: hidden; border-radius: 16px; container-type: inline-size; direction: ltr; background: radial-gradient(120% 90% at 50% 0%, #16264a 0%, #0b1426 70%); border: 1px solid #1e3a5f; touch-action: manipulation; }
.smap-world { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.smap-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.smap-path { fill: none; stroke: #64748b; stroke-dasharray: 9 7; stroke-linecap: round; opacity: .75; }
.smap-e-better .smap-path { stroke: #22c55e; opacity: .95; } .smap-e-worse .smap-path { stroke: #ef4444; opacity: .95; }
.smap-edge.is-on .smap-path { animation: smap-dash 1.6s linear infinite; }
.smap-edge.is-flow .smap-path { stroke-width: 6; opacity: 1; }
@keyframes smap-dash { to { stroke-dashoffset: -32; } }
.smap-mk-flat { fill: #64748b; } .smap-mk-better { fill: #22c55e; } .smap-mk-worse { fill: #ef4444; }
.smap-sign circle { fill: #0f172a; stroke: #64748b; stroke-width: 2; }
.smap-sign text { fill: #e2e8f0; font: 800 17px var(--font); direction: ltr; }
.smap-sign-pos circle { stroke: #38bdf8; } .smap-sign-neg circle { stroke: #fb923c; }
.smap-flow { fill: none; stroke-width: 6; stroke-dasharray: 12 9; stroke-linecap: round; animation: smap-dash 1.2s linear infinite; }
.smap-flow-better { stroke: #4ade80; } .smap-flow-worse { stroke: #f87171; } .smap-flow-flat { stroke: #cbd5e1; }
.smap-dot { stroke: #fff; stroke-width: 2.5; } .smap-dot-better { fill: #22c55e; } .smap-dot-worse { fill: #ef4444; } .smap-dot-flat { fill: #94a3b8; }
.smap-nodes, .smap-badges { position: absolute; inset: 0; }
.smap-node { position: absolute; transform: translate(-50%, -50%); width: 13.4cqw; cursor: pointer; outline: none; direction: rtl; transition: opacity .25s; }
.smap-card { background: #f8fafc; color: #0f172a; border-radius: 1.2cqw; border: .22cqw solid #cbd5e1; padding: .7cqw .8cqw .6cqw; box-shadow: 0 .5cqw 1.6cqw rgba(0,0,0,.35); transition: box-shadow .25s, border-color .25s, transform .25s; }
.smap-node:focus-visible .smap-card { border-color: #38bdf8; }
.smap-h { display: flex; align-items: center; gap: .4cqw; font-weight: 800; font-size: 1.12cqw; line-height: 1.25; min-height: 2.4cqw; }
.smap-ic { font-size: 1.9cqw; line-height: 1; } .smap-lb { flex: 1; } .smap-fc { font-size: 1.7cqw; }
.smap-r { display: flex; align-items: baseline; gap: .6cqw; margin-top: .1cqw; }
.smap-val { font-size: 2.5cqw; font-weight: 900; font-variant-numeric: tabular-nums; }
.smap-arr { font-size: 1.5cqw; font-weight: 900; color: #94a3b8; }
.smap-arr-better { color: #16a34a; } .smap-arr-worse { color: #dc2626; }
.smap-arr.is-live { animation: smap-pop .5s ease-out; font-size: 2.2cqw; }
@keyframes smap-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.4); } 100% { transform: scale(1); opacity: 1; } }
.smap-bar { height: .55cqw; background: #e2e8f0; border-radius: 1cqw; overflow: hidden; margin-top: .45cqw; } .smap-bar i { display: block; height: 100%; background: #0ea5e9; border-radius: 1cqw; }
.smap-node.sim-st-warn .smap-card { border-color: #f59e0b; } .smap-node.sim-st-warn .smap-bar i { background: #f59e0b; }
.smap-node.sim-st-crit .smap-card { border-color: #ef4444; } .smap-node.sim-st-crit .smap-bar i { background: #ef4444; }
.smap-hot .smap-card { transform: scale(1.12); box-shadow: 0 0 0 .5cqw rgba(56,189,248,.55), 0 1cqw 3cqw rgba(0,0,0,.5); }
.smap-hot-better .smap-card { box-shadow: 0 0 0 .5cqw rgba(34,197,94,.65), 0 1cqw 3cqw rgba(0,0,0,.5); border-color: #22c55e; }
.smap-hot-worse .smap-card { box-shadow: 0 0 0 .5cqw rgba(239,68,68,.65), 0 1cqw 3cqw rgba(0,0,0,.5); border-color: #ef4444; }
.smap-node.smap-hot { z-index: 6; }
.smap-arr-better.is-live { animation: smap-arr-up .85s ease-out; }
.smap-arr-worse.is-live { animation: smap-arr-down .85s ease-out; }
@keyframes smap-arr-up { 0% { transform: translateY(6px) scale(.55); opacity: 0; } 55% { transform: translateY(-4px) scale(1.35); opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes smap-arr-down { 0% { transform: translateY(-6px) scale(.55); opacity: 0; } 55% { transform: translateY(4px) scale(1.35); opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
.smap-chip { position: absolute; top: -2.6cqw; left: 50%; z-index: 8; transform: translate3d(-50%, 0, 0); padding: .22cqw 1.1cqw; border-radius: 2cqw; font-weight: 900; font-size: 1.75cqw; color: #fff; white-space: nowrap; animation: smap-rise 2.2s ease-out forwards; direction: ltr; pointer-events: none; will-change: transform, opacity; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.smap-chip-better { background: #16a34a; top: -2.6cqw; bottom: auto; animation-name: smap-rise; }
.smap-chip-worse { background: #dc2626; top: auto; bottom: -2.2cqw; animation-name: smap-drop; }
.smap-chip-flat { background: #64748b; }
@keyframes smap-rise { 0% { opacity: 0; transform: translate3d(-50%, 65%, 0) scale(.85); } 18% { opacity: 1; transform: translate3d(-50%, 0%, 0) scale(1.06); } 78% { opacity: 1; transform: translate3d(-50%, -40%, 0) scale(1); } 100% { opacity: 0; transform: translate3d(-50%, -115%, 0) scale(.95); } }
@keyframes smap-drop { 0% { opacity: 0; transform: translate3d(-50%, -65%, 0) scale(.85); } 18% { opacity: 1; transform: translate3d(-50%, 0%, 0) scale(1.06); } 78% { opacity: 1; transform: translate3d(-50%, 40%, 0) scale(1); } 100% { opacity: 0; transform: translate3d(-50%, 115%, 0) scale(.95); } }
.smap-lp { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: .3cqw; padding: .3cqw 1cqw; border-radius: 2cqw; border: .2cqw solid; font-weight: 900; font-size: 1.35cqw; cursor: pointer; font-family: var(--font); background: #0f172a; }
.smap-lp-r { color: #4ade80; border-color: #16a34a; } .smap-lp-b { color: #fdba74; border-color: #ea580c; }
.smap-lp-vicious { color: #fca5a5; border-color: #dc2626; animation: smap-pulse 1.2s infinite; }
.smap-lp-active { animation: smap-pulse 1.6s infinite; }
@keyframes smap-pulse { 50% { box-shadow: 0 0 0 .6cqw rgba(251,146,60,.35); } }
.smap-focus .smap-edge:not(.in-loop) { opacity: .15; } .smap-focus .smap-node:not(.in-loop) { opacity: .35; } .smap-edge.in-loop .smap-path { stroke-width: 6; opacity: 1; }
.smap-reset, .smap-skip { position: absolute; top: 1.2cqw; z-index: 3; font-family: var(--font); font-size: 1.3cqw; font-weight: 800; padding: .5cqw 1.2cqw; border-radius: 2cqw; border: 1px solid #475569; background: rgba(15,23,42,.9); color: #e2e8f0; cursor: pointer; }
.smap-reset { left: 1.2cqw; } .smap-skip { right: 1.2cqw; background: #0369a1; border-color: #38bdf8; }
.smap-say { position: absolute; bottom: 1cqw; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(15,23,42,.92); border: 1px solid #38bdf8; color: #e0f2fe; padding: .5cqw 1.8cqw; border-radius: 2cqw; font-size: 1.5cqw; font-weight: 800; max-width: 90%; text-align: center; direction: rtl; }
.smap-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 11.5px; color: #475569; direction: rtl; }
.smap-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px dashed; margin-inline-end: 4px; vertical-align: middle; } .smap-legend .lg-b { border-color: #22c55e; } .smap-legend .lg-w { border-color: #ef4444; }
.smap-legend .sg { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #0f172a; border: 1.5px solid #38bdf8; color: #e2e8f0; font-size: 11px; }
.smap-compact .smap-node { width: 17.5cqw; } .smap-compact .smap-lb { display: none; } .smap-compact .smap-h { min-height: 4.4cqw; justify-content: center; }
.smap-compact .smap-ic { font-size: 4.2cqw; } .smap-compact .smap-fc { font-size: 3.6cqw; } .smap-compact .smap-val { font-size: 4.6cqw; } .smap-compact .smap-arr { font-size: 3cqw; } .smap-compact .smap-arr.is-live { font-size: 4.4cqw; }
.smap-compact .smap-card { padding: 1.2cqw; border-radius: 2.2cqw; } .smap-compact .smap-bar { height: 1cqw; margin-top: 1cqw; } .smap-compact .smap-chip { font-size: 3.4cqw; top: -5cqw; }
.smap-compact .smap-lp { font-size: 2.8cqw; padding: .6cqw 1.8cqw; } .smap-compact .smap-reset, .smap-compact .smap-skip { font-size: 2.8cqw; padding: 1cqw 2.4cqw; } .smap-compact .smap-say { font-size: 3cqw; padding: 1cqw 3cqw; }
@media (prefers-reduced-motion: reduce) { .smap-lp-vicious, .smap-lp-active { animation: none; } }

.sloops { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sloop { background: #fff; color: #0f172a; border: 2px solid #cbd5e1; border-radius: 13px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.sloop-r { border-inline-start: 6px solid #16a34a; } .sloop-b { border-inline-start: 6px solid #ea580c; }
.sloop-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; } .sloop-k { background: #0f172a; color: #fff; border-radius: 8px; padding: 1px 8px; font-weight: 800; font-size: 11.5px; }
.sloop-st { margin-inline-start: auto; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 8px; background: #e2e8f0; color: #334155; }
.sloop-st-ok { background: #dcfce7; color: #166534; } .sloop-st-bad { background: #fee2e2; color: #991b1b; } .sloop-st-warn { background: #ffedd5; color: #9a3412; }
.sloop-path { display: flex; flex-wrap: wrap; gap: 3px 4px; font-size: 11.5px; color: #334155; align-items: center; } .sloop-path span { background: #f1f5f9; border-radius: 6px; padding: 1px 6px; } .sloop-path i { color: #94a3b8; font-style: normal; font-size: 9px; }
.sloop-m { height: 5px; background: #e2e8f0; border-radius: 5px; overflow: hidden; } .sloop-m i { display: block; height: 100%; background: #0ea5e9; }
.sloop-x { font-size: 12px; line-height: 1.7; color: #334155; } .sloop-s { font-size: 12px; font-weight: 800; background: #fefce8; border: 1px solid #fde047; color: #713f12; border-radius: 9px; padding: 5px 8px; }

.srp { background: #fff; color: #0f172a; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.srp-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .srp-score { position: relative; width: 132px; flex: none; }
.srp-ring { width: 132px; height: 132px; } .srp-ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 10; } .srp-ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.1s ease; }
.srp-ring-n { font: 900 30px var(--font); fill: #0f172a; } .srp-ring-s { font: 700 11px var(--font); fill: #64748b; }
.srp-medal { position: absolute; top: -6px; right: -6px; font-size: 34px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.srp-head { flex: 1; min-width: 220px; } .srp-k { font-size: 11.5px; font-weight: 800; color: #0369a1; } .srp-head h3 { margin: 2px 0 4px; font-size: 18px; } .srp-head p { margin: 0 0 6px; font-size: 13px; line-height: 1.8; color: #334155; }
.srp-chips { display: flex; gap: 6px; flex-wrap: wrap; } .srp-chip { background: #f1f5f9; border-radius: 20px; padding: 2px 11px; font-size: 12px; font-weight: 800; } .srp-chip-t { background: #fef3c7; color: #92400e; }
.srp-sec { border-top: 1px solid #e2e8f0; padding-top: 10px; } .srp-sum { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.8; color: #1e293b; } .srp-rec li::marker { content: '💡 '; }
.srp-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; } .srp-tbl th { text-align: right; color: #64748b; font-weight: 700; padding: 3px 6px; } .srp-tbl td { padding: 4px 6px; border-top: 1px solid #f1f5f9; }
.srp-d-better { color: #16a34a; font-weight: 800; } .srp-d-worse { color: #dc2626; font-weight: 800; } .srp-d-flat { color: #64748b; }
.srp-bds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.srp-bd, .pfl-bd { position: relative; background: #f1f5f9; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; opacity: .6; }
.srp-bd.on, .pfl-bd.on { background: linear-gradient(135deg, #fef9c3, #fde68a); border: 2px solid #f59e0b; opacity: 1; }
.srp-bd-i { font-size: 24px; } .srp-bd b { font-size: 12.5px; } .srp-bd em { font-style: normal; font-size: 11px; color: #475569; }
.srp-bd.new { animation: smap-pop .7s ease-out; } .srp-bd u { position: absolute; top: 4px; left: 6px; text-decoration: none; background: #dc2626; color: #fff; border-radius: 8px; padding: 0 6px; font-size: 10px; font-weight: 800; }
.srp-cmp { display: flex; flex-direction: column; gap: 8px; } .srp-cmp-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .srp-cmp-idle { color: #475569; font-size: 12.5px; } .srp-cmp-err { color: #991b1b; background: #fee2e2; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.srp-warn { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
.srp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; } .srp-kpis div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 11px; padding: 7px; text-align: center; display: flex; flex-direction: column; } .srp-kpis b { font-size: 20px; } .srp-kpis span { font-size: 10.5px; color: #64748b; }
.srp-board { display: grid; gap: 3px; } .srp-row, .pfl-row { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 8px; background: #f8fafc; font-size: 12.5px; color: #0f172a; } .srp-you, .pfl-you { background: #dbeafe; font-weight: 800; }
.srp-rk, .pfl-rk { width: 22px; height: 22px; display: grid; place-items: center; background: #0f172a; color: #fff; border-radius: 50%; font-size: 11px; } .srp-nm, .pfl-nm { flex: 1; }
.srp-st { display: grid; grid-template-columns: 1.4fr 2fr auto; gap: 8px; align-items: center; font-size: 12px; color: #1e293b; margin: 3px 0; } .srp-st em { font-style: normal; color: #64748b; font-size: 11px; }
.srp-bars { display: grid; gap: 2px; } .srp-bars i { display: block; height: 6px; border-radius: 6px; } .srp-bars .me { background: #0ea5e9; } .srp-bars .ot { background: #cbd5e1; }
.srp-btn { font-family: var(--font); font-weight: 800; font-size: 13px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; border-radius: 10px; padding: 8px 14px; cursor: pointer; } .srp-btn-main { background: linear-gradient(135deg, #0284c7, #0f766e); color: #fff; border-color: transparent; } .srp-act { display: flex; justify-content: center; }
@media (max-width: 640px) { .srp-kpis { grid-template-columns: repeat(2, 1fr); } .srp-st { grid-template-columns: 1fr; } }

.pfl { display: grid; gap: 14px; } .pfl-head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
.pfl-av { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9, #8b5cf6); display: grid; place-items: center; font-size: 24px; font-weight: 900; } .pfl-head h2 { margin: 0; }
.pfl-tot { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; } .pfl-tot span { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; font-size: 12.5px; color: var(--muted); } .pfl-tot b { color: #fff; font-size: 17px; margin-inline-end: 4px; }
.pfl-stage { gap: 12px; } .pfl-sh { display: flex; align-items: center; gap: 12px; } .pfl-sh h3 { margin: 0; } .pfl-si { font-size: 34px; }
.pfl-best { margin-inline-start: auto; text-align: center; display: flex; flex-direction: column; } .pfl-bs { font-size: 30px; font-weight: 900; } .pfl-bt { font-size: 12.5px; color: var(--muted); }
.pfl-bds { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; } .pfl-bd { color: #0f172a; flex-direction: row; align-items: center; gap: 7px; } .pfl-bd span { font-size: 22px; } .pfl-bd b { font-size: 12px; }
.pfl-cmp { background: #fff; color: #0f172a; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; } .pfl-cmp .gs-card-t { color: #0f172a; }
.pfl-run { border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 10px; background: #f8fafc; } .pfl-run summary { cursor: pointer; display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 13px; }
.pfl-ch { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 3px; font-size: 12px; color: #334155; } .pfl-ch em { font-style: normal; color: #0369a1; font-weight: 800; margin-inline-end: 4px; }

/* v2.6 — single-loop view: selector chips + circular ring */
.smap-views { display: flex; flex-wrap: wrap; gap: 6px; direction: rtl; }
.smap-views[hidden], .smap-ring[hidden], .smap-ringinfo[hidden], .smap-ri-s[hidden] { display: none; }
.smap-vw { font-family: var(--font); font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 16px; border: 1.5px solid #cbd5e1; background: #fff; color: #0f172a; cursor: pointer; }
.smap-vw-r { border-color: #16a34a; } .smap-vw-b { border-color: #ea580c; }
.smap-vw:hover { background: #f1f5f9; } .smap-vw.on { background: #0369a1; border-color: #0369a1; color: #fff; }
.smap-vw:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.smap-ring { position: absolute; inset: 0; direction: ltr; }
.smap-inring .smap-world, .smap-inring .smap-reset, .smap-inring .smap-skip, .smap-inring .smap-say { display: none !important; }
.smap-ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.smap-guide { fill: none; stroke: #334155; stroke-width: 2; stroke-dasharray: 3 9; opacity: .8; }
.smap-ed { font: 800 18px var(--font); fill: #94a3b8; direction: ltr; paint-order: stroke; stroke: #0b1426; stroke-width: 4px; }
.smap-e-better .smap-ed { fill: #4ade80; } .smap-e-worse .smap-ed { fill: #f87171; }
.smap-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: #e2e8f0; direction: rtl; pointer-events: none; }
.smap-hub-i { font-size: 7cqw; line-height: 1; opacity: .9; } .smap-hub-t { font-size: 1.7cqw; font-weight: 900; margin-top: .4cqw; }
.smap-stepno { position: absolute; top: -1.2cqw; right: -1.2cqw; width: 2.8cqw; height: 2.8cqw; border-radius: 50%; background: #0ea5e9; color: #fff; font-weight: 900; font-size: 1.6cqw; display: grid; place-items: center; border: .22cqw solid #0b1426; }
.smap-ringnodes .smap-chip { animation: none; opacity: 1; } .smap-chip-keep { top: -3.4cqw; }
.smap-ring-on .smap-card { transform: scale(1.12); border-color: #38bdf8; box-shadow: 0 0 0 .6cqw rgba(56,189,248,.6), 0 1cqw 3cqw rgba(0,0,0,.5); }
.smap-ring-done .smap-card { border-color: #38bdf8; opacity: .95; }
.smap-ringnodes .smap-node:not(.smap-ring-on):not(.smap-ring-done) .smap-card { opacity: .88; }
.smap-ringinfo { direction: rtl; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; color: #0f172a; }
.smap-ri-r { border-inline-start: 5px solid #16a34a; } .smap-ri-b { border-inline-start: 5px solid #ea580c; }
.smap-ri-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; } .smap-ri-k { font-weight: 900; } .smap-ri-st { margin-inline-start: auto; font-size: 11.5px; background: #e2e8f0; border-radius: 10px; padding: 1px 8px; }
.smap-ri-cap { font-size: 13px; font-weight: 800; color: #0369a1; line-height: 1.8; min-height: 2.2em; }
.smap-ri-x { font-size: 12.5px; color: #334155; line-height: 1.8; } .smap-ri-s { font-size: 12.5px; background: #fef9c3; border-radius: 8px; padding: 6px 10px; line-height: 1.8; }
.smap-ri-btns { display: flex; flex-wrap: wrap; gap: 6px; } .smap-ri-btns button { font-family: var(--font); font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 14px; border: 1px solid #94a3b8; background: #fff; color: #0f172a; cursor: pointer; }
.smap-ri-btns button:hover { background: #e2e8f0; }
.smap-compact .smap-hub-i { font-size: 12cqw; } .smap-compact .smap-hub-t { font-size: 3.4cqw; }
.smap-compact .smap-stepno { width: 5.6cqw; height: 5.6cqw; font-size: 3.2cqw; top: -2.4cqw; right: -2.4cqw; } .smap-compact .smap-chip-keep { top: -6.4cqw; }
@media (prefers-reduced-motion: reduce) { .smap-ring-on .smap-card { transition: none; } }
.smap-ringnodes .smap-node { width: 11.8cqw; } .smap-ringnodes .smap-h { font-size: 1cqw; min-height: 2.2cqw; } .smap-ringnodes .smap-ic { font-size: 1.7cqw; } .smap-ringnodes .smap-val { font-size: 2.3cqw; }
.smap-ringsvg .smap-path { opacity: 1; } .smap-ringsvg .smap-e-flat .smap-path { stroke: #94a3b8; }
.smap-compact .smap-ringnodes .smap-node { width: 15.5cqw; } .smap-compact .smap-ringnodes .smap-ic { font-size: 3.6cqw; } .smap-compact .smap-ringnodes .smap-val { font-size: 4cqw; }

/* ===== v2.6.3 — Mobile card labels, Vazirmatn everywhere, Canvas Floating Dock & Question Popup ===== */
body, button, input, select, textarea,
.smap, .smap *, .sim-el, .sim-el *, .sim-card, .sim-card *, .smap-qmodal, .smap-qmodal * {
  font-family: var(--font);
}

/* Reserve a clean non-overlapping bottom dock strip inside .smap-vp so floating buttons never cover cards */
.smap-world, .smap-ring { inset: 0 0 46px 0; }
.smap-compact .smap-world, .smap-compact .smap-ring { inset: 0 0 50px 0; }
.smap-say { bottom: 52px; }
.smap-compact .smap-say { bottom: 56px; font-size: 2.9cqw; padding: .8cqw 2.4cqw; }

/* Mobile card labels: ALWAYS VISIBLE & readable (overrides old .smap-compact .smap-lb { display: none }) */
.smap-compact .smap-vp { min-height: 360px; }
.smap-compact .smap-node { width: 20.8cqw; }
.smap-compact .smap-card { padding: 1cqw 1.05cqw .85cqw; border-radius: 2.1cqw; }
.smap-compact .smap-h { min-height: auto; justify-content: flex-start; gap: .5cqw; align-items: center; }
.smap-compact .smap-ic { font-size: 3cqw; flex: none; }
.smap-compact .smap-lb {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: clamp(8.5px, 2.5cqw, 11.5px);
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}
.smap-compact .smap-fc { font-size: 2.7cqw; flex: none; }
.smap-compact .smap-r { margin-top: .35cqw; gap: .8cqw; justify-content: space-between; }
.smap-compact .smap-val { font-size: clamp(12px, 3.7cqw, 16px); }
.smap-compact .smap-arr { font-size: clamp(10px, 2.7cqw, 13px); }
.smap-compact .smap-arr.is-live { font-size: clamp(13px, 4cqw, 18px); }
.smap-compact .smap-bar { height: .9cqw; margin-top: .7cqw; }
.smap-compact .smap-chip { font-size: 3.4cqw; padding: .45cqw 1.8cqw; animation-duration: 2.5s; }
.smap-compact .smap-chip-better { top: -4.8cqw; bottom: auto; }
.smap-compact .smap-chip-worse { top: auto; bottom: -4.2cqw; }
.smap-compact .smap-edge.is-on .smap-path { animation-duration: 2.2s; }
.smap-compact .smap-flow { animation-duration: 1.6s; }
.smap-ringnodes .smap-chip-worse { top: -3.4cqw; bottom: auto; animation: none; opacity: 1; }
.smap-compact .smap-ringnodes .smap-chip-worse { top: -6.4cqw; bottom: auto; }
.smap-compact .smap-ringnodes .smap-node { width: 20.5cqw; }
.smap-compact .smap-ringnodes .smap-ic { font-size: 2.8cqw; }
.smap-compact .smap-ringnodes .smap-lb { font-size: clamp(8px, 2.35cqw, 11px); }
.smap-compact .smap-ringnodes .smap-val { font-size: clamp(11px, 3.4cqw, 15px); }
.smap-ri-btns { display: none; }

/* Floating translucent dock at bottom edge of canvas */
.smap-dock[hidden], .smap-dock-ov[hidden], .smap-dock-rg[hidden], .smap-dock-btn[hidden] { display: none !important; }
.smap-dock {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 12;
  max-width: calc(100% - 12px); direction: rtl;
  background: rgba(15, 23, 42, 0.84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.32); border-radius: 999px;
  padding: 4px 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
}
.smap-dock-ov, .smap-dock-rg { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.smap-dock-ov::-webkit-scrollbar, .smap-dock-rg::-webkit-scrollbar { display: none; }
.smap-dock-btn {
  border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(30, 41, 59, 0.92); color: #f8fafc;
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 800; line-height: 1.3;
  cursor: pointer; white-space: nowrap; transition: transform .12s, background .15s, border-color .15s;
}
.smap-dock-btn:hover { background: #334155; border-color: #38bdf8; }
.smap-dock-btn:active { transform: scale(.96); }
.smap-dock-q { background: linear-gradient(135deg, #0284c7, #0f766e); border-color: rgba(56, 189, 248, 0.6); color: #fff; }
.smap-dock-q:hover { background: linear-gradient(135deg, #0369a1, #115e59); }
.smap-dock-replay { background: rgba(124, 58, 237, 0.28); border-color: rgba(167, 139, 250, 0.5); }
.smap-compact .smap-dock { bottom: 5px; padding: 3px 5px; }
.smap-compact .smap-dock-btn { padding: 5px 8px; font-size: 11px; }

/* Question & Choices Popup Modal over canvas */
.smap-qmodal {
  position: fixed; inset: 0; z-index: 95; direction: rtl;
  background: rgba(2, 6, 23, 0.64); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 12px;
  animation: smap-qm-in .18s ease-out;
}
@keyframes smap-qm-in { from { opacity: 0; } to { opacity: 1; } }
.smap-qm-card {
  width: min(640px, 95vw); max-height: 88vh; overflow-y: auto;
  background: #f8fafc; color: #0f172a; border-radius: 18px;
  border: 1.5px solid #cbd5e1; padding: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 12px;
}
.smap-qm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.smap-qm-titles { display: flex; flex-direction: column; gap: 4px; }
.smap-qm-titles h3 { margin: 0; font-size: 16.5px; font-weight: 900; color: #0f172a; line-height: 1.45; }
.smap-qm-pill {
  align-self: flex-start; font-size: 11px; font-weight: 800; color: #0369a1;
  background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 999px; padding: 2px 10px;
}
.smap-qm-fb {
  background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; font-weight: 700; line-height: 1.7;
}
.smap-qm-desc {
  background: #fff; border: 1px solid #e2e8f0; border-inline-start: 4px solid #0284c7;
  border-radius: 11px; padding: 10px 12px; font-size: 13.5px; line-height: 1.9; color: #1e293b; white-space: pre-wrap;
}
.smap-qm-choices { display: flex; flex-direction: column; gap: 8px; }
.smap-qm-ch {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: right;
  background: #fff; color: #0f172a; border: 2px solid #cbd5e1; border-radius: 12px;
  padding: 11px 12px; cursor: pointer; transition: .15s;
}
.smap-qm-ch:hover:not(:disabled) { border-color: #0f766e; background: #f0fdfa; transform: translateX(-2px); }
.smap-qm-ch.is-locked { opacity: .6; cursor: not-allowed; background: #f1f5f9; }
.smap-qm-idx {
  width: 26px; height: 26px; border-radius: 8px; background: #0f766e; color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 900; flex: none; margin-top: 1px;
}
.smap-qm-chbody { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.smap-qm-chbody b { font-size: 14px; font-weight: 800; line-height: 1.5; color: #0f172a; }
.smap-qm-chbody small { font-size: 12px; color: #475569; line-height: 1.65; }
.smap-qm-lock { font-style: normal; font-size: 11.5px; font-weight: 800; color: #b91c1c; }
.smap-qm-foot { display: flex; justify-content: center; padding-top: 2px; }
.smap-qm-viewbtn {
  border: 1.5px solid #0284c7; background: #eff6ff; color: #0369a1;
  border-radius: 10px; padding: 6px 12px; font-size: 12px; font-weight: 800;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.smap-qm-viewbtn:hover { background: #dbeafe; }
.smap-qm-viewbtn-lg { width: 100%; padding: 9px 14px; font-size: 13px; }
@media (max-width: 640px) {
  .smap-qm-card { padding: 12px; border-radius: 14px; max-height: 90vh; }
  .smap-qm-titles h3 { font-size: 15px; }
  .smap-qm-desc { font-size: 12.8px; }
  .smap-qm-chbody b { font-size: 13.2px; }
}

/* Stock card floating delta pop */
.sim-delta-pop { position: absolute; left: 50%; z-index: 6; padding: 2px 9px; border-radius: 99px; font-weight: 900; font-size: 12.5px; color: #fff; white-space: nowrap; direction: ltr; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.28); will-change: transform, opacity; }
.sim-delta-better { background: #16a34a; top: -8px; animation: smap-rise 2.2s ease-out forwards; }
.sim-delta-worse { background: #dc2626; bottom: -8px; animation: smap-drop 2.2s ease-out forwards; }
.sim-delta-flat { background: #64748b; top: -8px; animation: smap-rise 1.9s ease-out forwards; }

/* Clean Public /play/<slug> Mode */
body.public-play .topbar { display: none !important; }
body.public-play .main { max-width: 1180px; padding: 10px; }
.play-shell--public { display: block; }
.play-public-wrap { width: 100%; }
.viewport-frame--public { background: transparent; border: none; padding: 6px 0; min-height: auto; overflow: visible; }
.viewport-canvas--public { max-width: 1120px; width: 100%; margin: 0 auto; }
@media (max-width: 640px) {
  body.public-play .main { padding: 4px; }
  .viewport-frame--public { padding: 0; }
  .viewport-canvas--public { padding: 10px; border-radius: 12px; max-width: 100%; box-shadow: 0 10px 26px rgba(0,0,0,.35); }
}
