:root{
  --bg:#0a0a0c; --surface:#16161a; --surface2:#1f1f24; --line:#2b2b31;
  --text:#f2f2f4; --muted:#a7a7ae; --accent:#c8c9cd; --gold:#c9a86a;
  --good:#4caf7d; --warn:#e0a83e; --bad:#e05e5e; --radius:16px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0; padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  padding-bottom:calc(76px + env(safe-area-inset-bottom));
}
.demo-banner{
  background:#2a2113; color:#f0cf8f; font-size:12px; line-height:1.35;
  padding:8px 14px; text-align:center; border-bottom:1px solid #4a3a1c;
}
.app-header{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px 6px;
}
.app-name{font-size:20px; font-weight:700; letter-spacing:.14em}
.app-sub{color:var(--muted); font-size:13px; margin-top:2px}
.log-fab{
  background:var(--text); color:#0a0a0c; border:0; border-radius:999px;
  font-size:15px; font-weight:700; padding:11px 18px; min-height:44px; cursor:pointer;
}
main{padding:8px 14px 20px; max-width:720px; margin:0 auto}
h2.section{font-size:13px; letter-spacing:.12em; color:var(--muted); text-transform:uppercase; margin:20px 2px 10px}
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; margin-bottom:10px;
}
.kpis{display:grid; grid-template-columns:repeat(4,1fr); gap:8px}
.kpi{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:10px 6px; text-align:center}
.kpi .n{font-size:21px; font-weight:700}
.kpi .l{font-size:10.5px; color:var(--muted); margin-top:2px; line-height:1.25}
.progress{height:8px; background:var(--surface2); border-radius:99px; overflow:hidden; margin-top:8px}
.progress > div{height:100%; background:var(--gold); border-radius:99px}
.goal-line{display:flex; justify-content:space-between; font-size:14px}
.muted{color:var(--muted)} .small{font-size:12.5px} .tiny{font-size:11.5px}
.row{display:flex; justify-content:space-between; align-items:center; gap:10px}
.pill{display:inline-block; font-size:11px; font-weight:600; padding:3px 8px; border-radius:99px; background:var(--surface2); color:var(--accent); border:1px solid var(--line); white-space:nowrap}
.pill.hot{background:#3a1f1f; color:#ff9c9c; border-color:#5c2b2b}
.pill.overdue{background:#3a2a13; color:#f0cf8f; border-color:#5c451c}
.pill.stage{background:#1d2733; color:#a9c6e8; border-color:#2c3e55}
.opp-title{font-size:16px; font-weight:650}
.opp-meta{color:var(--muted); font-size:13px; margin-top:3px; line-height:1.45}
button.cardlike{width:100%; text-align:left; color:inherit; font:inherit; cursor:pointer}
.mini-btn{
  background:var(--surface2); color:var(--text); border:1px solid var(--line);
  border-radius:10px; padding:9px 12px; font-size:13.5px; min-height:44px; cursor:pointer;
}
.mini-btn:active{background:#2a2a30}
.chip-row{display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 4px}
.chip{
  background:var(--surface2); color:var(--text); border:1px solid var(--line);
  border-radius:999px; padding:9px 13px; font-size:14px; min-height:44px; cursor:pointer;
}
.chip.sel{background:var(--text); color:#0a0a0c; font-weight:700; border-color:var(--text)}
.chip .cnt{opacity:.65; font-size:12px}
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  display:flex; background:rgba(14,14,17,.97); border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.tab{
  flex:1 1 0; min-width:0; background:none; border:0; color:var(--muted);
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:9px 2px 8px; font-size:11px; min-height:56px; cursor:pointer;
}
.tab .tab-ico{font-size:19px; line-height:1}
.tab.active{color:var(--text)}
.tab.active .tab-ico{color:var(--gold)}
table.stats{width:100%; border-collapse:collapse; font-size:14px}
table.stats th, table.stats td{padding:8px 4px; border-bottom:1px solid var(--line); text-align:right}
table.stats th:first-child, table.stats td:first-child{text-align:left}
table.stats th{color:var(--muted); font-weight:600; font-size:12px}
.big-stat{font-size:30px; font-weight:750}
.stat-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.stat-cell{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:12px}
.stat-cell .n{font-size:22px; font-weight:700}
.stat-cell .l{font-size:12px; color:var(--muted); margin-top:2px}
.sheet-backdrop{position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:50}
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:60; max-height:88vh; overflow-y:auto;
  background:#121216; border-top:1px solid var(--line); border-radius:20px 20px 0 0;
  padding:16px 16px calc(20px + env(safe-area-inset-bottom)); max-width:720px; margin:0 auto;
}
.sheet-head{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px}
.sheet-title{font-size:18px; font-weight:700}
.sheet-sub{color:var(--muted); font-size:13px; margin-top:2px}
.icon-btn{background:var(--surface2); border:1px solid var(--line); color:var(--text); border-radius:10px; width:40px; height:40px; font-size:15px; cursor:pointer}
.stage-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:8px 0}
.stage-btn{
  background:var(--surface2); border:1px solid var(--line); color:var(--text);
  border-radius:12px; padding:12px; font-size:14.5px; min-height:48px; cursor:pointer; text-align:left;
}
.stage-btn.cur{border-color:var(--gold); color:var(--gold); font-weight:700}
.timeline{margin:6px 0 0; padding:0; list-style:none}
.timeline li{border-left:2px solid var(--line); padding:0 0 12px 12px; position:relative}
.timeline li::before{content:""; position:absolute; left:-5px; top:4px; width:8px; height:8px; border-radius:50%; background:var(--gold)}
.timeline .when{color:var(--muted); font-size:12px}
.fld-label{display:block; font-size:12.5px; color:var(--muted); margin:14px 0 2px; letter-spacing:.04em}
.text-in{
  width:100%; background:var(--surface2); border:1px solid var(--line); color:var(--text);
  border-radius:12px; padding:12px; font-size:16px; min-height:48px;
}
.toggle-row{display:flex; justify-content:space-between; align-items:center; margin-top:14px; font-size:15px}
.toggle{background:var(--surface2); border:1px solid var(--line); color:var(--text); border-radius:999px; padding:9px 18px; min-width:76px; min-height:44px; font-size:14px; cursor:pointer}
.toggle[aria-pressed="true"]{background:var(--text); color:#0a0a0c; font-weight:700}
.primary-btn{
  width:100%; margin-top:18px; background:var(--text); color:#0a0a0c; border:0;
  border-radius:14px; padding:15px; font-size:16px; font-weight:700; min-height:52px; cursor:pointer;
}
.fineprint{color:var(--muted); font-size:12px; line-height:1.5; margin-top:12px}
.toast{
  position:fixed; left:50%; transform:translateX(-50%); bottom:calc(92px + env(safe-area-inset-bottom));
  background:#26262c; color:var(--text); border:1px solid var(--line); border-radius:12px;
  padding:11px 16px; font-size:14px; z-index:80; max-width:92vw; text-align:center;
}
a.tool-link{display:block; text-decoration:none; color:inherit}
.ext{color:var(--gold); font-size:13px; font-weight:600; white-space:nowrap}
.notice{border-color:#5c451c; background:#1d180e}

/* v0.3 workspace upgrade */
button{touch-action:manipulation}
.opp-meta{font-size:13.5px}
.next-line{color:var(--gold)}
.quick-row{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:12px}
.quick-row a{text-decoration:none}
.qa-btn{width:100%; background:var(--surface2); color:var(--text); border:1px solid var(--line);
  border-radius:14px; padding:13px 6px; font-size:14px; font-weight:650; min-height:52px; cursor:pointer}
.qa-btn:active{background:#2a2a30}
.f-row{display:flex; align-items:center; gap:10px; padding:5px 0}
.f-name{width:104px; font-size:13.5px; color:var(--accent)}
.f-bar{flex:1; height:10px; background:var(--surface2); border-radius:99px; overflow:hidden}
.f-bar > span{display:block; height:100%; background:var(--gold); border-radius:99px}
.f-n{width:26px; text-align:right; font-weight:700; font-size:14px}
.bar{height:5px; background:var(--surface2); border-radius:99px; overflow:hidden; margin-top:4px; min-width:44px}
.bar > div{height:100%; background:var(--good); border-radius:99px}
.tab{min-height:60px}
