*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;--side-w:220px;--takeover-w:400px;--takeover-dur:200ms;--takeover-fade:120ms;--sheet-dur:200ms;--toast-dur:280ms;--menu-dur:200ms;--bg:#F4F5F3;--bg-side:#1F2A2E;--bg-card:#fff;--bg-panel:#fff;--ink:#1F2A2E;--muted:#5E6B6F;--line:#DDE2DF;--line-soft:#EEF1EF;--teal:#2F5D62;--teal-hover:#274E53;--on-teal:#fff;color-scheme:light}
html[data-theme="dark"]{--bg:#121A1C;--bg-side:#1F2A2E;--bg-card:#1F2A2E;--bg-panel:#26353A;--ink:#E8EEEC;--muted:#B7C3BF;--line:#33454B;--line-soft:#2A383D;--teal:#2F5D62;--teal-hover:#3A7076;--on-teal:#fff;color-scheme:dark}
body{font-family:-apple-system,"Segoe UI",Inter,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);font-size:14px;line-height:1.45;overflow-x:hidden}
a{color:inherit}
.app{display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);min-height:100vh}
html[data-takeover="opening"] .app,html[data-takeover="open"] .app,html[data-takeover="closing"] .app{grid-template-columns:var(--takeover-w) minmax(0,1fr)}
.side{width:auto;min-width:0;background:var(--bg-side);color:#DCE3E0;padding:20px 14px;flex-shrink:0}
.side .logo{font-weight:700;font-size:16px;color:#fff;margin-bottom:4px}
.side .logo-sub{font-size:11px;color:#9AA7A3;margin-bottom:20px;padding:0 2px}
.side a{display:block;padding:8px 10px;border-radius:8px;color:#C5CFCB;text-decoration:none;margin-bottom:2px}
.side a:hover{background:#2A383D;color:#fff}
.side a.on{background:#33454B;color:#fff}
.side .foot{margin-top:24px;padding:8px 10px;font-size:11px;color:#9AA7A3}
.main{flex:1;padding:24px 32px 40px;min-width:0;background:transparent}
.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:12px}
h1{font-size:22px;font-weight:700;letter-spacing:-0.02em}
.sub{color:var(--muted);font-size:13px;margin-top:2px}
.card{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:0}
.card h2{font-size:15px;margin-bottom:10px;font-weight:650}
.grid{display:grid;gap:14px}
.g4{grid-template-columns:repeat(4,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g2{grid-template-columns:2fr 1fr}
.g2e{grid-template-columns:1fr 1fr}
.stack{display:flex;flex-direction:column;gap:14px}
.metric{padding:16px 18px}
.metric .v{font-size:24px;font-weight:700;letter-spacing:-0.03em;line-height:1.15}
.metric .l{color:#5E6B6F;font-size:12px;margin-top:4px}
.metric.warn .v{color:#9A3328}
.metric.ok .v{color:#2F6B45}
.pill{display:inline-block;padding:2px 9px;border-radius:99px;font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;vertical-align:middle}
.red{background:#F6E1DE;color:#9A3328}
.amb{background:#F3E8DA;color:#8A5A1C}
.grn{background:#DFEDE3;color:#2F6B45}
.gry{background:#E8ECEA;color:#4B585C}
.blu{background:#DFE8F0;color:#2E5878}
.row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #EEF1EF;gap:10px}
.row:last-child{border:0}
.row .grow{min-width:0;flex:1}
.btn{background:var(--teal);color:var(--on-teal);border-radius:8px;padding:8px 14px;font-weight:600;font-size:13px;border:0;white-space:nowrap;cursor:pointer;font-family:inherit;text-decoration:none;display:inline-block;text-align:center;line-height:1.2}
.btn:hover{background:var(--teal-hover)}
.btn.q{background:var(--bg-card);color:var(--teal);border:1px solid var(--teal)}
.btn.q:hover{background:#F4F7F6}
.btn:disabled{opacity:.5;cursor:default}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:#5E6B6F;font-weight:600;padding:8px 6px;border-bottom:1px solid #DDE2DF;white-space:nowrap}
td{padding:9px 6px;border-bottom:1px solid #EEF1EF;vertical-align:middle}
tr:last-child td{border-bottom:0}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.muted{color:var(--muted)}
.small{font-size:12px}
.tl{position:relative;padding-left:26px}
.tl .s{position:relative;padding:0 0 16px 0}
.tl .s:before{content:"";position:absolute;left:-20px;top:4px;width:12px;height:12px;border-radius:50%;background:#2F5D62}
.tl .s:after{content:"";position:absolute;left:-15px;top:18px;width:2px;bottom:0;background:#C9D2CE}
.tl .s:last-child{padding-bottom:0}
.tl .s:last-child:after{display:none}
.tl .s.todo:before{background:#fff;border:2px solid #9AA7A3}
.tl .s.now:before{background:#B5761F;border:0}
.bar{height:8px;background:#E8ECEA;border-radius:6px;overflow:hidden}
.bar i{display:block;height:100%;background:#2F5D62;border-radius:6px}
.bar i.amb{background:#B5761F}
.bar i.red{background:#9A3328}
.bar-row{display:grid;grid-template-columns:140px 1fr 48px;gap:10px;align-items:center;padding:7px 0}
.bar-row .name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tog{display:inline-block;width:34px;height:20px;border-radius:12px;background:#C9D2CE;position:relative;vertical-align:middle;cursor:pointer;flex-shrink:0;border:0;padding:0}
.tog:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .28s cubic-bezier(.34,1.4,.64,1)}
.tog.on{background:#2F5D62}
.tog.on:after{transform:translateX(14px)}
.tag{font-size:11px;color:#5E6B6F;border:1px dashed #9AA7A3;border-radius:6px;padding:1px 6px;white-space:nowrap}
.mob{display:none}
.stages{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.stage{text-align:center;padding:10px 6px;border:1px solid #E4E8E6;border-radius:10px;background:#FAFBFA;min-width:0;min-height:90px;display:flex;flex-direction:column;justify-content:center}
.stage .n{font-size:20px;font-weight:700;letter-spacing:-0.03em}
.stage .lab{font-size:11px;color:#5E6B6F;margin-top:2px;line-height:1.25}
.stage.late{background:#FBF4F3;border-color:#E8C9C4}
.stage.late .n{color:#9A3328}
.stage.done{background:#F4F8F5}
.linkish{color:#2F5D62;text-decoration:none;font-weight:600}
.linkish:hover{text-decoration:underline}
a.rowlink, tr.rowlink{cursor:pointer}
tr.rowlink:hover td{background:#F7F9F8}
.email{background:#F7F8F7;border:1px solid #E4E8E6;border-radius:10px;padding:12px 14px;font-size:13px}
.email .meta{font-size:12px;color:#5E6B6F;margin-bottom:8px}
.email blockquote{border-left:3px solid #2F5D62;padding:0 0 0 12px;color:#1F2A2E;font-style:normal}
.note{padding:8px 0;border-bottom:1px solid #EEF1EF}
.note:last-child{border:0}
.banner{display:inline-flex;align-items:center;gap:6px}
.cash .amt{font-variant-numeric:tabular-nums;font-weight:700}
.score-stack .score{padding:10px 0;border-bottom:1px solid #EEF1EF}
.score-stack .score:first-child{padding-top:0}
.score-stack .score:last-child{border:0;padding-bottom:0}
.score h3{font-size:14px;margin-bottom:8px}
.score .stat{display:flex;justify-content:space-between;font-size:12px;margin:6px 0 3px}
.use-first{outline:2px solid #B5761F;outline-offset:-1px}
.kicker{font-size:11px;color:#5E6B6F;margin-top:6px}
.field{margin:0 0 12px}
.field label{display:block;font-size:12px;color:#5E6B6F;margin-bottom:4px;font-weight:600}
.field input,.field select,.field textarea{
  width:100%;border:1px solid #DDE2DF;border-radius:8px;padding:8px 10px;font:inherit;background:#fff;color:#1F2A2E
}
.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid #2F5D62;outline-offset:1px;border-color:#2F5D62}
.result .big{font-size:22px;font-weight:700;letter-spacing:-0.03em}
.warn-box{background:#FBF4F3;border:1px solid #E8C9C4;color:#9A3328;border-radius:8px;padding:8px 10px;font-size:13px;margin-top:10px}
.ok-box{background:#F4F8F5;border:1px solid #C9E0D0;color:#2F6B45;border-radius:8px;padding:8px 10px;font-size:13px;margin-top:10px}
.modal-bg{position:fixed;inset:0;background:transparent;display:flex;align-items:center;justify-content:center;z-index:70;padding:20px}
.modal-bg[hidden]{display:none}
.modal{background:#fff;border-radius:14px;padding:20px 22px;max-width:440px;width:100%;box-shadow:0 12px 40px rgba(31,42,46,.2)}
.modal h2{font-size:17px;margin-bottom:8px}
.modal p{color:#1F2A2E;margin-bottom:8px}
.modal .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}
.people-list button{display:block;width:100%;text-align:left;background:none;border:0;border-radius:8px;padding:8px 10px;font:inherit;cursor:pointer;color:#1F2A2E}
.people-list button:hover,.people-list button.on{background:#F0F3F2}
.comment-box{border:1px solid #DDE2DF;border-radius:8px;padding:8px 10px;width:100%;font:inherit;min-height:64px;resize:vertical}
@media(max-width:800px){
  .side{display:none}
  .side.open{display:block;position:fixed;inset:0 auto 0 0;z-index:30;width:min(260px,80vw);box-shadow:4px 0 24px rgba(0,0,0,.25)}
  .scrim{display:none;position:fixed;inset:0;background:rgba(31,42,46,.4);z-index:25}
  .scrim.on{display:block}
  .mob{display:flex;justify-content:space-between;align-items:center;background:#1F2A2E;color:#fff;padding:12px 16px;font-weight:700;position:sticky;top:0;z-index:20;gap:10px}
  .mob-start{display:flex;align-items:baseline;gap:8px;min-width:0}
  .mob-tools{display:flex;align-items:center;gap:8px;flex-shrink:0}
  .mob button{background:none;border:0;color:#fff;font:inherit;font-weight:700;cursor:pointer;padding:0}
  .app{display:block}
  .main{padding:16px 16px 32px}
  .g4{grid-template-columns:1fr 1fr}
  .g2,.g2e,.g3{grid-template-columns:1fr}
  .stages{grid-template-columns:repeat(3,1fr)}
  .hide-m{display:none}
  .top{flex-wrap:wrap;gap:8px}
  h1{font-size:19px}
  .bar-row{grid-template-columns:110px 1fr 44px;gap:8px}
  .row{align-items:flex-start}
  .row:has(.btn){flex-wrap:wrap}
  .row:has(.btn) .grow{flex:1 1 100%}
  .row:has(.btn) > .btn, .row:has(.btn) > a.btn{margin-top:2px}
  .btn{flex-shrink:0}
  .cash .muted{min-width:0}
  .cash .amt{flex-shrink:0}
}

button.stage{font:inherit;color:inherit;margin:0;width:100%;cursor:pointer;-webkit-appearance:none;appearance:none}
button.stage:hover{border-color:#C9D2CE;background:#F0F3F2}
button.stage.late:hover{background:#F8EEEC;border-color:#E8C9C4}
button.stage.done:hover{background:#EEF5F0}
button.stage:focus-visible{outline:2px solid #2F5D62;outline-offset:2px}
.stage-sheet-bg{position:fixed;inset:0;background:transparent;z-index:50}
.stage-sheet-bg[hidden]{display:none}
.stage-sheet-bg:before{content:"";position:absolute;inset:0;background:rgba(31,42,46,.45);opacity:0;transition:opacity .3s ease}
.stage-sheet-bg.is-open:before{opacity:1}
.stage-sheet{position:absolute;top:0;right:0;bottom:0;width:min(440px,92vw);background:#fff;box-shadow:-8px 0 40px rgba(31,42,46,.2);display:flex;flex-direction:column;transform:translateX(100%);transition:transform .3s cubic-bezier(.34,1.4,.64,1);z-index:1;overflow:hidden}
.stage-sheet-bg.is-open .stage-sheet{transform:translateX(0)}
.stage-sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:18px 18px 12px;border-bottom:1px solid #DDE2DF;flex-shrink:0}
.stage-sheet-head h2{font-size:17px;margin:0;font-weight:700;letter-spacing:-0.02em}
.stage-sheet-head .btn{flex-shrink:0}
.stage-sheet-body{overflow:auto;padding:8px 18px 32px;flex:1;-webkit-overflow-scrolling:touch}
.stage-group{margin-top:14px}
.stage-group h3{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#5E6B6F;margin:0 0 2px}
.stage-group.is-late h3{color:#9A3328}
.stage-order{display:block;text-decoration:none;color:inherit;padding:12px 10px;margin:0 -10px;border-bottom:1px solid #EEF1EF;border-radius:0}
.stage-group .stage-order:last-child{border-bottom:0}
a.stage-order:hover,a.stage-order:focus-visible{background:#F7F9F8;border-radius:8px;outline:none}
a.stage-order:focus-visible{outline:2px solid #2F5D62;outline-offset:0}
.stage-order-po{font-weight:700}
a.stage-order .stage-order-po{color:#2F5D62}
.stage-order-meta{font-size:12px;color:#5E6B6F;margin-top:2px;line-height:1.4}
.stage-order-flavor + .stage-order-meta{margin-top:6px}
.stage-order-reason{font-size:12px;color:#9A3328;margin-top:4px;line-height:1.4}
body.stage-sheet-open{overflow:hidden}
@media(max-width:759px){
  .stage-sheet{top:auto;left:0;right:0;width:100%;max-height:min(85vh,720px);border-radius:14px 14px 0 0;box-shadow:0 -8px 40px rgba(31,42,46,.2);transform:translateY(100%)}
  .stage-sheet-bg.is-open .stage-sheet{transform:translateY(0)}
}
@media(prefers-reduced-motion:reduce){
  .stage-sheet-bg,.stage-sheet{transition:none}
}

/* ---- Mortar additions: only what new pieces need, using the existing palette ---- */
[hidden]{display:none!important}
.role-pick{margin:0 2px 14px}
.role-pick label{display:block;font-size:11px;color:#9AA7A3;margin-bottom:4px}
.role-pick select{width:100%;background:#2A383D;color:#fff;border:1px solid #33454B;border-radius:8px;padding:6px 8px;font:inherit;font-size:13px}
.side-ai{display:block;width:100%;text-align:left;margin-top:10px;padding:8px 10px;border-radius:8px;border:1px solid #33454B;background:none;color:#C5CFCB;font:inherit;cursor:pointer}
.side-ai:hover{background:#2A383D;color:#fff}
.reset-demo{margin-top:8px;background:none;border:1px dashed #9AA7A3;color:#C5CFCB;border-radius:6px;padding:3px 8px;font:inherit;font-size:11px;cursor:pointer}
.reset-demo:hover{color:#fff}
.btn.armed,.btn.q.armed{background:#8A5A1C;color:#fff;border-color:#8A5A1C}
.ai-fab{position:fixed;right:18px;bottom:18px;z-index:35;background:#1F2A2E;color:#fff;border:0;border-radius:99px;padding:10px 16px;font:inherit;font-weight:600;cursor:pointer;box-shadow:0 6px 20px rgba(31,42,46,.25)}
.ai-fab:hover{background:#33454B}
.ai-soon{margin-top:16px}
.ai-soon h3{font-size:16px;margin-bottom:6px}
.ai-soon .comment-box{margin-top:12px}
.m-toast{position:fixed;left:50%;bottom:24px;z-index:60;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#1F2A2E;color:#fff;border-radius:10px;padding:10px 14px;font-size:13px;max-width:min(420px,calc(100vw - 32px));box-shadow:0 8px 24px rgba(31,42,46,.25);transition:transform .3s cubic-bezier(.34,1.4,.64,1),opacity .2s}
.m-toast.on{opacity:1;transform:translate(-50%,0)}
.fix-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.sec{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#5E6B6F;margin:14px 0 2px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;vertical-align:middle;background:#2F6B45}
.dot.mtg{background:#B5761F}.dot.out{background:#9AA7A3}
.live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2F6B45;vertical-align:middle}
.role-btns{display:flex;flex-wrap:wrap;gap:8px}
.people-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.person-card{display:flex;gap:10px;align-items:flex-start;border:1px solid #E4E8E6;border-radius:10px;padding:12px;text-decoration:none;color:inherit;background:#FAFBFA;min-width:0}
.person-card:hover{border-color:#C9D2CE;background:#F0F3F2}
.avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;background:#33454B;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}
.avatar.big{width:52px;height:52px;font-size:17px}
.person-head{display:flex;gap:12px;align-items:center;margin-bottom:8px}
.check{display:flex;gap:8px;align-items:flex-start;padding:4px 0;font-size:13px;font-weight:400;color:#1F2A2E}
.field .check input{width:auto;margin-top:2px}
.mini-select{border:1px solid #DDE2DF;border-radius:8px;padding:5px 8px;font:inherit;font-size:13px;background:#fff;max-width:55%}
.conn-pick{cursor:pointer;justify-content:flex-start}
.conn-pick input{margin-top:3px;flex-shrink:0}
.pr-chart{width:100%;height:auto;display:block;margin-bottom:8px}
.legend-dot{display:inline-block;width:10px;height:10px;border-radius:3px;vertical-align:middle}
.legend-dot.pay{background:#1F2A2E}.legend-dot.rev{background:#2F5D62}
details.help{border-bottom:1px solid #EEF1EF;padding:10px 0}
details.help:last-child{border:0}
details.help summary{cursor:pointer;font-weight:600}
details.help p{margin-top:6px}
.ph-top{display:flex;justify-content:space-between;align-items:center;background:#1F2A2E;color:#fff;padding:12px 16px;position:sticky;top:0;z-index:20;gap:10px}
.tag-dark{color:#C5CFCB;border-color:#9AA7A3}
.ph-main{max-width:520px;margin:0 auto;padding-bottom:80px}
.phone-body .g4{grid-template-columns:1fr 1fr}
@media(max-width:800px){
  .side.open{overflow-y:auto}
  .people-cards{grid-template-columns:1fr}
  .main{padding-bottom:80px}
  .ai-fab{right:12px;bottom:12px}
}
@media(min-width:801px) and (max-width:1100px){.people-cards{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){.m-toast{transition:none}}

/* ---- Mortar fixes (Nov 13) ---- */
@media(min-width:801px){
  .side{position:sticky;top:0;height:100vh;overflow-y:auto;align-self:flex-start}
}
a.card.tile{display:block;text-decoration:none;color:inherit;cursor:pointer}
a.card.tile:hover{border-color:#C9D2CE;background:#FAFBFA}
a.card.tile:focus-visible{outline:2px solid #2F5D62;outline-offset:2px}
#problem-list,#approvals-list,#to-pending,#to-history,#ho-reqs,#ho-log,#conn-connected,#conn-available,#invites-list,#ph-red,#ph-approvals,#whos-in,#bill-invoices{
  max-height:min(440px,62vh);overflow-y:auto;overscroll-behavior:contain;
  -webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 18px),transparent);padding-bottom:14px}
.back-link{display:inline-block;margin:0 0 10px;color:#2F5D62;text-decoration:none;font-weight:600;font-size:13px}
.back-link:hover{text-decoration:underline}
.to-note{color:#1F2A2E;background:#F7F8F7;border-left:3px solid #2F5D62;padding:3px 8px;margin-top:4px;border-radius:0 6px 6px 0}
.stat-table td:nth-child(2),.stat-table td:nth-child(3),.stat-table th:nth-child(2),.stat-table th:nth-child(3){text-align:right;width:92px}
.notify-box{margin-top:14px;padding-top:4px;border-top:1px solid #EEF1EF}
.tip{position:relative;display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:#E8ECEA;color:#4B585C;font-size:10px;font-weight:700;cursor:help;vertical-align:middle;line-height:1}
.tip:focus-visible{outline:2px solid #2F5D62;outline-offset:1px}
.tip:after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translateX(-50%);width:max-content;max-width:200px;background:#1F2A2E;color:#fff;font-size:12px;font-weight:500;line-height:1.35;padding:6px 8px;border-radius:6px;opacity:0;pointer-events:none;transition:opacity .15s;z-index:5;white-space:normal;text-align:left}
.tip:hover:after,.tip:focus-visible:after,.tip.show:after{opacity:1}
.score .stat .tip:after{left:0;transform:none}
.pr-chart{max-width:100%}
.pr-bar{cursor:pointer;outline:none}
.pr-bar:focus rect,.pr-bar:hover rect{stroke:#1F2A2E;stroke-width:1.5}
.tip:after{display:none}
.tip:hover:after,.tip:focus-visible:after,.tip.show:after{display:block}
.metric .tip:after{left:auto;right:-8px;transform:none}

/* ---- Mortar fixes 2 (Nov 13): quiet scrollbars, contained scrolling, chart tooltip ---- */
html{scrollbar-width:thin;scrollbar-color:#CDD4D1 transparent}
.side{overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#3A4D53 transparent;scrollbar-gutter:stable}
#problem-list,#approvals-list,#to-pending,#to-history,#ho-reqs,#ho-log,#conn-connected,#conn-available,#invites-list,#ph-red,#ph-approvals,#whos-in,#bill-invoices,
.stage-sheet-body,.table-wrap,#prod-sellers .scroll,#prod-makers .scroll{
  overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#D7DEDB transparent}
#problem-list,#approvals-list,#to-pending,#to-history,#ho-reqs,#ho-log,#conn-connected,#conn-available,#invites-list,#ph-red,#ph-approvals,#whos-in,#bill-invoices{
  scrollbar-gutter:stable;padding-right:10px;margin-right:-6px}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background-color:#D7DEDB;border-radius:10px;border:3px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-corner{background:transparent}
html::-webkit-scrollbar-thumb{background-color:#CDD4D1}
.side::-webkit-scrollbar-thumb{background-color:#3A4D53}
#pr-chart{position:relative}
.pr-tip{position:absolute;z-index:5;pointer-events:none;max-width:220px;background:#1F2A2E;color:#fff;font-size:12px;line-height:1.35;padding:6px 8px;border-radius:6px;box-shadow:0 4px 14px rgba(31,42,46,.2)}
#prod-extra .card{min-width:0}

/* ---- Mortar round 3 (Nov 14): invite preview ---- */
.invite-preview .sec:first-child{margin-top:4px}
.inv-list{margin:2px 0 4px 18px;font-size:13px;line-height:1.45}
.inv-list li{margin:2px 0}

/* ---- round 4: sidebar profile card, settings columns, profile page, appearance ---- */
.side a.side-profile{display:flex;align-items:center;gap:10px;padding:8px;margin:-6px -2px 6px;border-radius:10px;background:#26353A;color:#fff}
.side a.side-profile:hover{background:#2E4046}
.side-profile .avatar{width:38px;height:38px;background:#2F5D62;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.sp-who{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.sp-who b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sp-who span{font-size:11px;color:#9AA7A3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sp-stats{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0 0 16px}
.side a.sp-stat{display:block;margin:0;padding:6px 8px;border:1px solid #33454B;border-radius:8px;line-height:1.2;background:#1F2A2E;color:#fff}
.side a.sp-stat:hover,.side a.sp-stat:focus,.side a.sp-stat:focus-visible,.side a.sp-stat:active{background:#1F2A2E;color:#fff}
.sp-stat b{display:block;font-size:15px;color:#fff}
.sp-stat span{display:block;font-size:10.5px;color:#9AA7A3}
.set-cols{columns:2;column-gap:14px}
.set-cols>.card{break-inside:avoid;display:inline-block;width:100%;margin:0 0 14px}
@media (max-width:900px){.set-cols{columns:1}}
.notify-table td,.notify-table th{text-align:center}
.notify-table td:first-child,.notify-table th:first-child{text-align:left}
.seg{display:inline-flex;gap:6px}
.days{display:flex;flex-wrap:wrap;gap:4px 12px}
.pill.gry{background:#EEF1EF;color:#5E6B6F}
#pf-photo .avatar.big{width:72px;height:72px;font-size:22px;overflow:hidden}
.co-logo{border-radius:12px;overflow:hidden}
.co-logo img{border-radius:12px}
html[data-density="compact"] .main{padding:16px 22px 28px}
html[data-density="compact"] .card{padding:12px}
html[data-density="compact"] .row{padding:6px 0}
html[data-density="compact"] .grid,html[data-density="compact"] .stack{gap:10px}
html[data-density="compact"] .set-cols>.card{margin-bottom:10px}
html[data-theme="dark"] body{background:#172124;color:#DCE3E0}
html[data-theme="dark"] .card{background:#1F2A2E;border-color:#33454B}
html[data-theme="dark"] .sub,html[data-theme="dark"] .muted,html[data-theme="dark"] th,html[data-theme="dark"] .metric .l,html[data-theme="dark"] .sec,html[data-theme="dark"] .tag{color:var(--muted)}
html[data-theme="dark"] .row,html[data-theme="dark"] td,html[data-theme="dark"] th{border-color:#2A383D}
html[data-theme="dark"] .btn.q{background:transparent;color:#9FCBC7;border-color:#4E8A8F}
html[data-theme="dark"] .btn.q:hover{background:#26353A}
html[data-theme="dark"] .field input,html[data-theme="dark"] .field select,html[data-theme="dark"] .field textarea{background:#172124;color:#DCE3E0;border-color:#33454B}
html[data-theme="dark"] .tog{background:#33454B}
html[data-theme="dark"] .tog.on{background:#4E8A8F}
html[data-theme="dark"] .ok-box{background:#1E3328;border-color:#2F6B45;color:#BFE0C9}
html[data-theme="dark"] .pill.gry{background:#2A383D;color:#C5CFCB}
html[data-theme="dark"] .side{background:var(--bg-side)}
html[data-theme="dark"] .side a.side-profile{background:#1F2A2E}
html[data-theme="dark"] .linkish,html[data-theme="dark"] .back-link,html[data-theme="dark"] a.stage-order .stage-order-po{color:#9FCBC7}

/* ---- round 5: phone bottom tabs + More (≤800px only; desktop unchanged) ---- */
.m-tabs{display:none}
.chat-msgs{max-height:340px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:10px;padding-right:6px}
.chat-msg{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.chat-msg.mine{align-items:flex-end;justify-content:flex-end}
.chat-msg-line{display:flex;align-items:center;gap:8px;max-width:100%;min-width:0}
.chat-msg.mine .chat-msg-line{flex-direction:row-reverse}
.chat-msg .msg-actions{align-self:center;flex-shrink:0}
.chat-bubble{background:#F0F3F2;border-radius:12px;padding:8px 10px;max-width:80%}
.chat-msg.mine .chat-bubble{background:#E4EEEE}
button.row.chat-pick{width:100%;background:none;border-left:0;border-right:0;border-top:0;font:inherit;color:inherit;text-align:left;cursor:pointer}
.chat-pick.on b{color:#2F5D62}
html[data-theme="dark"] .chat-bubble{background:#26353A}
html[data-theme="dark"] .chat-msg.mine .chat-bubble{background:#2E4A4D}
@media(max-width:800px){
  :root{--tabh:94px}
  .mob .mob-title{font-weight:700}
  .m-tabs{display:block;position:fixed;z-index:60;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));
    bottom:calc(10px + env(safe-area-inset-bottom));border-radius:24px;padding:6px 6px 4px;
    background:rgba(31,42,46,.74);-webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4);
    border:1px solid rgba(255,255,255,.09);box-shadow:0 10px 30px rgba(31,42,46,.28),inset 0 1px 0 rgba(255,255,255,.06);
    transition:padding .45s cubic-bezier(.34,1.4,.64,1),left .45s cubic-bezier(.34,1.4,.64,1),right .45s cubic-bezier(.34,1.4,.64,1),border-radius .45s}
  .m-tabs-view{overflow:hidden;border-radius:18px}
  .m-tabs-track{display:flex;transition:transform .5s cubic-bezier(.34,1.4,.64,1);will-change:transform}
  .m-tabs-page{flex:0 0 100%;display:flex}
  .m-tab{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:50px;
    color:#B7C3BF;text-decoration:none;font-size:11px;font-weight:600;line-height:1.2;font-family:inherit;background:none;border:0;border-radius:14px;cursor:pointer;-webkit-tap-highlight-color:transparent;
    transition:height .45s cubic-bezier(.34,1.4,.64,1),transform .28s cubic-bezier(.34,1.4,.64,1)}
  .m-tab span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;max-height:14px;transition:max-height .35s cubic-bezier(.34,1.4,.64,1),opacity .2s}
  .m-tab svg{width:22px;height:22px;padding:2px 10px;box-sizing:content-box;border-radius:99px;transition:transform .4s cubic-bezier(.34,1.4,.64,1),background .2s}
  .m-tab.on{color:#fff}
  .m-tab.on svg{background:rgba(159,203,199,.22);transform:translateY(-1px) scale(1.06)}
  .m-tab:active{transform:scale(.96)}
  .m-tab:active svg{transform:scale(.9)}
  .m-tabs-next{transition:transform .28s cubic-bezier(.34,1.4,.64,1)}
  .m-tabs-next:active{transform:scale(.96)}
  .m-tab:focus-visible,.m-dot:focus-visible,.m-tabs-next:focus-visible{outline:2px solid #9FCBC7;outline-offset:-2px}
  .m-tab .m-tab-av{width:26px;height:26px;font-size:10px;background:#2F5D62;overflow:hidden;transition:transform .4s cubic-bezier(.34,1.4,.64,1)}
  .m-tabs-nav{display:flex;align-items:center;justify-content:center;gap:8px;height:14px;position:relative;transition:height .4s cubic-bezier(.34,1.4,.64,1),opacity .2s}
  .m-dots{display:flex;gap:2px}
  .m-dot{width:16px;height:14px;border:0;background:none;padding:0;cursor:pointer;position:relative}
  .m-dot:after{content:"";position:absolute;left:50%;top:50%;width:5px;height:5px;margin:-2.5px 0 0 -2.5px;border-radius:99px;background:rgba(255,255,255,.35);transition:width .4s cubic-bezier(.34,1.4,.64,1),margin .4s cubic-bezier(.34,1.4,.64,1),background .2s}
  .m-dot.on:after{width:14px;margin-left:-7px;background:#9FCBC7}
  .m-tabs-next{position:absolute;right:4px;top:-2px;width:22px;height:16px;border:0;border-radius:99px;background:rgba(255,255,255,.1);color:#DCE3E0;font-size:13px;font-weight:700;line-height:1;font-family:inherit;cursor:pointer;padding:0}
  .m-tabs.compact{left:max(48px,env(safe-area-inset-left));right:max(48px,env(safe-area-inset-right));padding:4px 6px;border-radius:20px}
  .m-tabs.compact .m-tab{height:36px}
  .m-tabs.compact .m-tab span:not(.m-tab-av){max-height:0;opacity:0}
  .m-tabs.compact .m-tab svg{transform:scale(.9)}
  .m-tabs.compact .m-tab .m-tab-av{transform:scale(.85)}
  .m-tabs.compact .m-tabs-nav{height:0;opacity:0;pointer-events:none}
  body.has-tabs{padding-bottom:calc(var(--tabh) + env(safe-area-inset-bottom))}
  body.has-tabs .main{padding-bottom:84px}
  body.has-tabs .ai-fab{right:max(14px,env(safe-area-inset-right));bottom:calc(var(--tabh) + env(safe-area-inset-bottom) + 10px);
    width:48px;height:48px;padding:0;border-radius:50%;font-size:18px;display:flex;align-items:center;justify-content:center}
  body.has-tabs .ai-fab .ai-fab-t{display:none}
  body.has-tabs .stage-sheet-bg{bottom:calc(var(--tabh) + env(safe-area-inset-bottom))}
  body.has-tabs .stage-sheet{top:auto;left:0;right:0;width:100%;max-height:min(80vh,680px);border-radius:14px 14px 0 0;box-shadow:0 -8px 40px rgba(31,42,46,.2);transform:translateY(100%)}
  body.has-tabs .stage-sheet-bg.is-open .stage-sheet{transform:translateY(0)}
  .m-you-profile{display:flex;align-items:center;gap:12px;padding:12px;margin:8px 0 10px;border-radius:12px;background:#1F2A2E;color:#fff;text-decoration:none}
  .m-you-profile .sp-who span{color:#C5CFCB;font-size:12px}
  .m-you-profile .m-you-open{color:#9FCBC7}
  .m-you-profile .avatar{overflow:hidden;background:#2F5D62}
  .m-you-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
  .m-you-stat{display:block;border:1px solid #DDE2DF;border-radius:10px;padding:8px 10px;text-decoration:none;color:inherit}
  .m-you-stat b{display:block;font-size:17px}
  .m-you-stat span{font-size:12px;color:#5E6B6F}
  html[data-theme="dark"] .m-you-stat{border-color:#33454B}
  html[data-theme="dark"] .stage-sheet{background:#1F2A2E}
}
@media(max-width:800px) and (prefers-reduced-motion:reduce){
  .m-tabs,.m-tabs-track,.m-tab,.m-tab span,.m-tab svg,.m-tab .m-tab-av,.m-tabs-nav,.m-dot:after{transition:none}
}
.sched-form summary{list-style:none;display:inline-block;margin-top:10px}
.sched-form summary::-webkit-details-marker{display:none}
.sched-form[open] summary{background:#F4F7F6}

/* ---------- co-packer side ---------- */
.bt{display:inline-flex;align-items:center;gap:5px;padding:1px 8px 1px 6px;border-radius:99px;font-size:11.5px;font-weight:650;white-space:nowrap;vertical-align:middle;color:var(--b);background:color-mix(in srgb,var(--b) 12%,#fff);border:1px solid color-mix(in srgb,var(--b) 30%,#fff)}
.bt i{width:7px;height:7px;border-radius:50%;background:var(--b)}
.bt-shared{--b:#5E6B6F}
html[data-theme="dark"] .bt{color:color-mix(in srgb,var(--b) 45%,#fff);background:color-mix(in srgb,var(--b) 30%,#1F2A2E);border-color:color-mix(in srgb,var(--b) 50%,#1F2A2E)}
.cp-brandbar{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.cp-bb{display:inline-flex;align-items:center;gap:6px;border:1px solid #DDE2DF;background:#fff;color:#1F2A2E;border-radius:99px;padding:6px 12px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:transform .35s cubic-bezier(.34,1.4,.64,1),background .2s}
.cp-bb i{width:8px;height:8px;border-radius:50%;background:var(--b)}
.cp-bb:hover{transform:translateY(-1px)}
.cp-bb.on{background:#1F2A2E;color:#fff;border-color:#1F2A2E}
html[data-theme="dark"] .cp-bb{background:#1F2A2E;color:#DCE3E0;border-color:#33454B}
html[data-theme="dark"] .cp-bb.on{background:#4E8A8F;border-color:#4E8A8F;color:#fff}
.cp-tl{list-style:none;display:flex;gap:4px;margin:10px 0 2px;padding:0;overflow-x:auto}
.cp-tl li{flex:1;min-width:64px;font-size:11px;color:#5E6B6F;position:relative;padding-top:12px}
.cp-tl li:before{content:"";position:absolute;top:0;left:0;right:0;height:5px;border-radius:99px;background:#DDE2DF}
.cp-tl li.done:before{background:#4E8A8F}
.cp-tl li.now:before{background:linear-gradient(90deg,#4E8A8F 50%,#9FCBC7 50%)}
.cp-tl li.now{color:#1F2A2E;font-weight:650}
html[data-theme="dark"] .cp-tl li.now{color:#fff}
html[data-theme="dark"] .cp-tl li:before{background:#33454B}
html[data-theme="dark"] .cp-tl li.done:before{background:#4E8A8F}
.cp-cal-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.cp-cal-grid{border-collapse:separate;border-spacing:4px;width:100%;min-width:720px;table-layout:fixed}
.cp-cal-grid th{font-size:12px;color:#5E6B6F;text-align:left;font-weight:600;padding:2px 4px}
.cp-cal-grid th.today{color:#2F6B6F}
.cp-cal-grid th:first-child{width:124px}
.cp-cell{vertical-align:top;background:#F4F7F6;border:1px dashed transparent;border-radius:8px;height:76px;padding:4px;transition:background .2s,border-color .2s}
.cp-cell.over{background:#E3F0EE;border-color:#4E8A8F}
html[data-theme="dark"] .cp-cell{background:#243236}
.cp-chip{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;border:0;border-left:4px solid var(--b);border-radius:7px;padding:5px 7px;margin-bottom:4px;font:inherit;font-size:11px;line-height:1.3;cursor:grab;color:#1F2A2E;background:color-mix(in srgb,var(--b) 14%,#fff);transition:transform .35s cubic-bezier(.34,1.4,.64,1),box-shadow .2s}
.cp-chip b{font-size:12px;color:var(--b)}
.cp-chip span{color:#5E6B6F;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.cp-chip em{font-style:normal;color:#8A5A12;font-weight:600}
.cp-chip:hover{transform:translateY(-1px);box-shadow:0 3px 10px rgba(31,42,46,.12)}
.cp-chip.dragging{opacity:.45}
html[data-theme="dark"] .cp-chip{background:color-mix(in srgb,var(--b) 28%,#1F2A2E);color:#DCE3E0}
html[data-theme="dark"] .cp-chip b{color:color-mix(in srgb,var(--b) 45%,#fff)}
html[data-theme="dark"] .cp-chip span{color:#9AA7A3}
.cp-move{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#E3F0EE;border:1px solid #9FCBC7;border-radius:10px;padding:10px 12px;margin-bottom:10px}
html[data-theme="dark"] .cp-move{background:#243236;border-color:#4E8A8F}
.cp-cap-bar{display:flex;height:9px;border-radius:99px;background:#EEF1EF;overflow:hidden}
.cp-cap-bar span{background:var(--b);height:100%}
html[data-theme="dark"] .cp-cap-bar{background:#2A383D}
.cp-hot{color:#9A3328}
.cp-scroll{max-height:340px;overflow:auto}
.cp-scroll-tall{max-height:520px}
.cp-mismatch{color:#9A3328;font-weight:600}
.cp-total{font-weight:700}
.cp-total td{border-top:2px solid #DDE2DF}
.cp-low-row td{background:#FBF1EE}
html[data-theme="dark"] .cp-low-row td{background:#3A2A28}
.cp-upgrade{margin-top:14px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#F4F7F6}
html[data-theme="dark"] .cp-upgrade{background:#243236}
.cp-paid-note,.cp-soon{max-width:620px}
.cp-row{align-items:center;gap:8px}
.co-logo{background:#2F5D62;color:#fff}
@media (max-width:760px){
  .cp-tiles{grid-template-columns:1fr 1fr}
  .cp-tl li{min-width:58px;font-size:10.5px}
}
@media (prefers-reduced-motion:reduce){
  .cp-bb,.cp-chip,.cp-cell{transition:none}
}
@media print{
  body.cp-printing .side,body.cp-printing .mob,body.cp-printing .m-tabs,body.cp-printing .cp-noprint,body.cp-printing .main > *:not(#cp-root),body.cp-printing #cp-root > *:not(#cp-recall-out){display:none!important}
  body.cp-printing #cp-recall-out > *:not(#cp-recall){display:none!important}
  body.cp-printing .main{padding:0}
  body.cp-printing .card{border:0}
}
#cp-root .grid>*,#cp-root .stack>*,#cp-root .card,.cp-row .grow{min-width:0}

/* ---------- warehouse Scan mode (big tap targets, phone first) ---------- */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.scan .btn{min-height:48px;padding:12px 16px;font-size:14px}
.scan .tog::before{content:"";position:absolute;inset:-14px -8px}
.scan-modes{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}
.scan-mode{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:88px;border-radius:14px;border:1px solid #DDE2DF;background:#fff;color:#1F2A2E;font:inherit;font-size:16px;font-weight:700;cursor:pointer;transition:transform .35s cubic-bezier(.34,1.4,.64,1),background .2s,color .2s}
.scan-mode svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.scan-mode:hover{transform:translateY(-2px)}
.scan-mode:active{transform:scale(.97)}
.scan-mode.on{background:#2F5D62;border-color:#2F5D62;color:#fff}
html[data-theme="dark"] .scan-mode{background:#1F2A2E;border-color:#33454B;color:#DCE3E0}
html[data-theme="dark"] .scan-mode.on{background:#4E8A8F;border-color:#4E8A8F;color:#fff}
.scan-bar{display:flex;gap:8px;margin-bottom:10px}
.scan-bar input{flex:1;min-width:0;min-height:56px;border:2px solid #9FCBC7;border-radius:12px;padding:0 14px;font:inherit;font-size:17px;letter-spacing:.02em;background:#fff;color:#1F2A2E}
.scan-bar input:focus{outline:none;border-color:#2F5D62;box-shadow:0 0 0 3px rgba(47,93,98,.15)}
html[data-theme="dark"] .scan-bar input{background:#172124;color:#DCE3E0;border-color:#4E8A8F}
.scan-cam{display:inline-flex;align-items:center;gap:6px;min-height:56px!important;min-width:56px}
.scan-cam svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.scan-msg{border-radius:10px;padding:12px 14px;margin-bottom:10px;font-size:14px;animation:scanPop .45s cubic-bezier(.34,1.4,.64,1)}
.scan-msg.ok{background:#E8F3EC;color:#24553A}
.scan-msg.warn{background:#FBF3E4;color:#7A5212}
.scan-msg.bad{background:#FBEDEA;color:#8A2E24}
html[data-theme="dark"] .scan-msg.ok{background:#22382C;color:#BFE3CB}
html[data-theme="dark"] .scan-msg.warn{background:#3A3122;color:#F0D9A8}
html[data-theme="dark"] .scan-msg.bad{background:#3A2A28;color:#F2C4BC}
@keyframes scanPop{from{transform:translateY(4px) scale(.98);opacity:0}to{transform:none;opacity:1}}
.scan-warn{background:#FBF3E4;color:#7A5212;border-radius:8px;padding:8px 10px;margin:8px 0;font-size:13px}
.scan-diff{background:#FBEDEA;color:#8A2E24}
html[data-theme="dark"] .scan-warn{background:#3A3122;color:#F0D9A8}
.scan-step{margin-bottom:12px}
.scan-entry{border-top:1px solid #DDE2DF;margin-top:10px;padding-top:10px}
.scan-entry .field input{min-height:48px;font-size:17px}
.scan .field input,.scan .field select{min-height:48px}
.scan-chips{display:flex;flex-wrap:wrap;gap:8px}
.scan-chip{display:flex;flex-direction:column;align-items:flex-start;min-height:48px;padding:7px 12px;border-radius:10px;border:1px dashed #9FCBC7;background:#F4F7F6;color:#1F2A2E;font:inherit;font-size:12px;cursor:pointer;text-align:left;transition:transform .35s cubic-bezier(.34,1.4,.64,1)}
.scan-chip b{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}
.scan-chip span{color:#5E6B6F}
.scan-chip:hover{transform:translateY(-1px)}
html[data-theme="dark"] .scan-chip{background:#243236;color:#DCE3E0;border-color:#4E8A8F}
.scan-photo-row{display:flex;align-items:center;gap:10px;margin:10px 0;flex-wrap:wrap}
.scan-thumb img{width:64px;height:64px;border-radius:8px;object-fit:cover;display:block}
.scan-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}
.scan-off{border:0;gap:12px;min-height:48px}
.scan-video video{width:100%;border-radius:12px;background:#1F2A2E;aspect-ratio:4/3;object-fit:cover}
@media (max-width:760px){
  .scan-modes{gap:8px}
  .scan-mode{min-height:76px;font-size:15px}
  .scan-cam span{display:none}
}
@media (prefers-reduced-motion:reduce){
  .scan-mode,.scan-chip{transition:none}
  .scan-msg{animation:none}
}

/* ---------- round 8: messages, calendar, stock modal, collapsible ---------- */
.who{display:inline-flex;flex-direction:column;line-height:1.25;vertical-align:middle;min-width:0}
.who b{font-weight:650}
.who .biz{font-size:11.5px;color:#5E6B6F;font-weight:500}
html[data-theme="dark"] .who .biz{color:#9AA7A3}
.chat-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.chat-head .who b{font-size:15px}
.chat-pick .grow{display:flex;flex-direction:column;gap:2px;min-width:0}
.chat-last{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#chat-picker .chat-pick{width:100%;min-height:52px}
.cp-chip.pending{outline:2px dashed var(--b);outline-offset:1px}
.cp-pend-tag{color:#8A5A12!important}
.cp-chip.cp-item{background:#fff;border-left-style:dotted}
html[data-theme="dark"] .cp-chip.cp-item{background:#1F2A2E}
.cp-tip{position:fixed;left:0;top:0;z-index:60;max-width:280px;background:#1F2A2E;color:#F4F7F6;font-size:12px;line-height:1.4;padding:7px 10px;border-radius:8px;box-shadow:0 6px 20px rgba(31,42,46,.25);pointer-events:none;opacity:0;transition:opacity .15s ease}
.cp-tip.on{opacity:1}
.cp-add-form .field{margin-bottom:10px}
.cp-add-form textarea{width:100%}
.cp-modal-bg{z-index:70}
.cp-modal{max-width:520px}
.cp-modal textarea{width:100%;font:inherit;line-height:1.45}
/* enter/exit motion is shared with .modal-bg in the motion pass below */
html[data-theme="dark"] .cp-modal{background:#1F2A2E;color:#DCE3E0}
.cp-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;background:none;border:0;padding:0;text-align:left;font:inherit;color:inherit;cursor:pointer}
.cp-collapse-head span{display:flex;flex-direction:column;gap:2px}
.cp-chev{width:22px;height:22px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .45s cubic-bezier(.34,1.4,.64,1)}
.cp-collapse-head[aria-expanded="true"] .cp-chev{transform:rotate(180deg)}
.cp-collapse{overflow:hidden;transition:height .5s cubic-bezier(.34,1.22,.64,1)}
.cp-collapse.closed{height:0}
@media (prefers-reduced-motion:reduce){
  .cp-chev,.cp-collapse,.cp-tip{transition:none}
  .cp-modal-bg.is-open .cp-modal{animation:none}
}
@media print{ .cp-collapse{height:auto!important} .cp-chev{display:none} }
/* ---------- motion pass (Luma, 2026-11-16): transform + opacity only ---------- */
.btn{transition:transform .28s cubic-bezier(.34,1.4,.64,1)}
.btn:active:not(:disabled){transform:scale(.96);transition-duration:.08s;transition-timing-function:ease-out}
button.stage{transition:transform .28s cubic-bezier(.34,1.4,.64,1)}
button.stage:active{transform:scale(.96);transition-duration:.08s;transition-timing-function:ease-out}
.side a,.side-ai,.reset-demo,.ai-fab,.people-list button,.mob button,.cp-collapse-head,a.stage-order,.person-card{transition:transform .28s cubic-bezier(.34,1.4,.64,1)}
.side a:active,.side-ai:active,.reset-demo:active,.ai-fab:active,.people-list button:active,.mob button:active,
.cp-collapse-head:active,a.stage-order:active,.person-card:active{transform:scale(.96);transition-duration:.08s;transition-timing-function:ease-out}
.cp-bb:active{transform:scale(.96)}
@keyframes mIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.m-in{animation:mIn .3s cubic-bezier(.22,1,.36,1) both;animation-delay:var(--m-d,0s)}
.modal-bg:before{content:"";position:absolute;inset:0;background:rgba(31,42,46,.45);opacity:0;transition:opacity .25s ease;z-index:0}
.modal-bg.is-open:before{opacity:1}
.modal-bg.is-leaving:before{opacity:0;transition-duration:.15s}
.modal-bg .modal{position:relative;z-index:1;transform:translateY(10px) scale(.96);opacity:0;transition:transform .3s cubic-bezier(.34,1.4,.64,1),opacity .22s ease}
.modal-bg.is-open .modal{transform:none;opacity:1}
.modal-bg.is-leaving .modal{transform:translateY(8px) scale(.98);opacity:0;transition-duration:.15s}
@keyframes checkPop{0%{transform:scale(.8)}55%{transform:scale(1.15)}100%{transform:scale(1)}}
input[type=checkbox].m-pop:checked{animation:checkPop .28s cubic-bezier(.34,1.4,.64,1)}
@media (prefers-reduced-motion:reduce){
  .btn,button.stage,.side a,.side-ai,.reset-demo,.ai-fab,.people-list button,.mob button,.tog:after,.m-tabs-next,.cp-collapse-head,a.stage-order,.person-card{transition:none}
  .m-in{animation:none}
  .modal-bg:before,.modal-bg .modal{transition:none}
  .modal-bg .modal{transform:none;opacity:1}
  input[type=checkbox].m-pop:checked{animation:none}
}

/* round 9: no page rubber-band behind the phone tab bar (iOS), swipe track on its own layer */
@media (max-width:800px){
  html,body{overscroll-behavior-y:none}
  .m-tabs-track{backface-visibility:hidden}
}
.side-brand{padding:0 2px 12px}
.side .side-brand .logo{margin-bottom:0}
.side-co{font-size:12px;color:#9AA7A3;font-weight:600;margin-top:1px}
.m-you-brand{padding:4px 0 12px}
.m-you-brand .logo{font-weight:700;font-size:16px;color:#1F2A2E}
.m-you-brand .side-co{color:#5E6B6F}
html[data-theme="dark"] .m-you-brand .logo{color:#fff}
.side .side-brand+.side-profile{margin-top:0}
/* round 10: tester layer */
/* round 9b (real iPhone): no blur while dragging, layer only while dragging, scroll element never rubber-bands */
@media (max-width:800px){
  html,body{overscroll-behavior:none}
  .m-tabs-track{will-change:auto}
  .m-tabs .m-tabs-view{touch-action:pan-y}
}
/* item 1 (Nov 16): laptop sidebar color runs past the top/bottom so a trackpad bounce never shows a gap; no page bounce on desktop */
@media (min-width:801px){
  /* native bounce kept (Grady wants it, softened by the sidebar/page colors filling the overscroll area) */
  html{background:linear-gradient(to right,#1F2A2E 0,#1F2A2E var(--side-fill,var(--side-w)),#F4F5F3 var(--side-fill,var(--side-w)))}
  html[data-theme="dark"]{background:linear-gradient(to right,var(--bg-side) 0,var(--bg-side) var(--side-fill,var(--side-w)),var(--bg) var(--side-fill,var(--side-w)))}
  html[data-takeover="opening"],html[data-takeover="open"],html[data-takeover="closing"]{--side-fill:var(--takeover-w)}
  .side{height:100vh;height:100dvh}
  .side::before{content:"";position:fixed;left:0;top:-100vh;bottom:-100vh;width:var(--side-fill,var(--side-w));background:inherit;z-index:-1;pointer-events:none}
}
/* recall report: Luma owns the fold motion in motion.css; no height/transition here */
.cp-recall{margin-top:10px}
#cp-recall-btn{display:inline-flex;align-items:center;gap:8px}
.cp-chev-box{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:rgba(47,93,98,.08);color:#2F5D62;flex-shrink:0}
html[data-theme="dark"] .cp-chev-box{background:rgba(125,211,200,.1);color:#7DD3C8}
.cp-recall .cp-chev{width:18px;height:18px}
#cp-recall-btn[aria-expanded="true"] .cp-chev{transform:rotate(180deg)}
@media print{.recall-fold{display:block}}
/* item 3: Message co-packer / Message brand from orders */
.cp-msg-btn{font-size:12px;padding:6px 10px;min-height:30px}
td .cp-msg-btn{margin:4px 0 0 4px;vertical-align:middle}
#order-msg-cp{flex-basis:100%;margin-top:6px}
@media (max-width:800px){.cp-msg-btn{min-height:44px;font-size:13px}#order-msg-cp .cp-msg-btn{width:100%}}
@media (max-width:800px){td:first-child .cp-msg-btn{display:block;margin:6px 0 0;white-space:normal;line-height:1.2;max-width:110px;text-align:left}}
/* item 6: calendar Add "More" options (same quick slide as the recall report) */
.cp-more{margin:2px 0 12px}
.cp-more .cp-collapse-head{padding:10px 12px;border:1px solid #E3E7E4;border-radius:10px;background:#F7F8F6;min-height:48px}
.cp-more .cp-collapse-head:hover{background:#F0F3F1}
.cp-more .cp-collapse-head:focus-visible{outline:2px solid #2F5D62;outline-offset:2px}
html[data-theme="dark"] .cp-more .cp-collapse-head{background:#1F2A2E;border-color:#2C3B40}
.cp-more .cp-chev{width:18px;height:18px;transition:transform .2s ease}
.cp-more .cp-collapse{display:grid;grid-template-rows:0fr;opacity:0;height:auto;overflow:visible;transition:grid-template-rows .2s ease,opacity .2s ease}
.cp-more .cp-collapse.open{grid-template-rows:1fr;opacity:1}
.cp-more .cp-collapse-in{min-height:0;overflow:hidden;padding:0 2px}
.cp-more .cp-collapse.open .cp-collapse-in{padding-top:12px}
.cp-more .cp-collapse:not(.open) .cp-collapse-in{visibility:hidden;transition:visibility 0s .2s}
@media (prefers-reduced-motion:reduce){.cp-more .cp-chev,.cp-more .cp-collapse,.cp-more .cp-collapse:not(.open) .cp-collapse-in{transition:none}}
.cp-check{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:13px;min-height:44px;cursor:pointer}
.cp-check input{width:18px;height:18px}
.cp-chip.cp-prio-high{box-shadow:inset 3px 0 0 #B4412F}
.cp-chip.cp-prio-low{opacity:.75}
.cp-row.cp-po-hit{background:#EEF6F4;border-radius:8px;outline:2px solid #2F5D62;outline-offset:-2px}
html[data-theme="dark"] .cp-row.cp-po-hit{background:#1F2A2E}
/* v19 (real iPhone): the tab bar keeps ONE steady fill. No blur toggling and no see-through backdrop picking up page colors.
   Icons never shrink away while the pill compacts (only labels collapse). */
@media (max-width:800px){
  .m-tabs,.m-tabs.compact,.m-tabs.dragging,html[data-theme="dark"] .m-tabs{background:rgb(31,42,46);-webkit-backdrop-filter:none;backdrop-filter:none}
  .m-tab svg,.m-tab .m-tab-av{flex-shrink:0}
  .m-tab{min-height:30px}
}

/* ---------- Gmail-style Messages, full-height panes (Nov 17) ---------- */
html:has(body[data-page="chat"]),
html:has(body[data-page="cp-chat"]){height:100%;overflow:hidden}
body[data-page="chat"],
body[data-page="cp-chat"]{
  height:100vh;height:100dvh;overflow:hidden;
  display:flex;flex-direction:column;
  box-sizing:border-box;
}
body[data-page="chat"] .mob,
body[data-page="cp-chat"] .mob{flex:0 0 auto;position:relative}
body[data-page="chat"] .scrim,
body[data-page="cp-chat"] .scrim{flex:0 0 auto}
body[data-page="chat"] .app,
body[data-page="cp-chat"] .app{
  display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);flex:1 1 auto;min-height:0;height:auto;overflow:hidden;
}
html[data-takeover="opening"] body[data-page="chat"] .app,
html[data-takeover="open"] body[data-page="chat"] .app,
html[data-takeover="closing"] body[data-page="chat"] .app,
html[data-takeover="opening"] body[data-page="cp-chat"] .app,
html[data-takeover="open"] body[data-page="cp-chat"] .app,
html[data-takeover="closing"] body[data-page="cp-chat"] .app{grid-template-columns:var(--takeover-w) minmax(0,1fr)}
body[data-page="chat"] .main,
body[data-page="cp-chat"] .main{
  flex:1 1 auto;min-height:0;overflow:hidden;
  display:flex;flex-direction:column;
  padding-bottom:var(--chat-floor-gap);
}
body[data-page="chat"] .main>.top,
body[data-page="cp-chat"] .main>.top,
body[data-page="cp-chat"] #cp-root>.top{flex:0 0 auto;margin-bottom:10px}
body[data-page="chat"] #chat-root,
body[data-page="cp-chat"] #cp-root,
body[data-page="cp-chat"] #chat-root-cp{
  flex:1 1 auto;min-height:0;min-width:0;
  display:flex;flex-direction:column;overflow:hidden;
}
:root{--chat-floor-gap:14px}
.chat-shell{
  flex:1 1 auto;min-height:0;min-width:0;overflow:hidden;
  display:grid;grid-template-columns:168px minmax(200px,clamp(200px,18vw,260px)) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
  gap:0;background:#fff;border:1px solid #DDE2DF;border-radius:12px;
}
#chat-rail,#chat-list,#chat-thread{min-width:0;min-height:0;overflow:hidden}
#chat-rail{
  background:#F4F7F6;border-right:1px solid #DDE2DF;padding:14px 12px;
  display:flex;flex-direction:column;gap:10px;
}
#chat-new{width:100%}
.chat-rail-item{
  font-size:13px;font-weight:650;padding:8px 10px;border-radius:8px;color:#1F2A2E;
}
.chat-rail-item.on{background:#E4EEEE;color:#2F5D62}
.chat-rail-n{display:inline-block;min-width:18px;padding:0 6px;border-radius:99px;background:#2F5D62;color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center;margin-left:6px}
.chat-rail-note{margin-top:auto}
#chat-list{display:flex;flex-direction:column;border-right:1px solid #DDE2DF;background:#fff}
.chat-list-head{flex:0 0 auto;padding:12px 12px 8px;border-bottom:1px solid #EEF1EF}
.chat-list-head h2{margin:0 0 8px}
.chat-inbox-search{margin:0 0 8px}
.chat-inbox-search input{width:100%;font:inherit;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink)}
#chat-card .chat-search{flex-direction:column;align-items:stretch;flex-wrap:nowrap;border:0;padding:0 0 10px;margin:0 0 10px;border-bottom:1px solid var(--line-soft)}
#chat-card .chat-pin{flex-direction:column;align-items:stretch;margin:0 0 10px;padding:8px 0;border-bottom:1px solid var(--line-soft)}
#chat-card h3{margin-top:4px}
.chat-filter{display:flex;gap:4px;background:#EEF3F2;border-radius:10px;padding:3px}
.chat-filter button{
  flex:1;min-width:0;border:0;background:none;color:#5E6B6F;font:inherit;font-weight:650;font-size:13px;
  padding:7px 8px;border-radius:8px;cursor:pointer;
}
.chat-filter button.on{background:#fff;color:#2F5D62;box-shadow:0 1px 2px rgba(31,42,46,.12)}
#chat-inbox{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#chat-list .chat-pick{padding:10px 12px;border-bottom:1px solid #EEF1EF;align-items:flex-start;border-radius:0}
#chat-list .chat-pick.on{background:#E8F3F1}
.chat-row-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0}
.chat-row-top .who{flex:1;min-width:0}
.chat-time{flex:0 0 auto;font-size:11px;color:#5E6B6F;white-space:nowrap;padding-top:2px}
.chat-subj{display:block;font-size:13px;font-weight:650;color:#1F2A2E;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px}
.chat-last{display:block}
.chat-pick.is-unread,.chat-pick.is-unread .chat-subj,.chat-pick.is-unread .chat-last,.chat-pick.is-unread .chat-time,.chat-pick.is-unread .who b{font-weight:700}
.chat-pick:not(.is-unread) .chat-last,.chat-pick:not(.is-unread) .chat-time{font-weight:400}
#chat-thread{display:flex;flex-direction:column;background:#fff;min-width:0;min-height:0;overflow:hidden}
#chat-thread .chat-head{flex:0 0 auto;margin:0;padding:12px 16px;border-bottom:1px solid #EEF1EF;min-width:0;display:flex;align-items:center;gap:10px}
.chat-head-who{flex:1;min-width:0}
.chat-head-biz{flex:0 0 auto;max-width:42%;font-size:12px;color:#5E6B6F;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-role{display:block;font-size:12px;font-weight:500;color:#5E6B6F;margin-top:1px}
.chat-msg-who{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:4px}
.chat-msg-id{min-width:0}
.chat-msg-biz{flex:0 0 auto;font-size:11px;color:#5E6B6F;white-space:nowrap;padding-top:1px}
.chat-quote{font-size:12px;color:#5E6B6F;border-left:2px solid #2F5D62;padding:2px 0 2px 8px;margin:0 0 6px}
.chat-msg{position:relative}
.chat-msg .chat-bubble{font-size:15px;line-height:1.5;padding:12px 14px;max-width:min(calc(100% - 72px),560px);min-width:0}
.chat-msg .chat-seen{width:100%;text-align:right}
.chat-msg:not(.mine) .chat-seen{text-align:left}
.msg-actions{display:flex;align-items:center;gap:0;flex-shrink:0;visibility:hidden;pointer-events:none;position:relative}
.chat-msg:hover .msg-actions,
.chat-msg:focus-within .msg-actions,
.chat-msg[data-actions="open"] .msg-actions{visibility:visible;pointer-events:auto}
.msg-actions button{border:0;background:transparent;padding:2px;margin:0;color:#5E6B6F;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:0;border-radius:0;box-shadow:none}
.msg-actions button:hover,.msg-actions button:focus-visible{color:#1F2A2E}
.msg-actions svg{width:14px;height:14px;display:block}
.msg-pop,.msg-menu{position:absolute;z-index:6;top:100%;right:0;left:auto;background:var(--bg-card);border:1px solid var(--line);border-radius:10px;padding:6px;box-shadow:0 8px 24px rgba(31,42,46,.18);min-width:168px}
.chat-msg.mine .msg-pop,.chat-msg.mine .msg-menu{right:auto;left:0}
.msg-pop{display:flex;gap:2px}
.msg-menu{display:flex;flex-direction:column;align-items:stretch;padding:4px}
.msg-menu button,.msg-menu .msg-menu-item{border:0;background:transparent;text-align:left;font:inherit;font-size:13px;padding:8px 10px;border-radius:6px;color:var(--ink);cursor:pointer}
.msg-menu button:hover,.msg-menu .msg-menu-item:hover{background:var(--line-soft)}
.chat-msg:not([data-react="open"]) .msg-pop{display:none}
.chat-msg:not([data-menu="open"]) .msg-menu{display:none}
.chat-react-chips{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:6px}
.chat-react-chips:empty{display:none}
.chat-msg-meta{flex-wrap:wrap}
.chat-reply{padding:4px 8px;font-size:12px;min-height:32px}
.chat-react{display:inline-flex;align-items:center;gap:3px;border:0;background:#EEF3F2;border-radius:99px;padding:4px 8px;min-height:32px;font:inherit;line-height:1;color:#1F2A2E;cursor:pointer}
.chat-react[aria-pressed="true"]{background:#E4EEEE;box-shadow:inset 0 0 0 1px #2F5D62}
.chat-react-n{font-size:11px;font-weight:650}
.chat-quick{display:flex;flex-wrap:wrap;gap:6px}
.chat-chip{border:0;background:#EEF3F2;border-radius:99px;padding:4px 10px;min-height:32px;font:inherit;font-size:12px;font-weight:650;color:#2F5D62;cursor:pointer}
.chat-reply-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;background:#F4F7F6;border-radius:8px;padding:8px 10px;margin-bottom:8px;border-left:3px solid #2F5D62}
.chat-reply-bar p{margin:2px 0 0;font-size:12px;color:#5E6B6F}
#chat-reply-cancel{flex:0 0 auto}
#chat-thread-main{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}
#chat-msgs,#chat-compose,#chat-thread .chat-head,#chat-pin,#chat-search,#chat-thread-main{max-width:720px;width:100%;margin-left:auto;margin-right:auto}
#chat-card{display:none}
@media(min-width:1280px){
  .chat-shell[data-chat-view="split"]{grid-template-columns:168px minmax(200px,clamp(200px,18vw,260px)) minmax(0,1fr) 150px}
  .chat-shell[data-chat-view="split"] #chat-card{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;overflow:auto;border-left:1px solid var(--line);background:var(--bg-card);padding:14px 14px 18px}
  #chat-info{display:none}
}
@media(max-width:1279px){
  #chat-info{display:inline-flex}
}

#chat-back{display:none;margin-right:8px}
body[data-page="chat"] .chat-msgs,
body[data-page="cp-chat"] .chat-msgs{
  flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;
  padding:14px 16px;
}
body[data-page="chat"] .chat-msgs>*,
body[data-page="cp-chat"] .chat-msgs>*{flex-shrink:0}
#chat-compose{flex:0 0 auto;padding:8px 12px 10px;border-top:1px solid #EEF1EF;background:#fff;display:flex;flex-direction:column;gap:6px;min-height:0}
#chat-compose .field{margin-bottom:0;position:relative}
#chat-compose .field label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
#chat-compose textarea{width:100%;resize:none;min-height:64px;max-height:128px;line-height:1.35}
#chat-compose .chat-compose-tools{margin-bottom:0}
#chat-compose #chat-send{min-height:36px;padding:6px 12px;align-self:flex-start}
@media(max-width:720px){
  #chat-compose{padding:6px 10px 8px;gap:4px}
  #chat-compose .chat-compose-tools{flex-wrap:nowrap}
  #chat-compose textarea{min-height:52px;max-height:104px}
}
@media (max-width:800px) and (max-height:720px){
  #chat-compose{padding:4px 8px 4px;gap:2px}
  #chat-compose textarea{min-height:40px;max-height:72px}
  #chat-compose #chat-send{min-height:30px;padding:4px 10px}
}
.chat-msg-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.chat-fwd{padding:4px 8px;font-size:12px;min-height:28px}
.chat-fwd-tag{font-size:11px;font-weight:650;color:#2F5D62;margin:2px 0 4px}
#chat-fwd-targets{max-height:240px;overflow-y:auto;margin-bottom:10px}
html[data-theme="dark"] .chat-subj,
html[data-theme="dark"] .chat-rail-item{color:#DCE3E0}
html[data-theme="dark"] .chat-time{color:#9AA7A3}
html[data-theme="dark"] .chat-fwd-tag{color:#9FCBC7}
html[data-theme="dark"] .chat-head-biz,
html[data-theme="dark"] .chat-role,
html[data-theme="dark"] .chat-msg-biz,
html[data-theme="dark"] .chat-quote,
html[data-theme="dark"] .chat-reply-bar p{color:#9AA7A3}
html[data-theme="dark"] .chat-react,
html[data-theme="dark"] .chat-chip{background:#26353A;color:#DCE3E0}
html[data-theme="dark"] .chat-chip{color:#9FCBC7}
html[data-theme="dark"] .chat-react[aria-pressed="true"]{background:#2E4A4D;box-shadow:inset 0 0 0 1px #9FCBC7}
html[data-theme="dark"] .chat-reply-bar{background:#1A2428;border-left-color:#9FCBC7}
html[data-theme="dark"] .chat-quote{border-left-color:#9FCBC7}
@media(min-width:801px){
  body[data-page="chat"] .side,
  body[data-page="cp-chat"] .side{height:100%;position:relative}
  body[data-page="chat"] .main,
  body[data-page="cp-chat"] .main{padding-bottom:var(--chat-floor-gap)}
}
@media(max-width:800px){
  body[data-page="chat"].has-tabs,
  body[data-page="cp-chat"].has-tabs{padding-bottom:calc(var(--chat-tab-gap,86px) + var(--chat-floor-gap))!important}
  body[data-page="chat"] .app,
  body[data-page="cp-chat"] .app{display:flex;flex-direction:column}
  body[data-page="chat"] .main,
  body[data-page="cp-chat"] .main,
  body.has-tabs[data-page="chat"] .main,
  body.has-tabs[data-page="cp-chat"] .main{padding-bottom:0;flex:1 1 auto;min-height:0;height:auto}
  .chat-shell{display:flex;flex-direction:column;border-radius:12px;min-height:0}
  .chat-shell[data-chat-view="list"] #chat-rail{display:block;flex:0 0 auto;border-right:0;border-bottom:1px solid #DDE2DF;padding:10px 12px}
  .chat-shell[data-chat-view="list"] #chat-list{flex:1 1 auto;border-right:0;height:auto}
  .chat-shell[data-chat-view="list"] #chat-thread{display:none}
  .chat-shell[data-chat-view="thread"] #chat-rail{display:block;flex:0 0 auto;border-right:0;border-bottom:1px solid #DDE2DF;padding:8px 12px}
  .chat-shell[data-chat-view="thread"] .chat-rail-item,
  .chat-shell[data-chat-view="thread"] .chat-rail-note{display:none}
  .chat-shell[data-chat-view="thread"] #chat-list{display:none}
  .chat-shell[data-chat-view="thread"] #chat-thread{display:flex;flex:1 1 auto;height:auto}
  #chat-back{display:inline-block}
  html[data-theme="dark"] .chat-shell[data-chat-view="list"] #chat-rail{border-color:#33454B}
}
@media(prefers-reduced-motion:reduce){
  .chat-filter button{transition:none}
}

/* ---------- Today’s runs card, slim one-line rows (Nov 17) ---------- */
:root{--run-pulse:2s}
#cp-today{overflow:visible}
#cp-today h2{margin-bottom:8px}
.cp-today-run{
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(64px,28%);
  align-items:center;gap:8px;height:32px;max-height:40px;
  min-width:0;white-space:nowrap;overflow:hidden;
  border-bottom:1px solid #EEF1EF;
}
.cp-today-run:last-child{border-bottom:0}
.cp-today-name{min-width:0;overflow:hidden;text-overflow:ellipsis;font-weight:650;font-size:13px;color:#1F2A2E}
.cp-today-time{flex:0 0 auto;font-size:12px;color:#5E6B6F;font-variant-numeric:tabular-nums}
.cp-today-bar{display:block;height:4px;background:#E4EEEE;border-radius:99px;overflow:hidden;min-width:48px}
.cp-today-fill{display:block;height:100%;width:0;border-radius:inherit;background:#2F5D62}
.cp-today-run[data-run-state="partway"] .cp-today-fill{animation:run-pulse var(--run-pulse) ease-in-out infinite}
@keyframes run-pulse{
  0%,100%{opacity:1}
  50%{opacity:.55}
}
html[data-theme="dark"] .cp-today-run{border-color:#2A383D}
html[data-theme="dark"] .cp-today-name{color:#DCE3E0}
html[data-theme="dark"] .cp-today-time{color:#9AA7A3}
html[data-theme="dark"] .cp-today-bar{background:#26353A}
html[data-theme="dark"] .cp-today-fill{background:#9FCBC7}
@media(prefers-reduced-motion:reduce){
  .cp-today-run[data-run-state="partway"] .cp-today-fill{animation:none}
}

/* ---------- pop-ups: takeover, sheet, AI float, bell, toasts (layout only; Luma owns motion) ---------- */
.side-slot{flex:1 1 auto;min-height:0;display:grid;align-content:start}
.side-tabs,.side-panel{grid-area:1/1;min-width:0;min-height:0}
.side-panel{display:flex;flex-direction:column;color:#DCE3E0;background:#1F2A2E}
.side-panel[hidden]{display:none}
.side-panel-head{display:flex;align-items:flex-start;gap:8px;margin-bottom:10px}
.side-panel-head h2{font-size:16px;margin:0;color:#fff;font-weight:700}
.side-back{flex-shrink:0;background:none;border:0;color:#C5CFCB;font:inherit;font-weight:700;cursor:pointer;padding:4px 6px;border-radius:8px;line-height:1}
.side-back:hover,.side-back:focus-visible{background:#2A383D;color:#fff;outline:2px solid #9FCBC7;outline-offset:1px}
.side-panel-body{flex:1 1 auto;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;color:#DCE3E0}
.side-panel-body .field label,.side-panel-body .small.muted,.side-panel-body .muted{color:#9AA7A3}
.side-panel-body .field input,.side-panel-body .field select,.side-panel-body .field textarea,.side-panel-body .comment-box{background:#172124;color:#DCE3E0;border-color:#33454B}
.side-panel-body h3,.side-panel-body .sec{color:#fff}
.side-panel-body .row{border-color:#2A383D;color:#DCE3E0}
.side-panel-body .btn.q{background:transparent;color:#9FCBC7;border-color:#4E8A8F}
html[data-takeover="opening"] .side-tabs,
html[data-takeover="open"] .side-tabs,
html[data-takeover="closing"] .side-tabs{visibility:hidden;pointer-events:none}
html[data-takeover="closed"] .sidebar-takeover .side-panel:not(.sheet),
html:not([data-takeover]) .sidebar-takeover .side-panel:not(.sheet){visibility:hidden;pointer-events:none}
html[data-takeover="opening"] .sp-stats,
html[data-takeover="open"] .sp-stats,
html[data-takeover="closing"] .sp-stats{display:none}

.sheet-scrim{position:fixed;inset:0;background:rgba(31,42,46,.35);z-index:44}
.sheet-scrim[hidden]{display:none}
.sheet{position:fixed;left:0;right:0;bottom:var(--sheet-bottom,0px);z-index:45;max-height:min(85vh,calc(100vh - var(--sheet-bottom,0px) - 8px));background:#fff;border-radius:14px 14px 0 0;box-shadow:0 -8px 40px rgba(31,42,46,.2);display:flex;flex-direction:column;padding:16px 16px calc(16px + env(safe-area-inset-bottom));color:#1F2A2E}
.sheet[hidden]{display:none}
.sheet .side-panel-head h2{color:#1F2A2E}
.sheet .side-back{color:#1F2A2E}
.sheet .side-panel-body{color:#1F2A2E}
.sheet .side-panel-body .field label,.sheet .side-panel-body .small.muted,.sheet .side-panel-body .muted{color:#5E6B6F}
.sheet .side-panel-body .field input,.sheet .side-panel-body .field select,.sheet .side-panel-body .field textarea,.sheet .side-panel-body .comment-box{background:#fff;color:#1F2A2E;border-color:#DDE2DF}
.sheet .side-panel-body h3,.sheet .side-panel-body .sec{color:#1F2A2E}
.sheet .side-panel-body .row{border-color:#EEF1EF;color:#1F2A2E}
.sheet .side-panel-body .btn.q{background:#fff;color:#2F5D62;border-color:#2F5D62}
html[data-theme="dark"] .sheet{background:#1F2A2E;color:#DCE3E0}
html[data-theme="dark"] .sheet .side-panel-head h2,html[data-theme="dark"] .sheet .side-panel-body,html[data-theme="dark"] .sheet .side-back{color:#DCE3E0}
html[data-theme="dark"] .sheet .side-panel-body .field input,html[data-theme="dark"] .sheet .side-panel-body .field select,html[data-theme="dark"] .sheet .side-panel-body .field textarea,html[data-theme="dark"] .sheet .side-panel-body .comment-box{background:#172124;color:#DCE3E0;border-color:#33454B}

.ai-float{position:fixed;left:0;top:0;z-index:50;width:340px;height:420px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);background:#fff;color:#1F2A2E;border:1px solid #DDE2DF;border-radius:14px;box-shadow:0 12px 40px rgba(31,42,46,.22);display:flex;flex-direction:column;min-width:240px;min-height:200px}
.ai-float[hidden]{display:none}
.ai-float-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid #EEF1EF;cursor:move;touch-action:none;border-radius:14px 14px 0 0}
.ai-float-head b{font-size:14px}
.ai-float-body{flex:1 1 auto;min-height:0;overflow:auto;padding:14px 14px 18px}
.ai-float-resize{position:absolute;right:4px;bottom:4px;width:18px;height:18px;cursor:nwse-resize;touch-action:none;background:linear-gradient(135deg,transparent 50%,#9AA7A3 50%)}
html[data-theme="dark"] .ai-float{background:#1F2A2E;color:#DCE3E0;border-color:#33454B}
html[data-theme="dark"] .ai-float-head{border-color:#2A383D}

.top[data-has-bell],.top:has([data-bell-host]){align-items:flex-start}
[data-bell-host]{flex-shrink:0}
.top > [data-bell-host]{margin-left:auto}
@media (min-width:721px){
  .top > [data-bell-host]{margin-right:calc(min(320px, calc(100vw - 48px)) - 36px)}
}
.bell{position:relative}
.bell-btn,
.mob .bell-btn{
  background:#EEF3F2;border:0;border-radius:99px;
  width:40px;height:40px;min-width:40px;min-height:40px;
  padding:0;margin:0;box-sizing:border-box;flex-shrink:0;
  font:inherit;cursor:pointer;color:#1F2A2E;
  display:inline-flex;align-items:center;justify-content:center
}
.bell-btn svg,
.mob .bell-btn svg{
  width:22px;height:22px;min-width:22px;min-height:22px;flex-shrink:0;display:block
}
.bell-btn:hover,.bell-btn:focus-visible{background:#E4EEEE;outline:2px solid #2F5D62;outline-offset:1px}
.bell-count{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:0 4px;border-radius:99px;background:#9A3328;color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center}
.bell-count[hidden]{display:none}
.bell-menu,.bell-pop{position:fixed;top:0;left:0;width:min(320px,calc(100vw - 24px));background:#fff;border:1px solid #DDE2DF;border-radius:12px;box-shadow:0 10px 30px rgba(31,42,46,.18);z-index:80;max-height:min(70vh,420px);overflow:auto;padding:6px}
.bell-menu[hidden],.bell-pop[hidden]{display:none}
.bell-item{display:block;width:100%;text-align:left;background:none;border:0;border-radius:8px;padding:8px 10px;font:inherit;cursor:pointer;color:#1F2A2E}
.bell-item:hover,.bell-item:focus-visible{background:#F0F3F2}
.bell-item.is-unread{background:#F4F8F5}
.bell-item b{display:block;font-size:13px}
.bell-item span{display:block;font-size:12px;color:#5E6B6F}
.bell-empty{padding:12px 10px;font-size:13px;color:#5E6B6F}
.mob .bell-btn{background:rgba(255,255,255,.12);color:#fff}
.mob .bell-btn:hover,.mob .bell-btn:focus-visible{background:rgba(255,255,255,.2);outline-color:#9FCBC7}
html[data-theme="dark"] .bell-btn{
  background:#26353A;color:#DCE3E0;border:0;border-color:transparent
}
html[data-theme="dark"] .bell-menu,html[data-theme="dark"] .bell-pop{background:#1F2A2E;border-color:#33454B}
html[data-theme="dark"] .bell-item{color:#DCE3E0}
html[data-theme="dark"] .bell-item:hover,html[data-theme="dark"] .bell-item:focus-visible{background:#26353A}
html[data-theme="dark"] .bell-item.is-unread{background:#1E3328}

.toast-stack{position:fixed;right:16px;bottom:16px;z-index:65;display:flex;flex-direction:column-reverse;gap:8px;width:min(360px,calc(100vw - 32px));pointer-events:none}
.toast{pointer-events:auto;background:#1F2A2E;color:#fff;border-radius:10px;padding:10px 12px;font-size:13px;box-shadow:0 8px 24px rgba(31,42,46,.25)}
.toast[hidden],.toast[data-toast="out"]{visibility:hidden}
.toast b{display:block;font-size:13px;margin-bottom:2px}
@media(max-width:800px){
  .toast-stack{bottom:calc(var(--chat-tab-gap,86px) + 8px)}
  body.has-tabs .toast-stack{bottom:calc(var(--chat-tab-gap,86px) + 8px)}
}
html[data-theme="dark"] .toast{background:#0F1719}

#fb-note{margin:0 0 10px}

@media(max-width:800px){
  .app{display:block;grid-template-columns:none}
  html[data-takeover="opening"] .app,html[data-takeover="open"] .app{grid-template-columns:none}
}

/* ---- Messages batch 3 layout (no opacity/transform/color transitions; Luma owns motion) ---- */
.chat-pin{flex:0 0 auto;display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:6px 16px;border-bottom:1px solid var(--line-soft);background:var(--bg-card);font-size:13px}
.chat-pin-label{display:block;font-size:12px;font-weight:650;color:var(--muted,#5E6B6F)}
.chat-pin-chip{display:block;width:100%;min-width:0}
.chat-pin-chip a,.chat-pin-chip .linkish,.chat-pin-chip button{
  display:block;width:100%;box-sizing:border-box;text-align:left;
  background:#EEF3F2;color:#2F5D62;font:inherit;font-size:13px;font-weight:650;
  text-decoration:none;border:0;border-radius:8px;padding:6px 10px;cursor:pointer;
}
.chat-pin-chip a:hover,.chat-pin-chip .linkish:hover,.chat-pin-chip button:hover{text-decoration:none;background:#E4EEEE}
.chat-search{flex:0 0 auto;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px 16px;border-bottom:1px solid var(--line-soft);background:var(--bg-card)}
.chat-search[hidden]{display:none !important}
.chat-search label{display:block;width:100%}
.chat-search input{display:block;width:100%;min-width:0;flex:none;font:inherit;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink)}
.chat-find-nav{display:flex;align-items:center;gap:4px}
.chat-search:not([data-find="on"]) .chat-find-nav,.chat-find-nav[hidden]{display:none !important}
.chat-find-btn{
  appearance:none;-webkit-appearance:none;
  width:28px;height:28px;padding:0;margin:0;border:0;border-radius:8px;
  background:#EEF3F2;color:#1F2A2E;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;line-height:0;
}
.chat-find-btn svg{width:16px;height:16px;display:block}
.chat-find-btn:hover,.chat-find-btn:focus-visible{background:#E4EEEE;color:#1F2A2E}
.chat-search mark,.chat-hit{background:#F3E8DA;color:#1F2A2E;padding:0 1px;border-radius:2px}
.chat-search mark.is-cur,.chat-hit.is-cur{background:#2F5D62;color:#fff}
.chat-day{display:flex;align-items:center;gap:10px;margin:12px 0 8px;color:var(--muted);font-size:12px;font-weight:650;text-align:center}
.chat-day:before,.chat-day:after{content:"";flex:1;height:1px;background:var(--line-soft)}
.chat-seen{display:block;text-align:right;font-size:11px;color:var(--muted);margin:2px 4px 0}
.chat-typing{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);padding:4px 2px 8px}
.chat-dots{display:inline-flex;gap:3px;margin-left:4px}
.chat-dots i{width:5px;height:5px;border-radius:50%;background:currentColor;display:block}
@media (prefers-reduced-motion: no-preference){
  .chat-dots i{animation:chat-dot 1.2s steps(2,end) infinite}
  .chat-dots i:nth-child(2){animation-delay:.15s}
  .chat-dots i:nth-child(3){animation-delay:.3s}
}
@keyframes chat-dot{0%,100%{visibility:visible}50%{visibility:hidden}}
@media (prefers-reduced-motion: reduce){
  .chat-dots{display:none}
}
.chat-msg.is-hl .chat-bubble{box-shadow:inset 0 0 0 2px var(--teal)}
.chat-react-chips{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:6px}
.chat-react-chips:empty{display:none}
.chat-react-chip{display:inline-flex;align-items:center;gap:3px;border:0;background:#EEF3F2;border-radius:99px;padding:2px 8px;min-height:22px;font:inherit;font-size:12px;color:var(--ink);cursor:pointer}
html[data-theme="dark"] .chat-react-chip{background:#1F2A2E;color:var(--ink)}
.chat-attach-row,.chat-compose-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.chat-file-chip{display:inline-flex;align-items:center;gap:6px;background:var(--line-soft);border-radius:99px;padding:4px 10px;font-size:12px}
.chat-file-chip button{border:0;background:transparent;color:var(--muted);cursor:pointer;font:inherit}
.chat-mention-pick{background:var(--bg-card);border:1px solid var(--line);border-radius:10px;padding:6px;margin-bottom:8px;max-height:180px;overflow:auto}
.chat-mention-pick[hidden]{display:none !important}
.chat-mention-pick button{display:block;width:100%;text-align:left;border:0;background:transparent;font:inherit;padding:6px 8px;border-radius:6px;cursor:pointer;color:var(--ink)}
.chat-mention-pick button:hover{background:var(--line-soft)}
.chat-mention{display:inline-flex;align-items:center;border:0;background:#E4EEEE;color:#2F5D62;font:inherit;font-size:13px;font-weight:650;border-radius:99px;padding:1px 8px;cursor:pointer;margin:0 1px}
#chat-attach,#chat-mention-btn,#chat-search-btn,#chat-info{border:0;background:transparent;color:var(--muted);cursor:pointer;padding:4px;display:inline-flex;align-items:center;justify-content:center}
#chat-attach svg,#chat-mention-btn svg,#chat-search-btn svg,#chat-info svg{width:20px;height:20px}
.chat-card-name{font-weight:700;font-size:15px}
.chat-card h3{font-size:13px;margin:10px 0 6px}
.chat-card-files{list-style:none;padding:0;margin:0}
.chat-card-files li{font-size:13px;padding:4px 0;border-bottom:1px solid var(--line-soft);color:var(--ink)}

/* Dark mode for the whole app. No colour transitions — Luma adds the cross-fade. */
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .card,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .stage,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .bell-menu,
html[data-theme="dark"] .ai-float,
html[data-theme="dark"] .ok-box,
html[data-theme="dark"] .warn-box,
html[data-theme="dark"] .no-access,
html[data-theme="dark"] .m-you-profile{background:var(--bg-card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .row,
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] .table-wrap{border-color:var(--line-soft);color:var(--ink)}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{background:#1F2A2E;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .btn.q{background:var(--bg-card);color:#9FCBC7;border-color:#7DD3C8}
html[data-theme="dark"] .btn.q:hover{background:#1F2A2E}
html[data-theme="dark"] .linkish{color:#7DD3C8}
html[data-theme="dark"] .pill.gry{background:#1F2A2E;color:var(--muted)}
html[data-theme="dark"] .pill.grn{background:#1A3324;color:#8FCB9B}
html[data-theme="dark"] .pill.red{background:#3A2220;color:#F2C4BC}
html[data-theme="dark"] .pill.amb{background:#3A3122;color:#F0D9A8}
html[data-theme="dark"] .pill.blu{background:#1E2E38;color:#B9D4E8}
html[data-theme="dark"] .tag{color:var(--muted);border-color:#5E6B6F}
html[data-theme="dark"] .stage{background:#1F2A2E;border-color:var(--line)}
html[data-theme="dark"] .stage.late{background:#2A1E1C;border-color:#5A3A36}
html[data-theme="dark"] .stage.done{background:#1A2A20}
html[data-theme="dark"] .bar{background:#1F2A2E}
html[data-theme="dark"] .chat-shell,
html[data-theme="dark"] #chat-list,
html[data-theme="dark"] #chat-thread,
html[data-theme="dark"] #chat-compose,
html[data-theme="dark"] #chat-card,
html[data-theme="dark"] .chat-pin,
html[data-theme="dark"] .chat-search{background:var(--bg-card);border-color:var(--line)}
html[data-theme="dark"] .chat-pin-chip a,html[data-theme="dark"] .chat-pin-chip .linkish,html[data-theme="dark"] .chat-pin-chip button{background:#26353A;color:#9FCBC7}
html[data-theme="dark"] .chat-pin-chip a:hover,html[data-theme="dark"] .chat-pin-chip button:hover{background:#2E4A4D}
html[data-theme="dark"] .chat-find-btn{background:#26353A;color:#DCE3E0}
html[data-theme="dark"] .chat-find-btn:hover,html[data-theme="dark"] .chat-find-btn:focus-visible{background:#2E4A4D;color:#E8EEEC}
html[data-theme="dark"] .chat-pin-label{color:#C5CFCB}
html[data-theme="dark"] #chat-rail{background:#1F2A2E;border-color:var(--line)}
html[data-theme="dark"] .chat-rail-item{color:var(--ink)}
html[data-theme="dark"] .chat-rail-item.on{background:#2E4A4D;color:#9FCBC7}
html[data-theme="dark"] .chat-list-head,
html[data-theme="dark"] #chat-list .chat-pick,
html[data-theme="dark"] #chat-thread .chat-head,
html[data-theme="dark"] #chat-compose,
html[data-theme="dark"] .chat-pin,
html[data-theme="dark"] .chat-search{border-color:var(--line-soft)}
html[data-theme="dark"] .chat-filter{background:#1F2A2E}
html[data-theme="dark"] .chat-filter button{color:var(--muted)}
html[data-theme="dark"] .chat-filter button.on{background:#26353A;color:#9FCBC7}
html[data-theme="dark"] #chat-list .chat-pick.on{background:#1A2A2E}
html[data-theme="dark"] .chat-subj,
html[data-theme="dark"] .chat-rail-item,
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3{color:var(--ink)}
html[data-theme="dark"] .chat-bubble{background:#1F2A2E;color:var(--ink)}
html[data-theme="dark"] .chat-msg.mine .chat-bubble{background:#2E4A4D}
html[data-theme="dark"] .msg-actions button{color:#C5CFCB}
html[data-theme="dark"] .msg-actions button:hover,html[data-theme="dark"] .msg-actions button:focus-visible{color:#E8EEEC}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .banner,
html[data-theme="dark"] #m-top,
html[data-theme="dark"] .m-top{background:var(--bg);border-color:var(--line)}
html[data-theme="dark"] .m-tabs,
html[data-theme="dark"] #m-tabs{background:#1F2A2E;color:var(--ink)}
html[data-theme="dark"] .modal-bg,.scrim,html[data-theme="dark"] #m-panel-bg{background:rgba(18,26,28,.55)}
html[data-theme="dark"] .field label{color:var(--muted)}
html[data-theme="dark"] .ok-box{background:#1A3324;color:#8FCB9B}
html[data-theme="dark"] .warn-box{background:#3A3122;color:#F0D9A8}
html[data-theme="dark"] .chat-quote{color:var(--muted);border-color:#7DD3C8}
html[data-theme="dark"] .chat-reply-bar{background:#1F2A2E;border-color:#7DD3C8}
html[data-theme="dark"] .chat-mention{background:#2E4A4D;color:#9FCBC7}
html[data-theme="dark"] .chat-search mark,html[data-theme="dark"] .chat-hit{background:#3A3122;color:#F0D9A8}
html[data-theme="dark"] .chat-search mark.is-cur,html[data-theme="dark"] .chat-hit.is-cur{background:#2F5D62;color:#fff}
html[data-theme="dark"] .ph-top{background:var(--bg-side);color:#E8EEEC}


html[data-theme="dark"] .person-card{background:var(--bg-card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .person-card:hover{background:#1F2A2E;border-color:var(--line)}
html[data-theme="dark"] .mini-select{background:#1F2A2E;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .stage-sheet{background:var(--bg-card);color:var(--ink)}
html[data-theme="dark"] .cp-chip.cp-item{background:var(--bg-card);color:var(--ink)}
html[data-theme="dark"] .metric{background:var(--bg-card);color:var(--ink);border-color:var(--line)}


/* ---- batch 4: centered confirm, feedback float (no transform/opacity/height/colour transitions) ---- */
.m-confirm-bg{position:fixed;inset:0;background:rgba(31,42,46,.45);display:flex;align-items:center;justify-content:center;z-index:80;padding:20px;pointer-events:none}
.m-confirm-bg[hidden]{display:none}
.m-confirm{background:#fff;color:#1F2A2E;border-radius:14px;padding:20px 22px;max-width:360px;width:100%;box-shadow:0 12px 40px rgba(31,42,46,.2);pointer-events:auto}
.m-confirm h2{font-size:17px;margin:0 0 8px}
.m-confirm p{margin:0 0 8px;color:#1F2A2E}
.m-confirm .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}
html[data-theme="dark"] .m-confirm{background:#1F2A2E;color:#DCE3E0}
html[data-theme="dark"] .m-confirm p{color:#DCE3E0}

.fb-float{position:fixed;right:24px;bottom:max(24px,env(safe-area-inset-bottom,0px));z-index:70;background:#1F2A2E;color:#DCE3E0;border:0;border-radius:999px;padding:12px 16px;font:inherit;font-weight:650;cursor:pointer;box-shadow:0 8px 24px rgba(31,42,46,.2);-webkit-user-select:none;user-select:none;touch-action:manipulation}
.fb-float:focus-visible{outline:3px solid #2F5D62;outline-offset:2px}
#fb-float::before,button.fb-float::before,button#fb-float::before{content:none;display:none;width:0;height:0;background:none;box-shadow:none;opacity:0;pointer-events:none}
.fb-chat-head{align-items:center}
.fb-chat-grip{flex:0 0 auto;width:16px;height:22px;border:0;padding:0;margin:0 6px 0 0;background:transparent;cursor:grab;position:relative;touch-action:none}
.fb-chat-grip::before{content:"";position:absolute;left:3px;top:50%;width:4px;height:4px;margin-top:-10px;border-radius:50%;background:currentColor;opacity:0.38;pointer-events:none;box-shadow:6px 0 0 currentColor,0 6px 0 currentColor,6px 6px 0 currentColor,0 12px 0 currentColor,6px 12px 0 currentColor}
.fb-chat[data-dragging],.fb-chat[data-dragging] .fb-chat-grip{cursor:grabbing}
.fb-tip{position:fixed;z-index:71;background:#1F2A2E;color:#fff;border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.35;max-width:min(240px,calc(100vw - 24px))}
.fb-tip[hidden],.fb-chat[hidden]{display:none !important}
.fb-chat{position:fixed;z-index:72;width:min(320px,calc(100vw - 24px));max-height:min(70vh,560px);overflow:auto;background:#fff;color:#1F2A2E;border:1px solid #DDE2DF;border-radius:14px;padding:14px;box-shadow:0 10px 30px rgba(31,42,46,.18);display:flex;flex-direction:column}
.fb-chat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;flex-shrink:0}
.fb-chat-head h2{font-size:17px;margin:0}
.fb-chat-log{display:flex;flex-direction:column;gap:8px;margin-bottom:10px;max-height:220px;overflow:auto;min-height:0;flex:0 1 auto}
#feedback-box,.fb-lead,.fb-name-step{flex-shrink:0}
.fb-bubble{background:#EEF3F2;border-radius:12px 12px 4px 12px;padding:8px 10px;font-size:13px;align-self:flex-end;max-width:95%}
.fb-bubble-who{font-size:11px;font-weight:650;margin-bottom:2px;color:#5E6B6F}
.fb-lead{font-size:13px;margin:0 0 8px;color:#5E6B6F}
.fb-send-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}
.fb-notyou{background:none;border:0;padding:0;font:inherit;font-size:12px;color:#2F5D62;cursor:pointer;text-decoration:underline}
.fb-name-step{display:flex;flex-direction:column;gap:8px}
.fb-name-step input{font:inherit;padding:8px 10px;border:1px solid #DDE2DF;border-radius:8px}
#fb-note{margin:0 0 10px}
html[data-theme="dark"] .fb-chat{background:#1F2A2E;color:#DCE3E0;border-color:#33454B}
html[data-theme="dark"] .fb-bubble{background:#26353A}
html[data-theme="dark"] .fb-bubble-who,html[data-theme="dark"] .fb-lead{color:var(--muted)}
html[data-theme="dark"] .fb-notyou{color:#7DD3C8}
html[data-theme="dark"] .fb-name-step input{background:#172124;color:#DCE3E0;border-color:#33454B}
@media (max-width:800px){
  body.has-tabs .fb-float{right:max(14px,env(safe-area-inset-right));bottom:calc(var(--tabh,64px) + env(safe-area-inset-bottom,0px) + 10px)}
  body.has-tabs .fb-chat{max-height:calc(100vh - var(--tabh,64px) - 96px)}
}
/* ---------- Batch 5 (Bolt): layout + structure only. No transitions here; Luma owns motion, the checkmark morph, hover tint and hairline looks. ---------- */
/* 1: no top bar. The bell sits alone, top right. */
main.main{position:relative}
.bell-dock{position:absolute;top:14px;right:20px;z-index:45}
@media(min-width:801px){main.main .top.bell-room{padding-right:52px}}
/* 2-5: bell panel (floating, kept on screen by JS). Hidden = closed. */
.bell-panel{position:fixed;top:0;left:0;width:min(340px,calc(100vw - 16px));display:flex;flex-direction:column;background:var(--bg-card);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 32px rgba(31,42,46,.18);z-index:80;overflow:hidden}
.bell-panel[hidden]{display:none}
.bell-head{padding:12px 14px 8px;font-size:13px;border-bottom:1px solid var(--line-soft)}
.bell-list{display:flex;flex-direction:column;gap:8px;padding:10px;overflow-y:auto;overscroll-behavior:contain;max-height:300px}
.bell-panel .bell-item{display:flex;align-items:flex-start;gap:4px;padding:0;border-radius:10px;background:transparent;width:auto}
.bell-panel .bell-item.is-unread{background:#F4F8F5}
.bell-open{flex:1;min-width:0;display:block;text-align:left;background:none;border:0;font:inherit;color:inherit;padding:10px 4px 10px 12px;cursor:pointer;border-radius:10px}
.bell-open b{display:block;font-size:13px}
.bell-open span{display:block;font-size:12px;color:var(--muted)}
.bell-open .bell-short{overflow-wrap:anywhere}
.bell-open .bell-at{font-size:11px;margin-top:2px}
.bell-x{flex:0 0 auto;width:28px;height:28px;margin:6px 6px 0 0;border:0;border-radius:8px;background:none;color:var(--muted);font-size:18px;line-height:1;cursor:pointer}
.bell-x:hover,.bell-x:focus-visible{background:var(--line-soft);color:var(--ink)}
.bell-open:focus-visible,.bell-x:focus-visible{outline:2px solid var(--teal);outline-offset:-2px}
.bell-empty{padding:14px;font-size:13px;color:var(--muted)}
html[data-theme="dark"] .bell-panel{background:#1F2A2E;border-color:#33454B}
html[data-theme="dark"] .bell-panel .bell-item.is-unread{background:#1E3328}
/* 6: confirm success, readable with no motion. Markup is fixed; only these display rules flip. */
.btn-check,.btn-done{display:none}
[data-confirmed] .btn-label{display:none}
[data-confirmed] .btn-check,[data-confirmed] .btn-done{display:inline}
[data-confirmed]{pointer-events:none}
/* 8: notes in Team activity / Waiting for approval in dark mode */
html[data-theme="dark"] .to-note{color:var(--ink);background:var(--bg-panel);border-left-color:#5FA8A8}
/* 9: Orders by stage numbers centered */
.stage .n{align-self:center;text-align:center;display:flex;justify-content:center;width:100%}
/* 10, 11, 15a: grids fill the width when a role hides a card */
.grid.g2:has(> [hidden]),.grid.g2e:has(> [hidden]){grid-template-columns:1fr}
.grid.g2:has(> .card.cash[hidden]){grid-template-columns:2fr 1fr}
.grid.g4:has(> [hidden]){grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
.grid:not(:has(> :not([hidden]))){display:none}
@media(max-width:800px){.grid.g4:has(> [hidden]){grid-auto-flow:row;grid-template-columns:1fr 1fr}}
/* 13, 14: notification dot next to the tab name, no icons */
.nav-dot{display:inline-block;font-style:normal;width:7px;height:7px;border-radius:50%;background:#C2453A;margin-left:7px;vertical-align:middle}
.m-tab .nav-dot{margin-left:4px}
/* 15b, c: richer rows, tighter spacing that stays clean */
@media(min-width:801px){.main{padding:20px 24px 32px}}
.grid{gap:12px}
.card{padding:14px 16px}
.row{padding:8px 0}
.m-row-meta .meta-ref{font-weight:600;color:var(--ink)}
.m-row-meta .meta-due{white-space:nowrap}
/* 18: tiny grey Sample data tag under the company name */
.side-sample{display:inline-block;margin-top:5px;padding:1px 7px;border:1px solid #4A5C61;border-radius:99px;font-size:10.5px;color:#9AA7A3;line-height:1.5}
/* 19: one clean stats line in the sidebar profile card */
.sp-stats{display:block;margin:0 2px 14px}
.sp-line{font-size:11.5px;color:#9AA7A3;line-height:1.5}
.side a.sp-stat,.side a.sp-stat:hover,.side a.sp-stat:focus,.side a.sp-stat:focus-visible,.side a.sp-stat:active{display:inline;padding:0;margin:0;border:0;background:none;color:#C5CFCB;text-decoration:none}
.side a.sp-stat:hover span{text-decoration:underline}
.sp-stat b,.sp-stat span{display:inline;font-size:11.5px}
.sp-stat b{color:#fff;font-weight:700}
.sp-stat span{color:inherit}
.sp-sep{color:#6F7F83}
/* 20: Seen and typing sit right under the last bubble */
.chat-msg .chat-seen{margin:2px 4px 0}
#chat-msgs .chat-typing{padding:2px 4px 6px;margin-top:-4px}
/* 21: the sidebar never clips; it scrolls on short laptop screens */
@media(min-width:801px){
  .side{position:sticky;top:0;height:100vh;height:100dvh;overflow-y:auto;align-self:start}
  .side .side-slot,.side .side-tabs{overflow:visible;max-height:none}
  .side .foot{padding-bottom:16px}
}
.bell-panel{font-weight:400;text-align:left}
.bell-panel .bell-open b,.bell-panel .bell-head b{color:var(--ink);font-weight:650}
/* 11: co-packer home tiles fill the row when a role has fewer than 4 */
@media(min-width:801px){.cp-tiles[data-n="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.cp-tiles[data-n="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Luma follow-ups (Nov 18): the Saved line keeps its space so siblings don't jump; steady bell count; readable dark people list */
.saved-slot{min-height:47px;display:flow-root}
@media (max-width:800px){.saved-slot{min-height:67px}}
.bell-count{font-variant-numeric:tabular-nums;min-width:18px;text-align:center;box-sizing:border-box}
html[data-theme="dark"] .people-list button{color:var(--ink)}
html[data-theme="dark"] .people-list button:hover,html[data-theme="dark"] .people-list button.on{background:#26353A}
/* Webb follow-ups (Nov 18): one-line profile stats on a shared baseline; Feedback pill never covers content */
.sp-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:18px}
.sp-stat b,.sp-stat span{font-size:12px;line-height:18px;vertical-align:baseline}
.sp-stat span{font-weight:400}
.sp-stat b{font-weight:600}
html{--fb-h:34px;--fb-gap:16px}
.fb-float{padding:0 14px;height:var(--fb-h);line-height:var(--fb-h);font-size:13px;bottom:max(var(--fb-gap),env(safe-area-inset-bottom,0px))}
@media(min-width:801px){main.main{padding-bottom:calc(var(--fb-h) + var(--fb-gap) * 2)}}
@media (max-width:800px){
  body.has-tabs .fb-float{bottom:calc(var(--tabh,64px) + env(safe-area-inset-bottom,0px) + 8px)}
  body:not(.has-tabs) .main{padding-bottom:calc(var(--fb-h) + var(--fb-gap) * 2)}
}
/* v31 (Webb): Feedback pill hides while the page scrolls (html[data-fb-scrolling], set by mortar.js); never while focused or open. No transitions here; Luma fades it in her file. */
html[data-fb-scrolling] .fb-float:not(:focus):not(:focus-visible):not([aria-expanded="true"]){visibility:hidden;pointer-events:none}
/* dark mode: a light pill on the dark page, like the dark pill on the light page */
html[data-theme="dark"] .fb-float{background:#DCE3E0;color:#1F2A2E;border:1px solid #DCE3E0;box-shadow:0 8px 24px rgba(0,0,0,.35)}
html[data-theme="dark"] .fb-float:focus-visible{outline-color:#7DD3C8}
/* v31: #bell-count sits on the bell at a fixed size; only [hidden] toggles it, so nothing around the bell moves */
.bell-btn{position:relative}
.bell-count{position:absolute;top:-4px;right:-4px;width:18px;min-width:18px;height:18px;padding:0;line-height:18px;font-size:10px;overflow:hidden;white-space:nowrap;letter-spacing:-.02em}
/* ===== v32 (Bolt): Hunt's v31 bugs. Static layout/colour only; no transitions here. ===== */
/* A02: one column on phone for every role's Problems page (the cash-hidden 2fr/1fr rule is desktop only) */
@media(max-width:800px){.grid.g2,.grid.g2e,.grid.g3,.grid.g2:has(> .card.cash[hidden]),.grid.g2:has(> [hidden]),.grid.g2e:has(> [hidden]){grid-template-columns:minmax(0,1fr)}}
/* A07: an odd last stat tile on phone spans the row instead of leaving a half-empty slot */
@media(max-width:800px){.grid.g4 > :not([hidden]):nth-last-child(1 of :not([hidden])):nth-child(odd of :not([hidden])){grid-column:1 / -1}}
/* A05: small grey labels in dark mode use the readable muted ink (#B7C3BF on #1F2A2E is 8.9:1) */
html[data-theme="dark"] .stage .lab,html[data-theme="dark"] .stage-group h3,html[data-theme="dark"] .stage-order-meta,html[data-theme="dark"] .metric .l,
html[data-theme="dark"] th,html[data-theme="dark"] .kicker,html[data-theme="dark"] .sec,html[data-theme="dark"] .cp-tl li,html[data-theme="dark"] .cp-cal-grid th,
html[data-theme="dark"] .cp-chip span,html[data-theme="dark"] .scan-chip span,html[data-theme="dark"] .who .biz,html[data-theme="dark"] .chat-time,html[data-theme="dark"] .chat-head-biz,
html[data-theme="dark"] .chat-role,html[data-theme="dark"] .chat-msg-biz,html[data-theme="dark"] .chat-quote,html[data-theme="dark"] .msg-actions button,html[data-theme="dark"] .chat-reply-bar p,
html[data-theme="dark"] .cp-today-time,html[data-theme="dark"] .bell-item span,html[data-theme="dark"] .bell-empty,html[data-theme="dark"] .fb-bubble-who,html[data-theme="dark"] .fb-lead,
html[data-theme="dark"] .email .meta,html[data-theme="dark"] .field label,html[data-theme="dark"] .stage .lab *,html[data-theme="dark"] .cp-tl li *{color:var(--muted)}
/* A06: the open chat's name and the header role are readable in dark mode */
html[data-theme="dark"] .chat-pick.on b,html[data-theme="dark"] #chat-list .chat-pick.on .who b{color:#9FCBC7}
/* A13: selected brand pill in dark mode: white on #2F5D62 (7.3:1) with a light teal edge */
html[data-theme="dark"] .cp-bb.on{background:#2F5D62;border-color:#5FA8A8;color:#fff}
/* A14 (static part; Luma owns any motion): no near-white pieces in dark mode.
   Feedback pill #26353A, text #E8EEEC (11.6:1), edge #5FA8A8 vs the #121A1C page (6.3:1). Tips #33454B / #E8EEEC. Run fill #5FA8A8 on its #26353A track. */
html[data-theme="dark"] .fb-float{background:#26353A;color:#E8EEEC;border:1px solid #5FA8A8;box-shadow:0 8px 24px rgba(0,0,0,.45)}
html[data-theme="dark"] .tip{background:#33454B;color:#E8EEEC}
html[data-theme="dark"] .cp-today-fill{background:#5FA8A8}
/* A08: the phone tab bar "You" avatar is a 26px circle (the tab-label span rule capped it at 14px tall) */
@media(max-width:800px){
  .m-tab span.m-tab-av{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;min-width:26px;min-height:26px;max-height:none;flex:0 0 26px;border-radius:50%;overflow:hidden;line-height:1;white-space:nowrap}
  .m-tab span.m-tab-av img{width:100%;height:100%;object-fit:cover;display:block}
}
/* A11: phone tap targets at least 24px; the extra box is transparent and negative margins keep the layout */
@media(max-width:800px){
  .m-dot{width:24px;height:24px;margin:-5px -4px}
  .m-tabs-next{width:32px;height:24px;margin:-4px -5px 0 0}
  .tog{box-sizing:content-box;border:2px solid transparent;background-clip:padding-box;margin:-2px}
  .tip{box-sizing:content-box;border:4.5px solid transparent;background-clip:padding-box;margin:-4.5px}
  td a,th a,.o-po a,a.o-po{display:inline-block;padding:4px 0;margin:-4px 0;min-height:24px;box-sizing:border-box}
}
/* A15: the sidebar role line wraps instead of cutting; View as / Plan selects fit the sidebar */
.sp-who span{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.role-pick select{font-size:12px;padding:6px 24px 6px 8px;text-overflow:ellipsis;-webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23DCE3E0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 8px center;background-size:10px 6px}
/* A18: working as designed (Grady, Nov 17): the takeover widens the sidebar and the page squeezes over; no overlay.
   Only the panel content is tidied: "At stake" stays on one line and the Notify select gets its own full-width line. */
@media(min-width:801px){
  .side-panel-body .row{gap:12px}
  .side-panel-body .row > .muted:first-child{white-space:nowrap;flex:0 0 auto}
  .side-panel-body .row > b{text-align:right;min-width:0}
  .notify-box .fix-actions{flex-wrap:wrap}
  .notify-box #notify-who{flex:1 1 100%;min-width:0;max-width:100%}
}
/* A19: pages with no page header (No access) leave room for the bell dock */
@media(min-width:801px){main.main:has(> .bell-dock):not(:has(.top)){padding-top:68px}}
/* A20: phone: co-packer run names and calendar chips wrap instead of cutting */
@media(max-width:800px){
  /* run rows stay one slim line of text: the progress bar moves under the name as a full-width hairline, so the name gets the room */
  .cp-today-run{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 4px;row-gap:4px;height:auto;max-height:none;min-height:32px;padding:5px 0}
  .cp-today-bar{grid-column:1 / -1;min-width:0}
  .cp-chip span{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
}
/* A22 (focus part): every bell note shows the focus ring, also when focus is moved by script (WebKit) */
.bell-item:focus-visible,.bell-item:focus{outline:2px solid #2F5D62;outline-offset:-2px}
html[data-theme="dark"] .bell-item:focus-visible,html[data-theme="dark"] .bell-item:focus{outline-color:#7DD3C8}
/* A21: the "Added here only" / "Forwarded" notes float just above the composer instead of growing it, so Send stays put */
#chat-compose{position:relative}
#chat-compose #chat-msg,#chat-compose #chat-fwd-sent{position:absolute;left:12px;right:12px;bottom:calc(100% + 6px);z-index:3;margin:0;pointer-events:none}
#chat-compose #chat-msg:empty{display:none}
#chat-compose #chat-msg .ok-box,#chat-compose #chat-msg > div{margin:0;box-shadow:0 4px 14px rgba(0,0,0,.12)}
/* A11: "?" tips: 15px dot, 25px target */
@media(max-width:800px){.tip{border-width:5px;margin:-5px}}
/* A19: brand "No access" card (the page header is inside the hidden #guarded block) also clears the bell */
@media(min-width:801px){main.main:has(> .bell-dock):has(> .no-access:not([hidden])){padding-top:68px}}
