/* CCAM v30: canonical presentation, using Asset Management as the reference.
   Load LAST. Sizes represent roles; one role has one style across workspaces.
   DD keeps its boxed grouping. Inline row editors keep their existing geometry. */
:root{
  color-scheme:light;
  --ui-body:14px;--ui-copy:13px;--ui-cell:12px;--ui-meta:11px;
  --ui-label:10.5px;--ui-column:10px;--ui-title:20px;--ui-figure:18px;
  --ui-field:34px;--ui-filter:28px;--ui-gap:12px;--ui-section:24px;
  --ui-card-shadow:0 1px 2px rgba(14,28,47,.04);
  --ccam-page-header-height:61px;
  --ccam-workspace-top:calc(40px + var(--ccam-page-header-height));
}
:root[data-theme=dark]{color-scheme:dark}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark}}
html body{font-size:var(--ui-body);font-family:var(--ccam-font);color:var(--text)}
html body :is(button,input,select,textarea,optgroup){font-family:var(--ccam-font)}
html body :is(.main-nav,.topbar,.detail-panel,.modal,.broker-modal,.tbl-wrap,.table-wrap){background-color:var(--bg);border-color:var(--border)}
html body .main-nav{padding:10px 0;border-right:1px solid var(--border)}
html body .main-nav .nav-item{font-size:var(--ui-copy);font-weight:400;color:var(--text2);gap:8px;padding:8px 16px;margin:1px 0;border-left:2px solid transparent;text-decoration:none}
html body .main-nav .nav-item:hover{background:var(--bg2);color:var(--text)}
html body .main-nav .nav-item.active{color:var(--gold-text);background:var(--gold-bg);font-weight:600;border-left-color:var(--brand-gold-hi)}
html body .main-nav .nav-item.active .nav-item-label{color:inherit}
html body .main-nav.collapsed .nav-item{padding:8px 0;justify-content:center}
html body .main-nav .nav-section{font-size:var(--ui-column);font-weight:700;letter-spacing:.09em;color:var(--text3);text-transform:uppercase}
html body :is(.ccam-page-chip,#deal-chip){font-family:var(--ccam-font);font-size:17px;font-weight:650;letter-spacing:-.01em}
html body :is(.page-title,.tracker-title,.rw-title,.dd-ph-t,.dd-hero h1){font-family:var(--ccam-serif);font-size:var(--ui-title);font-weight:600;color:var(--text);letter-spacing:0;line-height:1.3}
html body :is(.tracker-sub,.rw-sub,.dd-ph-s,.dd-hero .ad){font-size:var(--ui-cell);color:var(--text2);line-height:1.5}

/* Serif display / sans interface is AM's established hierarchy. */
html body :is(.met,.dd-kpi){padding:12px 14px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);min-width:0;box-shadow:none}
html body :is(.met-lbl,.dd-kpi-lbl,.sb .sl2){font-family:var(--ccam-font);font-size:9.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--gold-text);margin-bottom:5px}
html body :is(.met-val,.dd-kpi-val,.sb .sn){font-family:var(--ccam-serif);font-size:var(--ui-figure);font-weight:600;line-height:1.3;letter-spacing:0;font-variant-numeric:tabular-nums lining-nums}
html body :is(.met-val,.dd-kpi-val) :is(span,b,strong){font-family:inherit;font-size:inherit}
html body :is(.met-sub,.dd-kpi-sub){font-size:var(--ui-meta);line-height:1.4;color:var(--text2)}
html body :is(.sec-label,.dp-label,.rw-label,.lease-year-title,.sb .slbl){font-family:var(--ccam-font);font-size:var(--ui-label);font-weight:700;color:var(--gold-text);letter-spacing:.09em;text-transform:uppercase}
/* (v33.5 band and v33.8 in-band link rules removed in v33.14 — superseded by the v33.13 section-bar block below) */
html body .card{padding:16px 18px;border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--ui-card-shadow)}
html body .card-surface{background:var(--bg2);border:1px solid var(--border);box-shadow:none}

