:root {
  --bg-0: #F5F5F7;
  --bg-1: #FFFFFF;
  --bg-2: #EFEFF3;
  --bg-3: #E4E4EA;
  --glass-rail: rgba(245, 245, 247, 0.86);
  --glass-bar: rgba(255, 255, 255, 0.84);
  --glass-sheet: rgba(255, 255, 255, 0.94);
  --line: rgba(15, 17, 21, 0.075);
  --line-strong: rgba(15, 17, 21, 0.14);
  --specular-top: rgba(255, 255, 255, 0.88);
  --text-1: #1D1D1F;
  --text-2: #515154;
  --text-3: #76767C;
  --cta-bg: #18191C;
  --cta-ink: #FFFFFF;
  --cta-hover: #2C2E33;
  --accent: #0071E3;
  --accent-soft: rgba(0, 113, 227, 0.10);
  --amber: #E58B3B;
  --amber-soft: rgba(229, 139, 59, 0.12);
  --green: #1D9A49;
  --green-soft: rgba(29, 154, 73, 0.10);
  --warn: #B54708;
  --warn-soft: rgba(181, 71, 8, 0.10);
  --red: #D92D20;
  --red-soft: rgba(217, 45, 32, 0.10);
  --blue: #0071E3;
  --purple: #5856D6;
  --eo: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-sheet: cubic-bezier(0.18, 0.89, 0.24, 1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.05), 0 14px 32px rgba(0, 0, 0, 0.06);
  --font: "SF Pro Display", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --rail-w: 242px;
}

body[data-theme="dark"] {
  --bg-0: #090A0E;
  --bg-1: #13151B;
  --bg-2: #1C1F27;
  --bg-3: #252934;
  --glass-rail: rgba(9, 10, 14, 0.86);
  --glass-bar: rgba(19, 21, 27, 0.84);
  --glass-sheet: rgba(19, 21, 27, 0.94);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(194, 200, 212, 0.20);
  --specular-top: rgba(255, 255, 255, 0.085);
  --text-1: #F5F5F7;
  --text-2: #C2C8D4;
  --text-3: #868D9C;
  --cta-bg: #F5F6F8;
  --cta-ink: #090A0D;
  --cta-hover: #FFFFFF;
  --accent: #64D2FF;
  --accent-soft: rgba(100, 210, 255, 0.14);
  --amber: #E58B3B;
  --amber-soft: rgba(229, 139, 59, 0.16);
  --green: #30D158;
  --green-soft: rgba(48, 209, 88, 0.14);
  --warn: #FF9F0A;
  --warn-soft: rgba(255, 159, 10, 0.14);
  --red: #FF453A;
  --red-soft: rgba(255, 69, 58, 0.14);
  --blue: #64D2FF;
  --purple: #9B99FF;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 30px rgba(0, 0, 0, 0.40);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.45), 0 16px 36px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
  transition: background 0.24s var(--eo), color 0.24s var(--eo);
}

body.rail-mini { --rail-w: 72px; }

#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* Frosted Sidebar */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 30;
  background: var(--glass-rail);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  transition: width 0.30s var(--eo), background 0.24s var(--eo);
  overflow: hidden;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.brand-mark-svg { flex: none; width: 34px; height: 34px; }
.brand-text-wrap { transition: opacity 0.2s; min-width: 0; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.025em; color: var(--text-1); }
.brand-sub { font-size: 10px; letter-spacing: 0.08em; color: var(--text-3); font-weight: 600; text-transform: uppercase; }
body.rail-mini .brand-text-wrap,
body.rail-mini .nav-label,
body.rail-mini .nav-badge,
body.rail-mini .rail-section-title,
body.rail-mini .rail-footer-card { opacity: 0; pointer-events: none; }

.rail-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 6px 10px;
  white-space: nowrap;
}

.rail-nav { display: flex; flex-direction: column; gap: 3px; }
.rail-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--eo), color 0.18s var(--eo), box-shadow 0.18s var(--eo), transform 0.14s var(--eo);
  text-align: left;
}
.rail-btn:active { transform: scale(0.975); }
.rail-btn svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { background: var(--accent-soft); color: var(--text-1); }
.rail-btn.active {
  background: var(--bg-1);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 var(--specular-top), 0 1px 3px rgba(0, 0, 0, 0.08);
  color: var(--text-1);
  font-weight: 600;
}
.rail-btn.active svg { color: var(--amber); }
.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-2);
}
.rail-btn.active .nav-badge { background: var(--amber-soft); color: var(--amber); }

.rail-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-footer-card {
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--specular-top);
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.amber-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  margin-right: 6px;
}

.collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s;
}
.collapse-btn:hover { background: var(--bg-2); color: var(--text-1); }

