@font-face{font-family:'DM Sans';font-style:normal;font-weight:400 600;font-display:swap;src:url('../fonts/dm-sans-400-600-normal.woff2') format('woff2');}
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/playfair-display-700-normal.woff2') format('woff2');}

:root{
  --bg:#030B17; --surface:#07111A; --surface2:#112233; --line:rgba(36,212,195,0.22);
  --ink:#EDF4FB; --muted:#B0CCDE; --faint:#7EA4BA;
  --navy:#0B1622; --orange:#F19A08; --teal:#24D4C3;
  --good:#2ECC71; --warn:#F5B841; --crit:#E5484D;
  --r:12px;
}
*{box-sizing:border-box;}
html,body{margin:0;}
body{
  background:#030B17;
  color:var(--ink);
  font-family:'DM Sans',system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;
  padding:0 clamp(12px,3vw,28px) 40px;
  min-height:100dvh;
}
.tnum{font-variant-numeric:tabular-nums;}
.label{font-size:.75rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:600;}

/* ---- command bar ---- */
header{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;gap:16px;
  padding:14px 4px 12px;margin-bottom:8px;
  background:linear-gradient(#030B17 78%, transparent);
  border-bottom:1px solid rgba(36,212,195,0.07);
}
.brand{display:flex;align-items:center;gap:10px;}
.brand b{font-family:'DM Sans',system-ui,sans-serif;font-size:.9rem;letter-spacing:.12em;color:var(--teal);font-weight:700;}
.brand span{font-size:.62rem;letter-spacing:.18em;color:rgba(255,255,255,.35);text-transform:uppercase;}
.brand-dot{width:8px;height:8px;border-radius:50%;background:#24D4C3;flex-shrink:0;animation:pulse-dot 1.6s ease-in-out infinite;}
@keyframes pulse-dot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.2;transform:scale(.65)}}
.spacer{flex:1;}
.sync{display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--muted);}
.dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--teal);}
@media (prefers-reduced-motion:no-preference){
  .dot{animation:pulse 2.4s infinite;}
  @keyframes pulse{0%{box-shadow:0 0 0 0 rgba(36,212,195,.45);}70%{box-shadow:0 0 0 7px rgba(36,212,195,0);}100%{box-shadow:0 0 0 0 rgba(36,212,195,0);}}
}
button{font-family:inherit;cursor:pointer;border:none;}
.btn{
  background:rgba(36,212,195,0.05);color:var(--ink);
  border:1px solid rgba(36,212,195,0.18);
  padding:9px 14px;border-radius:10px;font-size:.82rem;font-weight:600;
  display:inline-flex;align-items:center;gap:7px;transition:.15s;
}
.btn:hover{border-color:var(--teal);color:#fff;background:rgba(36,212,195,0.09);}
.btn.primary{background:var(--orange);color:#1a1204;border-color:transparent;}
.btn.primary:hover{filter:brightness(1.08);}
.btn:focus-visible{outline:2px solid var(--teal);outline-offset:2px;}

/* ---- layout grid ---- */
.grid{display:grid;gap:16px;grid-template-columns:repeat(12,1fr);}
.col-12{grid-column:span 12;}
.col-7{grid-column:span 7;}
.col-5{grid-column:span 5;}
.col-6{grid-column:span 6;}
@media(max-width:860px){
  .col-7,.col-5,.col-6{grid-column:span 12;}
}

.panel{background:var(--surface);border:1px solid rgba(36,212,195,0.12);border-radius:var(--r);padding:16px 16px 18px;}
.panel-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;}
.panel-head h2{font-family:'DM Sans',system-ui,sans-serif;font-size:.95rem;margin:0;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--teal);}
.count-pill{margin-left:auto;background:rgba(36,212,195,0.06);border:1px solid rgba(36,212,195,0.12);border-radius:999px;padding:2px 10px;font-size:.72rem;color:var(--muted);}
.toggle{display:flex;gap:4px;background:rgba(0,0,0,.35);border:1px solid rgba(36,212,195,0.12);border-radius:9px;padding:3px;}
.toggle button{background:transparent;color:var(--muted);padding:5px 11px;border-radius:6px;font-size:.74rem;font-weight:600;}
.toggle button.on{background:rgba(36,212,195,0.12);color:var(--teal);}

