:root {
  --navy:#102338; --navy-2:#183149; --bg:#f5f7fa; --card:#ffffff; --ink:#17212b;
  --muted:#718091; --line:#e6ebf0; --teal:#0f5c56; --teal-soft:#e6f2f0;
  --red:#d9534f; --red-soft:#fff0ef; --amber:#d8952b; --amber-soft:#fff6e7;
  --green:#2f8f67; --green-soft:#ecf8f2; --shadow:0 8px 30px rgba(16,35,56,.06);
  --serif:Georgia,"Iowan Old Style","Palatino Linotype","Book Antiqua",Palatino,serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box} html,body{margin:0;min-height:100%;font-family:var(--sans);color:var(--ink);background:var(--bg)}
button,input{font:inherit} button{cursor:pointer}
#app[hidden],#lock[hidden]{display:none}

/* Lock */
#lock{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#faf8f5;padding:24px}
.lock-brand{font-weight:800;letter-spacing:.14em;color:var(--navy);font-size:.75rem}.lock-message{font-family:var(--serif);font-size:2rem;margin:12px 0 22px}
#lock-form{width:min(360px,100%)}.lock-line{display:flex;border-bottom:1px solid #d8d2c9;padding:8px 0}.lock-line.focused{border-color:var(--teal)}
#lock-input{flex:1;border:0;outline:0;background:transparent;text-align:center;font-family:var(--serif);font-style:italic;font-size:1.05rem}
#lock-send{border:0;background:transparent;color:#aaa;font-size:1.2rem}#lock-send.active{color:var(--teal)}.lock-error{font-size:.85rem;color:#7a736a;opacity:0}.lock-error.visible{opacity:1}