/* Common controls. Disabled and destructive actions retain their meaning. */
html body .btn.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:var(--ui-copy);font-weight:500;line-height:1.4;padding:7px 14px;border:1px solid var(--border2);border-radius:var(--radius);color:var(--text);background:transparent;cursor:pointer;min-height:0}
html body .btn.btn.sm{font-size:var(--ui-cell);padding:4px 10px}
html body .btn.btn.xs{font-size:var(--ui-meta);padding:2px 8px}
html body .btn.btn:hover{background:var(--bg2);border-color:var(--gold);color:var(--text)}
html body .btn.btn.pri{font-weight:600;background:var(--btn-pri-bg);border-color:var(--btn-pri-bd);color:var(--btn-pri-fg)}
html body .btn.btn.pri:hover{background:var(--btn-pri-bg-hover);border-color:var(--btn-pri-bg-hover);color:var(--btn-pri-fg);opacity:1}
html body .btn.btn.gold{background:transparent;color:var(--text);border-color:var(--border2)}
html body .btn.btn.dng{color:var(--red)}
html body .btn.btn.dng:hover{background:var(--red-bg);border-color:var(--red);color:var(--red-text)}
html body :is(button,.btn):disabled{opacity:.5;cursor:not-allowed;transform:none}
html body :is(button,.btn,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--gold);outline-offset:2px}
html body :is(input,select,textarea):focus{border-color:var(--gold)}
html body :is(input[type=checkbox],input[type=radio]){accent-color:var(--gold)}
html body input::placeholder,html body textarea::placeholder{color:var(--text3);opacity:1}
html body :is(.fld,.form-field,.broker-modal .fld) > :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=hidden]):not([type=color]),select,textarea){font-size:var(--ui-copy);line-height:1.4;min-height:var(--ui-field);padding:7px 10px;box-sizing:border-box;border:1px solid var(--border2);border-radius:var(--radius);background-color:var(--bg);color:var(--text);min-width:0}
html body :is(.fld,.form-field,.broker-modal .fld) > label{font-size:var(--ui-meta);font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text2)}
html body :is(.toolbar,.tracker-toolbar){gap:8px}
html body :is(.search-input,input.filter,select.filter,.toolbar select,.toolbar input[type=text],.toolbar input[type=search]){font-size:var(--ui-cell)!important;height:var(--ui-filter);box-sizing:border-box;background-color:var(--bg);color:var(--text);border:1px solid var(--border2);border-radius:var(--radius)}
html body .search-input{padding:4px 9px 4px 30px}
html body select:not([multiple]):not([size]){padding-right:26px}