/* ---- kanban ---- */
.board{display:flex;gap:12px;overflow-x:auto;padding-bottom:10px;scrollbar-width:thin;scrollbar-color:var(--teal) transparent;}
.board::-webkit-scrollbar{height:6px;}
.board::-webkit-scrollbar-track{background:transparent;}
.board::-webkit-scrollbar-thumb{background:rgba(36,212,195,0.35);border-radius:999px;}
.board::-webkit-scrollbar-thumb:hover{background:rgba(36,212,195,0.55);}
.stage{flex:0 0 210px;background:rgba(0,0,0,.28);border:1px solid rgba(36,212,195,0.1);border-radius:12px;padding:10px;}
.stage-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;}
.stage-head .n{font-size:.78rem;font-weight:700;color:rgba(36,212,195,0.75);}
.stage-head .c{font-size:.7rem;color:var(--muted);background:rgba(36,212,195,0.07);border-radius:999px;padding:1px 7px;}
.deal{background:var(--surface);border:1px solid rgba(36,212,195,0.1);border-left:3px solid var(--orange);border-radius:9px;padding:10px;margin-bottom:8px;transition:.15s;}
.deal:hover{background:var(--surface2);transform:translateY(-1px);}
.deal .dn{font-size:.82rem;font-weight:650;margin-bottom:3px;}
.deal .dc{font-size:.72rem;color:var(--muted);margin-bottom:8px;}
.deal .dm{display:flex;align-items:center;justify-content:space-between;}
.deal .amt{font-size:.82rem;font-weight:700;color:var(--orange);}
.age{font-size:.72rem;color:var(--muted);}
.age.warn{color:var(--warn);}
.age.crit{color:var(--crit);}
.muted-note{color:var(--faint);font-size:.82rem;padding:14px 4px;}
.connect-note{color:var(--muted);font-size:.82rem;padding:12px;background:rgba(0,0,0,.25);border:1px solid rgba(36,212,195,0.1);border-radius:10px;}
.connect-note b{color:var(--warn);}
.empty{flex:0 0 210px;display:flex;align-items:center;justify-content:center;color:var(--faint);font-size:.74rem;border:1px dashed rgba(36,212,195,0.12);border-radius:12px;min-height:80px;}

/* ---- tasks ---- */
.task{display:flex;gap:11px;padding:11px 4px;border-bottom:1px solid rgba(36,212,195,0.06);}
.task:last-child{border-bottom:none;}
.stripe{width:3px;border-radius:3px;background:var(--good);flex:0 0 3px;}
.stripe.warn{background:var(--warn);}.stripe.crit{background:var(--crit);}
.task .ts{font-size:.85rem;font-weight:600;margin-bottom:3px;}
.task .tsub{font-size:.72rem;color:var(--muted);}
.task .tsub b{color:rgba(36,212,195,0.7);font-weight:600;}
.due{margin-left:auto;text-align:right;font-size:.7rem;color:var(--muted);white-space:nowrap;}
.due.crit{color:var(--crit);font-weight:700;}
.chk{width:44px;height:44px;border:1.5px solid rgba(36,212,195,0.15);border-radius:8px;flex:0 0 44px;background:transparent;}
.chk:hover{border-color:var(--good);}

