/* ============================================================
   LIFTED // Mission Control — sidebar + full-size views
   Tinted near-black (blue-violet), indigo accent, JetBrains Mono
   on numerics/logs. Readable, spacious, interactive.
   ============================================================ */
:root {
  --bg:        #0B0D12;
  --surface:   #12151D;
  --surface-2: #171B26;
  --surface-3: #1F2433;
  --border:    rgba(150,170,210,0.12);
  --border-2:  rgba(150,170,210,0.22);
  --text:      #EEF1F7;
  --text-2:    #AAB3C7;
  --muted:     #6B7589;
  --accent:    #19D27E;
  --accent-2:  #34E88A;
  --glow:      rgba(25,210,126,0.22);
  --green:     #34D399;
  --amber:     #FBBF24;
  --red:       #F87171;
  --blue:      #60A5FA;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --sidebar-w: 232px;
  --topbar-h: 60px;
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans); color: var(--text); font-size: 15px;
  background:
    radial-gradient(1000px 560px at 80% -10%, rgba(25,210,126,0.10), transparent 60%),
    radial-gradient(820px 520px at 0% 110%, rgba(52,232,138,0.07), transparent 55%),
    var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; overflow: hidden;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
h1,h2,h3 { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== TOP BAR ===================== */
.topbar {
  position: relative; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px; padding: 0 22px;
  background: linear-gradient(180deg, rgba(11,13,18,0.96), rgba(11,13,18,0.80));
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 9px; width: calc(var(--sidebar-w) - 22px); }
.brand-mark { color: var(--accent); font-size: 16px; filter: drop-shadow(0 0 8px var(--glow)); }
.brand-name { font-weight: 700; letter-spacing: 0.14em; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 10.5px; letter-spacing: 0.16em; }
.cmdk-hint {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2); padding: 8px 16px;
  border-radius: 10px; cursor: pointer; font-size: 13px; min-width: 280px;
}
.cmdk-hint:hover { border-color: var(--border-2); color: var(--text); }
.cmdk-hint i { width: 15px; height: 15px; }
.cmdk-hint kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.autopilot { display: flex; align-items: center; gap: 10px; }
.ap-label { font-size: 10.5px; letter-spacing: 0.16em; color: var(--muted); }
.ap-state { font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); min-width: 62px; }
.autopilot.on .ap-state { color: var(--accent-2); text-shadow: 0 0 12px var(--glow); }
.switch { width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); position: relative; cursor: pointer; transition: background .25s; }
.switch.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.switch.on .knob { transform: translateX(20px); }
.topbar-spend { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--muted); }
.topbar-spend b { font-family: var(--mono); color: var(--text-2); font-size: 13px; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.live .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: breathe 2s infinite; }
.conn.down .dot { background: var(--red); }
.clock { font-size: 13px; color: var(--text-2); }
@keyframes breathe { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ===================== SHELL: sidebar + main ===================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: calc(100vh - var(--topbar-h)); }
.sidebar { border-right: 1px solid var(--border); padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; background: rgba(18,21,29,0.4); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500; border: 1px solid transparent; position: relative; }
.nav-item i { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--glow); }
.nav-badge { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center; }
.nav-badge.alert { background: rgba(52,232,138,.18); color: var(--accent-2); }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.sidebar-foot { margin-top: auto; padding: 10px 13px; font-size: 11px; color: var(--muted); }

.main { overflow-y: auto; padding: 24px 28px 40px; position: relative; }
.view-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.view-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.view-head .sub { color: var(--muted); font-size: 13px; }
.view-head .spacer { margin-left: auto; }

/* ===================== CARDS / TILES ===================== */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 16px 44px -30px rgba(0,0,0,.8); }
.tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; color: var(--muted); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid-cards { display: grid; gap: 16px; }
@media (max-width: 1200px){ .grid-2 { grid-template-columns: 1fr; } }