/* Main Shell & Floating Command Bar */
.main-shell {
  position: relative;
  z-index: 2;
  margin-left: var(--rail-w);
  min-height: 100vh;
  transition: margin-left 0.30s var(--eo);
}

.cmd-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--glass-bar);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmd-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cmd-title-group h1 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cmd-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.cmd-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Segmented Control */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.seg .seg-slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
  transition: transform 0.28s var(--eo), width 0.28s var(--eo);
  pointer-events: none;
}
.seg button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 11px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s;
}
.seg button:hover { color: var(--text-1); }
.seg button.on { color: var(--text-1); font-weight: 600; }
.seg.is-locked { opacity: 0.72; pointer-events: none; }

/* Pipeline Strip */
.pipeline-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
}
.pipe-node {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s var(--eo);
}
.pipe-node:hover { border-color: var(--line-strong); color: var(--text-1); background: var(--bg-1); }
.pipe-node.on {
  border-color: var(--line-strong);
  background: var(--bg-1);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: inset 0 1px 0 var(--specular-top), 0 1px 4px rgba(0, 0, 0, 0.06);
}
.pipe-step { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--amber); font-weight: 700; }
.pipe-val { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.pipe-arrow { color: var(--text-3); font-size: 12px; flex: none; }

/* Workspace & Cards (Solid Background + 1px Specular Top Rim) */
.workspace { max-width: 1600px; margin: 0 auto; padding: 20px 28px 84px; }

.glass-card {
  position: relative;
  min-width: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: inset 0 1px 0 var(--specular-top), var(--shadow);
  transition: border-color 0.22s var(--eo), box-shadow 0.22s var(--eo);
  overflow: hidden;
}
.glass-card:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 var(--specular-top), var(--shadow-hover);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-1); display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--text-3); }

/* KPI Strip */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kpi-num {
  font-family: var(--font);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin: 4px 0 3px;
  font-variant-numeric: tabular-nums;
}
.kpi-foot { font-size: 11.5px; color: var(--text-2); }
.ring-svg { width: 56px; height: 56px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 5.5; }
.ring-fg { fill: none; stroke-width: 5.5; stroke-linecap: round; transition: stroke-dashoffset 0.65s var(--eo); }

.studio-2col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.studio-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.studio-3col { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.master-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Semantic Pills & Monochrome SVG Icons */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  white-space: normal;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.pill-gold { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-blue { background: rgba(88, 86, 214, 0.12); color: var(--purple); border-color: transparent; }

.sf-ico {
  width: 14.5px;
  height: 14.5px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  transition: transform 0.18s var(--eo);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-1);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--specular-top);
  transition: transform 0.14s var(--eo), background 0.18s, border-color 0.18s, box-shadow 0.18s;
  text-decoration: none;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-strong); }