#app{min-height:100vh;display:grid;grid-template-columns:250px 1fr}
.sidebar{background:linear-gradient(180deg,var(--navy),#0c1d2f);color:#fff;padding:22px 16px;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0;height:100vh}
.brand-block{display:flex;gap:11px;align-items:center;padding:4px 8px 26px}.heart-mark{font-size:28px}.brand-title{font-weight:900;letter-spacing:.18em}.brand-subtitle{font-size:.58rem;letter-spacing:.12em;opacity:.65;margin-top:3px}
.nav-section-label{font-size:.62rem;font-weight:800;letter-spacing:.14em;color:#7f95aa;margin:14px 10px 7px}
.nav-item{width:100%;border:0;background:transparent;color:#d8e2ea;display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;column-gap:10px;text-align:left;padding:9px 10px;border-radius:10px;align-items:center}
.nav-item:hover,.nav-item.active{background:rgba(255,255,255,.08);color:#fff}.nav-item small{grid-column:2;font-size:.68rem;color:#7f95aa;margin-top:1px}.nav-item.muted{opacity:.8}
.agent-dot{grid-row:1/3;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.77rem;background:#28465f;color:#fff}
.pepper-dot{background:#dd704f}.atlas-dot{background:#325f9a}.marge-dot{background:#8b69a5}.scotty-dot{background:#438f7a}.hazel-dot{background:#b47344}.jonny-dot{background:#5a7cb1}.barry-dot{background:#85764d}.lee-dot{background:#676f7b}
.sidebar-footer{margin-top:auto;padding:16px 10px 4px;color:#8ea3b5;font-size:.72rem;display:flex;gap:8px;align-items:center}.live-dot{width:8px;height:8px;border-radius:50%;background:#62c28f}

.main-shell{min-width:0}.view{display:none}.active-view{display:block}
#pepper-view{padding:28px clamp(20px,3vw,42px) 36px;max-width:1600px;margin:0 auto}
.topbar{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:22px}.eyebrow{font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:800;margin-bottom:6px}
h1{margin:0;font-family:var(--serif);font-weight:500;font-size:clamp(2rem,3vw,3rem);letter-spacing:-.02em}.subtitle{margin:7px 0 0;color:var(--muted)}
.top-actions{display:flex;gap:10px;align-items:center}.ghost-button,.atlas-quick{border:1px solid var(--line);background:#fff;border-radius:10px;padding:11px 14px;color:var(--ink);box-shadow:0 2px 8px rgba(16,35,56,.02)}.atlas-quick{background:var(--navy);color:#fff;border-color:var(--navy)}.atlas-quick span{font-size:.68rem;opacity:.55;margin-left:12px}
.attention-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}.attention-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px 18px;display:flex;gap:14px;align-items:center;box-shadow:var(--shadow)}.attention-card strong{font-size:1.55rem;display:block}.attention-card span{display:block;color:var(--muted);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.attention-icon{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:900}.red-card .attention-icon{background:var(--red-soft);color:var(--red)}.amber-card .attention-icon{background:var(--amber-soft);color:var(--amber)}.green-card .attention-icon{background:var(--green-soft);color:var(--green)}
.dashboard-grid{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:16px}.panel{background:var(--card);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);padding:18px;min-width:0}.panel-large{grid-column:span 2}.panel-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:15px}.panel-head h2{margin:2px 0 0;font-size:1.02rem}.panel-kicker{font-size:.62rem;font-weight:900;letter-spacing:.12em;color:#758393}.panel-kicker.danger{color:var(--red)}.panel-kicker.finance{color:var(--teal)}.panel-meta{font-size:.67rem;color:#98a4af}
.list-stack{display:flex;flex-direction:column;gap:9px}.empty-state{min-height:150px;border:1px dashed #dfe5ea;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:12px;padding:22px;text-align:left;color:var(--muted)}.empty-state p{margin:4px 0 0;font-size:.82rem;line-height:1.5}.empty-icon{width:34px;height:34px;border-radius:50%;background:var(--green-soft);color:var(--green);display:flex;align-items:center;justify-content:center;font-weight:900}.small-empty{min-height:112px}
.alert-item{border:1px solid var(--line);border-left:4px solid var(--amber);border-radius:10px;padding:12px 13px}.alert-item.red{border-left-color:var(--red)}.alert-item h3{font-size:.88rem;margin:0 0 5px}.alert-item p{font-size:.78rem;color:var(--muted);margin:0 0 8px}.alert-meta{display:flex;gap:8px;flex-wrap:wrap;font-size:.65rem;color:#8b97a4}.alert-action{font-size:.73rem;font-weight:800;color:var(--navy)}
.compact-list{display:flex;flex-direction:column}.row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);font-size:.78rem}.row:last-child{border-bottom:0}.row span{color:var(--muted)}.row strong{font-weight:700;text-align:right}
.calendar-toggle{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}.calendar-toggle button{border:0;background:transparent;color:var(--muted);font-size:.62rem;font-weight:900;letter-spacing:.08em;padding:6px 8px}.calendar-toggle button.active{background:var(--navy);color:#fff}.calendar-event strong{display:block;text-align:left;flex:1}.calendar-event strong small{display:block;margin-top:2px;color:var(--muted);font-weight:500}.calendar-week{display:flex;flex-direction:column;gap:12px}.calendar-day-group h3{margin:0 0 4px;font-size:.66rem;font-weight:900;letter-spacing:.08em;color:var(--navy)}.calendar-day-group .row{padding:7px 0}.calendar-day-group .empty-line{padding:3px 0 5px}
.finance-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.metric{background:#f8fafb;border:1px solid #edf1f4;border-radius:11px;padding:13px;text-align:left}.metric span{font-size:.7rem;color:var(--muted);display:block}.metric strong{font-size:1.16rem;display:block;margin:6px 0 3px}.metric small{font-size:.58rem;color:#a1acb6;text-transform:uppercase;letter-spacing:.06em}
.metric-button{width:100%;appearance:none;color:inherit}.metric-button:not(:disabled):hover,.metric-button[aria-expanded="true"]{border-color:var(--teal);background:var(--teal-soft)}.metric-button:disabled{cursor:not-allowed}.metric-error{border-color:var(--red-soft)}
.overdue-detail{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}.overdue-detail-head{display:flex;justify-content:space-between;gap:12px;font-size:.75rem;margin-bottom:8px}.overdue-detail-head span{color:var(--muted)}.overdue-buckets{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:8px}.overdue-bucket-row{background:#fbfcfd;border:1px solid #edf1f4;border-radius:8px;padding:8px 10px}.overdue-invoices{max-height:260px;overflow-y:auto;border-top:1px solid var(--line)}.overdue-invoice-row span{display:block;min-width:0}.overdue-invoice-row small{display:block;margin-top:2px;color:var(--muted);font-size:.68rem}.overdue-invoice-row a{color:var(--teal);font-weight:800;text-decoration:none}
.agent-status-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.agent-status-list>div{display:grid;grid-template-columns:10px 1fr auto;align-items:center;gap:8px;font-size:.75rem;padding:7px 0}.agent-status-list small{color:var(--muted)}.status-dot{width:7px;height:7px;border-radius:50%}.status-dot.live{background:var(--green)}.status-dot.pending{background:var(--amber)}
.bottom-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin-top:16px}.note-form{display:flex;gap:8px}.note-form input{flex:1;border:1px solid var(--line);border-radius:10px;padding:11px 12px;outline:0}.note-form input:focus{border-color:var(--teal)}.note-form button{border:0;border-radius:10px;background:var(--navy);color:#fff;padding:0 16px}.tiny-note{font-size:.67rem;color:#99a4ae;margin:8px 0 0}

/* Live jobs */
.job-list{display:flex;flex-direction:column;max-height:360px;overflow-y:auto}
.job-row{border-bottom:1px solid var(--line);font-size:.78rem}.job-row:last-child{border-bottom:0}
.job-row summary{list-style:none;display:flex;align-items:center;gap:8px;padding:9px 0;cursor:pointer}.job-row summary::-webkit-details-marker{display:none}
.job-name{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.job-row summary strong{font-weight:700;color:var(--muted);white-space:nowrap}
.rag-dot{width:9px;height:9px;border-radius:50%;flex:none;background:#b8c1ca}.rag-green{background:var(--green)}.rag-orange{background:var(--amber)}.rag-red{background:var(--red)}
.week-tag{font-size:.58rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:2px 7px;white-space:nowrap}
.job-reason{margin:0 0 10px 17px;font-size:.72rem;line-height:1.5;color:var(--muted)}
.metric .basis{font-style:normal;color:var(--teal);font-weight:800}.metric .metric-untracked{font-size:.95rem;color:var(--muted)}

/* Pipeline (compact), collapsed empty alert panels, agent status at bottom */
.panel-compact{padding:12px 16px}.panel-compact .panel-head{margin-bottom:4px}.panel-compact .row{padding:5px 0;font-size:.72rem}
.panel-collapsed{display:flex;align-items:center;gap:14px;padding:11px 18px;align-self:start;grid-column:span 2;white-space:nowrap}.panel-collapsed .panel-head{margin:0;flex:none}.panel-collapsed .panel-head>div{display:flex;align-items:baseline;gap:8px}.panel-collapsed .panel-head h2{margin:0;font-size:.9rem}.panel-collapsed .panel-meta{display:none}
.empty-line{font-size:.78rem;color:var(--muted);min-width:0;overflow:hidden;text-overflow:ellipsis}.empty-line b{color:var(--green);margin-right:4px}
@media(max-width:760px){.panel-collapsed{grid-column:auto}}
.agent-panel{margin-top:16px}.agent-panel .agent-status-list{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}

/* Justin's List: tasks Justin personally owns */
.justin-panel{margin-bottom:16px}.panel-kicker.justin{color:#dd704f}
.justin-group-title{margin:0 0 4px;font-size:.7rem;font-weight:900;letter-spacing:.1em;color:var(--navy)}
.justin-group+.justin-group{margin-top:14px}
.justin-unconfirmed span{white-space:normal}.justin-unconfirmed strong{color:var(--red)}
.quote-row span{color:var(--ink);font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quote-row strong{color:var(--muted);font-weight:600;white-space:nowrap}
a.quote-row{color:inherit;text-decoration:none}.quote-row[href]:hover span{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}

/* Data stamp, and a panel whose upstream read failed */
.as-of{font-size:.7rem;color:var(--muted);white-space:nowrap}
.panel-error{border-color:var(--red-soft)}.panel-error .empty-icon{background:var(--red-soft);color:var(--red)}.panel-error p{word-break:break-word}
.panel-error-line{margin:10px 0 0;font-size:.72rem;color:var(--red)}

/* Atlas preserved as a notebook view */
#atlas-view{min-height:100vh;background:#faf8f5;color:#221f1d;display:none;flex-direction:column}.active-view#atlas-view{display:flex}.atlas-topbar{height:62px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;border-bottom:1px solid #e7e1d6;background:rgba(250,248,245,.96);position:sticky;top:0;z-index:2}.back-button{border:0;background:transparent;color:#7a736a}.atlas-title{display:flex;align-items:center;gap:8px}.atlas-title strong{display:block;font-size:.8rem}.atlas-title small{display:block;font-size:.65rem;color:#9a9289}
#atlas-page{flex:1;display:flex;flex-direction:column;min-height:0;width:min(620px,100%);margin:0 auto;padding:0 clamp(1.3rem,5vw,1.6rem);transition:width .6s ease}#atlas-view.conversation #atlas-page,#atlas-view.conversation #composer{width:min(900px,92vw)}
#cover{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:.85rem;transition:opacity .6s ease,transform .6s ease}#cover.leaving{opacity:0;transform:translateY(-10px);pointer-events:none}.wordmark{font-family:var(--serif);font-style:italic;font-size:.95rem;color:#b3aa9e}.dateline{font-size:.68rem;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:#b3aa9e}.greeting{font-family:var(--serif);font-weight:400;font-size:clamp(1.9rem,5vw,2.7rem);margin:0}
#entries{flex:1;overflow-y:auto;padding:1.5rem 0;display:none;flex-direction:column;gap:2rem}#entries.active{display:flex}.question{font-family:var(--serif);font-style:italic;font-size:1.05rem;color:#7a736a;margin:0 0 .65rem}.answer{font-size:1.02rem;line-height:1.68}.answer p{margin:0 0 1.1em}.answer ul{list-style:none;padding:0}.answer li{padding-left:1.15em;position:relative;margin-bottom:.45em}.answer li:before{content:"–";position:absolute;left:0;color:#b3aa9e}.answer.error{color:#7a736a;font-style:italic}.cursor{display:inline-block;width:.5ch;height:1em;background:#0f5c56;vertical-align:text-bottom;margin-left:1px;animation:blink 1s step-end infinite}@keyframes blink{50%{opacity:0}}
#composer{flex:none;width:min(620px,100%);margin:0 auto;padding:0 clamp(1.3rem,5vw,1.6rem) 1.7rem;transition:width .6s ease}.line{display:flex;align-items:center;gap:.25rem;border-top:1px solid #e7e1d6;padding-top:.75rem}.line.focused{border-color:#0f5c56}#input{flex:1;min-width:0;border:0;background:transparent;outline:0;font-family:var(--serif);font-style:italic;font-size:1.05rem;color:#221f1d;padding:0 0 .3rem}#send{width:2.25rem;height:2.25rem;border:0;background:transparent;color:#b3aa9e;font-size:1.15rem}#send.active{color:#0f5c56}

@media(max-width:1100px){#app{grid-template-columns:82px 1fr}.brand-block{justify-content:center}.brand-block>div:last-child,.nav-section-label,.nav-item span:not(.agent-dot),.nav-item small,.sidebar-footer span:last-child{display:none}.nav-item{display:flex;justify-content:center;padding:8px}.dashboard-grid{grid-template-columns:1fr 1fr}.panel-large{grid-column:span 2}}
@media(max-width:760px){#app{display:block}.sidebar{height:auto;min-height:0;position:sticky;top:0;z-index:10;flex-direction:row;padding:9px 10px;overflow-x:auto}.brand-block{padding:0 8px}.brand-block .heart-mark{font-size:22px}.nav-section-label,.sidebar-footer{display:none}.nav-item{width:auto;min-width:46px}.nav-item.muted{display:none}#pepper-view{padding:18px 14px 28px}.topbar{display:block}.top-actions{margin-top:16px}.dashboard-grid,.bottom-grid{grid-template-columns:1fr}.panel-large{grid-column:auto}.finance-grid{grid-template-columns:1fr 1fr}.atlas-quick{flex:1}}
@media(max-width:460px){.finance-grid{grid-template-columns:1fr}.top-actions{width:100%}.atlas-quick{width:100%}.attention-card{padding:14px}.panel{padding:15px}}

/* Phone: the three headline counters stay one row of compact tiles, so Today and Live jobs sit above the fold */
@media(max-width:760px){.attention-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:14px}.attention-card{flex-direction:column;align-items:flex-start;gap:6px;padding:10px 11px;border-radius:12px;min-width:0}.attention-icon{width:24px;height:24px;font-size:.75rem}.attention-card strong{font-size:1.2rem;line-height:1.1}.attention-card span{font-size:.58rem;letter-spacing:.03em;line-height:1.25}}

/* Scotty: the Installation Board framed full height, same topbar as Atlas */
#scotty-view{min-height:100vh;background:var(--bg);flex-direction:column}.active-view#scotty-view{display:flex}
.scotty-open-tab{font-size:.75rem;font-weight:700;color:var(--teal);text-decoration:none;white-space:nowrap}
.scotty-notice{margin:16px 22px 0;padding:12px 14px;border:1px dashed #dfe5ea;border-radius:12px;font-size:.82rem;color:var(--muted);line-height:1.5}.scotty-notice a{color:var(--teal);font-weight:700;white-space:nowrap}
.scotty-frame{flex:1;display:block;width:100%;height:calc(100vh - 62px);border:0;background:#fff}
@media(max-width:760px){.scotty-frame{height:calc(100vh - 126px)}#scotty-view .atlas-topbar{padding:0 14px}}

/* Phone: a small Refresh beside the "Data as of" stamp */
@media(max-width:760px){.ghost-button{flex:none;padding:6px 10px;font-size:.75rem;border-radius:8px}}
