*{box-sizing:border-box}html,body{margin:0;padding:0;font-family:Inter,Arial,sans-serif;background:#f5f7fb;color:#1f2937}button,input,select{font:inherit}
.topbar,.mobile-topbar{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;background:#163a63;color:#fff;position:sticky;top:0;z-index:20}
h1{margin:0;font-size:1.4rem}.sub{margin:.2rem 0 0;color:#d4e3f4}.ghost{background:#fff;color:#163a63;border:1px solid #c4d4e6}
.tabs{display:flex;gap:8px;padding:12px 16px;background:#fff;border-bottom:1px solid #dde5ef;position:sticky;top:72px;z-index:10}
.tab,.mobile-tab{padding:10px 14px;border-radius:999px;border:1px solid #c8d5e6;background:#fff;cursor:pointer}
.tab.active,.mobile-tab.active{background:#163a63;color:#fff;border-color:#163a63}
main{padding:16px}.panel{display:none}.panel.active{display:block}.panel-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.panel-header h2{margin:0}.team-map-root{overflow:visible;padding-bottom:24px;min-width:0}
.team-node-wrap{display:flex;flex-direction:column;align-items:center;min-width:180px}
.team-node{width:180px;min-height:88px;border:1px solid #c8d5e6;border-radius:18px;background:#fff;padding:12px;box-shadow:0 8px 24px rgba(21,61,101,.08);cursor:pointer;display:flex;flex-direction:column;gap:4px}
.team-node.collapsed{opacity:.9}
.team-node strong{font-size:.95rem}.team-node span{color:#58708d}.team-node small{color:#6b7280}
.team-child-row{display:flex;gap:18px;align-items:flex-start;justify-content:center;margin-top:26px;position:relative}
.team-child-row:before{content:"";position:absolute;top:-14px;left:10%;right:10%;height:2px;background:#c8d5e6}
.pipeline-board{display:flex;flex-wrap:nowrap;gap:14px;overflow-x:auto;overflow-y:hidden;padding:0 0 16px;align-items:stretch;scrollbar-gutter:stable}.pipeline-column{flex:0 0 224px;width:224px;max-width:224px;background:#eef3f9;border:1px solid #d3deeb;border-radius:20px;padding:12px;min-height:500px;display:flex;flex-direction:column}.pipeline-column.is-stage{background:#eaf2ff;border-color:#c6d8f3}.pipeline-column.is-field{background:#f7f9fc}.pipeline-column-head{display:flex;flex-direction:column;gap:6px;margin:0 0 10px}.pipeline-column h3{margin:0;font-size:1rem;line-height:1.25}.pipeline-column-meta{font-size:.78rem;color:#58708d;text-transform:uppercase;letter-spacing:.04em}.pipeline-dropzone,.pipeline-field-list{display:flex;flex-direction:column;gap:10px;min-height:360px;max-height:60vh;overflow-y:auto;padding-right:4px}.pipeline-card{background:#fff;border:1px solid #c8d5e6;border-radius:14px;padding:10px 12px;cursor:pointer;box-shadow:0 4px 14px rgba(21,61,101,.06);text-align:left;white-space:normal;word-break:break-word;line-height:1.3}.pipeline-stage-card{cursor:grab}.pipeline-field-card{display:flex;flex-direction:column;gap:6px}.pipeline-card-value{font-size:.88rem;color:#58708d}.pipeline-inline-link{font-size:.84rem;color:#163a63;text-decoration:none}.pipeline-inline-link:hover{text-decoration:underline}.pipeline-empty{border:1px dashed #c8d5e6;border-radius:14px;padding:12px;color:#6b7280;background:rgba(255,255,255,.7)}
.table-wrap{overflow:auto;background:#fff;border:1px solid #d5dfeb;border-radius:18px}
table{width:100%;border-collapse:collapse}th,td{padding:12px 10px;border-bottom:1px solid #ecf0f5;text-align:left;vertical-align:top}th{background:#163a63;color:#fff;position:sticky;top:0}
.state-input{width:110px;padding:7px 9px;border:1px solid #c8d5e6;border-radius:10px}
.import-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
.console{background:#0f172a;color:#d5e5ff;padding:14px;border-radius:16px;min-height:260px;white-space:pre-wrap;overflow:auto}
dialog{border:none;border-radius:18px;padding:0;max-width:860px;width:min(90vw,860px)}.dialog-card{padding:18px}.dialog-head,.dialog-actions{display:flex;justify-content:space-between;align-items:center}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0 18px}.field{display:flex;flex-direction:column;gap:6px}.field input,.field select{padding:10px;border:1px solid #c8d5e6;border-radius:12px;background:#fff}
.mobile-main,.mobile-team-map,.mobile-pipeline-list,.mobile-contacts-list{display:flex;flex-direction:column;gap:12px}
.mobile-panel{display:none;padding:12px}.mobile-panel.active{display:block}
.mobile-node{background:#fff;border:1px solid #d4deeb;border-radius:16px;padding:8px 12px}.mobile-node summary{display:flex;justify-content:space-between;cursor:pointer;list-style:none}
.mobile-node-children{padding-left:10px;margin-top:10px;display:flex;flex-direction:column;gap:10px}.mobile-leaf{display:flex;justify-content:space-between;gap:8px}
.mobile-stage-section,.mobile-contact-card{background:#fff;border:1px solid #d4deeb;border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:6px}
.mobile-person{background:#f5f9ff;border:1px solid #d4deeb;border-radius:14px;padding:10px;text-align:left}
@media (max-width:900px){.form-grid{grid-template-columns:1fr}.tabs{top:64px}}

/* Team map - strict no-overlap subtree layout */
.org-chart-shell{display:flex;flex-direction:column;gap:18px}
.org-map-controls{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid #d8e3ef;border-radius:22px;padding:14px 18px;box-shadow:0 8px 24px rgba(15,23,42,.05)}
.org-map-summary,.org-map-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.org-stat-pill{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;background:#eef4fb;border:1px solid #d6e2ef;color:#32506f;font-size:.92rem}
.org-action-btn{padding:9px 14px;border-radius:999px;cursor:pointer}
.org-chart-canvas{background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #d8e3ef;border-radius:32px;padding:20px 12px 24px;box-shadow:0 18px 40px rgba(21,61,101,.08);overflow:hidden}
.org-chart-viewport{position:relative;width:100%;overflow:hidden}
.org-stage-scale-wrap{position:relative;will-change:transform}
.org-stage{position:relative}
.org-connector-layer{position:absolute;inset:0;overflow:visible;pointer-events:none}
.org-connector-path{fill:none;stroke:#bccfe1;stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round}
.org-node-card{position:absolute;min-height:102px;border-radius:24px;border:1px solid #d4dfec;padding:16px 14px 12px;background:#fff;box-shadow:0 12px 28px rgba(21,61,101,.08);cursor:pointer;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.org-node-card:hover{transform:translateY(-2px);box-shadow:0 16px 34px rgba(21,61,101,.12)}
.org-node-card:focus-visible{outline:3px solid rgba(22,58,99,.18);outline-offset:3px}
.org-node-card.depth-0{background:linear-gradient(180deg,#0f4b8a 0%,#1a65ae 100%);border-color:#0f4b8a;color:#fff}
.org-node-card.depth-1{background:linear-gradient(180deg,#edf4fb 0%,#dfeaf6 100%);border-color:#c8d9eb;color:#153d65}
.org-node-card.depth-2{background:linear-gradient(180deg,#fff7e8 0%,#ffecc6 100%);border-color:#f0d9a6;color:#6c4c00}
.org-node-card.depth-3{background:linear-gradient(180deg,#eef9f2 0%,#d8efe1 100%);border-color:#c3e4cf;color:#1f5b3b}
.org-node-card.depth-4{background:linear-gradient(180deg,#f9eef9 0%,#ecd9ec 100%);border-color:#dec7de;color:#6b3f69}
.org-node-card.is-expanded{border-color:#163a63;box-shadow:0 20px 44px rgba(21,61,101,.14)}
.org-node-badge{position:absolute;top:-10px;left:50%;transform:translateX(-50%);min-width:30px;height:30px;padding:0 8px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #d4dfec;box-shadow:0 6px 16px rgba(15,23,42,.08);font-size:1rem;line-height:1}
.org-node-card.depth-0 .org-node-badge{color:#163a63}
.org-node-name{font-weight:800;font-size:.98rem;line-height:1.22;max-width:100%;overflow-wrap:anywhere}
.org-node-code{font-size:.84rem;opacity:.88;overflow-wrap:anywhere}
.org-node-meta{font-size:.8rem;opacity:.92}
.org-node-visible{font-size:.75rem;opacity:.84}
.org-inline-more{margin-top:4px;border:1px solid #c7d7ea;background:#fff;color:#163a63;border-radius:999px;padding:5px 10px;font-size:.77rem;cursor:pointer}
.org-empty-state{background:#fff;border:1px solid #d8e3ef;border-radius:22px;padding:28px;text-align:center;color:#5b728b}
.mobile-node{background:#fff;border:1px solid #d6e1ee;border-radius:18px;padding:10px 12px;box-shadow:0 8px 18px rgba(15,23,42,.04)}
.mobile-node summary{display:flex;justify-content:space-between;align-items:center;gap:12px;cursor:pointer;list-style:none}
.mobile-node-head,.mobile-leaf-head{display:flex;flex-direction:column;gap:2px;min-width:0}
.mobile-node-head strong,.mobile-leaf-head strong{overflow-wrap:anywhere}
.mobile-node-count{min-width:32px;height:32px;border-radius:999px;background:#eef4fb;border:1px solid #d6e1ee;display:flex;align-items:center;justify-content:center;color:#163a63;font-weight:700}
.mobile-node-meta{margin-top:8px;color:#5b728b;font-size:.83rem}
.mobile-node-children{padding-left:12px;margin-top:10px;display:flex;flex-direction:column;gap:10px;border-left:2px solid #dbe6f2}
@media (max-width:1200px){.org-map-controls{padding:12px 14px}}
@media (max-width:900px){.form-grid{grid-template-columns:1fr}.tabs{top:64px}.org-chart-canvas{padding:18px 10px 22px}}

/* Team Map - focus mode with Levi sidebar and selected subtree view */
.team-map-root{min-width:0;padding-bottom:8px}
.team-focus-layout{display:flex;gap:18px;align-items:stretch;min-height:calc(100vh - 250px);height:calc(100vh - 250px);overflow:hidden}
.team-map-sidebar{position:relative;flex:0 0 290px;max-width:290px;min-width:290px;background:#fff;border:1px solid #d8e3ef;border-radius:28px;box-shadow:0 16px 40px rgba(21,61,101,.08);transition:flex-basis .2s ease,max-width .2s ease,min-width .2s ease,transform .2s ease;overflow:visible}
.team-map-sidebar.is-closed{flex-basis:26px;max-width:26px;min-width:26px;border-color:transparent;background:transparent;box-shadow:none}
.team-map-sidebar-tab{position:absolute;top:22px;right:-16px;width:34px;height:110px;border-radius:18px;background:#163a63;color:#fff;border:none;box-shadow:0 10px 24px rgba(21,61,101,.18);cursor:pointer;writing-mode:vertical-rl;text-orientation:mixed;letter-spacing:.04em;font-weight:700;z-index:3}
.team-map-sidebar.is-open .team-map-sidebar-tab{right:-18px}
.team-map-sidebar-inner{height:100%;display:flex;flex-direction:column;overflow:hidden}
.team-map-sidebar.is-closed .team-map-sidebar-inner{opacity:0;pointer-events:none}
.team-map-search-wrap{position:sticky;top:0;z-index:2;background:#fff;padding:18px 18px 14px;border-bottom:1px solid #e2eaf4}
.team-map-search-label{display:block;font-size:.78rem;font-weight:700;color:#163a63;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}
.team-map-search{width:100%;padding:12px 14px;border:1px solid #c8d5e6;border-radius:14px;background:#f9fbff}
.team-map-search-hint{margin-top:8px;font-size:.82rem;color:#6c7f95;line-height:1.35}
.team-map-sidebar-list{overflow:auto;padding:12px 10px 14px;display:flex;flex-direction:column;gap:8px}
.team-map-sidebar-heading{padding:4px 8px 8px;font-size:.85rem;font-weight:700;color:#47637f}
.team-map-sidebar-empty{padding:14px 12px;color:#6c7f95;font-size:.92rem}
.team-map-sidebar-item{width:100%;text-align:left;display:flex;align-items:center;min-height:44px;padding:10px 14px 11px;border-radius:14px;box-sizing:border-box;border:1px solid transparent;background:#fff;color:#1f2937;cursor:pointer;font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-map-sidebar-item:hover{background:#eef4fb;border-color:#d6e2ef}
.team-map-sidebar-item.is-selected{background:#163a63;color:#fff;border-color:#163a63}
.team-focus-main{flex:1;min-width:0;overflow:auto;display:flex;flex-direction:column;gap:18px;padding-right:2px}
.team-map-default-view,.team-map-selected-view{display:flex;flex-direction:column;gap:18px}
.team-map-default-hero,.team-map-selected-header{background:linear-gradient(135deg,#ffffff 0%,#f5f9ff 100%);border:1px solid #d8e3ef;border-radius:28px;padding:22px 24px;box-shadow:0 14px 34px rgba(21,61,101,.06)}
.team-map-kicker{font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#5a7ca1;margin-bottom:8px}
.team-map-default-hero h3,.team-map-selected-header h3{margin:0 0 8px;font-size:1.4rem;color:#163a63}
.team-map-default-hero p,.team-map-selected-header p{margin:0;color:#5c7188;line-height:1.45;max-width:72ch}
.team-map-top-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.team-map-top-card{border:1px solid #d7e2ee;border-radius:24px;background:linear-gradient(180deg,#fff 0%,#f7fbff 100%);padding:18px;text-align:left;cursor:pointer;box-shadow:0 12px 28px rgba(21,61,101,.06);display:flex;flex-direction:column;gap:10px;min-height:210px}
.team-map-top-card:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(21,61,101,.1)}
.team-map-rank{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:999px;background:#163a63;color:#fff;font-weight:800}
.team-map-top-name{font-size:1.05rem;font-weight:800;color:#163a63;line-height:1.25}
.team-map-top-code{font-size:.9rem;color:#5c7188}
.team-map-top-stats{display:flex;flex-direction:column;gap:6px;color:#445a72;font-size:.92rem}
.team-map-top-cta{margin-top:auto;display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:999px;background:#eef4fb;color:#163a63;font-weight:700;width:max-content}
.team-map-selected-stats{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.org-chart-canvas{min-width:0}
.org-chart-viewport{width:100%}
.org-stage-scale-wrap{max-width:100%}
.org-node-card.is-focus-root{box-shadow:0 22px 46px rgba(15,75,138,.18)}
.mobile-team-search-wrap{margin-bottom:10px}
.mobile-team-search-results{display:flex;flex-direction:column;gap:10px;margin-bottom:12px}
@media (max-width:1200px){.team-focus-layout{height:calc(100vh - 240px);min-height:calc(100vh - 240px)}.team-map-sidebar{flex-basis:270px;max-width:270px;min-width:270px}}
@media (max-width:900px){.team-focus-layout{display:block;height:auto;min-height:0}.team-map-sidebar,.team-map-sidebar.is-closed{display:block;flex:none;width:100%;max-width:none;min-width:0;height:auto;margin-bottom:14px;overflow:visible}.team-map-sidebar.is-closed .team-map-sidebar-inner{opacity:1;pointer-events:auto}.team-map-sidebar-inner{height:auto;overflow:visible}.team-map-sidebar-tab{display:none}.team-map-search-wrap{position:static}.team-map-sidebar-list{max-height:60vh}.team-focus-main{overflow:visible;padding-right:0}.team-map-top-grid{grid-template-columns:1fr}.team-map-default-hero,.team-map-selected-header{padding:18px}}
.team-map-sidebar-tab.is-disabled{background:#9fb2c7;cursor:default;box-shadow:0 8px 20px rgba(21,61,101,.08)}

/* Team map selected-view refinement + horizontal explorer */
.team-map-selected-header--combined{display:flex;flex-direction:column;gap:14px}
.team-map-selected-headline h3{margin:0 0 8px;font-size:1.45rem;color:#163a63}
.team-map-selected-headline p{margin:0;color:#5c7188;line-height:1.45}
.team-map-selected-meta-row{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.team-map-selected-map-section{background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #d8e3ef;border-radius:28px;padding:18px 18px 20px;box-shadow:0 14px 34px rgba(21,61,101,.06)}
.team-map-selected-map-content{display:flex;gap:18px;align-items:stretch;overflow-x:auto;overflow-y:hidden;padding-bottom:6px}
.team-map-mini-columns{display:flex;gap:14px;align-items:stretch;flex:0 0 auto}
.team-map-mini-col{width:220px;min-width:220px;background:#fff;border:1px solid #d8e3ef;border-radius:22px;box-shadow:0 12px 28px rgba(21,61,101,.06);display:flex;flex-direction:column;overflow:hidden;max-height:72vh}
.team-map-mini-col-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 14px 12px;border-bottom:1px solid #e2eaf4;background:#f8fbff}
.team-map-mini-col-title{font-weight:800;font-size:.92rem;color:#163a63;line-height:1.25}
.team-map-mini-col-count{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;border-radius:999px;background:#eef4fb;border:1px solid #d6e2ef;color:#163a63;font-weight:800}
.team-map-mini-col-body{display:flex;flex-direction:column;gap:8px;padding:12px;overflow:auto}
.team-map-mini-entry{width:100%;text-align:left;display:flex;align-items:center;min-height:44px;padding:10px 14px 11px;border-radius:14px;box-sizing:border-box;border:1px solid #d7e2ee;background:#fff;color:#1f2937;cursor:pointer;font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-map-mini-entry:hover{background:#eef4fb;border-color:#cbd9e7}
.team-map-mini-entry.is-selected{background:#163a63;color:#fff;border-color:#163a63}
.team-map-selected-chart-shell{flex:1 0 760px;min-width:760px;display:flex;flex-direction:column;gap:12px}
.team-map-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.team-map-section-title{font-size:.82rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#5a7ca1}
.team-map-section-subtitle{margin-top:4px;font-size:.92rem;color:#5c7188}
.org-chart-canvas--scroll{padding:16px 14px 18px}
.org-chart-viewport{position:relative;width:100%;overflow-x:auto;overflow-y:hidden;padding-bottom:8px}
.org-stage{position:relative;min-width:max-content}
.org-chart-canvas--scroll .org-chart-viewport::-webkit-scrollbar,.team-map-mini-col-body::-webkit-scrollbar,.team-map-selected-map-content::-webkit-scrollbar{height:10px;width:10px}
.org-chart-canvas--scroll .org-chart-viewport::-webkit-scrollbar-thumb,.team-map-mini-col-body::-webkit-scrollbar-thumb,.team-map-selected-map-content::-webkit-scrollbar-thumb{background:#c7d7ea;border-radius:999px}
@media (max-width:1200px){.team-map-selected-chart-shell{min-width:680px;flex-basis:680px}}

.contact-header{align-items:flex-end;flex-wrap:wrap}
.contact-header-left{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.contact-sort-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.contact-sort-label{font-size:.92rem;font-weight:700;color:#5c7188}
.contact-sort-pill{border:1px solid #c8d5e6;background:#fff;color:#163a63;border-radius:999px;padding:8px 12px;cursor:pointer;font:inherit}
.contact-sort-pill.is-active{background:#163a63;color:#fff;border-color:#163a63}
@media (max-width:900px){.team-map-selected-meta-row{align-items:flex-start}.team-map-selected-map-content{display:block;overflow:visible}.team-map-mini-columns{display:grid;grid-template-columns:1fr;gap:12px}.team-map-mini-col{width:auto;min-width:0;max-height:none}.team-map-selected-chart-shell{min-width:0;flex-basis:auto}.org-chart-viewport{overflow:auto}}

.contact-link{color:#163a63;text-decoration:none;font-weight:600}
.contact-link:hover{text-decoration:underline}
.mobile-team-search-wrap{position:sticky;top:0;z-index:5;background:#f5f7fb;padding-bottom:8px}
.mobile-team-tree-wrap{display:flex;flex-direction:column;gap:12px}
/* Board markers (Brief 01): left-edge cadence bar + state-icon cluster + stage medians.
   Only new/red/amber paint a colored 4px left bar; neutral keeps the default border. */
.pipeline-stage-card.cad-new{border-left:4px solid #2563eb}
.pipeline-stage-card.cad-red{border-left:4px solid #dc2626}
.pipeline-stage-card.cad-amber{border-left:4px solid #f59e0b}
.pipeline-card-markers{display:inline-flex;gap:3px;margin-left:6px;font-size:.8rem;vertical-align:middle}
.pipeline-card-markers .pcm{cursor:default}
/* Key-student star toggle (Brief 01 #3): fixed top-right corner control on each
   stage card. Hollow when unflagged, gold when flagged. */
.pipeline-stage-card{position:relative;padding-right:30px}
.pipeline-card-star{position:absolute;top:6px;right:6px;border:0;background:transparent;cursor:pointer;font-size:1rem;line-height:1;padding:2px;color:#9aa7b8}
.pipeline-card-star.is-key{color:#f5a623}
.pipeline-card-star:hover{color:#f5a623}
.pipeline-bulk-message{background:#163a63;color:#fff;border:0;border-radius:8px;padding:6px 12px;cursor:pointer}
.pipeline-bulk-message:hover{background:#0f2c4d}
.pipeline-bulk-msg-count{font-size:.85rem;color:#58708d;margin:4px 0 10px}
.pipeline-stage-median{font-size:.72rem;color:#58708d;font-weight:600}
/* Responsive stage-tabs (Brief 01/08): hidden on desktop; under 760px the board
   stacks and shows ONE stage column full-width, switched by the tab bar. */
.pipeline-stage-tabs{display:none}
@media (max-width:760px){
  .pipeline-stage-tabs{display:flex;gap:6px;overflow-x:auto;padding:0 0 10px;-webkit-overflow-scrolling:touch}
  .pipeline-stage-tabs::-webkit-scrollbar{display:none}
  .pipeline-stage-tab{flex:0 0 auto;border:1px solid #c6d8f3;background:#eaf2ff;border-radius:999px;padding:8px 14px;font-size:.85rem;font-weight:600;color:#163a63;white-space:nowrap;cursor:pointer}
  .pipeline-stage-tab.is-active{background:#163a63;color:#fff;border-color:#163a63}
  .pst-count{display:inline-block;margin-left:6px;font-size:.72rem;opacity:.8}
  .pipeline-board{flex-direction:column;flex-wrap:nowrap;overflow-x:visible}
  .pipeline-column{flex:1 1 auto;width:auto;max-width:none;min-height:0}
  .pipeline-column.is-field{display:none}
  .pipeline-column.is-stage{display:none}
  .pipeline-column.is-stage.is-active-stage{display:flex}
  .pipeline-dropzone{max-height:none}
}
/* Student card (Brief 03): progressive-disclosure sheet; full-screen on mobile. */
.student-card-dialog{border:none;border-radius:16px;padding:0;max-width:560px;width:92vw;box-shadow:0 20px 60px rgba(21,61,101,.25)}
.student-card-dialog::backdrop{background:rgba(21,40,66,.45)}
.sc-card{padding:18px 20px;display:flex;flex-direction:column;gap:12px}
.sc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.sc-head h2{margin:0;font-size:1.3rem;line-height:1.2}
.sc-stage{margin-top:2px;font-size:.85rem;font-weight:600;color:#163a63;background:#eaf2ff;display:inline-block;padding:2px 10px;border-radius:999px}
.sc-decision{background:#f7f9fc;border:1px solid #e2e9f2;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px}
.sc-recent,.sc-next{font-size:.9rem;line-height:1.35}
.sc-tag{font-size:.78rem;font-weight:600;color:#58708d;background:#eef3f9;border-radius:999px;padding:2px 10px}
.sc-tag-red{color:#fff;background:#dc2626}
.sc-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.sc-btn{display:inline-block;border:1px solid #c6d8f3;background:#fff;color:#163a63;border-radius:10px;padding:9px 14px;font-size:.9rem;font-weight:600;text-decoration:none;cursor:pointer}
.sc-btn-primary{background:#163a63;color:#fff;border-color:#163a63}
.sc-section{border:1px solid #e2e9f2;border-radius:12px;padding:8px 12px}
.sc-section>summary{cursor:pointer;font-weight:600;color:#163a63;font-size:.92rem}
.sc-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin-top:8px}
.sc-grid>div{font-size:.9rem}
.sc-grid span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:#8595a8}
.sc-trouble{margin-top:8px;font-size:.9rem;color:#9a3412;background:#fff7ed;border-radius:8px;padding:8px}
.sc-list{margin:8px 0 0;padding-left:18px;display:flex;flex-direction:column;gap:5px;font-size:.88rem}
.sc-empty{font-size:.88rem;color:#8595a8;padding:6px 0}
/* (c) One-tap link to the filtered Activity view (replaces inline history). */
.sc-activity-link{margin-top:2px}
.sc-link{background:none;border:none;color:#1d4ed8;font-size:.9rem;font-weight:600;cursor:pointer;padding:6px 0;text-align:left}
.sc-link:hover{text-decoration:underline}
/* D4 desktop: card opens as a non-modal SIDE PANEL, keeping board context.
   No backdrop dimming the board; docked to the right, full-height, scrollable. */
/* Start the side panel BELOW the sticky header+tabs so they don't cover the
   card's name/stage/Close. --app-chrome is the measured header+tabs height (set
   by student-card.js on load/resize); the 144px fallback covers desktop before
   JS runs. 100dvh (not 100vh) so mobile browser chrome doesn't clip the bottom. */
.student-card-dialog.sc-side-panel{position:fixed;inset:var(--app-chrome,144px) 0 0 auto;margin:0;height:calc(100dvh - var(--app-chrome,144px));max-height:calc(100dvh - var(--app-chrome,144px));width:420px;max-width:92vw;border-radius:16px 0 0 16px;box-shadow:-12px 0 40px rgba(21,61,101,.18);overflow:auto}
.student-card-dialog.sc-side-panel .sc-card{min-height:100%}
/* A3 desktop hover-peek: floating last-activity tooltip on name hover. */
.sc-peek{position:absolute;z-index:1200;max-width:320px;background:#163a63;color:#fff;font-size:.82rem;line-height:1.35;padding:8px 11px;border-radius:8px;box-shadow:0 8px 24px rgba(21,40,66,.3);pointer-events:none;opacity:0;transform:translateY(-3px);transition:opacity .12s ease,transform .12s ease}
.sc-peek.show{opacity:1;transform:translateY(0)}
@media (max-width:760px){
  .student-card-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  .sc-grid{grid-template-columns:1fr}
}
/* Settings surface (Brief 04): automation toggles + kill-switch; mobile-usable. */
.settings-dialog{border:none;border-radius:16px;padding:0;max-width:560px;width:92vw;box-shadow:0 20px 60px rgba(21,61,101,.25)}
.settings-dialog::backdrop{background:rgba(21,40,66,.45)}
.set-card{padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.set-head{display:flex;justify-content:space-between;align-items:center}
.set-head h2{margin:0;font-size:1.25rem}
.set-master{border:1px solid #c6d8f3;background:#eaf2ff;border-radius:12px;padding:4px 12px}
.set-master-off{border-color:#dc2626;background:#fef2f2}
.set-list{display:flex;flex-direction:column;gap:2px}
.set-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 4px;border-bottom:1px solid #eef2f7}
.set-row-text{display:flex;flex-direction:column;gap:2px}
.set-row-text small{color:#8595a8;font-size:.78rem}
.set-row input[type=checkbox]{width:22px;height:22px;flex:0 0 auto}
.set-row-dim{opacity:.45}
.set-review{margin-top:4px}
.set-review-note{font-size:.78rem;color:#8595a8;margin-top:4px}
/* Progressive-disclosure sections + template bindings (Brief 04 consolidation) */
.set-section{border:1px solid #e3e9f1;border-radius:12px;padding:6px 12px}
.set-section>summary{cursor:pointer;font-weight:600;color:#163a63;padding:6px 0;list-style:none}
.set-section>summary::-webkit-details-marker{display:none}
.set-section>summary::before{content:"▸ ";color:#8595a8}
.set-section[open]>summary::before{content:"▾ "}
.set-bind-list{display:flex;flex-direction:column;gap:8px;padding:6px 0}
.set-bind-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.set-bind-row select,.set-bind-row input{flex:0 1 280px;max-width:60%;padding:8px;border:1px solid #c8d5e6;border-radius:10px;background:#fff}
.set-bind-sub{font-size:.8rem;color:#58708d;margin-top:8px;font-weight:600}
.set-bind-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
/* Activation-state pills (Brief 04 c): show whether each automation is
   configured, not just ON/OFF. */
.set-row-auto{align-items:flex-start}
.set-switch{flex:0 0 auto}
.set-switch input[type=checkbox]{width:22px;height:22px}
.set-pill{display:inline-block;margin-top:4px;font-size:.72rem;font-weight:600;padding:2px 8px;border-radius:999px;line-height:1.5}
.set-pill-ok{background:#e7f6ec;color:#176c3a}
.set-pill-warn{background:#fdf0d5;color:#9a6700}
.set-pill-off{background:#eef2f7;color:#64748b}
.set-pill-paused{background:#fde8e8;color:#b42318}

/* Stage → Purpose → Template manager (Brief 04 a / Brief 05). Searchable,
   sectioned — built to stay readable at 30-40+ templates. */
.set-mgr{display:flex;flex-direction:column;gap:8px;padding:4px 0}
.set-mgr-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.set-mgr-search{flex:1 1 200px;min-width:140px;padding:8px;border:1px solid #c8d5e6;border-radius:10px;background:#fff}
.set-mgr-total{font-size:.78rem;color:#8595a8}
.set-mgr-body{display:flex;flex-direction:column;gap:8px;max-height:46vh;overflow:auto}
.set-mgr-empty{font-size:.85rem;color:#64748b;padding:8px 2px}
.set-mgr-stage{border:1px solid #e3e9f1;border-radius:10px;padding:4px 10px;background:#fafcff}
.set-mgr-stage>summary{cursor:pointer;font-weight:700;color:#163a63;padding:6px 0;list-style:none}
.set-mgr-stage>summary::-webkit-details-marker{display:none}
.set-mgr-stage>summary::before{content:"▸ ";color:#8595a8}
.set-mgr-stage[open]>summary::before{content:"▾ "}
.set-mgr-purpose{font-size:.78rem;font-weight:600;color:#58708d;margin:6px 0 2px;text-transform:uppercase;letter-spacing:.02em}
.set-mgr-count{display:inline-block;font-size:.72rem;color:#64748b;background:#eef2f7;border-radius:999px;padding:0 7px;font-weight:600}
.set-mgr-item{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 4px;border-bottom:1px solid #eef2f7}
.set-mgr-item-title{font-weight:600;color:#1f2d3d}
.set-mgr-item-sub{font-size:.78rem;color:#8595a8;flex:1 1 100%}
.set-mgr-actions{margin-left:auto;display:flex;gap:6px}
.set-mgr-del{color:#b42318}

/* Automation activity view (Brief 05 B2). */
.set-act{display:flex;flex-direction:column;gap:8px;padding:4px 0}
.set-act-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.set-act-chips{display:flex;gap:6px;flex-wrap:wrap}
.set-act-chip{font-size:.74rem;padding:3px 9px;border-radius:999px;background:#eef2f7;color:#475569}
.set-act-chip strong{font-size:.85rem}
.set-act-chip.set-act-sent{background:#e7f0ff;color:#1d4ed8}
.set-act-chip.set-act-adv{background:#e7f6ec;color:#176c3a}
.set-act-chip.set-act-field{background:#f3e8ff;color:#6d28d9}
.set-act-chip.set-act-fail{background:#fde8e8;color:#b42318}
.set-act-note{font-size:.78rem;color:#8595a8}
.set-act-empty{font-size:.85rem;color:#64748b;padding:6px 2px}
.set-act-list{display:flex;flex-direction:column;gap:2px;max-height:40vh;overflow:auto}
.set-act-row{display:flex;align-items:flex-start;gap:8px;padding:7px 4px;border-bottom:1px solid #eef2f7}
.set-act-dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;margin-top:5px;background:#94a3b8}
.set-act-dot.set-act-sent{background:#2563eb}
.set-act-dot.set-act-adv{background:#16a34a}
.set-act-dot.set-act-field{background:#7c3aed}
.set-act-dot.set-act-fail{background:#dc2626}
.set-act-main{display:flex;flex-direction:column;gap:1px;flex:1 1 auto;min-width:0}
.set-act-who{color:#475569;font-weight:500}
.set-act-subj{color:#8595a8;font-size:.76rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.set-act-when{font-size:.72rem;color:#94a3b8;flex:0 0 auto;white-space:nowrap}

.settings-dialog{max-width:640px}
@media (max-width:760px){ .settings-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0} .set-bind-row{flex-direction:column;align-items:stretch} .set-bind-row select,.set-bind-row input{flex:1 1 auto;max-width:none} .set-mgr-body,.set-act-list{max-height:none} }
.import-contracted-opt{display:block;margin:8px 0;font-size:.88rem;color:#475569}
.contact-name-btn{background:none;border:none;padding:0;color:#163a63;font:inherit;font-weight:600;text-align:left;cursor:pointer;text-decoration:underline}
.contact-name-btn:hover{color:#0f2747}
/* Convergence (Brief 08): ONE responsive app. mobile.html now redirects to
   index.html; these make the desktop surfaces usable on phones. */
@media (max-width:760px){
  .topbar{flex-wrap:wrap;gap:8px}
  .tabs{overflow-x:auto;flex-wrap:nowrap;gap:6px;-webkit-overflow-scrolling:touch}
  .tab{flex:0 0 auto;white-space:nowrap}
  .contact-header{flex-direction:column;align-items:stretch;gap:8px}
  .table-wrap{overflow:visible}
  #contactsTable thead{display:none}
  #contactsTable,#contactsTable tbody,#contactsTable tr,#contactsTable td{display:block;width:auto}
  #contactsTable tr{border:1px solid #d3deeb;border-radius:12px;margin:0 0 10px;padding:8px;background:#fff}
  #contactsTable td{border:none;padding:4px 6px}
}
.sc-upload{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;align-items:center;border:1px dashed transparent;border-radius:10px;padding:6px;transition:background .12s,border-color .12s}
.sc-upload select,.sc-upload input[type=file]{font-size:.85rem}
.sc-fields{display:flex;flex-direction:column;gap:6px;margin:6px 0}
.sc-field-row{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.85rem}
.sc-field-row span{color:#8595a8;flex:0 0 45%}
.sc-field-row input{flex:1 1 auto;min-width:0;border:1px solid #d3deeb;border-radius:8px;padding:5px 8px;font:inherit;font-size:.85rem}
.sc-field-row input.sc-saved{border-color:#16a34a;background:#f0fdf4}
.sc-drop-hint{flex:1 1 100%;font-size:.78rem;color:#8595a8}
.sc-upload.sc-drop-active{border-color:#163a63;background:#eaf2ff}

/* A name that opens the universal student card (Brief 03 A2) — used in the
   activity feed and quiz tracker so any name surface reaches the card. */
.lm-cardname{cursor:pointer;text-decoration:underline dotted;text-underline-offset:2px}
.lm-cardname:hover{text-decoration:underline}
@media (max-width:760px){ .settings-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0} }

/* Team Map (Brief 08): post-convergence the org chart is served to phones too.
   It lays out at a min width wider than a phone; on small screens let the canvas
   pan horizontally and the viewport overflow so nodes are reachable, not clipped.
   Placed at EOF so it wins source-order over the base org-chart rules. */
@media (max-width:760px){.org-chart-canvas{overflow-x:auto;-webkit-overflow-scrolling:touch}.org-chart-viewport{overflow:visible}}

/* Contacts "By Recruit Date" view: group recruits by year with a clean break.
   The year heading is centered, large, bold and grey so it reads as a divider,
   visually distinct from the row text. A-Z view renders no bands. Placed at EOF
   so the mobile overrides win source-order over the base #contactsTable tr card
   rule (which would otherwise box the band/spacer rows). */
.contact-year-band td{background:#eef1f5;border-top:1px solid #dfe4ea;border-bottom:1px solid #dfe4ea;padding:14px 12px;text-align:center}
.contact-year-band .contact-year{font-size:1.5rem;font-weight:700;color:#6b7785;letter-spacing:.02em}
.contact-year-spacer td{padding:0;height:20px;border:none;background:transparent}
@media (max-width:760px){
  #contactsTable tr.contact-year-band,#contactsTable tr.contact-year-spacer{border:none;background:transparent;margin:0;padding:0;border-radius:0}
  #contactsTable tr.contact-year-band td{display:block;background:#eef1f5;border-top:1px solid #dfe4ea;border-bottom:1px solid #dfe4ea;text-align:center;padding:12px}
  #contactsTable tr.contact-year-spacer td{height:12px;padding:0}
}

/* ── Brand theming ─────────────────────────────────────────────────────────
   Platform default = Everborn (green + gold). brand-boot.js overrides these
   per tenant from /api/brand, so the page chrome matches the tenant's brand. */
:root{
  --brand-primary:#0E5C3A;   /* header / chrome */
  --brand-accent:#C8A24B;    /* gold accents */
  --brand-on-primary:#ffffff;
}
.topbar,.mobile-topbar{background:var(--brand-primary)}
.tab.active,.mobile-tab.active{background:var(--brand-primary);border-color:var(--brand-primary)}
.tabs .tab.active{color:var(--brand-on-primary)}
th{background:var(--brand-primary);color:var(--brand-on-primary)}
.ghost{color:var(--brand-primary);border-color:var(--brand-primary)}
.brand-logo{height:26px;vertical-align:middle;margin-right:8px}