/* Theme-aware stripes, hover and totals replace legacy fixed white fills. */
html body :is(.tbl-wrap,.table-wrap){border:1px solid var(--border);border-radius:var(--radius-lg)}
html body table thead th{font-family:var(--ccam-font);font-size:var(--ui-column);font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text2);background:var(--bg2);padding:8px 10px;border-bottom:1px solid var(--border)!important}
html body table tbody td{font-size:var(--ui-cell);line-height:1.45;padding:9px 10px;border-bottom-color:var(--border)}
html body table tbody tr + tr td{border-top-color:var(--border)}
html body :is(.tbl-wrap,.table-wrap) tbody tr:nth-child(even) > td{background-color:color-mix(in srgb,var(--bg2) 40%,var(--bg))}
html body table tbody tr:hover > td{background-color:var(--bg2)}
html body table tfoot td{font-size:var(--ui-cell);font-weight:650;color:var(--text);background:var(--bg2);padding:9px 10px;border-top:1px solid var(--border2)!important}
html body tr.ccam-rowedit[data-open="1"] > td{background:var(--gold-bg)}
html body tr.ccam-rowedit[data-open="1"] > td:first-child{box-shadow:inset 2px 0 0 var(--gold)}
html body tr.ccam-rowedit-panel > td{background:var(--bg2);padding:12px 14px 14px}
html[data-ccam-density=compact] body table:not(.ccam-no-density) :is(th,td){padding-top:var(--d-cell-y)!important;padding-bottom:var(--d-cell-y)!important;line-height:var(--d-row)}
html[data-ccam-density=compact] body .main-nav .nav-item{padding-top:var(--d-nav-y);padding-bottom:var(--d-nav-y)}
html body .badge{font-size:10px;font-weight:600;letter-spacing:.02em;border-radius:4px;padding:2px 7px}
html body :is(.badge.gray,.badge-gray){background:var(--gray-bg);color:var(--gray-text)}
html body :is(.modal,.broker-modal):not(.ccam-modal-inline){border:1px solid var(--border);box-shadow:var(--ccam-shadow-strong)}
html body .modal-backdrop{z-index:10050;background:rgba(14,28,47,.42)}
html body .backdrop{z-index:10039;background:rgba(14,28,47,.32)}
html body .detail-panel{z-index:10040}
html body :is(.modal-title,.modal-hdr h3,.dd-sl-dt){font-family:var(--ccam-font);font-size:16px;font-weight:600;color:var(--text);letter-spacing:0}
html body :is(.modal,.broker-modal):not(.ccam-modal-inline) > .modal-hdr{padding:18px 24px;border-bottom:1px solid var(--border)}
html body :is(.modal,.broker-modal):not(.ccam-modal-inline) > .modal-body{padding:20px 24px}
html body :is(.modal,.broker-modal):not(.ccam-modal-inline) > .modal-actions{padding:16px 24px;gap:8px;border-top:1px solid var(--border)}
html body .modal.ccam-modal-inline{border:0;box-shadow:none;background:transparent}
html body .dp-hdr{background:var(--bg2);border-bottom:1px solid var(--border)}
html body .dp-name{font-family:var(--ccam-serif);font-size:18px;font-weight:600;line-height:1.3}
html body .dp-row-lbl{font-size:var(--ui-cell);color:var(--text2)}

/* Acquisitions geometry: header height follows wrapping on narrow screens. */
html body[data-ccam-workspace]{background:var(--bg);padding-top:var(--ccam-workspace-top)!important}
html body[data-ccam-workspace] .topbar{position:fixed!important;top:40px;left:0;right:0;z-index:10001;height:61px;min-height:61px;padding:12px 20px;gap:12px}
html body[data-ccam-workspace] .main-nav{top:var(--ccam-workspace-top)!important}
html body[data-ccam-workspace] .detail-panel{top:var(--ccam-workspace-top)!important}
html body[data-ccam-workspace=dd] .dd-app,html body[data-ccam-workspace=map] .app{height:calc(100vh - var(--ccam-workspace-top))!important;height:calc(100dvh - var(--ccam-workspace-top))!important}

/* Pipeline: AM's warm cards, semantic stage dots, consistent card typography. */
html body #board{gap:12px;align-items:stretch}
html body #board .col{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg)}
html body #board .col-hdr{padding:12px 14px;gap:4px;border-bottom:1px solid var(--border)}
html body #board .col-hdr-top{align-items:flex-start;gap:8px}
html body .col-title{font-size:var(--ui-label);font-weight:700;letter-spacing:.07em;color:var(--text2)}
html body .col-count{font-size:10px;font-weight:600;letter-spacing:.02em;color:var(--text2);background:var(--bg);border:1px solid var(--border);border-radius:4px}
html body .deal-card{border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--ui-card-shadow)}
html body .deal-card:hover{border-color:var(--gold);box-shadow:var(--ccam-shadow)}
html body .deal-card.collapsed{padding:10px 12px}
html body :is(.dc-addr,.dc-mini-name){font-size:13px;font-weight:600;line-height:1.4}
html body :is(.dc-row,.dc-mini-addr,.dc-mini-price,.lc-stale-row){font-size:12px;line-height:1.45}
html body :is(.dc-foot,.lc-card-stale,.lc-stale){font-size:11px}
html body .c-identified{background:var(--text3)}
html body .c-review{background:var(--blue)}
html body :is(.c-reviewcomplete,.c-closed){background:var(--green)}
html body .c-loi{background:var(--amber)}
html body .c-contract{background:var(--purple)}
html body .c-dd{background:var(--gold)}