.btn:active { transform: scale(0.975); }
.btn:focus-visible, .rail-btn:focus-visible, .seg button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Single High-Emphasis Primary CTA per view (Direction C) */
.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-ink);
  border-color: var(--cta-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.btn-primary:hover {
  background: var(--cta-hover);
  color: var(--cta-ink);
  border-color: var(--cta-hover);
}

.btn-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.btn-green:hover { filter: brightness(0.95); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

@keyframes spinAppleRing { to { transform: rotate(360deg); } }
.btn.is-busy { opacity: 0.78; pointer-events: none; }
.btn.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  margin-right: 4px;
  animation: spinAppleRing 0.65s linear infinite;
  display: inline-block;
  flex: none;
}
.btn.is-done {
  background: var(--green-soft) !important;
  color: var(--green) !important;
  border-color: transparent !important;
}

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
select { cursor: pointer; text-overflow: ellipsis; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
input:focus, textarea:focus, select:focus {
  background: var(--bg-1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: 12px; }

/* Stream Cards (Concentric Radius + Restraint <=3 Core Items) */
.stream-list { display: flex; flex-direction: column; gap: 10px; }
.stream-item {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 13px 14px;
  cursor: pointer;
  transition: all 0.18s var(--eo);
}
.stream-item:hover { background: var(--bg-1); border-color: var(--line-strong); transform: translateY(-1px); }
.stream-item:active { transform: scale(0.994); }
.stream-item.selected {
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: inset 0 1px 0 var(--specular-top), 0 0 0 1px var(--accent-soft);
}
.stream-item.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.svg-stage {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 6px;
}
.topo-flow { stroke-dasharray: 6 6; animation: dashFlow 2.2s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -24; } }

/* 9:16 Cinema Video Cover Stage (Preserved Deep Dark Cinema Frame) */
.phone-stage-916 {
  position: relative;
  width: 100%;
  max-width: 310px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  border: 6px solid #1D1D1F;
  background: linear-gradient(165deg, #090A0E 0%, #161A23 55%, #0D0F14 100%);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24), 0 4px 12px rgba(0, 0, 0, 0.10);
}
.stage-beam {
  position: absolute;
  left: -10%;
  right: -10%;
  top: -15%;
  height: 68%;
  background: radial-gradient(55% 45% at 72% 24%, rgba(194, 200, 212, 0.16), transparent 65%),
              linear-gradient(108deg, transparent 40%, rgba(255, 255, 255, 0.05) 50%, transparent 60%);
  pointer-events: none;
}
.stage-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88)),
              repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 42px);
}
.stage-safe {
  position: absolute;
  left: 14px;
  right: 54px;
  top: 56px;
  bottom: 92px;
  border: 1px dashed rgba(194, 200, 212, 0.36);
  border-radius: 10px;
  pointer-events: none;
}
.stage-text-layer {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 108px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cover-line-1 { font-size: 11.5px; letter-spacing: 0.14em; color: #C2C8D4; font-weight: 600; }
.cover-line-2 {
  display: inline-block;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 8px;
  background: #F5F6F8;
  color: #090A0D;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}
.cover-line-3 { font-size: 12px; color: #E5E5EA; display: flex; align-items: center; gap: 6px; }
.cover-line-3::before { content: ""; width: 20px; height: 2px; background: #E58B3B; }

.timeline-track {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 6px;
  margin-top: 12px;
}
.tl-seg {
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s;
}
.tl-seg.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text-1); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: 11.5px; background: var(--bg-2); }
tr:hover td { background: var(--bg-2); }

/* Staggered Timeline Bar */
.stagger-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.stagger-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Inline Drawers & Right Slide-Out Fluid Inspection Drawers */
.drawer-panel {
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.section-hidden { display: none !important; }

@keyframes applePanelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.994); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tab-panel:not(.section-hidden),
.drawer-panel:not(.section-hidden) {
  animation: applePanelIn 0.24s var(--spring-sheet) both;
}

.side-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 10, 14, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--eo);
}
.side-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.side-sheet {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(440px, calc(100vw - 24px));
  z-index: 90;
  border-radius: 20px;
  background: var(--glass-sheet);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 var(--specular-top), 0 24px 60px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.28s var(--spring-sheet);
  overflow: hidden;
}
.side-sheet.open { transform: translateX(0); }

.side-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.side-sheet-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-1); }
.side-sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

.rtl-box {
  direction: rtl;
  text-align: right;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-1);
}

.sys-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* Dynamic Island Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 9999;
  max-width: min(92vw, 560px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(24, 25, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px) scale(0.96);
  transition: transform 0.26s var(--eo), opacity 0.20s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #30D158; flex: none; }
.toast.is-warn .toast-dot { background: #E58B3B; }

/* DSP-20261128-01: Hot Seedling Radar, 049 Topic Pool & Full-Link Funnel Review (Direction C) */
.hot-seedling-strip {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-color: rgba(229, 139, 59, 0.28);
}
.hot-seedling-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: border-color 0.18s var(--eo), background 0.18s var(--eo);
}
.hot-seedling-row:hover {
  background: var(--bg-1);
  border-color: var(--line-strong);
}
.hot-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--amber-soft);
  color: var(--amber);
}
.hot-seedling-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid rgba(229, 139, 59, 0.30);
  box-shadow: inset 0 1px 0 var(--specular-top), var(--shadow);
  margin-bottom: 14px;
}
.funnel-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.funnel-stage-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.funnel-stage-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.conclusion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.conclusion-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.conclusion-card strong {
  display: block;
  color: var(--text-1);
  margin-bottom: 5px;
  font-size: 13px;
}
.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-2);
}

@media (max-width: 1320px) {
  .studio-3col { grid-template-columns: minmax(0, 260px) minmax(0, 300px) minmax(0, 1fr); }
}
.overseas-3plat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.wa-card-box {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 var(--specular-top);
}
@media (max-width: 1020px) {
  .kpi-grid, .funnel-stage-grid, .overseas-3plat-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-3col, .studio-2col, .studio-equal, .master-detail, .conclusion-grid { grid-template-columns: 1fr; }
  .hot-seedling-row { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .rail { width: 72px; }
  .main-shell { margin-left: 72px; }
  .rail .brand-text-wrap, .rail .nav-label, .rail .nav-badge, .rail .rail-section-title, .rail .rail-footer-card { opacity: 0; pointer-events: none; }
  .kpi-grid, .funnel-stage-grid, .overseas-3plat-grid { grid-template-columns: 1fr; }
}