/* ---- content ---- */
.kv{display:flex;flex-direction:column;gap:12px;margin-bottom:16px;}
.kv .row .label{margin-bottom:3px;}
.kv .v{font-size:.9rem;font-weight:600;}
.kv .v.small{font-size:.82rem;font-weight:500;color:#8AAEC8;}
.kv .v a{color:var(--teal);text-decoration:none;border-bottom:1px dotted rgba(36,212,195,.35);}
.actions{display:flex;gap:9px;flex-wrap:wrap;}
.idea{margin-top:16px;padding-top:14px;border-top:1px solid rgba(36,212,195,0.08);}
.idea-row{display:flex;align-items:center;gap:8px;}
.idea-row input{flex:1;min-width:0;background:rgba(0,0,0,.3);border:1px solid rgba(36,212,195,0.12);border-radius:10px;padding:10px 12px;color:var(--ink);font-family:inherit;font-size:.84rem;outline:none;}
.idea-row input:focus{border-color:rgba(36,212,195,0.4);}
.idea-row input::placeholder{color:var(--faint);}
.mic.sm{width:38px;height:38px;flex:0 0 38px;font-size:1rem;}
.btn.sm{padding:9px 13px;}

/* ---- inbox ---- */
.inbox{background:var(--surface);}
.inbox .panel-head h2{color:var(--orange);}
.composer{background:rgba(0,0,0,.28);border:1px solid rgba(36,212,195,0.1);border-radius:11px;padding:10px;margin-bottom:12px;}
.composer textarea{width:100%;background:transparent;border:none;color:var(--ink);font-family:inherit;font-size:.86rem;resize:none;min-height:52px;outline:none;}
.composer textarea::placeholder{color:var(--faint);}
.composer-bar{display:flex;align-items:center;gap:8px;margin-top:6px;}
.types{display:flex;gap:5px;flex-wrap:wrap;}
.type{font-size:.72rem;padding:3px 9px;border-radius:999px;border:1px solid rgba(36,212,195,0.12);color:var(--muted);background:transparent;}
.type.on{background:rgba(241,154,8,.12);border-color:var(--orange);color:var(--orange);}
.mic{width:40px;height:40px;border-radius:50%;background:var(--orange);color:#1a1204;display:flex;align-items:center;justify-content:center;font-size:1.05rem;flex:0 0 40px;transition:.15s;}
.mic:hover{filter:brightness(1.08);}
.mic.rec{background:var(--crit);color:#fff;}
@media (prefers-reduced-motion:no-preference){.mic.rec{animation:micpulse 1.1s infinite;}
  @keyframes micpulse{0%{box-shadow:0 0 0 0 rgba(229,72,77,.55);}70%{box-shadow:0 0 0 9px rgba(229,72,77,0);}100%{box-shadow:0 0 0 0 rgba(229,72,77,0);}}}
.note .via{font-size:.72rem;}
.note{padding:9px 0;border-bottom:1px solid rgba(36,212,195,0.06);}
.note:last-child{border:none;}
.note .nm{display:flex;gap:8px;align-items:center;margin-bottom:3px;}
.note .nt{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--orange);font-weight:700;}
.note .ntime{font-size:.72rem;color:var(--faint);margin-left:auto;}
.note .ntx{font-size:.8rem;color:#9BBAD0;}

/* ---- social placeholder ---- */
.soon{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px 12px;color:var(--muted);text-align:center;}
.soon .badges{display:flex;gap:10px;}
.soon .bdg{width:44px;height:44px;border-radius:11px;background:var(--surface2);border:1px solid rgba(36,212,195,0.1);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.9rem;}
.soon small{font-size:.72rem;color:var(--faint);max-width:34ch;}

/* ---- briefing ---- */
.briefing-cols{display:grid;grid-template-columns:1fr 1fr;gap:20px;}
@media(max-width:768px){.briefing-cols{grid-template-columns:1fr;}}
.bsec-head{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);padding-bottom:8px;border-bottom:1px solid rgba(36,212,195,0.08);margin-bottom:12px;
  display:flex;align-items:center;gap:8px;}
.bsec-head .barrow{color:var(--faint);font-size:.65rem;margin-left:auto;transition:transform .2s;}
.bsec-head.open .barrow{transform:rotate(90deg);}
.bops-row{display:flex;justify-content:space-between;align-items:baseline;
  padding:5px 0;border-bottom:1px solid rgba(36,212,195,0.05);font-size:.82rem;}
.bops-row:last-child{border:none;}
.bops-row .bl{color:var(--muted);}
.bops-row .bv{color:var(--ink);font-weight:600;}
.bops-row .bv.warn{color:#e5ab0e;}
.bops-row .bv.ok{color:var(--teal);}
.intel-pre{background:rgba(0,0,0,.3);border:1px solid rgba(36,212,195,0.08);border-radius:6px;
  padding:12px;font-size:.7rem;line-height:1.65;overflow-y:auto;max-height:300px;
  white-space:pre-wrap;word-break:break-word;color:#6A90A8;font-family:monospace;
  margin-top:0;}

/* ---- toast ---- */
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);
  background:var(--surface2);border:1px solid rgba(36,212,195,0.15);border-left:3px solid var(--teal);
  color:var(--ink);padding:12px 18px;border-radius:11px;font-size:.85rem;max-width:min(92vw,460px);
  box-shadow:0 10px 30px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:.25s;z-index:60;}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
#toast.err{border-left-color:var(--crit);}
#toast.ok{border-left-color:var(--good);}

/* ---- modal ---- */
.modal-overlay{position:fixed;inset:0;background:rgba(2,6,12,.8);display:none;
  align-items:center;justify-content:center;z-index:50;padding:18px;}
.modal-overlay.show{display:flex;}
.modal{background:var(--surface);border:1px solid rgba(36,212,195,0.15);border-radius:16px;
  width:min(620px,96vw);max-height:82vh;display:flex;flex-direction:column;overflow:hidden;}
.modal-head{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid rgba(36,212,195,0.1);}
.modal-head h3{font-family:'DM Sans',sans-serif;margin:0;font-size:1rem;font-weight:700;letter-spacing:.06em;color:var(--teal);}
.modal-head .x{margin-left:auto;background:rgba(36,212,195,0.06);border:1px solid rgba(36,212,195,0.15);color:var(--ink);
  width:32px;height:32px;border-radius:8px;font-size:1rem;}
.modal-body{padding:8px 18px 18px;overflow-y:auto;}
.queue-post{border:1px solid rgba(36,212,195,0.1);border-radius:11px;padding:12px 14px;margin-top:12px;background:rgba(0,0,0,.25);}
.queue-post .qn{font-size:.72rem;color:var(--teal);letter-spacing:.04em;margin-bottom:6px;font-weight:600;}
.queue-post .qt{font-size:.82rem;color:#9BBAD0;white-space:pre-wrap;line-height:1.5;
  max-height:180px;overflow-y:auto;}
.btn.busy{opacity:.6;pointer-events:none;}

.btn.cora{color:var(--teal);border-color:rgba(36,212,195,0.3);background:rgba(36,212,195,0.06);}
.btn.cora .dot{width:.5rem;height:.5rem;}
.chat-scrim{position:fixed;inset:0;background:rgba(2,5,10,.6);z-index:40;
  opacity:0;pointer-events:none;transition:opacity .25s;}
.chat-scrim.show{opacity:1;pointer-events:auto;}
.chat{position:fixed;top:0;right:0;height:100dvh;width:min(440px,100vw);z-index:41;
  background:var(--surface);border-left:1px solid rgba(36,212,195,0.15);
  display:flex;flex-direction:column;transform:translateX(100%);
  transition:transform .28s cubic-bezier(.16,1,.3,1);box-shadow:-24px 0 60px rgba(0,0,0,.5);}
.chat.show{transform:none;}
.chat-head{display:flex;align-items:center;gap:9px;padding:15px 16px;border-bottom:1px solid rgba(36,212,195,0.1);}
.chat-head .dot{background:var(--orange);}
.chat-head h3{font-family:'DM Sans',sans-serif;font-size:.95rem;margin:0;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--orange);}
.chat-model{margin-left:auto;font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);font-weight:600;}
.chat-x{background:none;color:var(--muted);font-size:1.3rem;line-height:1;padding:0 4px;}
.chat-voice{background:none;border:none;cursor:pointer;font-size:1rem;line-height:1;padding:0 4px;opacity:.7;transition:opacity .15s;}
.chat-voice:hover{opacity:1;}
.chat-voice.muted{opacity:.3;}
.chat-thread{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:11px;}
.msg{max-width:86%;padding:10px 13px;border-radius:13px;font-size:.86rem;line-height:1.5;color:var(--ink);word-wrap:break-word;}
.msg.user{align-self:flex-end;background:rgba(36,212,195,0.07);border:1px solid rgba(36,212,195,0.15);border-bottom-right-radius:4px;}
.msg.cora{align-self:flex-start;background:rgba(241,154,8,.06);border:1px solid rgba(241,154,8,.2);border-bottom-left-radius:4px;}
.msg b{font-weight:600;}
.tool-chip{align-self:flex-start;font-size:.68rem;letter-spacing:.03em;color:var(--muted);
  padding:3px 9px;border:1px solid rgba(36,212,195,0.1);border-radius:20px;background:rgba(0,0,0,.25);}