/* DD blend: preserve boxed section bars, gold rail, grouped tables and panels. */
html body #dd-main{background:var(--bg);padding:24px 24px 80px}
html body #dd-main .dd-ph-s{white-space:normal}
html body #dd-main .dd-top > .dd-am-lbl,html body #dd-main .dd-am-row{margin:24px 0 10px;padding:7px 12px;min-height:38px;border:1px solid var(--border);border-left:3px solid var(--gold);border-radius:var(--radius);background:var(--bg2);gap:10px}
html body #dd-main :is(.dd-am-lbl,.dd-am-lbl.ccam-sec-toggle){font-family:var(--ccam-font);font-size:var(--ui-label);font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--gold-text)}
html body #dd-main .dd-am-row > .dd-am-lbl{margin:0;padding:0;background:none;border:0;min-height:26px}
html body #dd-main .dd-am-lbl :is(.cnt,.dd-ck-sum,.dd-sl-sum){font-size:11px;font-weight:500;color:var(--text2);letter-spacing:0;text-transform:none}
html body #dd-main .dd-top > .dd-am-lbl:hover,html body #dd-main .dd-am-row:hover{background:var(--gold-bg)}
html body #dd-main .tbl-wrap thead th{font-size:10px;color:var(--text2);background:var(--bg2);padding:8px 10px;border-bottom:1px solid var(--border)!important}
html body #dd-main .tbl-wrap tbody td{font-size:12px;padding:9px 10px;border-color:var(--border)}
html body #dd-main .tbl-wrap tr.ccam-grp > td{font-size:10.5px;letter-spacing:.07em;background:var(--bg2);color:var(--text);padding:8px 10px;box-shadow:inset 3px 0 0 var(--gold)}
html body #dd-main .tbl-wrap tr.ccam-grp.is-closed > td{box-shadow:inset 3px 0 0 var(--border2)}
html body #dd-main .tbl-wrap tfoot td{background:var(--bg2);color:var(--text);font-size:12px}
html body #dd-main .dd-am-acts :is(.btn,.dd-ex-btn,.dd-folders-toggle){font-size:12px;padding:4px 10px;border-radius:var(--radius)}
html body .dd-kpis{gap:12px}

/* Map's page-specific selectors otherwise defeat the shared theme. */
html body .sb .ct.on{background:var(--btn-pri-bg);border-color:var(--btn-pri-bd);color:var(--btn-pri-fg)}
html body .sb .tc{border-radius:4px;background:var(--gray-bg)!important;color:var(--gray-text)!important}
html body .sb .addr-input,html body .sb .si,html body .sb .prop-search{font-size:12px;height:28px;padding:5px 9px;box-sizing:border-box;color:var(--text);background:var(--bg)}
html body .mpbtn.on{background:var(--btn-pri-bg);color:var(--btn-pri-fg)}
html body .leaflet-container{background:var(--bg2)}

/* Role-specific inline styles must not create a second typography system. */
html body :is(.page-title,.tracker-title,.rw-title,.dd-ph-t){font-family:var(--ccam-serif)!important;font-size:var(--ui-title)!important;font-weight:600!important}
html body :is(.met-val,.dd-kpi-val,.sb .sn){font-family:var(--ccam-serif)!important;font-size:var(--ui-figure)!important;font-weight:600!important}
html body :is(.met-lbl,.dd-kpi-lbl){font-family:var(--ccam-font)!important;font-size:9.5px!important;font-weight:700!important}
html body :is(.modal-title,.modal-hdr h3){font-family:var(--ccam-font)!important;font-size:16px!important;font-weight:600!important}

