@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  /* backgrounds */
  --bg: #F2F4F7; --white: #FFFFFF; --soft: #F8F9FA;
  /* ink / grays */
  --ink: #111827; --g1: #1F2937; --g2: #4B5563; --g3: #9CA3AF; --g4: #D1D5DB; --border: #E5E7EB;
  /* brand colours */
  --red: #DC2626; --red-s: #FEF2F2; --red-m: rgba(220,38,38,.12);
  --green: #059669; --green-s: #ECFDF5; --green-m: rgba(5,150,105,.12);
  --blue: #2563EB; --blue-s: #EFF6FF; --blue-m: rgba(37,99,235,.10);
  --amber: #D97706; --amber-s: #FFFBEB; --amber-m: rgba(217,119,6,.12);
  --purple: #7C3AED; --purple-s: #F5F3FF; --purple-m: rgba(124,58,237,.12);
  --teal: #0891B2; --teal-s: #ECFEFF; --teal-m: rgba(8,145,178,.12);
  /* shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 28px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  font-feature-settings: 'cv05', 'cv11';
}

/* ── HEADER ── */
.hdr { background: #0F172A; padding: 0 28px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 200; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,.07); }
.hdr-brand { display: flex; align-items: center; gap: 12px; }
.hdr-logo-img { height: 36px; object-fit: contain; background: white; border-radius: 6px; padding: 4px 8px; }
.hdr-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; color: #fff; letter-spacing: -.2px; }
.hdr-sub { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: rgba(255,255,255,.38); letter-spacing: .8px; text-transform: uppercase; margin-top: 2px; }
.hdr-tabs { display: flex; gap: 2px; background: rgba(255,255,255,.06); padding: 3px; border-radius: 8px; }
.hdr-tab { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 5px 14px; border-radius: 6px; cursor: pointer; color: rgba(255,255,255,.5); transition: all .18s; border: none; background: transparent; white-space: nowrap; }
.hdr-tab:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.07); }
.hdr-tab.active { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.hdr-tab.t-col.active { background: var(--red); color: #fff; }
.hdr-tab.t-ip.active { background: var(--green); color: #fff; }
.hdr-tab.t-bo.active { background: var(--blue); color: #fff; }
.hdr-tab.t-qc.active { background: var(--amber); color: #fff; }
.hdr-actions { display: flex; gap: 8px; align-items: center; }
.comment-toggle-btn { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 6px 13px; border-radius: 7px; cursor: pointer; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: rgba(255,255,255,.6); transition: all .18s; white-space: nowrap; }
.comment-toggle-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.07); }
.comment-toggle-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── COMMENT MODE BAR ── */
.comment-mode-bar { background: var(--blue); color: #fff; padding: 9px 28px; display: flex; align-items: center; justify-content: space-between; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; }
.comment-mode-bar button { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500; transition: background .15s; }
.comment-mode-bar button:hover { background: rgba(255,255,255,.28); }

/* ── VIEWS ── */
.view { display: none; padding: 32px 36px 80px; max-width: 1600px; margin: 0 auto; }
.view.active { display: block; }

/* ── FLOW HEADER ── */
.flow-header { margin-bottom: 28px; }
.flow-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; font-weight: 500; }
.flow-title { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -.7px; line-height: 1.15; margin-bottom: 10px; color: var(--ink); }
.flow-desc { font-size: 13.5px; color: var(--g2); line-height: 1.7; max-width: 720px; font-weight: 400; }
.arch-legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.leg { display: flex; align-items: center; gap: 6px; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; color: var(--g2); }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.leg-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.leg-chip { padding: 3px 10px; border-radius: 5px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; }

/* ── USC MASTER BANNER ── */
.usc-master { display: flex; align-items: center; gap: 14px; background: var(--teal-s); border: 1px solid rgba(8,145,178,.2); border-radius: 10px; padding: 12px 18px; margin-bottom: 28px; max-width: 740px; }
.usc-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; color: var(--teal); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 2px; }
.usc-desc { font-size: 13px; color: var(--g2); line-height: 1.5; }
.usc-desc code { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; background: var(--teal-m); padding: 2px 7px; border-radius: 4px; color: var(--teal); font-weight: 600; }

/* ══════════════════════════════════════
   SNAKE FLOW LAYOUT
══════════════════════════════════════ */
.snake-flow { padding: 8px 0 32px; position: relative; }
.flow-row { display: flex; align-items: flex-start; gap: 0; flex-wrap: nowrap; padding: 4px 0; position: relative; }
.flow-row-label { font-family: 'IBM Plex Mono', monospace; font-size: 8px; color: var(--g3); letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 5px; padding: 3px 0; margin-bottom: 4px; }
.flow-row-label .dir-arrow { font-size: 11px; color: var(--g4); }

/* Turn connectors between snake rows */
.flow-turn { position: relative; height: 44px; margin: 0; overflow: visible; }
.flow-turn::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 100%;
  border-bottom: 2px solid var(--g4);
  border-bottom-right-radius: 0;
}
.flow-turn.turn-right::after { right: 16px; border-right: 2px solid var(--g4); border-bottom-right-radius: 12px; }
.flow-turn.turn-left::after { left: 16px; border-left: 2px solid var(--g4); border-bottom-left-radius: 12px; }
.flow-turn-arrow { position: absolute; bottom: -1px; font-size: 9px; color: var(--g4); }
.flow-turn.turn-right .flow-turn-arrow { right: 10px; }
.flow-turn.turn-left .flow-turn-arrow { left: 10px; }
.flow-row-wrap { margin-bottom: 0; }

/* ── STAGE NODES ── */
.sn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; position: relative; }
.sn-card { width: 168px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px 11px; cursor: pointer; transition: box-shadow .18s, transform .15s, border-color .15s; background: var(--white); position: relative; box-shadow: var(--shadow-sm); }
.sn-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.sn-card.wide { width: 188px; }
.sn-card.col { border-color: rgba(220,38,38,.25); background: #FFFBFB; }
.sn-card.ip  { border-color: rgba(5,150,105,.22); background: #F8FDFB; }
.sn-card.bo  { border-color: rgba(37,99,235,.20); background: #F8FAFF; }
.sn-card.qc  { border-color: rgba(217,119,6,.22);  background: #FFFDF5; }
.sn-card.wdt { border-color: rgba(124,58,237,.20); background: #FDFAFF; }
.sn-card.ext { border-color: var(--border); background: var(--soft); }
.sn-card.sys { border: 1.5px dashed rgba(5,150,105,.4); background: var(--green-s); }
.sn-card.exit-card { border-color: rgba(5,150,105,.4); background: linear-gradient(135deg,#D1FAE5,#ECFDF5); }
.sn-num { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 600; letter-spacing: .8px; color: var(--g3); margin-bottom: 5px; display: flex; align-items: center; gap: 4px; }
.sn-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sn-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12.5px; line-height: 1.3; margin-bottom: 3px; color: var(--ink); letter-spacing: -.1px; }
.sn-owner { font-family: 'Inter', sans-serif; font-size: 10px; color: var(--g3); font-weight: 400; margin-bottom: 8px; }
.sn-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 5px; font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500; cursor: pointer; transition: opacity .12s; border: 1px solid transparent; }
.badge:hover { opacity: .8; }
.b-ai { background: var(--blue-s); color: var(--blue); border-color: rgba(26,77,212,.15); }
.b-man { background: var(--amber-s); color: var(--amber); border-color: rgba(184,109,0,.15); }
.b-ext { background: var(--purple-s); color: var(--purple); border-color: rgba(91,44,184,.15); }
.b-gate { background: var(--red-s); color: var(--red); border-color: rgba(217,31,38,.15); }
.b-ok { background: var(--green-s); color: var(--green); border-color: rgba(15,122,69,.2); }

/* ── CONNECTORS ── */
.conn { display: flex; align-items: center; flex-shrink: 0; padding: 0 2px; align-self: flex-start; margin-top: 24px; }
.conn-line { width: 14px; height: 1.5px; background: var(--g4); }
.conn-arrow { width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.conn.ltr .conn-arrow { border-left: 6px solid var(--g4); }
.conn.rtl .conn-arrow { border-right: 6px solid var(--g4); }

/* ── GATE ── */
.gate { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; padding: 0 2px; align-self: flex-start; margin-top: 6px; }
.gate-circle { width: 52px; height: 52px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 8px; font-weight: 700; text-align: center; line-height: 1.3; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.gate-circle:hover { transform: scale(1.1); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.gc-red { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.gc-blk { background: #0F172A; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.gate-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--g3); text-align: center; margin-top: 5px; line-height: 1.5; font-weight: 600; }
.gy { color: var(--green); font-weight: 700; }
.gn { color: var(--red); font-weight: 700; }

/* ── ENTRY / PILL ── */
.entry-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; align-self: flex-start; margin-top: 6px; }
.entry-box { background: var(--soft); border: 1.5px dashed var(--border); border-radius: 9px; padding: 8px 13px; text-align: center; min-width: 116px; }
.entry-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--g3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; }
.entry-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 12px; }
.start-pill { background: var(--ink); color: #fff; padding: 7px 14px; border-radius: 20px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; align-self: flex-start; margin-top: 18px; flex-shrink: 0; }

/* ── ROLE VIEW ── */
.role-mini-flow { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.rmf-title { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; }
.rmf-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rmf-node { padding: 5px 11px; border-radius: 6px; font-size: 11px; font-weight: 500; border: 1px solid; white-space: nowrap; font-family: 'Inter', sans-serif; flex-shrink: 0; background: #fff; }
.rmf-node.active { color: #fff !important; border-color: transparent !important; font-weight: 600; }
.rmf-node.dim { opacity: .35; background: var(--soft) !important; border-color: var(--border) !important; color: var(--g3) !important; }
.rmf-arr { color: var(--g4); font-size: 12px; padding: 0 3px; flex-shrink: 0; }
.role-intro { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; margin-bottom: 20px; display: flex; gap: 18px; align-items: flex-start; cursor: pointer; transition: box-shadow .18s, transform .15s; box-shadow: var(--shadow-sm); }
.role-intro:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ri-stripe { width: 4px; border-radius: 4px; flex-shrink: 0; align-self: stretch; }
.ri-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 3px 10px; border-radius: 5px; display: inline-block; margin-bottom: 8px; }
.ri-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.4px; margin-bottom: 6px; color: var(--ink); }
.ri-desc { font-size: 13.5px; color: var(--g2); line-height: 1.7; max-width: 760px; }
.ri-owns { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--g1); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── SCREEN SEQUENCE ── */
.screens-title-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.screens-section-title { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--ink); letter-spacing: .5px; text-transform: uppercase; font-weight: 700; }
.screens-section-sub { font-size: 13.5px; color: var(--g2); margin-bottom: 20px; line-height: 1.7; max-width: 720px; }
.screen-seq-badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; background: var(--border); color: var(--g2); padding: 4px 10px; border-radius: 5px; white-space: nowrap; }

/* ── SCREEN PAIR ── */
.screen-pair { display: grid; grid-template-columns: 240px 1fr; gap: 20px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; align-items: flex-start; position: relative; box-shadow: var(--shadow-sm); }
.sp-left { display: flex; flex-direction: column; gap: 10px; }
.sp-stage-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--g3); letter-spacing: .8px; text-transform: uppercase; display: flex; align-items: center; gap: 5px; font-weight: 600; }
.sp-stage-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sp-screen-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; line-height: 1.25; letter-spacing: -.2px; }
.sp-screen-purpose { font-size: 12.5px; color: var(--g2); line-height: 1.6; margin-top: 3px; }

/* ── PHONE ── */
.phone { background: var(--ink); border-radius: 22px; padding: 6px; box-shadow: 0 12px 36px rgba(0,0,0,.18); width: 216px; align-self: flex-start; }
.phone-inner { background: #fff; border-radius: 17px; overflow: hidden; min-height: 400px; display: flex; flex-direction: column; }
.ph-bar { background: var(--ink); color: rgba(255,255,255,.6); font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; padding: 5px 12px; display: flex; justify-content: space-between; }
.ph-nav { padding: 7px 10px 6px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; background: #fff; }
.ph-back { font-size: 8px; color: var(--g3); }
.ph-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 10.5px; flex: 1; text-align: center; }
.ph-body { padding: 8px 9px; flex: 1; background: #F7F6F2; }

/* ── FORM ELEMENTS ── */
.gf { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; }
.gf.accent-red { border-top: 5px solid var(--red); }
.gf.accent-green { border-top: 5px solid var(--green); }
.gf.accent-blue { border-top: 5px solid var(--blue); }
.gf.accent-amber { border-top: 5px solid var(--amber); }
.gf.plain { border-top: 1px solid var(--border); }
.gf-h { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 10.5px; margin-bottom: 2px; }
.gf-sub { font-size: 8px; color: var(--g2); line-height: 1.5; margin-bottom: 7px; }
.gf-label { font-size: 8px; font-weight: 600; display: block; margin-bottom: 2px; }
.gf-req { color: var(--red); }
.gf-input { width: 100%; border: 0; border-bottom: 1.5px solid var(--border); padding: 3px 1px; font-size: 9px; background: transparent; outline: none; margin-bottom: 7px; }
.gf-input.filled { border-bottom-color: var(--green); }
.photo-box { border: 1.5px dashed var(--border); border-radius: 5px; padding: 7px; text-align: center; font-size: 8px; color: var(--g3); margin-bottom: 5px; }
.photo-box.ok { border-color: var(--green); background: var(--green-s); color: var(--green); }
.photo-box.ai-pending { border-color: var(--blue); background: var(--blue-s); color: var(--blue); }
.photo-box.required { border-color: var(--red); background: var(--red-s); color: var(--red); }
.ai-strip { background: var(--blue-s); border-radius: 4px; padding: 3px 6px; font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: var(--blue); margin-top: 2px; display: block; }
.ai-pass { background: var(--green-s); border-radius: 4px; padding: 3px 6px; font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: var(--green); margin-top: 2px; display: block; }
.ai-fail { background: var(--red-s); border-radius: 4px; padding: 3px 6px; font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: var(--red); margin-top: 2px; display: block; }
.gf-btn { display: block; text-align: center; padding: 7px; border-radius: 7px; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 10px; cursor: pointer; margin-top: 5px; letter-spacing: .3px; }
.gf-btn.red { background: var(--red); color: #fff; }
.gf-btn.green { background: var(--green); color: #fff; }
.gf-btn.blue { background: var(--blue); color: #fff; }
.gf-btn.amber { background: var(--amber); color: #fff; }
.gf-check { display: flex; align-items: center; gap: 5px; font-size: 8px; margin-bottom: 4px; }
.gf-cb { width: 13px; height: 13px; border-radius: 3px; border: 1.5px solid var(--g4); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 8px; color: #fff; }
.gf-cb.on { background: var(--green); border-color: var(--green); }

/* ── DASHBOARD ── */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 7px; }
.dash-stat { background: #fff; border-radius: 6px; padding: 5px 6px; }
.ds-v { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 17px; line-height: 1; }
.ds-l { font-size: 7px; color: var(--g3); margin-top: 1px; }
.ip-perf-row { display: flex; align-items: center; gap: 5px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 8px; }
.ip-perf-row:last-child { border-bottom: none; }
.ipr-n { flex: 1; font-weight: 600; }
.ipr-bar { width: 38px; height: 3px; background: var(--border); border-radius: 2px; }
.ipr-bar i { height: 3px; border-radius: 2px; display: block; }
.ipr-s { font-family: 'IBM Plex Mono', monospace; font-size: 7px; font-weight: 700; }

/* ── LIST ITEMS ── */
.list-item { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin-bottom: 5px; position: relative; }
.li-usc { font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: var(--g3); }
.li-name { font-size: 9px; font-weight: 600; margin-top: 1px; }
.li-loc { font-size: 7.5px; color: var(--g2); margin-top: 1px; }
.li-badge { position: absolute; top: 6px; right: 7px; font-family: 'IBM Plex Mono', monospace; font-size: 7px; font-weight: 700; padding: 2px 5px; border-radius: 3px; letter-spacing: .3px; }
.lb-go { background: var(--green-s); color: var(--green); }
.lb-block { background: var(--bg); color: var(--g3); }
.lb-rework { background: var(--red-s); color: var(--red); }
.lb-overdue { background: #FFE8E8; color: var(--red); }
.exc-item { display: flex; gap: 6px; padding: 5px 7px; background: #FFF7F7; border: 1px solid rgba(217,31,38,.15); border-radius: 6px; margin-bottom: 4px; }
.exc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex-shrink: 0; margin-top: 3px; }
.exc-usc { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 600; }
.exc-why { font-size: 7.5px; color: var(--g2); }
.exc-day { font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: var(--red); font-weight: 700; }
.step-row { display: flex; gap: 6px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-num { width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 7px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.snn-done { background: var(--green); color: #fff; }
.snn-act { background: var(--red); color: #fff; }
.snn-todo { background: var(--border); color: var(--g3); }
.step-t { font-size: 8.5px; font-weight: 600; }
.step-s { font-size: 7px; color: var(--g3); margin-top: 1px; }
.info-row { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; color: var(--g2); padding: 4px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row strong { color: var(--ink); }
.dispatch-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; margin-bottom: 5px; }
.dc-h { font-weight: 600; font-size: 9px; margin-bottom: 4px; }
.dc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 5px; }
.dc-stat { background: var(--soft); border-radius: 4px; padding: 4px 5px; }
.dc-stat-v { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px; line-height: 1; }
.dc-stat-l { font-size: 7px; color: var(--g3); }
.rework-notice { background: var(--red-s); border: 1px solid rgba(217,31,38,.2); border-radius: 6px; padding: 7px 8px; margin-bottom: 5px; }
.rw-h { font-weight: 700; font-size: 8.5px; color: var(--red); margin-bottom: 3px; }
.rw-b { font-size: 8px; color: var(--g1); line-height: 1.5; }
.deadline-bar { background: #fff; border-radius: 5px; padding: 4px 6px; margin-top: 4px; display: flex; align-items: center; justify-content: space-between; }
.dl-d { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; color: var(--red); }
.dl-l { font-size: 7.5px; color: var(--g3); }
.scorecard { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; margin-bottom: 5px; }
.sc-h { font-weight: 600; font-size: 9px; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.sc-row { display: flex; align-items: center; gap: 5px; font-size: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.sc-row:last-child { border-bottom: none; }
.sc-l { flex: 1; color: var(--g2); }
.sc-v { font-weight: 700; font-family: 'IBM Plex Mono', monospace; font-size: 8.5px; }

/* ── AI PIPELINE ── */
.sp-right { padding-left: 4px; }
.ai-pipeline { background: linear-gradient(160deg, #0F172A 0%, #1E293B 100%); border-radius: 14px; padding: 18px 20px; color: #E2E8F0; position: relative; overflow: hidden; }
.ai-pipeline::before { content: ''; position: absolute; top: -40%; right: -5%; width: 280px; height: 280px; background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 65%); pointer-events: none; }
.aip-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; flex-wrap: wrap; }
.aip-badge { background: rgba(37,99,235,.25); border: 1px solid rgba(99,139,255,.3); color: #93C5FD; font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: .8px; padding: 3px 8px; border-radius: 5px; text-transform: uppercase; }
.aip-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: #fff; letter-spacing: -.2px; }
.aip-trigger { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: #94A3B8; margin-bottom: 14px; padding: 6px 10px; background: rgba(255,255,255,.04); border-left: 2px solid #3B82F6; border-radius: 0 6px 6px 0; line-height: 1.55; }
.aip-trigger strong { color: #BFDBFE; font-weight: 600; }
.aip-steps { display: flex; flex-direction: column; gap: 6px; position: relative; }
.aip-step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 6px 0; align-items: flex-start; position: relative; }
.aip-step:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 30px; width: 2px; height: calc(100% - 24px); background: rgba(100,130,255,.18); }
.aip-step-num { width: 26px; height: 26px; border-radius: 50%; background: rgba(37,99,235,.3); border: 1.5px solid rgba(99,139,255,.45); display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; color: #93C5FD; flex-shrink: 0; position: relative; z-index: 2; }
.aip-step-num.human { background: rgba(217,119,6,.3); border-color: rgba(251,191,36,.45); color: #FCD34D; }
.aip-step-num.ai { background: rgba(5,150,105,.3); border-color: rgba(52,211,153,.5); color: #6EE7B7; }
.aip-step-content { padding-top: 2px; }
.aip-step-title { font-size: 12.5px; font-weight: 600; color: #fff; margin-bottom: 3px; letter-spacing: -.1px; }
.aip-step-actor { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: #64748B; letter-spacing: .3px; text-transform: uppercase; display: inline-block; margin-right: 6px; font-weight: 600; }
.aip-step-actor.human  { color: #FCD34D; }
.aip-step-actor.ai     { color: #6EE7B7; }
.aip-step-actor.system { color: #93C5FD; }
.aip-step-detail { font-size: 11.5px; color: #94A3B8; line-height: 1.6; margin-top: 3px; }
.aip-step-code { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: #BFDBFE; background: rgba(0,0,0,.3); padding: 5px 9px; border-radius: 5px; margin-top: 5px; display: block; line-height: 1.55; word-break: break-word; }
.aip-step-result { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-top: 5px; letter-spacing: .3px; }
.aip-result-pass   { background: rgba(52,211,153,.15); color: #6EE7B7; border: 1px solid rgba(52,211,153,.3); }
.aip-result-fail   { background: rgba(248,113,113,.15); color: #FCA5A5; border: 1px solid rgba(248,113,113,.3); }
.aip-result-review { background: rgba(251,191,36,.15); color: #FCD34D; border: 1px solid rgba(251,191,36,.3); }
.aip-db-write { background: rgba(8,145,178,.15); border: 1px solid rgba(103,232,249,.2); border-radius: 6px; padding: 6px 10px; margin-top: 6px; }
.aip-db-write-h { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: #67E8F9; letter-spacing: .5px; font-weight: 700; margin-bottom: 4px; }
.aip-db-fields { display: flex; flex-wrap: wrap; gap: 3px; }
.aip-db-field { font-family: 'IBM Plex Mono', monospace; font-size: 9px; background: rgba(103,232,249,.12); color: #A5F3FC; padding: 2px 5px; border-radius: 3px; }
.aip-footer { display: flex; gap: 14px; padding-top: 12px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.07); flex-wrap: wrap; }
.aip-foot-item { font-size: 11px; color: #64748B; }
.aip-foot-item strong { color: #E2E8F0; font-weight: 600; }

/* ── NO-AI PANEL ── */
.no-ai-note { background: var(--soft); border: 1px dashed var(--border); border-radius: 10px; padding: 13px 15px; }
.no-ai-tag { font-family: 'IBM Plex Mono', monospace; font-size: 8px; color: var(--amber); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.no-ai-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.no-ai-desc { font-size: 10.5px; color: var(--g2); line-height: 1.6; }
.no-ai-step { display: flex; gap: 8px; padding: 5px 0; font-size: 10.5px; align-items: flex-start; }
.no-ai-step-num { background: var(--ink); color: #fff; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.no-ai-step-text { color: var(--g1); line-height: 1.55; }
.no-ai-db { background: var(--teal-s); border: 1px solid rgba(10,112,133,.2); border-radius: 5px; padding: 6px 9px; margin-top: 10px; }
.no-ai-db-h { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; color: var(--teal); font-weight: 700; margin-bottom: 3px; }
.no-ai-db-fields { display: flex; flex-wrap: wrap; gap: 3px; }
.no-ai-db-field { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; background: var(--teal-m); color: var(--teal); padding: 1px 4px; border-radius: 2px; }

/* ── EXTRAS SECTIONS ── */
.fork-section { margin-top: 24px; max-width: 520px; }
.fork-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.fork-head { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.fork-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fork-branch { padding: 10px 12px; border-radius: 7px; border: 1px solid; }
.fb-tg { background: var(--red-s); border-color: var(--red-m); }
.fb-ap { background: var(--blue-s); border-color: var(--blue-m); }
.fb-tag { font-family: 'IBM Plex Mono', monospace; font-size: 8px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 5px; }
.fb-rule { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 11.5px; margin-bottom: 3px; }
.fb-code { font-family: 'IBM Plex Mono', monospace; font-size: 8px; background: rgba(0,0,0,.07); padding: 2px 6px; border-radius: 3px; display: inline-block; }
.rework-section { margin-top: 24px; background: #FFF8F7; border: 1.5px dashed rgba(217,31,38,.3); border-radius: 12px; padding: 14px 18px; max-width: 820px; }
.rework-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px; color: var(--red); margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.rework-desc { font-size: 11px; color: var(--g2); line-height: 1.65; margin-bottom: 10px; }
.rework-steps { display: flex; gap: 7px; flex-wrap: wrap; }
.rs { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 4px 7px; font-size: 10.5px; }
.rs-n { width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 7px; font-weight: 700; flex-shrink: 0; }
.deps-section { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 820px; }
.dep-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.dep-h { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.dep-item { display: flex; gap: 9px; padding: 8px; background: var(--soft); border-radius: 7px; margin-bottom: 6px; }
.dep-item-name { font-weight: 600; font-size: 11.5px; }
.dep-item-desc { font-size: 10.5px; color: var(--g2); margin-top: 2px; line-height: 1.5; }
.dep-fields { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.dep-field { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; background: var(--teal-m); color: var(--teal); padding: 1px 5px; border-radius: 2px; }

/* ── POPUP ── */
.pop-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 500; padding: 24px; }
.pop-overlay.open { display: flex; }
.pop-card { background: #fff; border-radius: 20px; max-width: 520px; width: 100%; max-height: 84vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05); }
.pop-head { padding: 24px 26px 16px; border-bottom: 1px solid var(--border); }
.pop-eye { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; padding: 4px 10px; border-radius: 5px; display: inline-block; margin-bottom: 10px; }
.pe-ai   { background: var(--blue-s);   color: var(--blue); }
.pe-man  { background: var(--amber-s);  color: var(--amber); }
.pe-db   { background: var(--teal-s);   color: var(--teal); }
.pe-gate { background: var(--red-s);    color: var(--red); }
.pe-ext  { background: var(--purple-s); color: var(--purple); }
.pe-role { background: var(--soft);     color: var(--g1); }
.pop-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.5px; line-height: 1.25; color: var(--ink); }
.pop-body { padding: 20px 26px 24px; }
.pop-desc { font-size: 13.5px; color: var(--g2); line-height: 1.75; margin-bottom: 16px; }
.pop-sec { margin-bottom: 14px; }
.pop-sec-l { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; color: var(--g3); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 5px; }
.pop-sec-v { font-size: 13px; color: var(--ink); line-height: 1.65; }
.pop-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pop-field { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 3px 8px; border-radius: 4px; font-weight: 500; }
.pf-db { background: var(--teal-s); color: var(--teal); }
.pf-ai { background: var(--blue-s); color: var(--blue); }
.pop-close { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 14px 26px; text-align: right; display: flex; gap: 8px; justify-content: flex-end; }
.pop-close-btn { background: var(--ink); color: #fff; border: none; border-radius: 8px; padding: 9px 24px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s; letter-spacing: -.1px; }
.pop-close-btn:hover { background: #1e293b; }

/* ── COMMENT SYSTEM ── */
.comment-panel { position: fixed; right: 0; top: 56px; width: 320px; background: var(--white); border-left: 1px solid var(--border); padding: 0; height: calc(100vh - 56px); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); z-index: 300; box-shadow: -8px 0 32px rgba(0,0,0,.08); }
.comment-panel.open { transform: translateX(0); }
.cp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.cp-title { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: -.1px; }
.cp-head button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--g3); line-height: 1; padding: 0 2px; transition: color .15s; }
.cp-head button:hover { color: var(--ink); }
.cp-actions { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.cp-actions button { font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 500; padding: 5px 12px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--soft); color: var(--g2); transition: border-color .15s, background .15s; }
.cp-actions button:hover { border-color: var(--g3); background: var(--white); color: var(--ink); }
.cp-list { flex: 1; overflow-y: auto; padding: 14px 14px; }
.cp-empty { text-align: center; color: var(--g3); font-size: 13px; margin-top: 48px; line-height: 1.6; }
.cp-item { background: var(--soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.cp-item-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cp-item-badge { background: var(--blue); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 700; flex-shrink: 0; }
.cp-item-author { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); }
.cp-item-target { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; color: var(--teal); margin-bottom: 5px; }
.cp-item-text { font-size: 13px; color: var(--ink); line-height: 1.55; }
.cp-item-delete { float: right; cursor: pointer; color: var(--g3); font-size: 14px; background: none; border: none; padding: 0; margin-left: 6px; transition: color .15s; }
.cp-item-delete:hover { color: var(--red); }
.comment-badge { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); color: #fff; font-family: 'IBM Plex Mono', monospace; font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.sn-card { position: relative; }
.screen-pair { position: relative; }
.comment-mode .sn-card:hover, .comment-mode .screen-pair:hover { outline: 2px dashed var(--blue); outline-offset: 2px; cursor: crosshair; }

/* ── COMMENT INPUT POPUP ── */
.comment-input-popup { position: fixed; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05); padding: 18px; width: 300px; z-index: 600; }
.cip-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 14px; letter-spacing: -.2px; }
.cip-label { font-size: 11px; font-weight: 600; margin-bottom: 4px; display: block; color: var(--g2); }
.cip-author { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 13px; outline: none; margin-bottom: 10px; font-family: 'Inter', sans-serif; transition: border-color .15s; }
.cip-author:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.cip-text { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; font-size: 13px; outline: none; min-height: 90px; resize: vertical; margin-bottom: 12px; font-family: 'Inter', sans-serif; transition: border-color .15s; }
.cip-text:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.cip-actions { display: flex; gap: 8px; }
.cip-save { background: var(--blue); color: #fff; border: none; border-radius: 7px; padding: 9px 18px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; flex: 1; transition: background .15s; }
.cip-save:hover { background: #1d4ed8; }
.cip-cancel { background: var(--soft); border: 1px solid var(--border); border-radius: 7px; padding: 9px 14px; font-size: 13px; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 500; transition: border-color .15s; }
.cip-cancel:hover { border-color: var(--g3); }

/* ── LOGIN PHONE ── */
.login-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.login-context { flex: 1; }
.login-context-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.login-context-desc { font-size: 11.5px; color: var(--g2); line-height: 1.7; margin-bottom: 14px; }
.login-context-points { list-style: none; }
.login-context-points li { font-size: 11px; color: var(--g1); padding: 5px 0; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.login-context-points li:last-child { border-bottom: none; }
.lcp-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.login-role-strip { display: flex; gap: 3px; margin: 8px 0; }
.lrs-btn { flex: 1; padding: 5px 4px; text-align: center; border-radius: 5px; font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; letter-spacing: .3px; border: 1.5px solid var(--border); color: var(--g3); cursor: pointer; background: #fff; }
.lrs-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ══════════════════════════════════════
   CEO DESKTOP DASHBOARD
══════════════════════════════════════ */
.ceo-wrap { max-width: 1400px; }

/* Header */
.ceo-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.ceo-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.ceo-title { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 32px; letter-spacing: -.5px; line-height: 1.1; margin-bottom: 6px; }
.ceo-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--g3); letter-spacing: .5px; }
.ceo-kpi-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* KPI chips */
.ceo-kpi-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 22px; min-width: 120px; cursor: pointer; transition: box-shadow .15s, transform .12s; box-shadow: var(--shadow-sm); }
.ceo-kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ceo-kpi-card--active { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ceo-kpi-value { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 30px; line-height: 1; margin-bottom: 5px; letter-spacing: -1px; }
.ceo-kpi-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); letter-spacing: .8px; text-transform: uppercase; }

/* Section label */
.ceo-grid-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ceo-grid-label span:first-child { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); }
.ceo-grid-hint { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); letter-spacing: .3px; }

/* Mandal grid */
.ceo-mandal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

/* Mandal card */
.ceo-mandal-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; transition: box-shadow .15s; }
.ceo-mandal-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.09); }
.ceo-mandal-card--on { outline: 2.5px solid var(--ink); }
.ceo-mc-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 16px 10px; cursor: pointer; }
.ceo-mc-head:hover { background: var(--soft); }
.ceo-mc-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.ceo-mc-sub { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--g3); letter-spacing: .5px; }
.ceo-mc-pct { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 20px; line-height: 1; }
.ceo-mc-bar { height: 3px; background: var(--border); margin: 0 16px 12px; border-radius: 2px; }
.ceo-mc-bar-fill { height: 3px; border-radius: 2px; transition: width .4s ease; }
.ceo-mc-cells { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.ceo-mc-cell { padding: 10px 14px; cursor: pointer; transition: background .12s; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ceo-mc-cell:nth-child(2n) { border-right: none; }
.ceo-mc-cell:nth-child(3), .ceo-mc-cell:nth-child(4) { border-bottom: none; }
.ceo-mc-cell:hover { background: var(--soft); }
.ceo-mc-cell--on { }
.ceo-mc-val { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 22px; line-height: 1; margin-bottom: 2px; }
.ceo-mc-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--g3); letter-spacing: .8px; text-transform: uppercase; }
.ceo-mc-stuck { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 700; color: var(--red); background: var(--red-s); padding: 5px 16px; letter-spacing: .3px; }

/* Filter bar */
.ceo-filter-bar { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ceo-filter-bar--muted { background: transparent; border-color: transparent; }
.ceo-fb-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); letter-spacing: .5px; font-weight: 600; }
.ceo-fb-chip { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 11px; border-radius: 4px; }
.ceo-fb-mandal { background: var(--ink); color: #fff; }
.ceo-fb-count { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g2); margin-left: 4px; }
.ceo-fb-clear { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; background: none; border: 1px solid var(--border); border-radius: 5px; padding: 4px 11px; cursor: pointer; color: var(--g2); letter-spacing: .3px; }
.ceo-fb-clear:hover { border-color: var(--red); color: var(--red); }

/* Record list */
.ceo-list { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ceo-list-head { display: grid; grid-template-columns: 130px 1fr 100px 130px 140px 110px 100px; gap: 0; background: var(--soft); border-bottom: 1.5px solid var(--border); padding: 10px 16px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--g3); }
.ceo-list-body { max-height: 480px; overflow-y: auto; }
.ceo-row { display: grid; grid-template-columns: 130px 1fr 100px 130px 140px 110px 100px; gap: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: center; font-size: 12px; transition: background .1s; }
.ceo-row:last-child { border-bottom: none; }
.ceo-row:hover { background: var(--soft); }
.ceo-row--stuck { background: rgba(217,31,38,.03); }
.ceo-row-usc { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g2); }
.ceo-row-name { font-weight: 600; font-size: 13px; }
.ceo-row-mandal { font-size: 12px; color: var(--g2); }
.ceo-row-ip { font-size: 12px; }
.ceo-row-stage { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g2); }
.ceo-badge { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: .4px; }
.ceo-row-days { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); }
.ceo-row-days--stuck { color: var(--red); font-weight: 700; }
.ceo-no-records { padding: 40px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--g3); }
.ceo-more-note { padding: 12px 16px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--g3); border-top: 1px solid var(--border); background: var(--soft); }

/* CEO tab colour */
.hdr-tab.t-ceo.active { background: #5B2CB8; color: #fff; }

/* ── TWEAKS: density ── */
body.tweak-density-compact .ceo-mandal-grid { gap: 8px; }
body.tweak-density-compact .ceo-mc-cell { padding: 7px 10px; }
body.tweak-density-compact .ceo-mc-val { font-size: 18px; }
body.tweak-density-compact .ceo-row { padding: 7px 14px; font-size: 11px; }
body.tweak-density-compact .ceo-kpi-value { font-size: 26px; }
body.tweak-density-spacious .ceo-mandal-grid { gap: 18px; }
body.tweak-density-spacious .ceo-mc-cell { padding: 16px 18px; }
body.tweak-density-spacious .ceo-mc-val { font-size: 28px; }
body.tweak-density-spacious .ceo-row { padding: 14px 20px; font-size: 13px; }
body.tweak-density-spacious .ceo-kpi-value { font-size: 40px; }

/* ── TWEAKS: tone ── */
body.tweak-tone-clinical { --bg:#FAFAFA; --soft:#F4F4F4; --border:#E0E0E0; --white:#FFFFFF; }
body.tweak-tone-clinical .ceo-title, body.tweak-tone-clinical .ceo-mc-name { font-family: 'Inter', sans-serif; font-weight: 700; }
body.tweak-tone-clinical .ceo-kpi-value, body.tweak-tone-clinical .ceo-mc-val, body.tweak-tone-clinical .ceo-mc-pct { font-family: 'Inter', sans-serif; }
body.tweak-tone-dark { --bg:#111217; --soft:#1A1B22; --white:#1F2128; --border:#2C2E38; --ink:#F0F0F0; --g1:#D0D0D0; --g2:#9A9A9A; --g3:#666; --g4:#3A3A3A; }
body.tweak-tone-dark .hdr { background: #0A0B0E; }
body.tweak-tone-dark .ceo-mc-head:hover, body.tweak-tone-dark .ceo-row:hover { background: rgba(255,255,255,.04); }

/* ── TWEAKS: focus ── */
body.tweak-focus-exceptions .ceo-mandal-card { opacity: .7; }
body.tweak-focus-exceptions .ceo-mandal-card:has(.ceo-mc-stuck) { opacity: 1; outline: 2px solid var(--red); }
body.tweak-focus-exceptions .ceo-row:not(.ceo-row--stuck) { opacity: .45; }
body.tweak-focus-exceptions .ceo-row--stuck { background: rgba(217,31,38,.06); }
body.tweak-focus-progress .ceo-mandal-card { filter: grayscale(.6); }
body.tweak-focus-progress .ceo-mc-cell:first-child, body.tweak-focus-progress .ceo-mc-cell:nth-child(2) { filter: none; }

/* ── DATABASE SECTION ─────────────────────────── */
.db-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1.5px solid var(--border);
}

/* Top bar: stats + legend */
.db-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.db-stats { display: flex; gap: 24px; }
.db-stat { display: flex; flex-direction: column; align-items: center; }
.db-stat-v { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 22px; line-height: 1; color: var(--ink); }
.db-stat-l { font-family: 'IBM Plex Mono', monospace; font-size: 8.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--g3); margin-top: 2px; }
.db-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.db-leg { display: flex; align-items: center; gap: 5px; font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--g2); }
.db-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.db-act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
  transition: all .14s; text-decoration: none; white-space: nowrap; border: 1.5px solid;
}
.db-act-primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.db-act-primary:hover { background: #1F2937; box-shadow: var(--shadow-md); }
.db-act-primary:disabled { opacity: .6; cursor: not-allowed; }
.db-act-ghost { background: transparent; border-color: var(--border); color: var(--g2); }
.db-act-ghost:hover { border-color: var(--g3); color: var(--ink); background: var(--soft); }
.db-act-icon { font-style: normal; font-size: 13px; }

/* Badge classes (shared: topbar legend + column rows) */
.dbc-pk { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: rgba(217,119,6,.13); color: #B45309; white-space: nowrap; }
.dbc-fk { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: rgba(37,99,235,.10); color: #2563EB; white-space: nowrap; }
.dbc-uk { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: rgba(5,150,105,.12); color: #047857; white-space: nowrap; }
.dbc-ai { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: rgba(124,58,237,.10); color: #7C3AED; white-space: nowrap; }

/* Section group */
.db-sg { margin-bottom: 32px; }
.db-sg-hd {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sec-color, #475569);
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.db-sg-icon { font-size: 18px; flex-shrink: 0; }
.db-sg-info { flex: 1; min-width: 0; }
.db-sg-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); }
.db-sg-desc { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--g3); margin-top: 2px; }
.db-sg-counts { display: flex; gap: 6px; flex-shrink: 0; }
.db-sg-chip { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 600; padding: 3px 9px; border-radius: 4px; background: var(--soft); border: 1px solid var(--border); color: var(--g2); }

/* Table card grid */
.db-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1280px) { .db-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px)  { .db-grid { grid-template-columns: 1fr; } }

/* Table card */
.db-tc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .14s;
}
.db-tc:hover { box-shadow: var(--shadow-md); }

.db-tc-hd { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.db-tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.db-tc-name { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 11px; color: var(--ink); letter-spacing: .3px; }
.db-tc-chips { display: flex; gap: 4px; }
.db-tc-chip { font-family: 'IBM Plex Mono', monospace; font-size: 8px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: var(--soft); border: 1px solid var(--border); color: var(--g3); }
.dbtc-fk { background: rgba(37,99,235,.07); border-color: rgba(37,99,235,.18); color: #2563EB; }
.dbtc-ai { background: rgba(124,58,237,.07); border-color: rgba(124,58,237,.18); color: #7C3AED; }
.db-tc-desc { font-family: 'IBM Plex Mono', monospace; font-size: 8.5px; color: var(--g3); line-height: 1.4; }

/* Column rows */
.db-col-list { padding: 2px 0 4px; }
.db-cr {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 14px;
  transition: background .1s;
  min-height: 26px;
}
.db-cr:hover { background: var(--soft); }
.db-cr-pk { background: rgba(217,119,6,.04); }
.db-cr-pk:hover { background: rgba(217,119,6,.08); }
.db-cr-audit { opacity: .5; }
.db-cr-audit:hover { opacity: 1; }

.db-ct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--soft);
  color: var(--g3);
  border: 1px solid var(--border);
  width: 38px;
  text-align: center;
  flex-shrink: 0;
}
/* Type chip color variations */
.db-ct[data-type="uuid"]      { background: rgba(71,85,105,.07);  color: #475569; border-color: rgba(71,85,105,.15); }
.db-ct[data-type="boolean"]   { background: rgba(5,150,105,.08);  color: #047857; border-color: rgba(5,150,105,.18); }
.db-ct[data-type="enum"]      { background: rgba(124,58,237,.07); color: #7C3AED; border-color: rgba(124,58,237,.15); }
.db-ct[data-type="timestamp"] { background: rgba(156,163,175,.12); color: #9CA3AF; border-color: rgba(156,163,175,.2); }
.db-ct[data-type="date"]      { background: rgba(156,163,175,.12); color: #9CA3AF; border-color: rgba(156,163,175,.2); }
.db-ct[data-type="decimal"]   { background: rgba(8,145,178,.07);  color: #0891B2; border-color: rgba(8,145,178,.15); }
.db-ct[data-type="integer"]   { background: rgba(8,145,178,.07);  color: #0891B2; border-color: rgba(8,145,178,.15); }
.db-ct[data-type="bigint"]    { background: rgba(8,145,178,.07);  color: #0891B2; border-color: rgba(8,145,178,.15); }

.db-cn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  color: var(--g1);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-cnote {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7.5px;
  color: var(--g3);
  font-style: italic;
  flex: 2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-badges { display: flex; gap: 3px; flex-shrink: 0; }

/* ── DB CHIPS ON FLOW NODES ── */
.sn-db-row { display:flex; gap:3px; flex-wrap:wrap; margin-top:7px; padding-top:6px; border-top:1px solid var(--border); }
.sn-db-pill { font-family:'IBM Plex Mono',monospace; font-size:8.5px; font-weight:700; padding:2px 7px; border-radius:3px; letter-spacing:.2px; cursor:pointer; transition:opacity .12s; }
.sn-db-pill:hover { opacity:.7; }

/* ── FOOTER ── */
.page-footer { background: #0F172A; padding: 20px 36px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 48px; border-top: 1px solid rgba(255,255,255,.06); }
.page-footer span { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: rgba(255,255,255,.35); letter-spacing: .3px; }
.page-footer strong { color: rgba(255,255,255,.65); }

@media (max-width: 900px) {
  .screen-pair { grid-template-columns: 1fr; }
  .phone { width: 210px; }
  .hdr-tabs { gap: 2px; }
  .hdr-tab { font-size: 8px; padding: 4px 8px; }
}