.confirm-card{align-self:flex-start;max-width:86%;background:rgba(241,154,8,.07);
  border:1px solid rgba(241,154,8,.32);border-radius:13px;padding:12px 13px;
  display:flex;flex-direction:column;gap:9px;}
.cc-label{font-size:.6rem;letter-spacing:.14em;text-transform:uppercase;color:var(--orange);font-weight:700;}
.cc-summary{font-size:.86rem;line-height:1.45;color:var(--ink);}
.cc-actions{display:flex;gap:8px;margin-top:2px;}
.cc-actions .btn{padding:7px 15px;font-size:.8rem;}
.thinking{align-self:flex-start;display:flex;gap:5px;padding:12px 13px;}
.thinking span{width:6px;height:6px;border-radius:50%;background:var(--faint);}
@media (prefers-reduced-motion:no-preference){
  .thinking span{animation:blink 1.3s infinite;}
  .thinking span:nth-child(2){animation-delay:.18s;}
  .thinking span:nth-child(3){animation-delay:.36s;}
  @keyframes blink{0%,60%,100%{opacity:.3;}30%{opacity:1;}}
}
@media (prefers-reduced-motion:reduce){.chat,.chat-scrim{transition:none;}}
.chat-composer{border-top:1px solid rgba(36,212,195,0.1);padding:11px 12px;display:flex;gap:8px;align-items:flex-end;}
.chat-composer textarea{flex:1;min-width:0;resize:none;background:rgba(0,0,0,.3);border:1px solid rgba(36,212,195,0.12);
  border-radius:11px;padding:10px 12px;color:var(--ink);font-family:inherit;font-size:.86rem;
  line-height:1.4;outline:none;max-height:120px;}
.chat-composer textarea:focus{border-color:rgba(36,212,195,0.4);}