@media(min-width:761px) and (max-width:1200px){
  html body[data-ccam-workspace] .topbar{height:auto;flex-wrap:wrap;row-gap:8px}
  html body[data-ccam-workspace] .topbar-right{flex-wrap:wrap}
}

@media(max-width:760px){
  html body[data-ccam-workspace]{margin-left:0!important}
  html body[data-ccam-workspace=map] .app{margin-left:0!important}
  html body :is(.ccam-page-chip,#deal-chip){font-size:15px;max-width:calc(100vw - 190px)}
  html body[data-ccam-workspace] .topbar{height:auto;min-height:61px;flex-wrap:wrap;row-gap:8px;padding:10px 12px}
  html body[data-ccam-workspace] .topbar-left{flex:1 1 100%;min-width:0}
  html body[data-ccam-workspace] .topbar-right{flex:1 1 100%;flex-wrap:wrap;justify-content:flex-start}
  html body[data-ccam-workspace] > .content{padding:16px 12px 64px}
  html body[data-ccam-workspace] .detail-panel{top:40px!important;max-height:calc(100dvh - 40px)}
  html body #dd-main{padding:16px 12px 64px!important}
  html body #dd-main .dd-am-acts{flex-wrap:wrap;max-width:100%}
  html body[data-ccam-workspace=map] .sb{left:0;top:var(--ccam-workspace-top)}
  html body :is(.toolbar,.tracker-toolbar){flex-wrap:wrap}
  html body :is(.toolbar,.tracker-toolbar) :is(input,select),html body :is(.search-input,input.filter,select.filter){font-size:16px!important;height:40px}
  html body :is(.fld,.form-field,.broker-modal .fld) > :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;min-height:40px}
  html body :is(.topbar,.toolbar,.modal-actions) .btn{min-height:40px}
  html body :is(.met-lbl,.dd-kpi-lbl){font-size:10px!important}
  html body .broker-modal .modal-body{grid-template-columns:1fr;gap:12px}
  html body :is(.modal,.broker-modal):not(.ccam-modal-inline) > :is(.modal-hdr,.modal-body,.modal-actions){padding:14px 16px}
  html body .sb :is(.addr-input,.si,.prop-search){font-size:16px;height:40px}
  html body .sb .addr-btn{min-height:40px}
}
/* A monochrome logo remains legible on the dark navy page header. */
html[data-theme=dark] body .topbar-left img{filter:brightness(0) invert(1);opacity:.94}
@media(prefers-color-scheme:dark){html:not([data-theme=light]) body .topbar-left img{filter:brightness(0) invert(1);opacity:.94}}
@media(prefers-reduced-motion:reduce){html body :is(.btn,.card,.deal-card,.nav-item,.detail-panel,.main-nav,.topbar){transition:none!important;animation:none!important}}
@media print{html body :is(.card,.tbl-wrap,.table-wrap,.met){box-shadow:none;background:white}}

/* ══ v33.13 — section headers, platform-wide, in the Due Diligence style ═════
   A solid bar with a gold left edge: small uppercase title, any count or
   note beside it in plain gray, and the section's buttons at its right end
   as ordinary small buttons. Collapsible sections open and close by
   clicking anywhere on the bar (no arrow); a closed bar goes quiet — gray
   edge, muted title. Replaces the v33.5 tinted band and the v33.8 "text
   link inside the band" treatment. Same block in ccam-brand.css and
   ccam-ui.css so every page gets it. */
html body .sec-label{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;box-sizing:border-box;min-height:36px;
  margin:26px 0 8px;padding:4px 12px;
  background:var(--bg2);border:1px solid var(--border);border-left:3px solid var(--gold);
  border-radius:var(--radius,8px);box-shadow:none;
  font-family:var(--ccam-font);font-size:11.5px;font-weight:700;letter-spacing:.07em;line-height:1.3;
  text-transform:uppercase;color:var(--text)}