/* HERO */
.hero { position: relative; overflow: hidden; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-glow { position: absolute; right: -60px; top: -90px; width: 340px; height: 340px; background: radial-gradient(circle, var(--glow), transparent 62%); filter: blur(44px); pointer-events: none; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pulse.on { background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2); animation: breathe 1.6s infinite; }
.hero-title { font-size: 30px; font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; margin: 6px 0 0; font-family: var(--mono); background: linear-gradient(180deg,#fff,#c9cfe0); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-word; }
.hero-meta { color: var(--text-2); margin: 12px 0 0; display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.hero-foot { display: flex; justify-content: space-between; font-size: 12px; margin-top: 14px; color: var(--muted); }
.chip { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; font-size: 12px; color: var(--text-2); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.kpi-section { margin-bottom: 16px; }
.kpi-section:last-child { margin-bottom: 0; }
.kpi-section-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--accent-2); letter-spacing: .04em; margin: 4px 0 9px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.kpi { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px 12px; overflow: hidden; transition: transform .12s, border-color .2s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-2); }
.kpi-biz { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi-value { font-size: 28px; font-weight: 500; margin-top: 6px; font-family: var(--mono); }
.kpi-unit { color: var(--text-2); font-size: 17px; }
.kpi-delta { font-size: 11.5px; margin-top: 2px; }
.kpi-delta.up { color: var(--green); } .kpi-delta.down { color: var(--red); } .kpi-delta.flat { color: var(--muted); }
.spark { position: absolute; right: 0; bottom: 0; width: 64%; height: 30px; opacity: .75; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.8; }

/* ACTIVITY */
.stream-body { display: flex; flex-direction: column; gap: 3px; }
.ev { display: grid; grid-template-columns: 64px 12px 110px 96px 1fr; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.ev:hover { background: var(--surface-2); }
.ev-time { color: var(--muted); font-size: 11.5px; }
.ev-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; }
.ev-src { color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-type { color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ev-sum { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.full .ev-sum { white-space: normal; }
.ev.tool .ev-dot { background: var(--accent); }
.ev.stop .ev-dot { background: var(--green); }
.ev.notify .ev-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.ev.start .ev-dot { background: var(--accent-2); }
.ev.chat .ev-dot { background: var(--blue); }
.mini-stream .ev { grid-template-columns: 58px 10px 1fr; }
.mini-stream .ev .ev-src, .mini-stream .ev .ev-type { display: none; }

/* KANBAN */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; min-width: 0; }
.col-head { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .06em; color: var(--text-2); text-transform: uppercase; margin-bottom: 11px; font-weight: 600; }
.col-count { font-family: var(--mono); color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 10px; padding: 12px 13px; cursor: pointer; transition: transform .12s, border-color .2s; }
.card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.card.p0 { border-left-color: var(--red); } .card.p1 { border-left-color: var(--amber); }
.card.p2 { border-left-color: var(--accent); } .card.p3 { border-left-color: var(--muted); }
.card-title { font-size: 14px; line-height: 1.32; font-weight: 500; }
.card-desc { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tag { font-size: 10.5px; background: var(--surface-3); border-radius: 6px; padding: 2px 8px; color: var(--text-2); }
.who { font-size: 11px; color: var(--muted); }
.ap-dot { font-size: 12px; }
.card-actions { margin-top: 9px; display: flex; gap: 6px; }
.card-actions button { font-size: 11px; background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.card-actions button:hover { border-color: var(--accent); color: var(--text); }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 16px 0; opacity: .5; }

/* DEPLOYMENTS */
.dep { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.dep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dep-name { font-size: 16px; font-weight: 600; }
.dep-mission { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dep-url { font-size: 12px; color: var(--accent); margin-top: 4px; display: inline-block; }
.dep-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dep-badge { font-size: 10px; letter-spacing: .1em; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; font-weight: 600; }
.dep-badge.up { background: rgba(52,211,153,.16); color: var(--green); }
.dep-badge.down { background: rgba(248,113,113,.16); color: var(--red); }
.dep-badge.degraded { background: rgba(251,191,36,.16); color: var(--amber); }
.dep-badge.unknown,.dep-badge.unreachable,.dep-badge.unconfigured { background: var(--surface-3); color: var(--muted); }
.dep-actions { display: flex; gap: 6px; }
.dep-actions button { background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 6px 9px; cursor: pointer; display: grid; place-items: center; }
.dep-actions button:hover { border-color: var(--accent); color: var(--text); }
.dep-actions button i { width: 15px; height: 15px; }
.dep-containers { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.dep-c { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 7px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.dep-c .cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dep-c.running .cdot { background: var(--green); box-shadow: 0 0 7px var(--green); }
.dep-c .cname { color: var(--text); font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-c .cstatus { color: var(--muted); margin-left: auto; white-space: nowrap; font-size: 11.5px; }

/* AGENTS */
.worker-bar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.worker-bar .wb-k { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.worker-bar .wb-v { font-family: var(--mono); font-size: 16px; }
.worker-bar .wb-v.armed { color: var(--accent-2); }
.worker-bar .dry { font-size: 10px; letter-spacing: .1em; color: var(--amber); border: 1px solid rgba(251,191,36,.3); border-radius: 6px; padding: 3px 9px; margin-left: auto; }
.agent-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; margin-bottom: 9px; }
.agent-row .adot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.agent-row.working .adot { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); animation: breathe 1.6s infinite; }
.agent-row.waiting .adot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.agent-row.idle .adot { background: var(--green); }
.agent-row.error .adot { background: var(--red); }
.agent-row .aname { font-family: var(--mono); }
.agent-row .astate { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* REQUESTS */
.req { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 11px; padding: 15px 16px; margin-bottom: 12px; }
.req-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-kind { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 9px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.req-kind.api_key { background: rgba(25,210,126,.18); color: var(--accent); }
.req-kind.decision { background: rgba(251,191,36,.18); color: var(--amber); }
.req-kind.access { background: rgba(52,232,138,.18); color: var(--accent-2); }
.req-title { font-size: 15px; font-weight: 600; }
.req-biz { font-size: 11px; color: var(--muted); margin-left: auto; }
.req-detail { font-size: 13.5px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.req-actions { display: flex; gap: 9px; margin-top: 13px; }
.req-actions input { flex: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 9px 12px; font-size: 13px; font-family: var(--mono); }
.req-actions input:focus { outline: none; border-color: var(--accent); }
.req-actions button { border: none; border-radius: 9px; padding: 9px 16px; font-size: 13px; cursor: pointer; }
.req-actions .prov { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.req-actions .dis { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.req-actions .prov { display: inline-flex; align-items: center; gap: 6px; }
.req-actions .prov i { width: 14px; height: 14px; }
.reply-ta { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 10px 12px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; resize: vertical; }
.reply-ta:focus { outline: none; border-color: var(--accent); }

/* CHAT */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 64px); }
.chat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 10px; }
.msg { max-width: 760px; }
.msg.user { align-self: flex-end; }
.msg-role { font-size: 10px; letter-spacing: .12em; color: var(--muted); margin-bottom: 5px; }
.msg.user .msg-role { text-align: right; }
.msg-text { display: inline-block; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.user .msg-text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant .msg-text { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.system .msg-text { background: transparent; border: 1px dashed var(--border); color: var(--text-2); font-size: 13px; }
.msg-text code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: .9em; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.chat-input textarea { flex: 1; resize: none; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 13px 15px; font-family: var(--sans); font-size: 14.5px; max-height: 160px; line-height: 1.45; }
.chat-input textarea:focus { outline: none; border-color: var(--accent); }
.chat-input button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; border-radius: 12px; width: 50px; height: 48px; color: #fff; cursor: pointer; display: grid; place-items: center; }
.chat-input button i { width: 19px; height: 19px; }
/* live "terminal" steps while Claude works on a chat answer */
.chat-steps { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.chat-step { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.chat-step.working { color: var(--accent); }

/* BUSINESS DETAIL */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px,1fr)); gap: 18px; }
.biz-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; border-top: 3px solid var(--accent); }
.biz-card h3 { font-size: 19px; }
.biz-repos { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.repo-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.repo-row .rkind { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.biz-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* DATA TABLES */
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.dt td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.dt tr:hover td { background: var(--surface-2); }
.dt tr.clickrow { cursor: pointer; }
.dt tr.clickrow:hover td { background: var(--surface-3); }
.dt th.sortable { cursor: pointer; user-select: none; }
.dt th.sortable:hover { color: var(--text); }
.kpi.clickable { cursor: pointer; }
.tag.stmt { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; text-decoration: none; color: var(--accent); border: 1px solid var(--border); }
.tag.stmt:hover { border-color: var(--accent); color: var(--text); }
.tstat.inactive { background: var(--surface-3); color: var(--muted); }
.dt .r { text-align: right; }
.dt .pos { color: var(--green); }
.dt tfoot td { border-top: 2px solid var(--border-2); border-bottom: none; font-weight: 600; color: var(--text); }
/* CHART */
.chart { position: relative; }
.chart svg { width: 100%; height: 180px; display: block; overflow: visible; }
.chart .area { fill: var(--glow); stroke: none; }
.chart .ln { fill: none; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.chart .ln.total { stroke: var(--accent-2); stroke-width: 1.4; }
.chart .ln.mav { stroke: #60A5FA; }   /* Maverick — blue */
.chart .ln.br { stroke: #FBBF24; }    /* Best Rate — amber */
.chart .ln.nmi { stroke: #A78BFA; }   /* Stratamize Gateway (NMI) — violet */
.chart-x { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .lg { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
/* Overview command center */
.ov-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.ovt { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.ovt.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.ovt[disabled] { opacity: .5; cursor: not-allowed; }
.ovt .soon { font-size: 9px; letter-spacing: .08em; background: var(--surface-3); color: var(--muted); padding: 2px 5px; border-radius: 5px; text-transform: uppercase; }
.ov-kpis { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); margin-bottom: 18px; }
.chart.tall svg { height: 240px; }
.chart .ln.volln { stroke: var(--accent); }
.chart-foot { font-size: 12px; margin-top: 10px; display: flex; gap: 16px; }
.split-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.split-label { width: 80px; color: var(--text-2); }
.split-row .mono { width: 48px; text-align: right; }
.bar { flex: 1; height: 9px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar.sm { height: 6px; margin: 6px 0 4px; }
.bar .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar .fill.mav { background: var(--accent); }
.bar .fill.br { background: var(--green); }
.rankrow { padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.rankrow:hover { background: var(--surface-2); }
.rankrow:last-child { border-bottom: none; }
.rankrow-top { display: flex; justify-content: space-between; font-size: 13.5px; }
.rankrow-sub { font-size: 11.5px; }
.expand-row { margin-top: 10px; text-align: center; }
.btn.ghost { background: transparent; border: 1px dashed var(--border); color: var(--text-2); font-size: 12px; padding: 6px 14px; cursor: pointer; border-radius: 8px; }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.flag-row { display: flex; align-items: center; gap: 9px; padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.flag-row:last-child { border-bottom: none; }
.flag-row:hover { background: var(--surface-2); }
.flag-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-meta { font-size: 11.5px; }
.flag-pill { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.flag-pill.risk, .flag-pill.churn { background: rgba(239,68,68,.15); color: var(--red); }
.flag-pill.chargeback { background: rgba(239,68,68,.2); color: var(--red); }
.flag-pill.reserve { background: rgba(245,158,11,.15); color: var(--amber, #f59e0b); }
.rspark { width: 58px; height: 22px; opacity: .8; }
.rspark path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.mom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mom-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; font-weight: 700; }
.mom-head.up { color: var(--green); }
.mom-head.down { color: var(--red); }
.mom-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--border); }
.mom-row:last-child { border-bottom: none; }
.mom-row:hover { background: var(--surface-2); }
.mom-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mom-delta { font-family: var(--mono); flex-shrink: 0; }
.mom-delta.up { color: var(--green); }
.mom-delta.down { color: var(--red); }
.kpi.fc .kpi-value { color: var(--accent-2); }
.dstat { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }
.dstat.lost { background: rgba(239,68,68,.15); color: var(--red); }
.dstat.won { background: rgba(34,197,94,.15); color: var(--green); }
.dstat.processed { background: rgba(245,158,11,.13); color: var(--amber, #f59e0b); }
tr.attn td { background: rgba(245,158,11,.05); }
.deal-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.deal-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; }
.deal-col-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); font-weight: 700; margin-bottom: 10px; }
.deal-col-head .col-count { background: var(--surface-3); border-radius: 10px; padding: 1px 8px; }
.deal-col-body { display: flex; flex-direction: column; gap: 9px; max-height: 460px; overflow-y: auto; }
.deal-card { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 9px; padding: 11px 12px; cursor: pointer; }
.deal-card:hover { border-color: var(--accent); }
.deal-card.drafting { border-left-color: var(--muted); }
.deal-card.submitted { border-left-color: var(--amber, #f59e0b); }
.deal-card.approved { border-left-color: var(--green); }
.deal-name { font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.deal-meta { margin-bottom: 7px; }
.deal-foot { display: flex; justify-content: space-between; font-size: 11px; }
/* E-signature */
.sg-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sg-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px; }
.sg-col-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); font-weight: 700; margin-bottom: 12px; }
.sg-col-head .col-count { background: var(--surface-3); border-radius: 10px; padding: 1px 8px; }
.sg-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 13px; margin-bottom: 10px; cursor: pointer; }
.sg-card:hover { border-color: var(--accent); }
.sg-card-name { font-weight: 600; font-size: 14px; margin-bottom: 9px; }
.sg-signers { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.sg-chip { font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.sg-card-foot { display: flex; justify-content: space-between; font-size: 11.5px; }
.sg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; margin-bottom: 14px; position: sticky; top: 0; z-index: 5; }
.sg-tool { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 7px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sg-tool i { width: 15px; height: 15px; }
.sg-tool.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.sg-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.sg-work { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.sg-pages { display: flex; flex-direction: column; gap: 16px; }
.sg-page { position: relative; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,.4); user-select: none; }
.sg-page.placing { cursor: crosshair; }
.sg-page img { display: block; width: 100%; }
.sg-item { position: absolute; border: 1.5px dashed var(--accent); border-radius: 4px; cursor: move; display: flex; align-items: center; justify-content: center; min-height: 16px; }
.sg-item.field { background: rgba(25,210,126,.12); }
.sg-item.text { border-style: solid; border-color: transparent; color: #111; font-size: 12px; justify-content: flex-start; padding-left: 2px; background: rgba(25,210,126,.08); }
.sg-item.whiteout { background: #fff; border: 1px solid #ddd; }
.sg-item-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; pointer-events: none; white-space: nowrap; overflow: hidden; }
.sg-item-x { position: absolute; top: -9px; right: -9px; width: 17px; height: 17px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; line-height: 17px; text-align: center; cursor: pointer; display: none; }
.sg-item:hover .sg-item-x { display: block; }
.sg-item.sel { box-shadow: 0 0 0 2px var(--accent), 0 6px 18px var(--glow); z-index: 5; }
.sg-item.edittext { background: #fff; border: 1px solid var(--accent); color: #111; justify-content: flex-start; padding: 0 2px; overflow: hidden; }
.sg-item-txt { font-size: 11px; color: #111; white-space: nowrap; overflow: hidden; pointer-events: none; }
.sg-textspan { position: absolute; cursor: text; border-radius: 2px; background: rgba(25,210,126,.10); outline: 1px dashed rgba(25,210,126,.55); }
.sg-textspan:hover { background: rgba(25,210,126,.26); outline-color: var(--accent); }
.sg-edit-input { position: absolute; z-index: 20; box-sizing: border-box; padding: 0 2px; margin: 0;
  line-height: 1; border: 1.5px solid var(--accent); border-radius: 3px; background: #fff; color: #111;
  box-shadow: 0 6px 22px var(--glow); font-family: var(--sans); outline: none; min-height: 14px; }
.sg-item-gear { position: absolute; top: -9px; right: 11px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); font-size: 10px; line-height: 16px; text-align: center; cursor: pointer; display: none; }
.sg-item:hover .sg-item-gear { display: block; }
.sg-fset-type { font-size: 13px; margin-bottom: 12px; text-transform: capitalize; }
.sg-tog { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; user-select: none; }
.sg-tog input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.sg-prefill { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface-3); color: var(--text); font-size: 13px; }
.sg-prefill:focus { outline: none; border-color: var(--accent); }
.sg-resize { position: absolute; right: -4px; bottom: -4px; width: 11px; height: 11px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
/* gmail-style contact autocomplete */
.ac-menu { position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 11px; box-shadow: 0 16px 44px rgba(0,0,0,.5); overflow: hidden; max-height: 260px; overflow-y: auto; }
.ac-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; cursor: pointer; }
.ac-item:hover { background: var(--glow); }
.sg-preview { width: 100%; height: 600px; border: 1px solid var(--border); border-radius: 10px; background: #fff; display: block; }
.ac-name { font-size: 13px; font-weight: 600; color: var(--text); }
.ac-addr { font-size: 11.5px; color: var(--muted); }
/* Documents desktop: folders + context menu */
.folder-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.folder-tile { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color .12s, background .12s, transform .08s; }
.folder-tile:hover { border-color: var(--border-2); }
.folder-tile.on { border-color: var(--accent); background: var(--glow); color: var(--accent); }
.folder-tile.new { color: var(--muted); border-style: dashed; font-weight: 500; }
.folder-tile [data-lucide] { width: 16px; height: 16px; }
.folder-tile.drop-hot { border-color: var(--accent); background: var(--glow); transform: scale(1.03); }
.folder-n { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 1px 8px; }
.folder-tile.on .folder-n { color: var(--accent); }
.folder-x { display: none; margin-left: 2px; width: 16px; height: 16px; line-height: 15px; text-align: center; border-radius: 50%; color: var(--muted); font-size: 13px; }
.folder-tile:hover .folder-x { display: inline-block; }
.folder-x:hover { background: rgba(248,113,113,.18); color: var(--red); }
.ctx-menu { position: fixed; z-index: 200; min-width: 196px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 11px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 5px; }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none; position: relative; }
.ctx-item:hover { background: var(--glow); }
.ctx-item.danger:hover { background: rgba(248,113,113,.16); color: var(--red); }
.ctx-item [data-lucide] { width: 15px; height: 15px; flex-shrink: 0; }
.ctx-caret { margin-left: auto; color: var(--muted); }
.ctx-sep { height: 1px; background: var(--border); margin: 5px 6px; }
.ctx-sub { position: absolute; left: calc(100% - 4px); top: -5px; min-width: 180px; max-height: 280px; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 11px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 5px; }
.sg-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 64px; }
.sg-signer { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 9px; margin-bottom: 8px; cursor: pointer; }
.sg-signer.active { background: var(--surface-2); }
.sg-signer-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.sg-rm { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-3); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.sg-rm:hover { background: rgba(239,68,68,.15); color: var(--red); border-color: var(--red); }
.sg-signself { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-3); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sg-signself:hover { background: var(--glow); color: var(--accent); border-color: var(--accent); }
.sg-signself i { width: 13px; height: 13px; }
.sg-signer input { display: block; width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 6px 9px; font-size: 12.5px; margin-bottom: 4px; }
.sg-signer input:focus { outline: none; border-color: var(--accent); }
.sg-msg { width: 100%; min-height: 80px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 10px; font-family: inherit; font-size: 13px; resize: vertical; }
.sg-timeline { display: flex; flex-direction: column; gap: 2px; }
.sg-event { display: flex; gap: 11px; padding: 9px 2px; align-items: flex-start; }
.sg-ev-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--accent); flex-shrink: 0; }
.sg-ev-dot.signed, .sg-ev-dot.completed { background: var(--green); }
.sg-ev-dot.viewed { background: var(--amber, #f59e0b); }
.sg-ev-dot.declined, .sg-ev-dot.voided { background: var(--red); }
.sg-event b { text-transform: capitalize; font-size: 13px; }
.sg-signer-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.sg-signer-row:last-child { border-bottom: none; }
.sg-upload { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.sg-upload:hover { border-color: var(--accent); color: var(--text); }
.sg-doclist { max-height: 280px; overflow-y: auto; }
.sg-docrow { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 7px; cursor: pointer; font-size: 13px; }
.sg-docrow:hover { border-color: var(--accent); background: var(--surface-2); }
.histbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.histbar div { height: 100%; }
.risk { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.risk.high { background: rgba(248,113,113,.16); color: var(--red); }

/* TICKETS */
.ticket-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 360px); overflow-y: auto; }
.ticket-row { padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.ticket-row:hover { border-color: var(--border-2); }
.ticket-row.sel { border-color: var(--accent); background: var(--surface-3); }
.ticket-top { display: flex; align-items: center; gap: 9px; }
.ticket-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 11.5px; color: var(--text-2); }
.tstat { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; font-weight: 600; background: var(--surface-3); color: var(--text-2); flex: none; }
.tstat.new, .tstat.open { background: rgba(25,210,126,.18); color: var(--accent); }
.tstat.closed { background: rgba(52,211,153,.14); color: var(--green); }
.tstat.live { background: rgba(52,211,153,.16); color: var(--green); }
.tstat.ok { background: rgba(52,211,153,.16); color: var(--green); }
.tstat.alert { background: rgba(251,191,36,.18); color: var(--amber); }

/* ---- Skills & Credentials ---- */
.cred-field { font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; display: inline-flex; gap: 6px; align-items: center; }
.cred-field code { color: var(--text); font-family: var(--mono, monospace); }
.cred-skills { margin-top: 13px; border-top: 1px solid var(--border); padding-top: 11px; }
.skill-row { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; }
.skill-head { display: flex; align-items: center; gap: 9px; }
.skill-name { font-size: 13.5px; font-weight: 500; }
.skill-desc { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.skill-err { font-size: 12px; color: var(--amber); margin-top: 5px; }
.skill-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.skill-result { margin-top: 9px; background: var(--bg, #0d0f14); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 11.5px; color: var(--text); max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* ---- Social Composer ---- */
.brand-chip { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 13.5px; }
.brand-chip.active { border-color: var(--accent); background: var(--surface-3); }
.brand-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 4px; }
.brief-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.brief-grid textarea, .brief-grid input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 8px 10px; font-family: var(--sans); font-size: 13px; resize: vertical; }
.brief-grid textarea:focus, .brief-grid input:focus { outline: none; border-color: var(--accent); }
.digest { margin-top: 12px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent-2); border-radius: 9px; }
.digest p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.chan-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.chan-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chan-add select, .chan-add input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; flex: 1; min-width: 130px; }
.compose-in { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 13px; font-family: var(--sans); font-size: 14px; resize: vertical; }
.compose-in:focus { outline: none; border-color: var(--accent); }
.post-group { margin-bottom: 16px; }
.post-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; }
.post-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.post-text { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 10px 12px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; resize: vertical; }
.post-text:focus { outline: none; border-color: var(--accent); }
.post-err { color: var(--amber); font-size: 12px; margin-top: 6px; }
.post-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.post-metrics { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.dim.over { color: var(--amber); font-weight: 600; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 10px; }
.idea-chip { text-align: left; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; max-width: 100%; }
.idea-chip:hover { border-color: var(--accent); }
.strategy-card { background: linear-gradient(180deg, rgba(25,210,126,.08), rgba(25,210,126,.02)); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.strat-head { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.strat-head i { width: 14px; height: 14px; }
.strat-summary { margin: 7px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.strat-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11.5px; color: var(--text-2); }
.strat-tags b { color: var(--text-2); text-transform: uppercase; font-size: 10px; letter-spacing: .04em; margin-right: 4px; }
.strat-rationale { margin: 8px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; }
.variant-row { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.variant-pill { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.variant-pill.active { border-color: var(--accent); color: var(--text); background: var(--surface-3); }
.variant-pill b { margin-left: 3px; }
.post-body { display: flex; gap: 14px; align-items: flex-start; }
.post-main { flex: 1; min-width: 0; }
.scorecard { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.score-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-2); }
.score-row > span:first-child { width: 70px; flex: none; }
.score-bar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 999px; }
.score-row b { width: 18px; text-align: right; color: var(--text); }
.score-overall { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.score-overall b { font-size: 15px; margin-left: 4px; }
.post-visual { width: 168px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.post-img { width: 168px; height: 168px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.visual-empty { width: 168px; height: 168px; border-radius: 10px; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11.5px; }
.visual-btns { display: flex; gap: 6px; }

/* ---- Email client ---- */
.mail-layout { display: flex; gap: 16px; align-items: flex-start; }
.mail-folder { padding: 6px 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: var(--text-2); text-transform: capitalize; display: flex; align-items: center; gap: 6px; }
.mail-folder:hover { background: var(--surface-2); }
.mail-folder.active { background: var(--surface-3); color: var(--text); }
.mail-list { display: flex; flex-direction: column; }
.mail-row { display: flex; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; cursor: pointer; background: var(--surface-2); position: relative; transition: border-color .12s, background .12s; }
.mail-row:hover { border-color: var(--accent); }
.mail-row.junk { opacity: .55; }
.mail-row.unread { background: var(--surface-3); border-color: var(--border); }
.mail-row.unread .mail-from, .mail-row.unread .mail-subj { font-weight: 700; }
.mail-row.unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.mail-row.needs { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.mail-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; margin-top: 6px; }
.mail-row-main { flex: 1; min-width: 0; }
.mail-row-top { display: flex; align-items: center; gap: 8px; }
.mail-from { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mail-flag { font-size: 10px; color: var(--amber); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); padding: 1px 6px; border-radius: 999px; }
.mail-date { font-size: 11px; flex: none; }
/* quick actions: a hover-reveal toolbar pinned to the row's right edge so all of them
   (incl. trash) are always fully visible regardless of sender/subject length */
.mail-quick { display: none; align-items: center; gap: 3px; position: absolute; top: 7px; right: 10px;
  z-index: 4; padding: 3px 5px; border-radius: 10px; background: var(--surface-3);
  border: 1px solid var(--border-2); box-shadow: -16px 0 18px 6px var(--surface-2); }
.mail-row:hover .mail-quick { display: flex; }
.mail-row:hover .mail-date { visibility: hidden; }
.mail-quick button { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); width: 27px; height: 27px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none; }
.mail-quick button:hover { color: var(--text); border-color: var(--accent); background: var(--surface-3); }
.mail-quick button.danger:hover { color: var(--danger, #ef5a5a); border-color: var(--danger, #ef5a5a); }
.modal-foot .ghost.danger:hover { color: var(--danger, #ef5a5a); border-color: var(--danger, #ef5a5a); }
.mail-quick i { width: 14px; height: 14px; }
.mail-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; padding-top: 4px; }
.mail-pager .btn { display: inline-flex; align-items: center; gap: 4px; }
.mail-pager .btn:disabled { opacity: .4; cursor: default; }
.mail-pager .btn i { width: 15px; height: 15px; }
.tstat.muted { background: var(--surface-3); color: var(--text-2); border-color: var(--border); opacity: .8; }
.btn.danger { border-color: color-mix(in srgb, var(--danger, #ef5a5a) 45%, var(--border)); color: var(--danger, #ef5a5a); }
.btn.danger:hover { border-color: var(--danger, #ef5a5a); background: color-mix(in srgb, var(--danger, #ef5a5a) 12%, transparent); }
.quota-banner { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--amber) 10%, transparent); font-size: 12.5px; line-height: 1.5; color: var(--text); }
.quota-banner i { width: 18px; height: 18px; color: var(--amber); flex: none; margin-top: 1px; }
.kb-banner { display: flex; align-items: center; gap: 14px; padding: 13px 15px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 12px; background: linear-gradient(180deg, rgba(25,210,126,.10), rgba(25,210,126,.03)); }
.kb-bar { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.kb-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.playbook-edit { width: 100%; min-height: 480px; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.55; resize: vertical; }
.playbook-doc { font-size: 13.5px; line-height: 1.62; color: var(--text-2); }
.playbook-doc h1, .playbook-doc h2, .playbook-doc h3, .playbook-doc h4 { color: var(--text); letter-spacing: -.01em; }
.playbook-doc h1 { font-size: 19px; margin: 20px 0 10px; }
.playbook-doc h2 { font-size: 15px; margin: 26px 0 10px; padding: 8px 0 8px 12px; border-left: 3px solid var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent); border-radius: 0 8px 8px 0; text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; }
.playbook-doc h3 { font-size: 13.5px; margin: 16px 0 5px; color: var(--accent-2, var(--accent)); }
.playbook-doc h2:first-child, .playbook-doc h1:first-child { margin-top: 0; }
.playbook-doc ul { margin: 6px 0 8px; padding-left: 20px; }
.playbook-doc li { margin: 4px 0; }
.playbook-doc p { margin: 8px 0; }
.playbook-doc strong { color: var(--text); font-weight: 650; }
.playbook-doc code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: var(--text); }
.playbook-doc table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 12.5px; }
.playbook-doc th { text-align: left; padding: 7px 10px; background: var(--surface-3); color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.playbook-doc td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.playbook-doc tr:hover td { background: var(--surface-2); }
.playbook-doc blockquote { margin: 10px 0; padding: 8px 14px; border-left: 2px solid var(--accent-2, var(--accent)); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text); }

/* Contacts */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.contact-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); position: relative; transition: border-color .12s, transform .12s; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.contact-avatar { width: 42px; height: 42px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2, #8b5cf6)); }
.contact-main { min-width: 0; flex: 1; }
.contact-name { font-weight: 650; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-role { font-size: 12px; margin: 1px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-lines { display: flex; flex-direction: column; gap: 3px; }
.contact-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; overflow: hidden; }
.contact-line:hover { color: var(--accent); }
.contact-line i { width: 13px; height: 13px; flex: none; }
.contact-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; margin-top: 8px; flex-wrap: wrap; }
.contact-compose { padding: 7px 9px; flex: none; }
.contact-compose i { width: 15px; height: 15px; }
.kv-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.kv-row label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }

/* Company documents */
.doc-card-actions { display: flex; gap: 7px; margin: 0 12px 12px; }
.doc-memorize { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px; font-size: 11.5px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; cursor: pointer; }
.doc-memorize:hover { color: var(--accent); border-color: var(--accent); }
.doc-memorize:disabled { opacity: .7; cursor: default; }
.doc-memorize.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--glow); }
.doc-memorize.sign { flex: 0 0 auto; }
.doc-memorize.sign:hover { color: var(--accent); border-color: var(--accent); }
.doc-memorize i { width: 13px; height: 13px; }
.cdoc-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); overflow: hidden; }
.cdoc-card:hover { border-color: var(--accent); }
.cdoc-preview { display: flex; align-items: center; justify-content: center; height: 130px; background: var(--surface-3); border-bottom: 1px solid var(--border); overflow: hidden; }
.cdoc-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; }
.cdoc-card > :not(.cdoc-preview) { margin-left: 14px; margin-right: 14px; }
.cdoc-card > .cdoc-actions { margin-bottom: 14px; }
.cdoc-top { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.cdoc-top > i { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.cdoc-name { font-weight: 600; font-size: 13.5px; color: var(--text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdoc-name:hover { color: var(--accent); }
.cdoc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cdoc-tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); border: 1px dashed var(--border); color: var(--text-2); cursor: pointer; }
.cdoc-tag:hover { border-color: var(--accent); color: var(--accent); }
.cdoc-comments { display: flex; flex-direction: column; gap: 4px; }
.cdoc-comment { font-size: 12px; color: var(--text-2); padding: 5px 9px; background: var(--surface); border-left: 2px solid var(--accent-2, var(--accent)); border-radius: 0 7px 7px 0; }
.cdoc-actions { display: flex; align-items: center; gap: 6px; }
.cdoc-actions .btn { padding: 5px 8px; }
.cdoc-actions .btn i { width: 14px; height: 14px; }
.mail-subj { font-size: 13.5px; color: var(--text); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-sum { font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-answer { margin-top: 12px; padding: 12px 14px; background: linear-gradient(180deg, rgba(25,210,126,.08), rgba(25,210,126,.02)); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: 10px; }
.mail-answer p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.mail-sources { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.mail-src { font-size: 11.5px; color: var(--text-2); cursor: pointer; padding: 3px 0; }
.mail-src:hover { color: var(--accent); }
.mail-iframe { width: 100%; height: 440px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.mail-thread { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.mail-thread .mail-iframe { height: auto; min-height: 140px; max-height: 380px; }
.mail-msg { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--surface-2); }
.mail-msg.sent { border-left: 3px solid var(--accent); }
.mail-msg-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-size: 13px; }
.mail-msg-head:hover { background: var(--surface-3); }
.mail-msg-from { font-weight: 600; }
.mail-msg.sent .mail-msg-from { color: var(--accent); }
.mail-msg-snip { padding: 0 12px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-thread .mail-msg .mail-iframe { margin: 0 10px 10px; width: calc(100% - 20px); border-radius: 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--text-2); padding: 6px 14px; font-size: 12.5px; cursor: pointer; }
.seg button.active { background: var(--surface-3); color: var(--text); }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.doc-card { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); text-decoration: none; color: var(--text); overflow: hidden; transition: border-color .12s, transform .12s; }
.doc-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc-preview { height: 116px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.doc-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; background: #fff; }
.doc-preview-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.doc-preview-icon i { width: 30px; height: 30px; color: var(--accent); }
.doc-ext { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--text-2); }
.doc-card .doc-meta { padding: 10px 12px; }
.doc-meta { min-width: 0; }
.doc-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-draft-wrap { margin-top: 12px; }
.ticket-body { font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; }
.ticket-resp { margin-top: 10px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent-2); border-radius: 9px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.reply-box { margin-top: 16px; }
.reply-box textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 12px 14px; font-family: var(--sans); font-size: 14px; resize: vertical; }
.reply-box textarea:focus { outline: none; border-color: var(--accent); }

/* FORM EDITOR (applications) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 13px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-2); letter-spacing: .03em; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 9px 11px; font-family: var(--sans); font-size: 13.5px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--accent); }
.section-head { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.tile .section-head:not(:first-child) { margin-top: 22px; }
.fee-wrap { display: inline-flex; align-items: center; gap: 4px; }
.fee-pre, .fee-suf { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.form-actions button:disabled { opacity: .5; cursor: default; }
.principal { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.feeinput { width: 120px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 6px 9px; font-family: var(--mono); font-size: 12.5px; text-align: right; }
.feeinput:focus { outline: none; border-color: var(--accent); }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 20px; opacity: .7; }
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 9px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn i { width: 15px; height: 15px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--text-2); padding: 7px 13px; font-size: 12.5px; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }

/* ===================== OVERLAYS / MODALS ===================== */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,10,0.62); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.palette-overlay { align-items: flex-start; padding-top: 12vh; }
.modal { width: min(560px, 94vw); background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.9); }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal input, .modal textarea, .modal select { width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 13px; font-family: var(--sans); font-size: 14px; margin-bottom: 11px; }
.modal textarea { resize: vertical; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.modal .check { display: flex; gap: 9px; align-items: center; font-size: 13px; color: var(--text-2); margin: 4px 0 16px; }
.modal .check input { width: auto; margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 11px; margin-top: 8px; }
.modal .kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.modal .kv span { color: var(--muted); }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-size: 14px; }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; }

/* LOGS MODAL */
.logs-modal { width: min(960px, 95vw); max-height: 84vh; overflow-y: auto; }
.log-block { margin-bottom: 16px; }
.log-name { font-size: 12.5px; color: var(--accent-2); margin-bottom: 6px; }
.log-pre { background: #06070b; border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; font-size: 12px; line-height: 1.5; color: #b8c0d4; white-space: pre-wrap; word-break: break-word; max-height: 380px; overflow-y: auto; margin: 0; }

/* PALETTE */
.palette { width: min(600px, 94vw); background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); }
.palette input { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: 18px 20px; font-size: 16px; font-family: var(--sans); }
.palette input:focus { outline: none; }
.palette-list { max-height: 360px; overflow-y: auto; padding: 7px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 14.5px; color: var(--text-2); }
.palette-item i { width: 17px; height: 17px; }
.palette-item.sel { background: var(--surface-2); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 64px 1fr; }
  .nav-item span, .nav-badge, .sidebar-foot, .brand-sub { display: none; }
  .brand { width: auto; }
  .board { grid-template-columns: 1fr 1fr; }
  .cmdk-hint { min-width: 0; }
}

/* web demo builder: generating spinner */
.spin{animation:spin 1s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}

/* ===== Phone layout (installed PWA / mobile browser) =====
   Sidebar becomes a fixed bottom icon bar; topbar keeps only the essentials;
   everything single-column with touch-sized targets. */
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-spend, .clock, .cmdk-hint, .brand-sub, .ap-label, .ap-state { display: none; }
  .shell { display: block; height: auto; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    flex-direction: row; align-items: center; gap: 2px;
    border-right: none; border-top: 1px solid var(--border);
    background: rgba(11,17,24,0.97); backdrop-filter: blur(8px);
    overflow-x: auto; overflow-y: hidden; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .sidebar .biz-switch, .sidebar .nav-sep, .sidebar-foot { display: none; }
  .nav-item { flex: 0 0 auto; padding: 10px; border-radius: 12px; }
  .nav-item span { display: none; }
  .nav-item .nav-badge { display: inline-flex; position: absolute; transform: translate(10px,-10px); }
  .main { padding: 14px 12px calc(74px + env(safe-area-inset-bottom)); height: auto; min-height: calc(100vh - var(--topbar-h)); }
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .view-head { flex-wrap: wrap; gap: 8px; }
  .req-actions { flex-wrap: wrap; }
  .req-actions button, .btn, .seg { min-height: 38px; }
  .modal { max-width: 100vw !important; width: 100vw; height: 100dvh; max-height: 100dvh;
           border-radius: 0; overflow-y: auto; }
  .overlay { padding: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chat-wrap { height: calc(100dvh - var(--topbar-h) - 84px); }
}