/* ---- markdown rendering ---- */
.md-h{font-family:'DM Sans',sans-serif;margin:.4em 0 .2em;color:var(--ink);}
h2.md-h{font-size:1.05rem;font-weight:700;}
h3.md-h{font-size:.92rem;font-weight:700;}
h4.md-h{font-size:.84rem;font-weight:600;}
.md-c{background:rgba(255,255,255,.07);padding:1px 5px;border-radius:3px;font-family:monospace;font-size:.82em;color:#c8e6c9;}
.md-code{background:rgba(0,0,0,.28);border:1px solid rgba(36,212,195,0.1);border-radius:6px;
  padding:10px 12px;font-family:monospace;font-size:.79em;overflow-x:auto;white-space:pre;margin:.5em 0;display:block;}
.md-table{border-collapse:collapse;width:100%;margin:.5em 0;font-size:.8rem;}
.md-table th,.md-table td{border:1px solid rgba(36,212,195,0.12);padding:5px 9px;text-align:left;}
.md-table th{background:rgba(36,212,195,0.07);font-weight:600;color:var(--teal);}
.md-table tr:hover td{background:rgba(255,255,255,.02);}

/* ---- audit batch display ---- */
.audit-batch{align-self:stretch;max-width:100%;background:rgba(5,15,28,.7);
  border:1px solid rgba(36,212,195,0.18);border-radius:10px;padding:14px;margin:4px 0;overflow-x:auto;}
.audit-batch h4{font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--teal);margin:0 0 12px;font-family:'DM Sans',sans-serif;font-weight:700;}
.audit-table{width:100%;border-collapse:collapse;font-size:.78rem;min-width:480px;}
.audit-table th{background:rgba(36,212,195,.05);padding:6px 9px;text-align:left;
  font-weight:600;color:var(--muted);font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;}