@supports not (background: color-mix(in srgb, red 5%, transparent)){html body .sec-label{background:var(--bg2)}}
html body .sec-label:first-child{margin-top:0}
html body .sec-label::after{display:none!important;content:none!important}
/* counts and notes inside the bar read as plain text, like "Escrow day 15 of 71" */
html body .sec-label :is([id$="-count"],.cnt,.sec-meta,[style*="font-weight:400"],[style*="font-weight: 400"]){
  font-size:11.5px!important;font-weight:500!important;letter-spacing:0;text-transform:none;color:var(--text2)!important}
/* collapsible: the whole bar is the toggle; no arrow */
html body .sec-label.ccam-sec-toggle::before{display:none!important;content:none!important}
html body .sec-label.ccam-sec-toggle{cursor:pointer;transition:background .12s,border-color .12s}
html body .sec-label.ccam-sec-toggle:hover{background:var(--bg3,#eceae6);opacity:1}
html body .sec-label.ccam-sec-collapsed{border-left-color:var(--border2);background:var(--bg);color:var(--text2)}
html body .sec-label.ccam-sec-collapsed:hover{background:var(--bg2)}
/* a header that shares its row with buttons or a filter ("Investors / Add
   investor", "Active deals / Sort by"): the ROW becomes the bar, so any
   number of controls sit at its right end without overlapping. */
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]):has(> .sec-label){
  position:relative;align-items:center!important;gap:8px;flex-wrap:wrap;box-sizing:border-box;min-height:36px;
  margin:26px 0 8px!important;padding:4px 8px 4px 12px!important;
  background:var(--bg2);border:1px solid var(--border);border-left:3px solid var(--gold);border-radius:var(--radius,8px)}
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]):has(> .sec-label:first-child):first-child{margin-top:0!important}
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]) > .sec-label{
  flex:1 1 auto;min-width:0;min-height:26px;margin:0!important;padding:0!important;border:0!important;background:none!important;border-radius:0}
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]) > .sec-label ~ :is(.btn,button){
  position:static;transform:none;margin:0;
  background:var(--bg)!important;border:1px solid var(--border2)!important;border-radius:6px!important;box-shadow:none!important;
  padding:4px 11px!important;font-size:12px!important;font-weight:500!important;letter-spacing:0;text-transform:none;
  color:var(--text)!important;text-decoration:none!important}
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]) > .sec-label ~ :is(.btn,button):hover{
  background:var(--bg2)!important;border-color:var(--text3)!important}
html body :is([style*="display:flex"],[style*="display: flex"]):not([style*="column"]):has(> .sec-label.ccam-sec-collapsed){border-left-color:var(--border2);background:var(--bg)}
/* launcher admin sections use the same bar */
html body .admin-section-title{display:flex;align-items:center;gap:10px;min-height:36px;box-sizing:border-box;padding:4px 12px;
  background:var(--bg2);border:1px solid var(--border);border-left:3px solid var(--gold);border-radius:var(--radius,8px);
  font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text)}
/* the dashboard's Portfolio overview header and the attention panel follow suit */
html body .ov-bar{display:flex;align-items:center!important;justify-content:space-between;gap:10px;flex-wrap:wrap;box-sizing:border-box;
  min-height:36px;margin:26px 0 10px!important;padding:4px 8px 4px 12px!important;
  background:var(--bg2);border:1px solid var(--border);border-left:3px solid var(--gold);border-radius:var(--radius,8px)}
html body .ov-bar > div:first-child{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;min-width:0}
html body .ov-bar .ov-title{font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text)}
html body .ov-bar .ov-sub{margin:0;font-size:11.5px;font-weight:500;color:var(--text2)}
html body .ccam-att-hd.ccam-sec-toggle::before{display:none!important;content:none!important}
html body .ccam-att{border-left:3px solid var(--gold)}
html body .ccam-att-hd h3{font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text)}