.audit-table td{padding:7px 9px;border-top:1px solid rgba(255,255,255,.04);}
.audit-table td.amt-pos{color:#4ecdc4;font-variant-numeric:tabular-nums;}
.audit-table td.amt-neg{color:#ff8c69;font-variant-numeric:tabular-nums;}
.audit-actions{display:flex;gap:5px;flex-wrap:wrap;}
.audit-btn{font-size:.7rem;padding:4px 9px;border-radius:5px;border:1px solid;
  cursor:pointer;background:transparent;transition:background .15s;}
.audit-btn.approve{border-color:rgba(36,212,195,0.35);color:#24D4C3;}
.audit-btn.approve:hover:not(:disabled){background:rgba(36,212,195,0.1);}
.audit-btn.redirect{border-color:rgba(241,154,8,0.3);color:#F19A08;}
.audit-btn.redirect:hover:not(:disabled){background:rgba(241,154,8,0.08);}
.audit-btn.reject{border-color:rgba(255,255,255,0.1);color:var(--muted);}
.audit-btn.reject:hover:not(:disabled){background:rgba(255,255,255,0.05);}
.audit-btn:disabled{opacity:.3;cursor:not-allowed;}

/* ---- audit progress narration ---- */
.audit-progress{align-self:flex-start;max-width:86%;background:rgba(36,212,195,.03);
  border:1px solid rgba(36,212,195,.1);border-radius:8px;
  padding:7px 11px;font-size:.76rem;color:var(--muted);font-style:italic;}

/* ---- mobile tab bar ---- */
.tab-bar{
  display:none;
  position:fixed;bottom:calc(68px + env(safe-area-inset-bottom));left:0;right:0;
  height:52px;
  background:#070F1A;border-top:1px solid rgba(36,212,195,0.12);
  z-index:30;
}
.tab-btn{
  flex:1;height:100%;
  background:none;color:var(--muted);border-radius:0;
  font-size:.62rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:44px;transition:color .15s;
}
.tab-icon{width:15px;height:15px;flex-shrink:0;}
.tab-btn.on{color:var(--teal);}
.tab-btn.on::after{
  content:'';display:block;position:absolute;bottom:0;
  left:50%;transform:translateX(-50%);
  width:24px;height:2px;border-radius:2px 2px 0 0;background:var(--teal);
}
.tab-btn{position:relative;}

/* ---- tab badges ---- */
.tab-badge{
  position:absolute;top:7px;left:calc(50% + 8px);
  min-width:15px;height:15px;padding:0 3px;border-radius:8px;
  background:var(--crit);color:#fff;
  font-size:.6rem;font-weight:800;line-height:15px;text-align:center;
  display:none;align-items:center;justify-content:center;
}
.tab-badge.show{display:inline-flex;}

/* ---- CORA nav (thumb zone) ---- */
.cora-nav{
  display:none;
  position:fixed;bottom:0;left:0;right:0;
  height:calc(68px + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  background:#070F1A;border-top:1px solid rgba(36,212,195,0.12);
  z-index:31;
  justify-content:space-around;align-items:center;
}
.cora-nav-btn{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;color:rgba(140,160,184,.6);font-size:.58rem;font-weight:700;letter-spacing:.07em;
  text-transform:uppercase;text-decoration:none;cursor:pointer;
  min-height:44px;transition:color .15s;border:none;background:none;
}
.cora-nav-btn.active{color:var(--teal);}
.cora-nav-btn:hover{color:rgba(255,255,255,.85);}
.cora-nav-btn svg{stroke:currentColor;}

/* ---- mobile overrides ---- */
@media(max-width:767px){
  body{padding-bottom:calc(128px + env(safe-area-inset-bottom));}

  header.c-header{
    position:sticky;top:0;z-index:20;
    height:52px;padding:0 16px;margin-bottom:0;
    background:rgba(3,11,23,0.96);
    backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  }
  .brand>span:not(.brand-dot){display:none;}
  #synced{display:none;}
  #open-chat{display:none;}
  .btn-label{display:none;}

  .tab-pane{display:none;}
  .tab-pane.active{
    display:flex;flex-direction:column;gap:16px;
    grid-column:1 / -1;padding-bottom:8px;
  }

  .tab-bar{display:flex;}
  .cora-nav{display:flex;}
}

/* tab panes controlled by .active class on all viewports */

/* ---- card-context mic buttons ---- */
.card-mic {
  background: transparent;
  border: 1px solid rgba(36,212,195,0.14);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  margin-left: auto;
  padding: 5px 8px;
  transition: background .15s, color .15s;
}
.card-mic:hover {
  background: rgba(36,212,195,0.07);
  color: var(--teal);
}
.card-mic.active {
  color: var(--teal);
  border-color: var(--teal);
}

/* ---- accounting / finance card ---- */
.acct-panel { display:flex; flex-direction:column; }
.acct-panel-head { align-items:center; flex-wrap:wrap; gap:8px; }

/* context meter */
.acct-ctx-wrap { display:flex; align-items:center; gap:6px; margin-left:auto; }
.acct-ctx-bar-outer { width:72px; height:4px; background:rgba(255,255,255,.06); border-radius:3px; overflow:hidden; }
.acct-ctx-bar-fill { height:100%; border-radius:3px; transition:width .4s; }
.acct-ctx-bar-fill.green  { background:var(--teal); }
.acct-ctx-bar-fill.yellow { background:var(--orange); }
.acct-ctx-bar-fill.red    { background:var(--crit); }
.acct-ctx-label { font-size:.6rem; color:var(--muted); letter-spacing:.06em; white-space:nowrap; }

/* header buttons */
.acct-handoff-btn { font-size:.72rem; padding:5px 11px; }
.local-badge { font-size:.55rem; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:#1a9e8f; background:rgba(36,212,195,.1); border:1px solid rgba(36,212,195,.25); border-radius:4px; padding:2px 6px; vertical-align:middle; cursor:default; }
.acct-reset-btn   { font-size:.72rem; padding:5px 11px; color:var(--muted); border-color:rgba(255,255,255,.08); }
.acct-reset-btn:hover { color:var(--crit); border-color:rgba(229,72,77,.35); }

/* near-limit warning */
.acct-warn {
  display:none; font-size:.74rem; color:var(--crit);
  padding:7px 14px; margin-bottom:10px;
  background:rgba(229,72,77,.05); border:1px solid rgba(229,72,77,.15); border-radius:8px;
}

/* chat thread */
.acct-thread {
  flex:1; overflow-y:auto; padding:14px 4px;
  display:flex; flex-direction:column; gap:10px;
  min-height:280px; max-height:calc(100dvh - 340px);
  scrollbar-width:thin; scrollbar-color:var(--teal) transparent;
}
@media(max-width:767px) {
  .acct-thread { max-height:calc(100dvh - 300px); }
}

/* image strip (preview before send) */
.acct-img-strip {
  display:flex; align-items:center; gap:8px;
  padding:0 2px 8px; min-height:0;
}
.acct-img-thumb {
  max-height:58px; max-width:110px; border-radius:6px;
  border:1px solid rgba(36,212,195,.2); cursor:pointer; object-fit:cover;
}
.acct-img-strip-label { font-size:.7rem; color:var(--muted); }
.acct-img-clear {
  background:rgba(255,255,255,.1); border:none; border-radius:50%;
  width:20px; height:20px; color:var(--ink); cursor:pointer;
  font-size:.72rem; line-height:20px; text-align:center;
  flex:0 0 20px;
}

/* composer */
.acct-composer {
  border-top:1px solid rgba(36,212,195,.08);
  padding:10px 0 2px;
  display:flex; gap:7px; align-items:flex-end;
}
.acct-composer textarea {
  flex:1; min-width:0; resize:none;
  background:rgba(0,0,0,.3); border:1px solid rgba(36,212,195,.12);
  border-radius:11px; padding:10px 12px;
  color:var(--ink); font-family:inherit; font-size:.86rem;
  line-height:1.4; outline:none; max-height:120px;
}
.acct-composer textarea:focus { border-color:rgba(36,212,195,.35); }
.acct-composer textarea::placeholder { color:var(--faint); }
.acct-tool-btn {
  flex:0 0 36px; width:36px; height:36px;
  background:none; border:1px solid rgba(36,212,195,.12);
  border-radius:8px; color:var(--muted); font-size:.95rem;
  cursor:pointer; transition:background .15s;
  display:flex; align-items:center; justify-content:center;
}
.acct-tool-btn:hover { background:rgba(36,212,195,.07); color:var(--teal); }
.acct-send-btn {
  flex:0 0 auto; background:var(--teal); color:#030B17;
  border:none; border-radius:10px; padding:9px 16px;
  font-size:.83rem; font-weight:700; cursor:pointer; transition:filter .15s;
  white-space:nowrap;
}
.acct-send-btn:hover { filter:brightness(1.1); }
.acct-mic-btn {
  flex:0 0 36px; width:36px; height:36px;
  background:rgba(241,154,8,.12); border:1px solid rgba(241,154,8,.25);
  border-radius:50%; color:var(--orange); font-size:.95rem;
  cursor:pointer; transition:background .15s;
  display:flex; align-items:center; justify-content:center;
}
.acct-mic-btn:hover { background:rgba(241,154,8,.2); }
.acct-mic-btn.recording {
  background:var(--crit); border-color:var(--crit); color:#fff;
  animation:micpulse 1.1s infinite;
}

/* inline image preview inside a message */
.acct-msg-img {
  max-width:100%; max-height:220px; border-radius:8px;
  display:block; margin-bottom:6px; cursor:zoom-in;
}

/* handoff pre-block inside modal */
.handoff-pre {
  white-space:pre-wrap; font-size:.8rem; line-height:1.65;
  background:rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.06);
  border-radius:8px; padding:12px 14px;
  max-height:55vh; overflow-y:auto; color:#9BBAD0;
}

/* --- Phase 1 bank audit: classification batch card --- */
.classify-batch {
  background:var(--surface2); border-radius:10px;
  border-left:3px solid var(--teal);
  padding:14px 16px; margin:10px 0; align-self:stretch;
}
.classify-head { margin-bottom:10px; }
.classify-head b { display:block; color:var(--fg); font-size:.9rem; margin-bottom:3px; }
.classify-sub { font-size:.76rem; color:var(--muted); }
.classify-list { display:flex; flex-direction:column; gap:7px; margin-bottom:12px; }
.classify-entry {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 10px; background:var(--surface1); border-radius:7px;
  transition:opacity .2s;
}
.classify-entry.classified { opacity:.55; }
.classify-info { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.classify-inst { font-size:.78rem; font-weight:600; color:var(--teal); }
.classify-fname { font-size:.74rem; color:var(--fg); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.classify-period { font-size:.7rem; color:var(--muted); }
.classify-actions { display:flex; gap:6px; flex-shrink:0; }
.classify-btn {
  font-size:.73rem; font-weight:600; border:none; border-radius:5px;
  padding:5px 10px; cursor:pointer; transition:opacity .15s;
}
.classify-btn.corp { background:var(--teal); color:#030B17; }
.classify-btn.pers { background:var(--surface1); color:var(--muted); border:1px solid var(--border,rgba(255,255,255,.08)); }
.classify-btn:hover:not(:disabled) { opacity:.82; }
.classify-btn:disabled { opacity:.35; cursor:default; }
.classify-done { font-size:.73rem; font-weight:600; padding:5px 10px; border-radius:5px; }
.classify-done.corporate { background:var(--teal); color:#030B17; }
.classify-done.personal { background:var(--surface1); color:var(--muted); border:1px solid var(--border,rgba(255,255,255,.08)); }
.classify-footer {
  display:flex; align-items:center; gap:12px;
  padding-top:10px; border-top:1px solid rgba(255,255,255,.06);
}
.classify-run-btn { font-size:.8rem; padding:7px 14px; }
.classify-hint { font-size:.7rem; color:var(--faint); }
.classify-none { font-size:.82rem; color:var(--muted); margin-bottom:10px; }

/* ================================================================
   SIDEBAR LAYOUT — v3.1
   App shell: left nav + scrollable main + pinned bottom composer
   ================================================================ */

html, body { height: auto; }
body { padding: 0 0 calc(128px + env(safe-area-inset-bottom)); }
html { scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* Header: sticky, blurred — same as mobile */
header.c-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  height: 52px;
  background: rgba(3,11,23,0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(36,212,195,0.12);
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Full-width layout — sidebar replaced by bottom nav */
.c-layout { display: flex; flex: 1; }

/* Sidebar hidden — navigation lives in bottom tab-bar + cora-nav */
.c-sidebar { display: none; }
.nav-list {
  flex: 1; padding: 8px; display: flex; flex-direction: column;
  gap: 2px; overflow-y: auto; scrollbar-width: none;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  transition: .12s; border-left: 2px solid transparent;
  white-space: nowrap; overflow: hidden; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--ink); }
.nav-item.on {
  border-left-color: var(--teal); color: var(--ink);
  background: rgba(36,212,195,0.06);
}
.nav-item .tab-icon { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; overflow: visible; }
.nav-item .tab-badge {
  margin-left: auto; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--crit); color: #fff; font-size: .6rem; font-weight: 800;
  line-height: 16px; text-align: center; padding: 0 4px; display: none;
}
.nav-item .tab-badge.show { display: inline-block; }
.sidebar-info {
  padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}

/* Main content */
.c-main {
  flex: 1; overflow: visible; padding: 16px 24px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Tab pane visibility — one panel at a time on all widths */
.tab-pane { display: none; flex-direction: column; gap: 16px; }
.tab-pane.active { display: flex; }

/* Bottom CORA composer */
.cora-composer {
  padding: 10px 18px 14px; background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
}
#cora-quick {
  flex: 1; background: var(--surface2); color: var(--ink);
  border: 1px solid rgba(36,212,195,0.14); border-radius: 12px;
  padding: 10px 14px; font-size: .88rem; font-family: inherit;
  resize: none; height: 42px; max-height: 120px; overflow-y: auto;
  line-height: 1.5; transition: border-color .15s;
}
#cora-quick:focus { outline: none; border-color: rgba(36,212,195,0.4); }
#cora-quick::placeholder { color: var(--muted); }
.cora-mic-btn, .cora-send-btn {
  flex-shrink: 0; height: 40px; border-radius: 10px; border: none;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: .15s;
}
.cora-mic-btn {
  width: 40px; background: var(--surface2); color: var(--muted);
  border: 1px solid var(--line); font-size: 1rem;
}
.cora-mic-btn:hover { border-color: var(--teal); color: var(--teal); }
.cora-send-btn {
  padding: 0 18px; background: var(--teal); color: #07111F;
  font-size: .82rem; font-weight: 700; letter-spacing: .04em;
}
.cora-send-btn:hover { filter: brightness(1.08); }

/* Hide the legacy slide-in drawer; voice pipeline still has DOM refs */
.chat-scrim, aside.chat { display: none !important; }

/* Bottom nav — always visible on all viewports */
.tab-bar { display: flex; }
.cora-nav { display: flex; }
.cora-composer { display: none; }

/* Mobile: sidebar collapses, tab-bar takes over */
@media (max-width: 767px) {
  html, body { height: auto; }
  #app { height: auto; min-height: 100dvh; }
  .c-sidebar { display: none; }
  .cora-composer { display: none; }
  .c-main { overflow: visible; padding: 14px 14px; gap: 12px; }
  body { padding: 0 0 calc(128px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  header.c-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(3,11,23,0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
}

/* ================================================================
   MOBILE-FIRST CARD FIXES — v3.2
   ================================================================ */

/* Tasks: content div shrinks correctly, due date stays right */
.tc { flex: 1; min-width: 0; }

/* Briefing: long topic/article values don't overflow */
.bops-row .bv { min-width: 0; word-break: break-word; max-width: 58%; text-align: right; }

/* Eval queue rows — CSS classes replacing all inline styles */
.eval-row { display:flex; gap:10px; align-items:flex-start; padding:10px 0; border-bottom:1px solid var(--line); }
.eval-row:last-child { border-bottom:none; }
.eval-verdict { font-weight:700; font-size:.7rem; min-width:64px; padding-top:2px; letter-spacing:.04em; flex-shrink:0; }
.eval-body { flex:1; min-width:0; }
.eval-title { font-size:.86rem; font-weight:600; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; margin-bottom:2px; }
.eval-sub { font-size:.76rem; color:var(--muted); line-height:1.4; }
.eval-actions { display:flex; gap:5px; flex-wrap:wrap; margin-top:6px; }
.eval-done { font-size:.66rem; font-weight:700; color:var(--muted); letter-spacing:.04em; }
.eval-btn { font-size:.72rem; font-weight:700; padding:5px 11px; border-radius:6px; cursor:pointer; white-space:nowrap; border:none; font-family:inherit; }
a.eval-btn { display:inline-block; text-decoration:none; line-height:normal; }
.eval-btn.eval-primary { background:rgba(36,212,195,.12); color:var(--teal); }
.eval-btn.eval-sec { background:transparent; border:1px solid var(--line); color:var(--muted); }
.eval-btn.eval-sec:hover { border-color:var(--teal); color:var(--teal); }

/* All panel heads wrap on mobile — defensive safety net */
@media (max-width: 767px) {
  .panel-head { flex-wrap: wrap; }
  /* Finance: h2 takes full row, ctx bar + buttons share second row */
  .acct-panel-head h2 { flex-basis: 100%; margin-bottom: 0; }
  .acct-ctx-wrap { flex: 1; min-width: 100px; }
  /* Finance thread: bounded so fixed navbars don't shift on iOS */
  .acct-thread { max-height: calc(100dvh - 300px); min-height: 0; }
  /* Tasks: due date moves below title instead of squeezing beside it */
  .task { flex-wrap: wrap; align-items: center; }
  .due { flex-basis: 100%; margin-left: calc(3px + 11px + 44px + 11px); text-align: left; margin-top: 0; padding-bottom: 2px; }
}
