:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f3a5f; --accent-soft: #e8eef6; --good: #1e7a46; --good-bg: #e3f4ea;
  --bad: #a3271f; --bad-bg: #fbe5e3; --warn: #8a5a00; --warn-bg: #fff2d6;
  --radius: 6px; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.overdue { color: var(--bad); font-weight: 600; }

/* Shell */
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.sidebar { background: var(--accent); color: #fff; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: block; font-weight: 700; font-size: 16px; margin: 0 0 18px; padding: 0 8px; letter-spacing: .02em; color: #fff; }
.sidebar .brand:hover { background: none; }
/* logo.png is the white version, made for the navy sidebar. */
.sidebar .brand img { display: block; width: 100%; max-width: 170px; height: auto; padding: 4px 4px 0; }
.sidebar a { display: block; color: #dbe4f0; padding: 7px 10px; border-radius: var(--radius); }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.sidebar .user { position: absolute; bottom: 16px; left: 12px; right: 12px; font-size: 12px; color: #b9c6d8; }
.sidebar .user a { display: inline; padding: 0; color: #fff; }
main { padding: 20px 28px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head .spacer { flex: 1; }

/* Controls */
.btn, button { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer; font: inherit; }
.btn:hover, button:hover { border-color: #c7ccd4; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-small { padding: 3px 8px; font-size: 12px; }
.btn-danger { color: var(--bad); border-color: #e9b8b3; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--text); max-width: 100%; }
textarea { width: 100%; }
.messages { list-style: none; padding: 0; margin: 0 0 12px; }
.messages li { padding: 8px 12px; border-radius: var(--radius); background: var(--good-bg); color: var(--good); margin-bottom: 6px; }
.messages li.error { background: var(--bad-bg); color: var(--bad); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 12px; }
.filters label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.filters select[multiple] { height: 64px; }
details.columns summary { cursor: pointer; color: var(--accent); }
details.columns .grid { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 16px; padding: 8px 0; }

/* Tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); position: sticky; top: 0; }
table.data th a { color: var(--muted); }
table.data tr:hover td { background: #fafcff; }
table.data td.wrap { white-space: normal; }
.pager { display: flex; gap: 10px; align-items: center; padding: 10px; color: var(--muted); }

/* Pills */
.pill, .tag, .stage { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #eef0f3; color: #3c4453; }
.pill-high { background: var(--bad-bg); color: var(--bad); }
.pill-mid { background: var(--warn-bg); color: var(--warn); }
.pill-low { background: #eef0f3; color: var(--muted); }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.stage { background: var(--accent-soft); color: var(--accent); }
.stage-tenant, .stage-opportunity { background: var(--good-bg); color: var(--good); }
.stage-not_interested, .stage-do_not_contact { background: var(--bad-bg); color: var(--bad); }

/* Record page */
.record-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.record-head h1 { margin: 0; font-size: 22px; }
.record-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.record { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fields p { margin: 0 0 10px; }
.fields label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.fields input:not([type=checkbox]):not([type=radio]), .fields select, .fields textarea { width: 100%; }

/* News review */
.news-section { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 8px; }
.news-card { border-left: 3px solid var(--line); outline: none; }
.news-card:focus-within, .news-card:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.news-card.decided-proceed, .news-card.decided-pursue { border-left-color: var(--good); }
.news-card.decided-decline, .news-card.decided-pass { border-left-color: var(--bad); opacity: .8; }
.news-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.news-card-head .stage, .news-card-head .tag { margin-left: 4px; }
.decide { display: flex; gap: 6px; }
.btn-danger-on { background: var(--bad); border-color: var(--bad); color: #fff; }
.draft-box { margin-top: 8px; padding: 8px 10px; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.draft-box input { margin-bottom: 6px; }
.draft-html { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 80px; margin-top: 4px; }
.news-card-foot { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; flex-wrap: wrap; }
.news-card-foot textarea { flex: 1; min-width: 220px; }

/* Project / prospecting chips */
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-right: 5px;
  letter-spacing: .02em; vertical-align: 1px; }
a.chip:hover { text-decoration: none; filter: brightness(.95); }
.chip-project { background: #e4ecfb; color: #1d4ed8; }
.chip-prospecting { background: #f1ece2; color: #7a5b1d; }

/* AI summary */
.ai-summary { border-left: 3px solid var(--accent); }
.ai-summary p { margin: 0 0 8px; }
.ai-summary .ai-headline { font-weight: 600; font-size: 15px; }
.ai-summary ul { margin: 0 0 8px; padding-left: 18px; }
.ai-summary li { margin-bottom: 3px; }

/* Read-only details + edit dialog */
dl.details { margin: 0 0 6px; display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 13px; }
dl.details dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
dl.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.details dd.prose { white-space: normal; }
.edit-dialog { border: 0; border-radius: 10px; padding: 0; width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(15, 23, 42, .3); color: var(--text); }
.edit-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.edit-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 16px; text-transform: capitalize; }
.dialog-body { padding: 14px 18px; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* Chip pickers (fit score, campus of interest) */
#id_fit_score, #id_campus_choice { display: flex; flex-wrap: wrap; gap: 6px; }
#id_fit_score label, #id_campus_choice label { display: inline-block; margin: 0; padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 99px; cursor: pointer; font-size: 13px; color: var(--text); background: var(--panel); user-select: none; }
#id_fit_score label:hover, #id_campus_choice label:hover { border-color: var(--accent); }
#id_fit_score input, #id_campus_choice input { position: absolute; opacity: 0; pointer-events: none; }
#id_fit_score label:has(input:checked), #id_campus_choice label:has(input:checked) {
  background: var(--accent); border-color: var(--accent); color: #fff; }
.fit-definition { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 1em; }
.fields ul { list-style: none; padding: 0; margin: 0; }
.fields .helptext { display: block; font-size: 11px; color: var(--muted); }
.errorlist { color: var(--bad); margin: 0; padding-left: 16px; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card .value { font-size: 16px; font-weight: 600; margin-top: 4px; }
.card .sub { font-size: 12px; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li.bg { opacity: .65; font-size: 13px; }
.timeline .icon { text-align: center; }
.timeline .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.timeline .meta { color: var(--muted); font-size: 12px; }
.timeline .body { white-space: pre-wrap; font-size: 13px; color: #3c4453; margin-top: 4px; }

/* Tasks */
.tasklist { list-style: none; padding: 0; margin: 0; }
.tasklist li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tasklist li form { margin: 0; }
.tasklist .done { text-decoration: line-through; color: var(--muted); }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form input[name=title] { flex: 1; min-width: 160px; }

/* Kanban */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.column { background: #eceff3; border-radius: var(--radius); width: 250px; flex: 1 0 250px; padding: 8px; min-height: 120px; }
.column h4 { margin: 2px 4px 8px; font-size: 13px; display: flex; justify-content: space-between; }
.column.drop { outline: 2px dashed var(--accent); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; cursor: grab; }
.kcard .sub { font-size: 12px; color: var(--muted); }

/* Home */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) {
  .record, .grid-2 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar .user { position: static; }
}

/* Sign-in */
.login { max-width: 360px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px; overflow: hidden; }
.login .login-logo { background: var(--accent); margin: -28px -28px 22px; padding: 26px 28px 22px; text-align: center; }
.login .login-logo img { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto; }
.login h1 { font-size: 16px; margin: 0 0 16px; color: var(--muted, #6b7280); font-weight: 600; text-align: center; }
.login input { width: 100%; margin-bottom: 10px; }
.login .btn { width: 100%; text-align: center; }
.login hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* Pipeline (Home, board, report) */
.subhead { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.subhead:first-of-type { margin-top: 0; }
.row-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.row-line:last-child { border-bottom: 0; }
table.data.compact td, table.data.compact th { padding: 5px 8px; }
.num { text-align: right; white-space: nowrap; }
.kcard .risk { font-size: 11px; color: var(--bad); margin-top: 3px; }
.kcard .next { font-size: 12px; margin-top: 3px; }
.column.collapsed { width: 150px; flex: 0 0 150px; }
.board-summary { font-size: 12px; color: var(--muted); margin: -6px 0 10px; }
.role-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--accent-soft); border-radius: var(--radius); margin-bottom: 10px; font-size: 13px; }
.bulkbar[hidden] { display: none; }
details.checks { position: relative; }
details.checks > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; background: var(--panel); min-width: 120px; font-size: 13px; color: var(--text); }
details.checks > summary::after { content: " ▾"; color: var(--muted); }
details.checks > div { position: absolute; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 170px; }
details.checks label { display: flex !important; flex-direction: row !important; gap: 6px; align-items: center; color: var(--text) !important; padding: 2px 0; white-space: nowrap; }
.danger-zone { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.danger-zone summary { font-size: 12px; color: var(--muted); cursor: pointer; }
@media print {
  .sidebar, .no-print, .messages { display: none !important; }
  .shell { display: block !important; }
  main { padding: 0 !important; }
  .panel { break-inside: avoid; border: 0; padding: 0; }
}
.stack-form select, .stack-form input:not([type=file]):not([type=checkbox]) { width: 100%; margin-bottom: 6px; }

.report-logo { display: block; height: auto; margin: 0 0 12px; }
@media print { .report-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Sidebar tree */
.sidebar { overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .user { position: static; margin-top: auto; padding: 14px 8px 0; }
.sidebar .nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8fa3bd; margin: 14px 10px 4px; font-weight: 600; }
.sidebar a.nav-top { font-weight: 600; color: #fff; }
.sidebar .nav-1 { padding: 5px 10px 5px 16px; font-size: 13.5px; }
.sidebar .nav-2 { padding: 3px 10px 3px 30px; font-size: 12.5px; color: #b9c6d8; position: relative; }
.sidebar .nav-2::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 50%; border-left: 1px solid rgba(255,255,255,.18); border-bottom: 1px solid rgba(255,255,255,.18); width: 6px; }
.sidebar .nav-bell { font-size: 13px; margin-bottom: 4px; }
.tag-alert { background: #e5484d; color: #fff; }

/* Meetings calendar */
.cal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; margin-bottom: 8px; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #f6f7f9; }
.cal-day.other .cal-date { color: #b0b6c0; }
.cal-day.today .cal-date { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal-date { font-size: 12px; font-weight: 600; align-self: flex-start; margin-bottom: 2px; }
.cal-event { all: unset; box-sizing: border-box; display: block; width: 100%; font-size: 11.5px; padding: 2px 5px; border-radius: 4px; background: #eef0f3; color: #3c4453; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { filter: brightness(.95); }
.cal-event.ext { background: #e4ecfb; color: #1d4ed8; }
.cal-event.notes::before { content: "📝 "; }
.meeting-dialog { width: min(980px, 94vw); max-height: 88vh; border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.meeting-dialog::backdrop { background: rgba(15,23,42,.45); }
.meeting-panel { padding: 20px 24px; }
.mp-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.mp-head h2 { margin: 0 0 4px; font-size: 18px; }
.mp-grid { display: grid; grid-template-columns: 1fr 260px; gap: 24px; }
.mp-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.mp-grid h3:first-child { margin-top: 0; }
.action-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 6px; background: #fbfcfd; }
.granola { font-size: 13.5px; line-height: 1.5; }
.granola h4 { font-size: 14px; margin: 14px 0 4px; }
.granola ul { margin: 2px 0 6px; padding-left: 18px; }
.granola .li-detail { color: var(--muted); font-size: 12.5px; margin: 0 0 4px 18px; }
.attendees { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.attendees li { padding: 3px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
@media (max-width: 760px) { .mp-grid { grid-template-columns: 1fr; } .cal-day { min-height: 70px; } }

/* Comments + notifications */
.comment-form textarea { width: 100%; margin-bottom: 6px; }
.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.comment-head { font-size: 12.5px; }
.comment-body { font-size: 13.5px; }
.comment-body p { margin: 3px 0; }
.mention { background: #e4ecfb; color: #1d4ed8; border-radius: 3px; padding: 0 3px; font-weight: 600; }
.notif { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 13.5px; }
.notif:hover { background: #f6f7f9; text-decoration: none; }
.notif.unread { font-weight: 600; }
.notif.unread .notif-kind::before { content: "● "; color: #e5484d; }
.notif-kind { font-size: 12px; color: var(--muted); }
.notif-when { font-size: 12px; white-space: nowrap; font-weight: 400; }

/* Collapsible sidebar sections */
.sidebar details > summary { list-style: none; cursor: pointer; position: relative; }
.sidebar details > summary::-webkit-details-marker { display: none; }
.sidebar .nav-sec > summary { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8fa3bd; margin: 12px 0 3px; padding: 3px 10px; font-weight: 600; border-radius: var(--radius); }
.sidebar .nav-sec > summary:hover { color: #fff; }
.sidebar .nav-sec > summary::after, .sidebar .nav-sub > summary::after { content: "›"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); transition: transform .15s; color: #8fa3bd; font-size: 13px; }
.sidebar details[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.sidebar .nav-sub > summary { margin: 0; }
.sidebar .nav-sub > summary a { padding-right: 26px; }
.sidebar .nav-planned { display: block; color: #8fa3bd; cursor: default; }

/* Possible duplicates */
.dup-help { font-size: 13px; color: var(--muted); }
.dup-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.dup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8f9fb; }
.dup-reasons { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.dup-reasons .tag { font-size: 11px; }
.dup-actions { display: flex; gap: 6px; white-space: nowrap; }
table.dup-table { table-layout: fixed; width: 100%; margin: 0; border: 0; }
table.dup-table th, table.dup-table td { vertical-align: middle; }
table.dup-table .center { text-align: center; }
table.dup-table .dup-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.dup-table .dup-domains { white-space: normal; }
table.dup-table .dup-domains .tag { margin: 1px 2px 1px 0; }
table.dup-table tr.dup-keep td { background: var(--accent-soft); }
table.dup-table tr.dup-keep .dup-name a { font-weight: 600; }
.cal-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; padding: 8px 12px; margin-bottom: 10px; background: var(--accent-soft); border-radius: var(--radius); }

/* Dashboard week calendar */
.week-panel h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-nav { margin-left: auto; display: flex; gap: 4px; text-transform: none; letter-spacing: 0; }
.week-grid { display: grid; gap: 8px; }
.week-day { background: #f6f7f9; border-radius: var(--radius); padding: 6px; min-height: 120px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.week-day.today { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.week-day.past { opacity: .75; }
.week-date { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: baseline; margin-bottom: 2px; }
.week-date strong { font-size: 15px; color: var(--text); }
.week-day.today .week-date strong { color: var(--accent); }
.cal-event.week-event { white-space: normal; padding: 5px 7px; background: var(--panel); border: 1px solid var(--line); line-height: 1.3; }
.cal-event.week-event.ext { background: #e4ecfb; border-color: #c9d8f5; }
.week-time { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.week-title { display: block; font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.week-co { display: inline-block; margin-top: 2px; margin-right: 3px; font-size: 10.5px; padding: 0 5px; border-radius: 3px; background: #fff; color: #1d4ed8; }
.week-empty { font-size: 12px; padding: 4px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: 1fr !important; } .week-day { min-height: 0; } }
.clist-holder { list-style: none; text-align: center; padding: 8px 0 2px; display: block !important; border: 0 !important; }
.clist [hidden] { display: none !important; }

/* Land search */
main:has(.land) { padding: 0; max-width: none; }
.land-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; overflow-y: auto; }
.land-side-head { padding: 8px 14px 2px; }
.land-side-head h1 { font-size: 18px; margin: 0 0 2px; }
.land-filters { padding: 6px 14px 8px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.land-filters input:not([type=checkbox]), .land-filters select { width: 100%; }
.lf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.lf-grid label, .lf-status { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.lf-checks { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.lf-checks a { margin-left: 4px; color: var(--muted); }
.lf-group summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.land-count { padding: 8px 14px; font-size: 13px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.land-results { list-style: none; margin: 0; padding: 0; }
.land-count { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.land-results li { display: flex; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; align-items: flex-start; }
.land-results li:hover, .land-results li.on { background: var(--accent-soft); }
.lr-score { min-width: 30px; text-align: center; color: #fff; border-radius: 5px; font-weight: 700; font-size: 12px; padding: 2px 0; }
.map-search-results div { padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.map-search-results div:hover { background: var(--accent-soft); }
.ml-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-top: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }
.lg.h { background: #1aa34a; } .lg.m { background: #f0a500; } .lg.l { background: #9aa3ad; } .lg.k { background: #d7301f; } .lg.p { background: #1e6bff; } .lg.w { background: #9b59ff; }
.land-card { padding: 14px 16px; font-size: 13px; }
.land-card section { margin-top: 14px; }
.land-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.lc-head { display: flex; gap: 12px; align-items: flex-start; }
.lc-head h2 { margin: 0; font-size: 17px; }
.lc-net { font-size: 13px; font-weight: 400; }
.lc-title { flex: 1; }
.lc-close { font-size: 18px; color: var(--muted); }
.lc-score { min-width: 46px; height: 46px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.lc-score.sh { background: #1aa34a; } .lc-score.sm { background: #f0a500; } .lc-score.sl { background: #9aa3ad; } .lc-score.sk { background: #d7301f; }
.lc-killers { margin-top: 10px; background: var(--bad-bg); color: var(--bad); border-radius: var(--radius); padding: 6px 10px; font-weight: 600; }
.lc-status { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.lc-status .on.st-pursue { background: #1e6bff; border-color: #1e6bff; color: #fff; }
.lc-status .on.st-watch { background: #9b59ff; border-color: #9b59ff; color: #fff; }
.lc-status .on.st-pass { background: #5b6470; border-color: #5b6470; color: #fff; }
.lc-reason { flex: 1; min-width: 120px; font-size: 12px; padding: 3px 6px; }
.lc-small { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.lc-dl { display: grid; grid-template-columns: 96px 1fr; gap: 3px 10px; margin: 0; }
.lc-dl dt { color: var(--muted); }
.lc-dl dd { margin: 0; overflow-wrap: anywhere; }
.lc-reasons { list-style: none; margin: 0; padding: 0; }
.lc-reasons li { display: flex; gap: 8px; padding: 2px 0; }
.lc-reasons .pts { min-width: 28px; text-align: right; font-weight: 700; color: var(--good); }
.lc-reasons .r-warn .pts { color: var(--muted); }
.lc-reasons .r-bad .pts, .lc-reasons .r-bad { color: var(--bad); }
.lc-table { width: 100%; border-collapse: collapse; }
.lc-table th { text-align: left; color: var(--muted); font-weight: 400; vertical-align: top; width: 120px; padding: 3px 8px 3px 0; }
.lc-table td { padding: 3px 0; vertical-align: top; }
.lc-table tr + tr th, .lc-table tr + tr td { border-top: 1px solid #f0f2f5; }
.lc-confirm { margin: 0; padding-left: 18px; color: var(--warn); }
.lc-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.lf-tree { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.lf-tree a { color: var(--muted); margin-left: 4px; }
.lf-tree label { display: inline; }
.lf-l1 { font-weight: 600; }
.lf-caret { all: unset; cursor: pointer; display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; color: #4a5563; font-size: 14px; vertical-align: middle; }
.lf-caret::before { content: "▾"; }
.lf-caret.shut::before { content: "▸"; }
.lf-caret:focus-visible { outline: 2px solid #1e6bff; border-radius: 3px; }
.lf-kids[hidden] { display: none; }
.lf-region { margin-left: 14px; }
.lf-l2 { font-weight: 500; }
.lf-county { margin-left: 18px; }
.tools-panel label { display: block; margin: 4px 0; }
.tools-panel select, .tools-panel input:not([type=radio]) { width: 100%; margin-top: 2px; }
.tools-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tools-tabs button { border: 0; background: none; padding: 4px 8px; border-radius: var(--radius); color: var(--muted); }
.tools-tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tools-tabs .tools-close { margin-left: auto; }
.tools-seg { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.tool-result { margin: 8px 0; font-size: 14px; }
.tool-result:empty { display: none; }
.tools-actions { display: flex; gap: 6px; }
.heat-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.heat-legend i, .route-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.drive-pin { background: #111; color: #fff; border: 2px solid #fff; border-radius: 50%; text-align: center; font-weight: 700; line-height: 18px; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.qd-grip { height: 8px; cursor: ns-resize; background: linear-gradient(#e3e6eb, #e3e6eb) center / 48px 3px no-repeat; }
.qd-grip:hover { background-color: var(--accent-soft); }
.qd-head { display: flex; align-items: center; gap: 8px; padding: 2px 12px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.qd-head .spacer { flex: 1; }
.qd-body { flex: 1; display: grid; grid-template-columns: 1fr 260px; min-height: 0; }
.qd-table-wrap { overflow: auto; }
.qd-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.qd-table th { position: sticky; top: 0; background: #fafbfc; color: var(--muted); font-weight: 600; text-align: left; padding: 5px 6px; white-space: nowrap; }
.qd-table td { padding: 3px 6px; border-top: 1px solid #f0f2f5; white-space: nowrap; }
.qd-table input, .qd-table select { font-size: 12px; padding: 2px 4px; }
.qd-table .num { text-align: right; }
.qd-summary { border-left: 1px solid var(--line); padding: 8px 12px; overflow-y: auto; font-size: 13px; }
.qd-kv { display: flex; justify-content: space-between; padding: 2px 0; }
.qd-verdict { padding: 6px 8px; border-radius: var(--radius); font-weight: 600; margin-bottom: 6px; }
.qd-verdict.ok { background: var(--good-bg); color: var(--good); }
.qd-verdict.bad { background: var(--bad-bg); color: var(--bad); }
.qd-pin span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; background: #e31a1c; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: move; }
.qd-pin.bad span { background: #111; outline: 2px solid #e31a1c; }

.asm-main { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.asm-owners { margin: 2px 0 6px; }
.asm-actions { display: flex; gap: 6px; }
.site-dialog { border: 0; border-radius: 10px; padding: 18px 20px; width: min(440px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.site-dialog h3 { margin: 0 0 10px; }
.site-dialog label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.site-dialog input, .site-dialog select, .site-dialog textarea { width: 100%; color: var(--text); font-size: 14px; }
.site-dialog-actions { display: flex; gap: 8px; align-items: center; }
.site-dialog-actions .spacer { flex: 1; }
.lc-asm { margin-top: 8px; font-size: 12px; }

.proj-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
/* minmax(0, …) keeps the single phone column at the screen's width; a plain 1fr grows to its widest table. */
@media (max-width: 1000px) { .proj-layout { grid-template-columns: minmax(0, 1fr); } }
.campus-card { padding: 0; overflow: hidden; }
.campus-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px 14px; background: var(--accent-soft); flex-wrap: wrap; }
.campus-head h2 { margin: 0; font-size: 18px; }
.campus-stats { font-size: 13px; color: var(--muted); }
.campus-sites { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }

/* Land search layout: filters | (toolbar / map + docked card / docked QD drawer) */
.land { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  height: calc(var(--main-vh, 100vh) - var(--topbar-h)); }  /* fills the window under the top bar, with no page scroll */
.land.side-closed { grid-template-columns: 0 minmax(0, 1fr); }
.land.side-closed .land-side { visibility: hidden; border: 0; }
.land-side { grid-row: 2; }
.land-work { grid-row: 2; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; }
.land-toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; position: relative; z-index: 1000; }
.tb-title { font-weight: 700; font-size: 15px; margin-right: 6px; cursor: default; }
.tb-btn, .tb-select { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tb-btn:hover, .tb-select:hover { border-color: #c7ccd4; background: #fafbfc; }
.tb-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-select { padding-right: 2px; max-width: 150px; }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.tb-spacer { flex: 1; }
.tb-menu { position: relative; }
.tb-menu > summary { list-style: none; }
.tb-menu > summary::-webkit-details-marker { display: none; }
.tb-menu[open] > summary { border-color: var(--accent); }
.tb-pop { position: absolute; top: 36px; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px 12px; width: 260px; display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; max-height: 70vh; overflow-y: auto; }
.tb-right .tb-pop { left: auto; right: 0; }
.ml-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-top: 6px; }
.map-search { position: relative; width: clamp(150px, 17vw, 320px); }
.map-search input { width: 100%; height: 30px; }
.map-search-results { position: absolute; top: 34px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.2); max-height: 360px; overflow-y: auto; z-index: 1001; }
.views-pop { width: 300px; }
[data-tool-key="layers"] .tb-pop { width: 320px; }
.view-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.view-actions { margin-left: auto; display: flex; gap: 8px; font-size: 12px; }
.view-actions a { color: var(--muted); }
.view-form { display: flex; flex-direction: column; gap: 4px; }
.view-form input[name=name] { width: 100%; }
.land [hidden] { display: none !important; }

.land-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; }
.land-map-wrap { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #dfe3e8; }
.land-card-wrap { width: clamp(300px, 30vw, 420px); overflow-y: auto; background: #fff; border-left: 1px solid var(--line); min-height: 0; }
.tools-panel { position: absolute; top: 10px; left: 54px; z-index: 900; width: 290px; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); padding: 10px 12px; font-size: 13px; }
.asm-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 890; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); padding: 8px 12px; max-width: min(640px, 70%); font-size: 13px; border-left: 4px solid #00e5ff; }
.map-legend { position: absolute; bottom: 22px; left: 10px; z-index: 800; background: rgba(255,255,255,.92); padding: 4px 8px;
  border-radius: var(--radius); font-size: 11px; display: flex; gap: 10px; }
.qd-drawer { height: 280px; min-height: 120px; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08); }
@media (max-width: 900px) {
  .land, .land.side-closed { grid-template-columns: 1fr; grid-template-rows: auto auto 80vh; height: auto; }
  .land-side { grid-row: 2; max-height: 45vh; }
  .land-work { grid-row: 3; }
  .land.side-closed .land-side { display: none; }
  .land-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .land-card-wrap { width: auto; max-width: none; max-height: 50vh; border-left: 0; border-top: 1px solid var(--line); }
}
.site-row { padding: 2px 0; }
.pill.site-acquired, .pill.site-contract { background: #e3ecff; color: #1e4fbf; }
.pill.site-loi { background: #def6fb; color: #00788f; }
.pill.site-outreach { background: var(--warn-bg); color: var(--warn); }
.pill.site-review { background: #efe6ff; color: #6b3fc0; }
.pill.site-dropped { background: #eef0f3; color: var(--muted); }
.inline-filter select { margin-left: 4px; }
.sites-table td { vertical-align: top; }
/* Active-site tables: fixed columns so every campus / project group lines up top to bottom */
.sites-active { table-layout: fixed; width: 100%; }
.sites-active th:nth-child(1) { width: 128px; }
.sites-active .pill { white-space: normal; display: inline-block; max-width: 100%; }
.sites-active th:nth-child(2) { width: 22%; }
.sites-active th:nth-child(3) { width: 78px; }
.sites-active th:nth-child(4) { width: 66px; }
.sites-active th:nth-child(5) { width: 17%; }
.sites-active th:nth-child(6) { width: 8%; }
.sites-active th:nth-child(7) { width: 78px; }
.sites-active th:nth-child(8) { width: 12%; }
.sites-active td { overflow-wrap: anywhere; }
.note-clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sites-active .deal-day { margin-top: 4px; font-size: 11px; color: var(--muted); }
.sites-table .num, .sites-table th.num { text-align: right; }
.sites-table .sites-note { max-width: 380px; color: var(--text); }
.ml-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.ml-prog > label { flex: 1; }
.ml-info { font-size: 13px; color: var(--muted); }
.ml-about { flex-basis: 100%; font-size: 12px; background: #f6f7f9; border-radius: var(--radius); padding: 6px 8px; margin: 2px 0 4px;
  display: flex; flex-direction: column; gap: 3px; }
.ml-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.pop-note { font-size: 12px; color: #444; margin: 4px 0; max-width: 300px; }
.lc-program { padding: 6px 0; border-top: 1px solid #f0f2f5; display: flex; flex-direction: column; gap: 2px; }
.lc-program:first-of-type { border-top: 0; }

/* Land site page: deal timeline */
.stage-track { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.stage-track li { position: relative; text-align: center; padding: 22px 4px 0; font-size: 12px; }
.stage-track li::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--line); }
.stage-track li:first-child::before { left: 50%; }
.stage-track li:last-child::before { right: 50%; }
.stage-track li.done::before { background: var(--accent); }
.stage-track .dot { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line); }
.stage-track li.done .dot { background: var(--accent); border-color: var(--accent); }
.st-label { font-weight: 600; }
.st-date { color: var(--muted); }
.st-gap { color: var(--accent); font-size: 11px; font-weight: 600; margin-top: 2px; }
.st-prev { color: var(--muted); font-size: 11px; }
.deal-clock { margin: 0 0 12px; font-size: 13px; }
.deal-clock b { font-size: 15px; }
.milestone-form label { display: grid; grid-template-columns: 1fr 150px 40px; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.note-add { display: flex; gap: 6px; margin-bottom: 10px; }
.note-add input { flex: 1; }
.site-events { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.site-events li { padding: 6px 0; border-top: 1px solid #f0f2f5; font-size: 13px; }
.site-events li.ev-status div { font-weight: 600; }
.site-events li.ev-milestone div { color: var(--accent); }
@media (max-width: 900px) { .stage-track { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } }

/* Sites page: deal timelines */
.gantt { position: relative; font-size: 12px; }
.gantt-axis { position: relative; height: 18px; margin-left: 300px; color: var(--muted); }
.gantt-axis span { position: absolute; transform: translateX(-2px); white-space: nowrap; }
.gantt-row { display: grid; grid-template-columns: 300px 1fr; align-items: center; min-height: 26px; border-top: 1px solid #f0f2f5; }
.gantt-name { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 8px; }
.gantt-name .pill { flex: none; }
.gantt-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-days { flex: none; min-width: 44px; text-align: right; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt-track { position: relative; height: 26px; }
.gantt-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #f0f2f5; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #e53935; opacity: .6; }
.gantt-bar { position: absolute; top: 10px; height: 6px; border-radius: 3px; background: #cfd8e3; }
.gantt-bar.site-loi { background: #9fe3ef; } .gantt-bar.site-contract, .gantt-bar.site-acquired { background: #a9c3ff; }
.gantt-bar.site-outreach { background: #ffe0a3; } .gantt-bar.site-review { background: #dccbff; }
.gantt-pt { position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15); background: #9aa3ad; display: inline-block; }
.gantt-legend .gantt-pt { position: static; margin: 0 4px 0 0; vertical-align: -2px; }
.ms-identified, .ms-contacted { background: #9aa3ad !important; }
.ms-loi_sent { background: #00b8d9 !important; } .ms-loi_signed { background: #00788f !important; }
.ms-psa_sent { background: #7c4dff !important; } .ms-psa_signed { background: #1e4fbf !important; }
.ms-feasibility_end, .ms-approvals, .ms-closed { background: #1aa34a !important; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0 300px; }
.gantt-today-key { display: inline-block; width: 2px; height: 12px; background: #e53935; margin-right: 4px; vertical-align: -2px; }
@media (max-width: 900px) { .gantt-row { grid-template-columns: 150px 1fr; } .gantt-axis, .gantt-legend { margin-left: 150px; } }

/* Site plan drawer */
.sp-drawer { height: 320px; }
.sp-body { flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; min-height: 0; }
.sp-col { padding: 6px 12px; overflow-y: auto; min-height: 0; font-size: 13px; }
.sp-col + .sp-col { border-left: 1px solid var(--line); }
.sp-zone label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.sp-zone select { width: 100%; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin: 6px 0; }
.sp-grid input { width: 100%; }
.sp-table input[type=number] { width: 72px; }
.sp-table select { max-width: 180px; }
.sp-mode { float: right; text-transform: none; letter-spacing: 0; font-weight: 400; }
.sp-mode label { margin-left: 8px; }
@media (max-width: 1100px) { .sp-body { grid-template-columns: 1fr; } .sp-col + .sp-col { border-left: 0; border-top: 1px solid var(--line); } }
details.archive > summary { cursor: pointer; padding: 2px 0; }
details.archive[open] > summary { margin-bottom: 8px; }
details.archive { background: #fafbfc; }
.archive-list > summary { cursor: pointer; }
.archive-list { background: #fafbfc; }

/* Assemblage tracker */
.acq-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: #eef0f3; margin: 6px 0; }
.acq-seg { display: block; height: 100%; }
.acq-seg.site-acquired, .acq-key.site-acquired { background: #1e4fbf; } .acq-seg.site-contract, .acq-key.site-contract { background: #3a7bd5; }
.acq-seg.site-loi, .acq-key.site-loi { background: #00a5c2; } .acq-seg.site-outreach, .acq-key.site-outreach { background: #f0a500; }
.acq-seg.site-review, .acq-key.site-review { background: #9b6dff; } .acq-seg.site-prospect, .acq-key.site-prospect { background: #9aa3ad; }
.acq-seg.site-dropped, .acq-key.site-dropped { background: #d5d9df; }
.acq-legend, .acq-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }
.acq-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.acq-hint { background: var(--warn-bg); color: var(--warn); padding: 6px 10px; border-radius: var(--radius); }
.deal-grid th.ms-col, .deal-grid td.ms-col { text-align: center; padding-left: 4px; padding-right: 4px; }
.deal-grid td.ms-done { color: var(--accent); font-weight: 600; }
.deal-grid .owner-row td { background: #f6f7f9; }
.deal-grid .deal-note { max-width: 220px; }
.deal-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sites-progress { display: flex; width: 120px; height: 8px; border-radius: 4px; overflow: hidden; background: #eef0f3; margin-top: 4px; }
.gantt-pt.gantt-sub { width: 7px; height: 7px; margin-left: -3.5px; top: 9.5px; border-width: 1px; opacity: .8; }
.gantt-legend .gantt-pt.gantt-sub { width: 8px; height: 8px; }

/* Site page mini map */
.site-map-panel { padding: 10px 12px; position: relative; }
.site-map-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.site-map-head h3 { margin: 0; }
.site-map-head .spacer { flex: 1; }
.site-map-head a.tb-btn { text-decoration: none; }
#site-map { height: 380px; border-radius: var(--radius); background: #dfe3e8; }
.site-map-panel .tb-menu { position: relative; }
.site-map-panel .tb-pop { position: absolute; top: 36px; right: 0; left: auto; z-index: 1000; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px 12px; width: 280px; display: flex; flex-direction: column;
  gap: 3px; font-size: 13px; max-height: 340px; overflow-y: auto; }
.site-map-panel .tb-menu > summary { list-style: none; }
.site-map-panel .tb-menu > summary::-webkit-details-marker { display: none; }
.site-map-legend { position: absolute; left: 22px; bottom: 18px; z-index: 800; }

/* Sites page stage filter */
.stage-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; }
.stage-filter-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 2px; }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px; text-decoration: none; }
.stage-chip:hover { text-decoration: none; border-color: #9aa3ad; }
.stage-chip b { font-weight: 600; color: var(--muted); }
.stage-chip.on { background: #1e2a3a; border-color: #1e2a3a; color: #fff; }
.stage-chip.on b { color: #cfd6df; }
.stage-chip.empty { opacity: .55; }
.stage-chip-archive { color: var(--muted); }

/* Site parcels: excluded / trimmed, and the trim bar on the mini map */
.row-excluded td { color: var(--muted); background: #f6f7f9; }
.row-excluded td a { color: var(--muted); }
.pill-excluded { background: #eceff3; color: #6b7480; border: 1px dashed #b8c0ca; }
.parcel-actions { white-space: nowrap; }
.parcel-actions form { display: inline; margin-left: 6px; }
.acq-key.key-excluded { background: rgba(154,163,173,.25); border: 1px dashed #9aa3ad; }
.acq-key.key-cutaway { background: rgba(255,255,255,.4); border: 1px dashed #6b7480; }
.trim-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; margin-bottom: 8px;
  background: #fff7ed; border: 1px solid #fdba74; border-radius: var(--radius); }
.trim-bar #trim-msg { color: #7c3a0a; }
.site-map-panel.trimming #site-map { cursor: crosshair; outline: 2px solid #ff7a00; }
.trim-bar .btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.trim-bar[hidden] { display: none; }

/* Zoning code detail on the parcel card */
.zd-card summary { cursor: pointer; font-size: 12px; color: #1e6bff; }
.zd-card .zd { border: 0; padding: 4px 0; font-size: 12px; }
.zd-card .zd-p, .zd-card .zd-ul li { font-size: 12px; }
.zd-card .zd-ul { margin: 2px 0 4px 16px; padding: 0; list-style: disc; }
.zd-card .zd-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #6b7480; margin-top: 6px; }
.zd-card .zd-t { width: 100%; border-collapse: collapse; } .zd-card .zd-t th { text-align: left; width: 72px; color: #6b7480; font-weight: 600; vertical-align: top; }

/* Campus summary (/campuses/<code>/) */
.campus-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .campus-layout { grid-template-columns: minmax(0, 1fr); } }
.campus-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.campus-item:last-of-type { border-bottom: 0; }
.campus-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.campus-owners { margin: 4px 0 0 18px; padding: 0; font-size: 12px; }
.campus-add summary { cursor: pointer; margin-top: 4px; }
.campus-form textarea { width: 100%; margin: 6px 0; }
.campus-update { padding: 2px 0; }
.campus-day { margin-bottom: 8px; font-size: 13px; }
.campus-feed { list-style: none; margin: 4px 0 0; padding: 0; }
.campus-feed li { padding: 2px 0; font-size: 12px; }
.campus-report-body { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.campus-report-print { white-space: pre-wrap; font-family: inherit; font-size: 14px; margin: 0; }

/* Contracts */
.pill.ct-drafting { background: #eef0f3; color: #3c4453; }
.pill.ct-negotiating { background: var(--warn-bg); color: var(--warn); }
.pill.ct-signed { background: #e3ecff; color: #1e4fbf; }
.pill.ct-closed { background: var(--good-bg); color: var(--good); }
.pill.ct-terminated { background: #eef0f3; color: var(--muted); text-decoration: line-through; }
.soon { color: var(--warn); font-weight: 600; }
.ct-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 16px; align-items: start; }
.ct-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--accent-soft); border-radius: var(--radius);
  padding: 8px 12px; margin: -6px 0 14px; font-size: 13px; }
.ct-deadlines { list-style: none; margin: 0; padding: 0; }
.ct-deadlines li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ct-deadlines li:last-child { border-bottom: 0; }
.ct-when { flex: 0 0 48px; font-weight: 600; }
.ct-ask textarea { margin-bottom: 6px; }
.ct-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ct-quick .chip { cursor: pointer; border: 1px solid var(--line); background: #fafbfc; color: var(--accent); font-weight: 500; }
.ct-answer { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 10px; }
.ct-answer.pinned { background: #fbfcf4; }
.ct-q { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ct-q .spacer { flex: 1; }
.ct-q form { display: inline-flex; gap: 8px; align-items: baseline; }
.ct-a { line-height: 1.55; }
.ct-a h4 { margin: 14px 0 4px; font-size: 14px; }
.ct-a p { margin: 6px 0; }
.ct-a ul, .ct-a ol { margin: 4px 0; padding-left: 20px; }
a.cite { display: inline-block; min-width: 16px; padding: 0 4px; margin: 0 1px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; vertical-align: super; }
a.cite:hover { background: var(--accent); color: #fff; text-decoration: none; }
.cite-pop { position: absolute; z-index: 50; width: min(440px, 90vw); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.14); padding: 10px 12px; font-size: 13px; }
.cite-pop .cite-where { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.cite-pop blockquote, .cr-def blockquote, .cr-panel blockquote { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--accent);
  background: #fafbfc; white-space: pre-wrap; max-height: 320px; overflow: auto; font-family: Georgia, "Times New Roman", serif; }
.ct-sources { font-size: 12px; margin-top: 4px; }
.ct-sources q, .ct-source-list q { display: block; color: var(--muted); margin: 2px 0 6px; }
.ct-chain { list-style: none; margin: 0; padding: 0; }
.ct-doc { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ct-doc:last-child { border-bottom: 0; }
.ct-doc.superseded { opacity: .65; }
.ct-sub { margin: 14px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tag.ct-from-us { background: #e3ecff; color: #1e4fbf; }
.tag.ct-from-them { background: var(--warn-bg); color: var(--warn); }
.ct-add { margin-top: 10px; }
.ct-add > summary { list-style: none; cursor: pointer; }
.ct-add > summary::-webkit-details-marker { display: none; }
.ct-edit summary { cursor: pointer; color: var(--accent); display: inline; }
.ct-edit .fields label { display: block; margin: 4px 0; }
.ct-edit .fields input, .ct-edit .fields select { width: 100%; }
.ct-dates td { vertical-align: top; }
.ct-dates tr.ct-done td { color: var(--muted); text-decoration: line-through; }
.ct-dates tr.ct-done td form, .ct-dates tr.ct-done td details { text-decoration: none; }
.ct-check { border: 0; background: none; font-size: 16px; padding: 0 4px; color: var(--accent); }
.ct-proposed { background: #fffbea; border: 1px solid #f1e3b0; border-radius: var(--radius); padding: 8px; margin-bottom: 10px; }
.ct-owner { display: block; padding: 2px 0; }
.ct-template { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ct-template:last-child { border-bottom: 0; }
.ct-template .btn-small { float: right; }
.cr-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cr-docs .chip { background: #eef0f3; color: #3c4453; font-weight: 500; padding: 3px 8px; }
.cr-docs .chip.active { background: var(--accent); color: #fff; }
.cr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cr-side { position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(var(--main-vh, 100vh) - var(--topbar-h) - 24px); overflow: auto; }
/* Documents read like paper: letter-size sheets on a grey desk, one per page, 1-inch margins. */
.cr-desk { background: #e4e7ec; border-radius: var(--radius); padding: 24px 16px; min-height: 60vh; }
.cr-doc { display: grid; gap: 20px; justify-items: center; }
.cr-page, .cr-sheet { width: 100%; max-width: 816px; min-height: 1056px; background: #fff; padding: 72px 76px 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.cr-sheet { margin: 0 auto; min-height: 400px; display: block; }
.cr-page-no { color: #8a919c; font-size: 11px; text-align: center; margin-top: auto; padding-top: 24px; font-family: Georgia, serif; }
.cr-text { white-space: pre-wrap; font-family: "Times New Roman", Times, Georgia, serif; font-size: 15px; line-height: 1.5;
  color: #111; flex: 1; }
.cr-pdf { width: 100%; height: calc(100vh - 170px); min-height: 600px; border: 0; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cr-bar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg-btn { padding: 4px 10px; font-size: 12px; color: var(--text); }
.seg-btn.on { background: var(--accent); color: #fff; }
.seg-btn:hover { text-decoration: none; }
@media (max-width: 700px) { .cr-desk { padding: 8px 0; } .cr-page, .cr-sheet { padding: 28px 20px; min-height: 0; } }
.cr-term { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
  border-bottom: 1px dotted #7d8ba1; border-radius: 0; }
.cr-term:hover { background: var(--accent-soft); }
.cr-xref { border-bottom: 1px solid #b9c7dc; }
.cr-badge { display: inline-block; font-family: system-ui, sans-serif; font-size: 11px; background: var(--warn-bg); color: var(--warn);
  border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.cr-hl { background: #fff1a8; padding: 1px 0; }
.cr-anchor { scroll-margin-top: 12px; }
#hl { scroll-margin-top: 80px; }
.cr-def { margin-bottom: 10px; }
.cr-outline ul { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.cr-outline li { padding: 2px 0; }
.rl { white-space: pre-wrap; font-family: "Times New Roman", Times, Georgia, serif; font-size: 15px; line-height: 1.6; color: #111; }
/* A redline as Word shows one: each author's changes in their color, struck or double-underlined, with a change bar. */
.rl del { color: var(--rl-c, var(--bad)); text-decoration: line-through; text-decoration-thickness: 1px; }
.rl ins { color: var(--rl-c, #1d4ed8); text-decoration: underline double; text-underline-offset: 2px; }
.rl-chg { --rl-c: #c0261f; box-shadow: -10px 0 0 -8px var(--rl-c); border-radius: 2px; cursor: pointer; }
.rl-chg:hover { background: #fff6c8; }
.rl-n { font-family: system-ui, sans-serif; font-size: 9px; font-weight: 700; color: #fff; background: var(--rl-c);
  border-radius: 7px; padding: 0 4px; margin-right: 2px; vertical-align: super; line-height: 1; }
.rl-page { display: block; margin: 18px -76px; border-top: 1px dashed #c9ced6; text-align: center; font: 11px Georgia, serif;
  color: #8a919c; line-height: 0; }
.rl-a0 { --rl-c: #c0261f; } .rl-a1 { --rl-c: #1d4ed8; } .rl-a2 { --rl-c: #15803d; } .rl-a3 { --rl-c: #a21caf; }
.rl-a4 { --rl-c: #c2410c; } .rl-a5 { --rl-c: #0e7490; }
.rl-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 10px; }
.rl-key { display: inline-flex; align-items: center; gap: 5px; }
.rl-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--rl-c); display: inline-block; }
.rl-legend del { color: var(--bad); } .rl-legend ins { color: #1d4ed8; text-decoration: underline double; }
.rl-item { border-left: 3px solid var(--rl-c, var(--line)); background: #fff; border-radius: var(--radius); padding: 8px 10px;
  margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); scroll-margin-top: 50px; }
.rl-item-head { display: flex; gap: 6px; align-items: baseline; border: 0; background: none; padding: 0; font: inherit;
  text-align: left; cursor: pointer; width: 100%; }
.rl-num { background: var(--rl-c, var(--accent)); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 6px; }
.rl-who { font-size: 12px; color: var(--muted); }
.rl-diff { margin: 4px 0; font-family: Georgia, serif; }
.rl-diff del { color: var(--bad); } .rl-diff ins { color: #1d4ed8; }
.rl-claude { display: flex; gap: 6px; flex-wrap: wrap; }
.rl-new summary { cursor: pointer; list-style: none; color: var(--accent); }
.rl-new textarea { width: 100%; margin: 4px 0; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #ffe27a; } 100% { background: transparent; } }
/* Word tracked changes inside the reader */
.tc-ins { color: #1d4ed8; text-decoration: underline double; }
.tc-del { color: var(--bad); text-decoration: line-through; }
.cr-legend { margin: 0 0 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.cr-legend ins { color: #1d4ed8; } .cr-legend del { color: var(--bad); }
/* Comments sidebar */
.cr-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; position: sticky; top: 0;
  background: var(--bg); z-index: 2; }
.cr-tabs .tab { border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; }
.cr-tabs .tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.cr-tabs .count { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.cm-hint { margin-top: 0; }
.cm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px;
  font-size: 13px; scroll-margin-top: 50px; }
.cm-card.cm-claude { border-left: 3px solid #d97706; background: #fffcf5; }
.cm-card.cm-resolved { opacity: .7; }
.rl-item .cm-card { margin: 6px 0 4px; box-shadow: none; }
.cm-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.cm-head .spacer { flex: 1; }
.cm-head form { display: inline-flex; gap: 6px; }
.cm-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase; flex: none; }
.cm-avatar-claude { background: #d97706; }
.cm-quote { display: block; border: 0; border-left: 3px solid #f2c94c; background: #fffbea; margin: 6px 0; padding: 3px 8px;
  font: italic 12px Georgia, serif; color: #5b4a10; text-align: left; cursor: pointer; width: 100%; }
.cm-body p { margin: 4px 0; }
.cm-reply { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.cm-reply-form { display: flex; gap: 6px; margin-top: 6px; align-items: flex-start; }
.cm-reply-form textarea { flex: 1; min-height: 30px; font-size: 12px; }
.cm-done { margin-top: 10px; }
.cm-mark { background: #fff1b8; border-bottom: 2px solid #f2c94c; cursor: pointer; }
.cm-mark.hover, .cm-mark.flash { background: #ffd95a; }
.cm-add { position: absolute; z-index: 60; border: 0; background: var(--accent); color: #fff; border-radius: 16px; padding: 5px 12px;
  font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; }
.cm-pop { position: absolute; z-index: 61; width: 330px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 10px; }
.cm-pop textarea { width: 100%; margin: 6px 0; }
.cm-pop-quote { font-style: italic; max-height: 60px; overflow: hidden; }
.mention-menu { position: absolute; z-index: 70; list-style: none; margin: 0; padding: 4px 0; background: #fff; min-width: 220px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.15); font-size: 13px; }
.mention-menu li { padding: 4px 10px; cursor: pointer; }
.mention-menu li.on, .mention-menu li:hover { background: var(--accent-soft); }
.ct-ccount { font-size: 11px; margin-left: 4px; }
/* Summaries: every cited line opens its source */
.citable { cursor: pointer; border-radius: 3px; }
.citable:hover { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-facts a { color: inherit; border-bottom: 1px dotted #9aa3ad; }
.ct-facts a:hover { color: var(--accent); text-decoration: none; }
/* Closing timeline */
.tl-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tl-eff input { margin-left: 6px; }
.tl-versions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-check { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px;
  font-size: 12px; background: #fff; cursor: pointer; }
.chip-check.chip-exec { border-color: #9fd3b4; background: var(--good-bg); }
.tl-whatif { background: var(--warn-bg); color: var(--warn); }
.tl-k-deposit, .tl-k-hard, .tl-k-payment { --tl-c: #15803d; }
.tl-k-feasibility, .tl-k-title, .tl-k-approval { --tl-c: #b45309; }
.tl-k-closing { --tl-c: #1f3a5f; }
.tl-k-expiration, .tl-k-notice { --tl-c: #b91c1c; }
.tl-k-extension { --tl-c: #7c3aed; }
.tl-k-covenant, .tl-k-other { --tl-c: #6b7280; }
.tl-k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tl-c, var(--accent)); margin: 0 4px 0 8px; }
.tl-key { margin-top: 10px; }
/* Overview: dots on a track, names in their own column, so nothing hangs off either end */
.tl-overview { display: grid; gap: 4px; }
.tl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; }
.tl-name { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-axis { position: relative; height: 16px; margin: 0 10px; }
.tl-tick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-tick:first-child { transform: none; }
.tl-tick.tl-today { color: var(--bad); font-weight: 600; }
.tl-track { position: relative; height: 26px; margin: 0 10px; border-radius: 13px; background: #f1f3f6; }
.tl-grid { position: absolute; top: 4px; bottom: 4px; border-left: 1px solid #dfe3e8; }
.tl-now { position: absolute; top: -3px; bottom: -3px; border-left: 2px dashed var(--bad); }
.tl-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--tl-c, var(--accent)); border: 2px solid var(--tl-c, var(--accent)); box-shadow: 0 0 0 2px #fff; }
.tl-dot:hover { transform: scale(1.3); text-decoration: none; z-index: 2; }
.tl-dot.tl-computed { background: #fff; }
.tl-dot.tl-done { opacity: .4; }
.tl-count { position: absolute; top: -9px; right: -9px; background: #fff; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; font-size: 9px; line-height: 14px; min-width: 14px; text-align: center; padding: 0 2px; }
@media (max-width: 700px) { .tl-row { grid-template-columns: 1fr; gap: 2px; } }
/* Month-by-month list */
.tl-agenda, .tl-agenda ol { list-style: none; margin: 0; padding: 0; }
.tl-month { margin-bottom: 12px; }
.tl-month-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: 4px 0; margin-bottom: 4px; }
.tl-item { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 6px 0 6px 0; border-left: 3px solid var(--tl-c, var(--line));
  padding-left: 10px; margin: 4px 0; scroll-margin-top: 60px; }
.tl-item:target { background: #fffbea; }
.tl-item.done { opacity: .55; }
.tl-item.late .tl-label { color: var(--bad); }
.tl-when { text-align: center; line-height: 1.1; }
.tl-when b { display: block; font-size: 18px; }
.tl-when span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.tl-label { font-weight: 600; }
.tl-late { background: var(--bad-bg); color: var(--bad); font-size: 11px; }
.tl-soon { background: var(--warn-bg); color: var(--warn); font-size: 11px; }
.tl-scroll { overflow-x: auto; }
.tl-table td { vertical-align: top; }
.tl-table tr.tl-changed td { background: #fffbea; }
.tl-diff { background: var(--warn-bg); color: var(--warn); font-size: 10px; }
.tl-cell { color: inherit; }
/* Extensions */
.tl-ext { border: 1px solid #ddd3fb; background: #faf8ff; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.tl-ext.done { border-color: var(--line); background: #fafbfc; }
.tl-ext-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-move { margin: 10px 0 6px; display: grid; gap: 2px; }
.tl-move-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 18px 110px 110px; gap: 6px; align-items: center;
  padding: 4px 8px; background: #fff; border-radius: 4px; font-size: 13px; }
.tl-move-row.main { font-weight: 600; border: 1px solid #c9bdf5; }
.tl-move-row.opt { cursor: pointer; color: var(--muted); }
.tl-move-row.opt:has(input:checked) { color: var(--text); }
.tl-from { color: var(--muted); text-decoration: line-through; }
.tl-to { font-weight: 600; color: #5b21b6; }
.tl-arrow { color: var(--muted); }
.tl-ext-go { margin-top: 6px; }
@media (max-width: 700px) { .tl-move-row { grid-template-columns: 1fr auto auto; } .tl-move-row > :nth-child(3), .tl-move-row > :nth-child(5) { display: none; } }
/* The executed agreement */
.ct-executed { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--good-bg); border: 1px solid #9fd3b4;
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.ct-exec-badge { background: var(--good); color: #fff; font-weight: 700; font-size: 12px; border-radius: 12px; padding: 2px 10px; white-space: nowrap; }
.ct-executed > div { flex: 1; min-width: 220px; }
.tag.ct-exec { background: var(--good); color: #fff; }
.ct-upnext { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.ct-upnext li { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; font-size: 13px; border-left: 3px solid var(--tl-c, var(--line)); padding-left: 8px; }
/* Drag-and-drop upload */
.dropzone { border: 2px dashed #c3cad4; border-radius: 10px; background: #fafbfc; padding: 14px; margin-top: 10px; transition: background .15s, border-color .15s; }
.dropzone.dz-over { border-color: var(--accent); background: var(--accent-soft); }
.dz-target { display: flex; gap: 12px; align-items: center; }
.dz-target > div:not(.dz-icon) { flex: 1; }
.dz-icon { flex: none; }
.dz-icon { font-size: 26px; color: var(--accent); width: 36px; text-align: center; }
.dz-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.dz-list:empty { display: none; }
.dz-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.dz-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-what { grid-column: 1 / -1; color: var(--muted); }
.dz-row.working .dz-state { color: var(--muted); animation: dzpulse 1.2s infinite; }
.dz-row.ok .dz-state { color: var(--good); font-weight: 700; }
.dz-row.failed { border-color: #f0b8b3; } .dz-row.failed .dz-state { color: var(--bad); }
.dz-next { justify-self: start; }
@keyframes dzpulse { 50% { opacity: .4; } }
/* Dashboard critical dates calendar */
.cc-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cc-tag { border: 1px solid var(--cc, var(--line)); color: var(--cc, var(--text)); background: #fff; opacity: .45; cursor: pointer; }
.cc-tag.on { opacity: 1; background: var(--cc-bg, #fff); }
.cc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cc-dow { font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 6px; border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); background: #fafbfc; }
.cc-day { min-height: 92px; padding: 3px 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cc-day.out { background: #fafbfc; }
.cc-day.out .cc-num { color: #b6bcc5; }
.cc-day.today { background: #f2f7ff; }
.cc-day.today .cc-num { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 6px; display: inline-block; }
.cc-num { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.cc-item { display: block; font-size: 11px; line-height: 1.3; padding: 2px 4px; margin-bottom: 2px; border-radius: 3px;
  border-left: 3px solid var(--cc, var(--accent)); background: var(--cc-bg, var(--accent-soft)); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; }
.cc-item[hidden] { display: none; }
.cc-item:hover { text-decoration: none; filter: brightness(.96); }
.cc-item b { font-size: 10px; color: var(--cc, var(--accent)); }
.cc-item.done { opacity: .55; text-decoration: line-through; }
.cc-item.late { box-shadow: inset 0 0 0 1px var(--bad); }
.cc-what { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-t-psa, .cc-t-option, .cc-t-loi, .cc-t-contract { --cc: #1f3a5f; --cc-bg: #e8eef6; }
.cc-t-pda { --cc: #7c3aed; --cc-bg: #f1ebfe; }
.cc-t-lease { --cc: #0e7490; --cc-bg: #e0f4f8; }
.cc-t-dd { --cc: #b45309; --cc-bg: #fdf1e1; }
.cc-t-closing { --cc: #15803d; --cc-bg: #e3f4ea; }
.cc-t-entitlement { --cc: #a21caf; --cc-bg: #fbe8fb; }
.cc-t-task { --cc: #b91c1c; --cc-bg: #fbe5e3; }
@media (max-width: 800px) { .cc-day { min-height: 60px; padding: 2px; } .cc-item { font-size: 10px; } .cc-what { display: none; } }
.rl-same { display: inline; }
.rl-same summary { display: inline; cursor: pointer; color: var(--muted); font-family: system-ui, sans-serif; font-size: 12px; }
.rl-same[open] summary { display: none; }
@media (max-width: 1100px) { .ct-layout, .cr-layout { grid-template-columns: minmax(0, 1fr); } .cr-side { position: static; max-height: none; } }

/* Due diligence and closing */
.print-only { display: none; }
@media print { .print-only { display: inline; } .dd-more { display: none; } }
.dd-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dd-strip > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.dd-strip .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dd-strip .value { font-size: 18px; font-weight: 600; margin: 2px 0; }
.dd-strip .fields select, .dd-strip .fields textarea { width: 100%; margin: 4px 0; }
.dd-risk { border-color: #f1d9a8; background: #fffbea; }
.dd-risk ul { margin: 0; padding-left: 18px; }
.dd-table td { vertical-align: top; }
.dd-table tr.dd-clear td:nth-child(2) b { color: var(--good); }
.dd-table tr.dd-issue td:nth-child(2) b { color: var(--bad); }
.dd-table tr.dd-waived td { color: var(--muted); }
.dd-table tr.dd-late td:first-child { box-shadow: inset 3px 0 var(--bad); }
.dd-table tr.dd-more td { border-top: 0; padding-top: 0; }
.dd-status { font-size: 12px; padding: 2px 4px; }
.dd-findings { margin-top: 3px; max-width: 520px; }
.dd-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; margin: 6px 0; }
.dd-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.dd-form .dd-wide { grid-column: 1 / -1; }
.dd-summary { margin: 4px 0; }
.dd-summary > summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.dd-claude { display: inline-block; margin-left: 10px; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cl-list li:last-child { border-bottom: 0; }
.cl-list li.cl-done .cl-name { color: var(--muted); text-decoration: line-through; }
.cl-list li.cl-na .cl-name { color: var(--muted); }
.cl-list .cl-name { flex: 1; }
.cl-side { margin: 10px 0 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lc-owned { background: var(--good-bg); color: var(--good); border-radius: var(--radius); padding: 4px 8px; margin: 6px 0; font-size: 12px; }

/* Entitlements */
.pill.en-planned { background: #eef0f3; color: #3c4453; }
.pill.en-preapp, .pill.en-submitted { background: #e3ecff; color: #1e4fbf; }
.pill.en-review, .pill.en-hearing { background: var(--warn-bg); color: var(--warn); }
.pill.en-approved { background: var(--good-bg); color: var(--good); }
.pill.en-denied, .pill.en-expired { background: var(--bad-bg); color: var(--bad); }
.pill.en-withdrawn { background: #eef0f3; color: var(--muted); text-decoration: line-through; }
.en-steps { list-style: none; margin: 0; padding: 0; }
.en-steps li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.en-steps li:last-child { border-bottom: 0; }
.en-steps .en-date { flex: 0 0 96px; font-weight: 600; }
.en-steps .en-what { flex: 1; }
.en-steps li.en-done .en-date, .en-steps li.en-done .en-what b { color: var(--muted); }
.en-steps li.en-missed .en-date { color: var(--bad); }
.en-matrix label { font-size: 13px; }
.en-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 12px; margin: 8px 0; }
.en-kinds label { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
@media (max-width: 900px) { .en-kinds { grid-template-columns: 1fr 1fr; } }

/* Build records */
tr.bd-phase td { background: #fafbfc; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding-top: 8px; }
tr.bd-done td { color: var(--muted); }
tr.bd-done td b { font-weight: 500; }
tr.bd-selected td { background: var(--good-bg); }
tr.bd-out td { color: var(--muted); }
tr.bd-total td { font-weight: 700; border-top: 2px solid var(--line); }
.bd-claude { display: grid; gap: 8px; margin: 12px 0 4px; padding: 10px; background: var(--accent-soft); border-radius: var(--radius); }
.bd-claude textarea { margin-bottom: 4px; }

/* Tenant site fit */
.tf-score { display: inline-block; min-width: 34px; padding: 2px 6px; border-radius: 99px; font-weight: 700;
  text-align: center; background: var(--good-bg); color: var(--good); }
.tf-score.tf-fails { background: #eef0f3; color: var(--muted); }
.tf-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.tf-checks li::before { display: inline-block; width: 14px; font-weight: 700; }
.tf-checks li.tf-ok::before { content: "✓"; color: var(--good); }
.tf-checks li.tf-no::before { content: "✕"; color: var(--bad); }
.tf-checks li.tf-maybe::before { content: "?"; color: var(--warn); }
.tf-checks li.tf-no b { color: var(--bad); }
@media (max-width: 900px) { .dd-strip, .dd-form { grid-template-columns: 1fr 1fr; } }
@media print { .ct-print { border: 0; padding: 0; } a.cite { background: none; } }

/* Report layout: add / remove sections */
.report-layout .rl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 10px; }
.report-layout fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0; background: #fff; }
.report-layout legend { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 6px; }
.report-layout fieldset label { display: block; padding: 3px 0; font-size: 13px; }
.report-layout .rl-site { display: block; padding: 4px 0; font-size: 13px; }
.report-layout .rl-actions { margin: 12px 0 0; }
.rl-sections { display: grid; gap: 2px; max-width: 560px; }
.rl-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.rl-row:hover { border-color: #9aa3ad; }
.rl-extra { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); max-width: 720px; }
.rl-extra input[type=text], .rl-extra textarea { width: 100%; box-sizing: border-box; }

/* Sites page: stat tiles, grouped site cards */
.sites-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 2px 0 14px; }
.sites-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 120px; }
.sites-stats b { display: block; font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sites-stats span { font-size: 12px; color: var(--muted); }
.sites-timeline > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; }
.sites-timeline > summary::-webkit-details-marker { display: none; }
.sites-timeline > summary h3 { display: inline; margin: 0; }
.sites-timeline > summary::before { content: "\25B8"; color: var(--muted); }
.sites-timeline[open] > summary::before { content: "\25BE"; }
.sites-timeline .gantt { margin-top: 10px; }
.compare-bar { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; gap: 10px; align-items: center; padding: 8px 14px; margin: 0 0 12px;
  background: #1e2a3a; color: #fff; border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.compare-bar[hidden] { display: none; }
.compare-bar .muted { color: #b6c0cd; }
.compare-bar .spacer { flex: 1; }
.site-group { margin: 0 0 24px; }
.sg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 0 2px 8px; margin-bottom: 10px; border-bottom: 2px solid var(--line); }
.sg-head h2 { margin: 0; font-size: 18px; }
.sg-meta { color: var(--muted); font-size: 13px; flex: 1; }
.sg-meta b { color: var(--text); }
.sg-all { font-size: 12px; color: var(--muted); cursor: pointer; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.site-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-top: 4px solid #9aa3ad;
  border-radius: 10px; padding: 12px 14px; transition: box-shadow .15s; }
.site-card:hover { box-shadow: 0 6px 18px rgba(20,30,50,.10); }
.site-card.site-acquired, .site-card.site-contract { border-top-color: #1e4fbf; }
.site-card.site-loi { border-top-color: #00a5c2; }
.site-card.site-outreach { border-top-color: #f0a500; }
.site-card.site-review { border-top-color: #9b6dff; }
.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-top .spacer { flex: 1; }
.sc-check { display: inline-flex; margin: 0; cursor: pointer; }
.sc-day { font-size: 11px; color: var(--muted); }
.sc-score { min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-name { margin: 0; font-size: 16px; line-height: 1.25; }
.sc-name a { color: var(--text); }
.sc-where { font-size: 12px; color: var(--muted); margin-top: -4px; }
.sc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 0; border-top: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; }
.sc-metrics b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.sc-metrics span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sc-owners { font-size: 12.5px; line-height: 1.4; }
.sc-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-flag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #fdecea; color: #b3261e; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-note { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.site-card .sites-progress { width: 100%; margin-top: 0; }

/* Email template editor */
.tpl-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 12px; }
.tpl-f { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.tpl-f label { font-size: 12px; font-weight: 600; color: var(--muted); }
.tpl-f input[type=text], .tpl-f select, .tpl-f textarea { width: 100%; box-sizing: border-box; }
.tpl-f textarea { font-family: inherit; line-height: 1.45; }
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f6f7f9; }
.fmt-bar button { border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 3px 9px; font-size: 12.5px; cursor: pointer; }
.fmt-bar button:hover { border-color: #9aa3ad; background: var(--accent-soft); }
.fmt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.tpl-f .fmt-bar + textarea { border-radius: 0 0 6px 6px; }
.tpl-note { color: #8a5a00; background: #fff6e0; border-radius: 6px; padding: 6px 9px; }
.tpl-adv { margin: 4px 0 12px; }
.tpl-adv summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.tpl-preview iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tpl-preview { position: sticky; top: calc(var(--topbar-h) + 8px); align-self: start; }
.tpl-keys { margin-top: 6px; font-size: 12.5px; }
.tpl-keys summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.tpl-keys table { border-collapse: collapse; margin-top: 4px; }
.tpl-keys td { padding: 3px 12px 3px 0; vertical-align: top; }
.tpl-keys code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpl-who { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.tpl-who select { flex: 1; min-width: 0; }
.tpl-attach input[type=file] { font-size: 13px; }

/* Live alerts */
#alert-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.alert-toast { display: block; background: #1e2a3a; color: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  text-decoration: none; transition: opacity .5s, transform .5s; animation: toast-in .25s ease-out; }
.alert-toast:hover { text-decoration: none; background: #26364b; }
.alert-toast b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #9fc3ff; margin-bottom: 2px; }
.alert-toast span { font-size: 13px; line-height: 1.35; }
.alert-toast.gone { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.alert-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.alert-prefs label { font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }

/* Site card pop-up (Trello-style) */
.site-card[data-card-url] { cursor: pointer; }
.site-card[data-card-url]:focus-visible { outline: 2px solid var(--accent, #124b87); outline-offset: 2px; }
.scard-dialog { width: min(1080px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 60px rgba(10,20,40,.35); background: #f4f5f7; }
.scard-dialog::backdrop { background: rgba(15,22,33,.55); }
.scard { display: flex; flex-direction: column; max-height: 92vh; }
.scard-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; background: #fff; border-top: 6px solid #9aa3ad; border-bottom: 1px solid var(--line); }
.scard.site-acquired .scard-head, .scard.site-contract .scard-head { border-top-color: #1e4fbf; }
.scard.site-loi .scard-head { border-top-color: #00a5c2; } .scard.site-outreach .scard-head { border-top-color: #f0a500; }
.scard.site-review .scard-head { border-top-color: #9b6dff; }
.scard-title { flex: 1; min-width: 0; }
.scard-title h2 { margin: 4px 0 2px; font-size: 20px; line-height: 1.25; }
.scard-x { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.scard-x:hover { color: var(--text); }
.scard-error { margin: 10px 20px 0; padding: 8px 12px; border-radius: 8px; background: #fdecea; color: #b3261e; font-size: 13px; }
.scard-body { display: grid; grid-template-columns: 1fr 230px; gap: 18px; padding: 16px 20px 20px; overflow-y: auto; }
.scard-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.scard-facts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.scard-facts > div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.scard-facts b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.scard-facts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.scard-sec { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.scard-sec h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #4a5563; }
.scard-sec p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; }
.scard-ai { background: linear-gradient(180deg, #f3f7ff, #fff 60%); border-color: #d6e2fb; }
.scard-headline { font-weight: 600; }
.scard-risks { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.scard-next { background: #eef4ff; border-radius: 6px; padding: 6px 9px; }
.scard-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.scard-steps li { display: grid; grid-template-columns: 14px 1fr; column-gap: 6px; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: #f6f7f9; }
.scard-steps li i { grid-row: span 2; width: 10px; height: 10px; margin-top: 3px; border-radius: 50%; border: 2px solid #c3c9d1; }
.scard-steps li.done i { background: #1a8f4a; border-color: #1a8f4a; }
.scard-steps li.future i { background: #fff; border-color: #f0a500; }
.scard-steps li span.muted { font-size: 11.5px; }
.scard-log { margin-top: 8px; font-size: 12.5px; }
.scard-log summary { cursor: pointer; color: var(--muted); }
.scard-log div { padding: 2px 0; }
.scard-row { display: block; padding: 7px 9px; margin: 0 -6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.scard-row:hover { background: #f4f6f9; text-decoration: none; }
.scard-row + .scard-row { border-top: 1px solid #f0f2f5; }
.scard-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scard-task { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f2f5; font-size: 13.5px; }
.scard-task.done a { text-decoration: line-through; color: var(--muted); }
.scard-tick { width: 18px; height: 18px; border: 2px solid #9aa3ad; border-radius: 4px; background: #fff; padding: 0; font-size: 12px; line-height: 1; color: #fff; cursor: pointer; }
.scard-task.done .scard-tick { background: #1a8f4a; border-color: #1a8f4a; }
.scard-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scard-add input[name=title] { flex: 1 1 200px; min-width: 0; }
.scard-comment { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.scard-comment textarea { flex: 1; min-width: 0; font-family: inherit; }
.scard-cmt { padding: 7px 0; border-top: 1px solid #f0f2f5; font-size: 13.5px; }
.scard-side { display: flex; flex-direction: column; gap: 7px; }
.scard-side .btn { text-align: center; }
.scard-side select { width: 100%; }
.scard-label { margin-top: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scard-notes { color: var(--muted); }
@media (max-width: 800px) {
  .scard-body { grid-template-columns: 1fr; }
  .scard-facts { grid-template-columns: repeat(3, 1fr); }
  .scard-two { grid-template-columns: 1fr; }
}

.scard-members { display: flex; flex-wrap: wrap; gap: 4px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #124b87; color: #fff; font-size: 11px; font-weight: 700; }
.team-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-check { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; }
.tenant-row { padding: 6px 0; border-bottom: 1px solid #f0f2f5; position: relative; }
.tenant-row .inline-unlink { position: absolute; right: 0; top: 6px; }

/* Sites: view switch, board */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: 12px; }
.seg a { padding: 5px 12px; font-size: 13px; color: var(--text); text-decoration: none; background: #fff; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: #1e2a3a; color: #fff; }
.seg-toggle { padding: 5px 12px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; background: #fff; margin-left: 6px; }
.seg-toggle.on { background: var(--accent-soft); border-color: #9fb8dc; }
.site-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.sb-col { background: #eef0f3; border-radius: 12px; padding: 8px; min-height: 120px; }
.sb-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; font-size: 13.5px; }
.sb-head .acq-key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sb-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; transition: background .15s; }
.sb-list.drop-on { background: #dde6f5; }
.sb-tile { gap: 5px; padding: 9px 11px; border-top-width: 3px; cursor: grab; }
.sb-tile.dragging { opacity: .45; }
.sb-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.sc-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.sc-badges .spacer { flex: 1; }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.avatar-team { background: #6b7a90; margin-left: -6px; border: 2px solid #fff; }

/* Task labels (the Trello categories) and critical dates */
.tlabel { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff; background: #6b7480; vertical-align: 1px; }
.tl-deal { background: #1e4fbf; } .tl-legal { background: #8e44ad; } .tl-civil { background: #c77700; }
.tl-architecture { background: #00838f; } .tl-program { background: #2e7d32; } .tl-land_use { background: #6d4c41; }
.tl-critical { background: #c62828; }
.scard-date { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; padding: 6px 8px; margin: 0 -6px; border-radius: 8px; font-size: 13px; color: var(--text); text-decoration: none; }
.scard-date:hover { background: #f4f6f9; text-decoration: none; }
.scard-date .sd-when { font-variant-numeric: tabular-nums; font-weight: 600; }
.scard-date .sd-left { color: var(--muted); font-size: 12px; white-space: nowrap; }
.scard-date.soon .sd-left { color: #c77700; font-weight: 600; }
.scard-date.late .sd-left { color: #c62828; font-weight: 600; }

/* Settings: dropdown lists */
.dd-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }
.dd-area h3 { margin-top: 0; }
.dd-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dd-row:hover { background: #f4f6f9; text-decoration: none; }
.dd-row + .dd-row { border-top: 1px solid #f0f2f5; }
.dd-used { display: block; margin-top: 1px; }
.tag-open { background: #e3f5ea; color: #1a7a40; }
.dd-table input[name^=label_] { width: 100%; box-sizing: border-box; }
.dd-table tr.dd-hidden td { background: #f6f7f9; color: var(--muted); }
.dd-table tr.dd-hidden input[name^=label_] { color: var(--muted); text-decoration: line-through; }
.dd-new input { width: 320px; max-width: 100%; margin-left: 6px; }
.dd-actions { margin-bottom: 0; }
.scard-date.done { color: var(--muted); }
.scard-date.done span:nth-child(2) { text-decoration: line-through; }
.scard-date.done .sd-left { color: #1a8f4a; font-weight: 600; }
.cr-draftnote { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 6px 12px; margin-bottom: 10px; }
.tc-ins[class*="rl-a"], .tc-del[class*="rl-a"] { color: var(--rl-c); }
.rl-tracked [data-tc] { cursor: pointer; }
.rl-views { margin-bottom: 10px; }

/* Capital: sources, the stack and term sheets side by side */
.pill.cap-identified, .pill.cap-outreach { background: #eef0f3; color: #3c4453; }
.pill.cap-discussion { background: #e3ecff; color: #1e4fbf; }
.pill.cap-term_sheet, .pill.cap-approved { background: var(--warn-bg); color: var(--warn); }
.pill.cap-closing, .pill.cap-closed { background: var(--good-bg); color: var(--good); }
.pill.cap-passed, .pill.cap-declined { background: #f3f3f3; color: var(--muted); }
.cap-stack { display: flex; flex-direction: column; gap: 4px; }
.cap-layer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 7px 10px; border-radius: 8px; border-left: 4px solid #c9d2df; background: #f7f9fb; font-size: 13px; }
.cap-layer.cap-equity { border-left-color: #2e7d32; }
.cap-layer.cap-debt { border-left-color: #1e4fbf; }
.cap-layer.cap-grants { border-left-color: #c77700; }
.cap-layer.cap-out { opacity: .55; }
.cap-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cap-compare th, .cap-compare td { vertical-align: top; }
.cap-compare td.changed { background: #fff8e6; }
.cap-compare td .q { color: var(--muted); font-size: 11px; cursor: help; text-decoration: underline dotted; }
.cap-terms { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 13px; margin: 6px 0; }
.cap-terms dt { color: var(--muted); }
.cap-terms dd { margin: 0; }
.cap-touch { display: grid; grid-template-columns: 70px 80px 1fr auto; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.cap-touch .k { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Company page (company_detail.html, company_meeting_card.html, action_item.html, company_actions.html)
   ========================================================================== */
.co-tabs { position: sticky; top: var(--topbar-h); z-index: 5; background: var(--bg); overflow-x: auto; overflow-y: hidden;
  white-space: nowrap; scrollbar-width: none; padding-top: 4px; }
.co-tabs a { flex: none; }
.co-tabs .count, .co-kinds .count, .co-fold .count { background: #eef0f3; color: var(--muted); border-radius: 8px;
  padding: 0 6px; font-size: 11px; font-weight: 600; }
.co-tabs .count-hot { background: var(--warn-bg); color: var(--warn); }
.co-record { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }

.co-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
/* Each cell draws its right and bottom rule; the -1px margins push the outer ones under the container's border. */
.co-facts > div { padding: 8px 12px; display: flex; flex-direction: column; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.co-facts .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.co-facts .value { font-weight: 600; overflow-wrap: anywhere; }
.co-facts .sub { font-size: 12px; color: var(--muted); }
.co-facts .co-fact-wide { grid-column: span 2; }
.co-pair .panel { margin-bottom: 0; }
.co-pair { margin-bottom: 16px; }
.h3-link { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; }

.co-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 8px; }
.co-section-head h2 { font-size: 16px; margin: 0; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); margin-bottom: 14px; }
.mcard-upcoming { border-left-color: var(--good); }
.mcard-head { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mcard-date { flex: none; width: 44px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius);
  line-height: 1.1; padding: 3px 0; }
.mcard-date span { display: block; font-size: 10.5px; text-transform: uppercase; color: var(--muted); }
.mcard-date strong { font-size: 17px; }
.mcard-title { flex: 1; min-width: 0; }
.mcard-title h4 { margin: 0 0 2px; font-size: 15px; }
.mcard-title .muted { font-size: 12.5px; }
.mcard-links { display: flex; gap: 10px; font-size: 12px; white-space: nowrap; }
.mcard-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.mcard-summary, .mcard-actions { padding: 10px 14px 12px; min-width: 0; }
.mcard-actions { border-left: 1px solid var(--line); background: #fbfcfd; }
.mcard h5, .co-sub { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.co-sub { margin-top: 4px; }
.mcard .granola h4:first-child { margin-top: 0; }
.granola.clamp { max-height: 240px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.clamp-toggle { margin-top: 4px; }
.clamp-toggle[hidden] { display: none; }
.mcard h5 .muted, .co-sub .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.mk-task > summary { display: inline-block; cursor: pointer; font-size: 12px; color: var(--accent); margin-top: 4px; list-style: none; }
.mk-task > summary::-webkit-details-marker { display: none; }
.mk-task[open] > summary { display: none; }

.action-item .ai-line { display: flex; gap: 8px; align-items: flex-start; }
.action-item .ai-line input[type=checkbox] { margin-top: 3px; }
.action-item .ai-text { flex: 1; min-width: 0; }
.ai-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border: 2px solid #c7ccd4; border-radius: 50%; }
.ai-done strong { text-decoration: line-through; color: var(--muted); }
.mcard-actions .action-item { background: var(--panel); }
.more-link { display: inline-block; font-size: 12.5px; margin: 2px 0 8px; }

.co-fold { padding: 0; }
.co-fold > summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); list-style-position: inside; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-fold[open] > summary { border-bottom: 1px solid var(--line); }
.co-fold > :not(summary) { margin: 12px 14px; }
.co-fold > .panel { border: 0; padding: 0; background: none; }
.fold-hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }

.co-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.co-kinds a { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 3px 12px; font-size: 13px; color: var(--text); }
.co-kinds a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.co-kinds a.active .count { background: rgba(255,255,255,.2); color: #fff; }

@media (max-width: 1100px) { .co-record { grid-template-columns: minmax(0, 1fr); } }
.co-side { min-width: 0; }
@media (max-width: 700px) {
  .mcard-body { grid-template-columns: 1fr; }
  .mcard-actions { border-left: 0; border-top: 1px solid var(--line); }
  .mcard-head { flex-wrap: wrap; }
  .mcard-links { width: 100%; padding-left: 56px; }
  .co-facts { grid-template-columns: 1fr 1fr; }
}
/* End company page */


/* ==========================================================================
   Task page: rename and description edited in place (task_detail.html, task_row.html)
   ========================================================================== */
.te-title { flex: 1 1 280px; min-width: 0; }
[data-edit-box] [hidden] { display: none !important; }
.te-title [data-view] { display: flex; align-items: center; gap: 6px; }
.te-title h1 { cursor: text; overflow-wrap: anywhere; }
.te-title h1:hover { background: var(--accent-soft); border-radius: var(--radius); }
.te-title form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.te-title input[name=title] { flex: 1 1 260px; font-size: 18px; font-weight: 600; }
.te-pencil { font-size: 16px; color: var(--muted); }
.te-pencil:hover { color: var(--accent); }
#description h3 .te-edit { float: right; text-transform: none; letter-spacing: 0; }
#description.editing h3 .te-edit { display: none; }
.te-empty { cursor: text; margin: 0; }
.te-row-edit { color: var(--muted); font-size: 12px; margin-left: 2px; opacity: 0; }
.tasklist li:hover .te-row-edit, .te-row-edit:focus { opacity: 1; }
@media (hover: none) { .te-row-edit { opacity: 1; } }
@media (max-width: 1000px) { .te-record > section { order: -1; } }  /* description before the side form on a phone */
/* End task page */

/* ==========================================================================
   Navigation and colour (2026-10 UX overhaul): top bar, search palette, sidebar that stays open,
   and colour reserved for meaning. See docs/UX_REVIEW.md.
   ========================================================================== */
:root {
  /* Deal stages, cool to warm as a deal gets closer to signing. */
  --st-prospect: #5b6475; --st-prospect-bg: #eef0f3;
  --st-qualified: #1d4ed8; --st-qualified-bg: #e3ebfd;
  --st-loi: #6d28d9; --st-loi-bg: #efe8fd;
  --st-lease: #0e7490; --st-lease-bg: #ddf3f8;
  --st-signed: #15803d; --st-signed-bg: #dcf3e4;
  --st-hold: #a16207; --st-hold-bg: #fdf3d8;
  --st-lost: #9f1239; --st-lost-bg: #fbe4ea;
  --today: #b45309; --today-bg: #fff3df;
  --topbar-h: 52px;
}
.stage-prospect, .stage-contacted { background: var(--st-prospect-bg); color: var(--st-prospect); }
.stage-qualified, .stage-engaged { background: var(--st-qualified-bg); color: var(--st-qualified); }
.stage-meeting { background: var(--st-loi-bg); color: var(--st-loi); }
.stage-loi_neg, .stage-loi_signed { background: var(--st-loi-bg); color: var(--st-loi); }
.stage-loi_signed { box-shadow: inset 0 0 0 1px var(--st-loi); }
.stage-lease_neg { background: var(--st-lease-bg); color: var(--st-lease); }
.stage-signed { background: var(--st-signed-bg); color: var(--st-signed); font-weight: 600; }
.stage-on_hold { background: var(--st-hold-bg); color: var(--st-hold); }
.stage-lost { background: var(--st-lost-bg); color: var(--st-lost); }
.stage.good { background: var(--good-bg); color: var(--good); }
/* Board columns carry their stage colour along the top. */
.column { border-top: 3px solid var(--st-prospect); }
.column[data-stage=qualified] { border-top-color: var(--st-qualified); }
.column[data-stage=loi_neg], .column[data-stage=loi_signed] { border-top-color: var(--st-loi); }
.column[data-stage=lease_neg] { border-top-color: var(--st-lease); }
.column[data-stage=signed] { border-top-color: var(--st-signed); background: #e8f5ec; }
.column[data-stage=on_hold] { border-top-color: var(--st-hold); }
.column[data-stage=lost] { border-top-color: var(--st-lost); }
.kcard:has(.risk) { border-left: 3px solid var(--bad); }
/* Dates: red when late, amber when due today. */
.due-late, .overdue { color: var(--bad); font-weight: 600; }
.due-today { color: var(--today); font-weight: 600; }
.tag-alert { background: var(--bad); color: #fff; font-weight: 600; }
/* Buttons: solid navy for the main action, red only for removing things. */
.btn-primary:hover { background: #18304f; border-color: #18304f; }
.btn-danger { background: #fff; }
button.btn-primary, .btn.btn-primary { box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }

/* Shell: CoStar-style navy bar across the top with drop-down menus, page underneath. */
.shell { display: block; min-height: 100vh; }
.main-col { min-width: 0; }
.appbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 6px;
  padding: 0 18px; background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 2px 8px rgba(15, 23, 42, .12); }
.appbar .spacer { flex: 1; }
.appbar .brand { display: block; margin-right: 14px; flex: 0 0 auto; }
.appbar .brand img { display: block; height: 30px; width: auto; }
.appbar .nav-burger { display: none; }
.topnav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.tn-link, .tn-menu > summary { display: flex; align-items: center; gap: 5px; height: 100%; padding: 0 12px; color: #dbe4f0;
  font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.tn-link:hover, .tn-menu > summary:hover, .tn-menu[open] > summary { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.tn-link.active, .tn-menu.active > summary { color: #fff; border-bottom-color: #f5a524; }
.tn-menu { position: relative; height: 100%; }
.tn-menu > summary { list-style: none; }
.tn-menu > summary::-webkit-details-marker { display: none; }
.tn-menu > summary::after { content: "▾"; font-size: 10px; opacity: .7; }
.tn-count { background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.tn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f5a524; }
.tn-drop { position: absolute; left: 0; top: 100%; min-width: 320px; background: #fff; color: var(--text); border-radius: 0 0 10px 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .22); padding: 8px; border-top: 3px solid #f5a524; z-index: 60; }
.tn-drop-right { left: auto; right: 0; }
.tn-drop a { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 6px; color: var(--text); }
.tn-drop a strong { font-weight: 600; font-size: 14px; }
.tn-drop a span { font-size: 12px; color: var(--muted); }
.tn-drop a span:empty { display: none; }
.tn-drop a:hover { background: var(--accent-soft); text-decoration: none; }
.tn-drop a.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.appbar-icon { position: relative; border: 0; background: none; font-size: 17px; padding: 6px 8px; border-radius: var(--radius);
  color: #dbe4f0; line-height: 1; cursor: pointer; text-decoration: none; }
.appbar-icon:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.appbar .bell .count { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.appbar .search-trigger { display: flex; align-items: center; gap: 8px; width: 210px; padding: 6px 10px; text-align: left;
  color: #dbe4f0; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; }
.appbar .search-trigger:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.search-trigger .search-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.appbar .search-trigger kbd { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #dbe4f0; }
.search-icon { font-size: 17px; line-height: 1; }
.btn-new { background: #f5a524; border-color: #f5a524; color: #1d2330; font-weight: 600; }
.btn-new:hover { background: #ffb840; border-color: #ffb840; }
.appbar .user-menu .avatar { background: #fff; color: var(--accent); }
kbd { display: inline-block; font: 600 10.5px/1 system-ui, sans-serif; padding: 3px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: #f8fafc; color: var(--muted); }
main { padding: 20px 28px 40px; }

/* Drop-down menus (+ New, account). */
.menu-wrap { position: relative; }
.menu-wrap > summary { list-style: none; cursor: pointer; }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu-wrap .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 6px; z-index: 60; }
.menu a, .menu .menu-btn { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 6px; color: var(--text);
  width: 100%; text-align: left; border: 0; background: none; font: inherit; }
.menu a:hover, .menu .menu-btn:hover { background: var(--accent-soft); text-decoration: none; }
.menu a .muted { font-size: 12px; }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; font-weight: 600; }
.menu-head .muted { font-weight: 400; font-size: 12px; }
.user-menu .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; }

/* Search palette. */
.palette { border: 0; padding: 0; width: min(640px, calc(100vw - 32px)); margin-top: 10vh; border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .35); }
.palette::backdrop { background: rgba(15, 23, 42, .4); }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; outline: none; }
.palette-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; font-weight: 600; }
.pal-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center;
  padding: 7px 10px; border-radius: 8px; color: var(--text); }
.pal-item:hover { text-decoration: none; }
.pal-item.on { background: var(--accent-soft); }
.pal-title { grid-column: 1; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pal-sub { grid-column: 1; font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pal-sub:empty { display: none; }
.pal-item .stage { grid-column: 2; grid-row: 1 / span 2; }
.pal-empty { padding: 14px; margin: 0; }
.palette-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; }

/* Page tabs (Tenant pipeline: Board / Table / Report) and filter chips. */
.page-tabs { display: inline-flex; background: #e9edf2; border-radius: 8px; padding: 3px; gap: 2px; }
.page-tabs a { padding: 5px 14px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
.page-tabs a:hover { color: var(--text); text-decoration: none; }
.page-tabs a.on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chips a { padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips a .n { opacity: .7; margin-left: 3px; }

/* Breadcrumbs above record pages. */
.crumbs { font-size: 12.5px; color: var(--muted); margin: -6px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
/* "← Back to <page>" above every page (back.js). */
.hub-back { margin: -4px 0 8px; font-size: 13px; }
.hub-back-link { display: inline-block; padding: 4px 10px 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); background: var(--panel); text-decoration: none; }
.hub-back-link:hover, .hub-back-link:focus-visible { color: var(--accent); border-color: var(--accent); }
/* A deal inside its company card: the deal's own name under the company tabs. */
.deal-in-company { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 12px; }
.deal-in-company h2 { margin: 0; font-size: 18px; }
.kcard .kco { font-weight: 600; }
.kcard .kdeal { font-size: 12px; color: var(--muted); }

@media (max-width: 1180px) {
  .appbar .nav-burger { display: block; }
  .topnav { display: none; position: absolute; left: 0; right: 0; top: var(--topbar-h); height: auto; flex-direction: column;
    background: var(--accent); padding: 8px; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  html.nav-open .topnav { display: flex; }
  .tn-link, .tn-menu > summary { height: 42px; border: 0; }
  .tn-menu { height: auto; }
  .tn-drop { position: static; box-shadow: none; border-top: 0; border-radius: 8px; margin: 0 0 6px; min-width: 0; }
  .appbar .search-trigger { width: auto; }
  .appbar .search-trigger kbd, .appbar .search-text { display: none; }
}
@media (max-width: 640px) { .appbar .brand img { height: 24px; } main { padding: 14px 16px 30px; } }
@media print { .appbar, .palette { display: none !important; } }
/* End navigation and colour */

/* ==========================================================================
   Dashboard (home.html, dashboard.js): search hero and customizable widgets.
   ========================================================================== */
.hero { background: linear-gradient(135deg, #1f3a5f 0%, #2b5283 100%); color: #fff; border-radius: 12px; padding: 20px 24px 16px;
  margin-bottom: 18px; box-shadow: 0 6px 20px rgba(31, 58, 95, .18); }
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hero-top h1 { margin: 0; font-size: 21px; }
.hero-top .spacer { flex: 1; }
.hero-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.hero-btn:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); }
.hero-search { position: relative; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px;
  padding: 0 14px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.hero-search .search-icon { color: var(--muted); font-size: 20px; }
.hero-search input { flex: 1; border: 0; padding: 14px 0; font-size: 16px; outline: none; background: none; }
.hero-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; color: var(--text); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .25); z-index: 30; max-height: 60vh; }
.hero-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; }
.hero-links a { color: #dbe4f0; }
.hero-links a:hover { color: #fff; }

.customize-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px;
  background: var(--today-bg); border: 1px solid #f3d19c; border-radius: 10px; }
.customize-bar .spacer { flex: 1; }
.add-widget .menu { width: 340px; max-height: 60vh; overflow-y: auto; }
.add-widget .menu-btn[disabled] { opacity: .5; cursor: default; }

.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; grid-auto-flow: row dense; }
.widget { grid-column: span var(--w, 6); position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px 14px; min-width: 0; }
.widget-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; min-height: 22px; }
.widget-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.widget.headless:not(:where(.customizing *)) > .widget-head { display: none; }
.widget-body { min-width: 0; }
/* A real (thin) scrollbar with its own gutter: Windows 11's overlay scrollbar drew over the dates at the right edge. */
.widget[style*="--h"] > .widget-body { height: var(--h); overflow: auto; scrollbar-width: thin; scrollbar-color: #c3ccd8 transparent;
  scrollbar-gutter: stable; }
.widget[style*="--h"] .week-day { min-height: calc(var(--h) - 70px); }
.widget .panel, .widget .week-panel { border: 0; padding: 0; margin: 0; background: none; }
.widget .cards { margin-bottom: 0; }
.widget-link { position: absolute; top: 12px; right: 14px; font-size: 12.5px; }
.widget-tools { display: none; margin-left: auto; gap: 6px; align-items: center; }
.widget-size { display: inline-flex; background: #eef1f5; border-radius: 6px; padding: 2px; }
.widget-size button { border: 0; background: none; padding: 2px 7px; font-size: 12px; border-radius: 4px; color: var(--muted); }
.widget-size button.on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }
.widget-x { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 4px; color: var(--muted); }
.widget-x:hover { color: var(--bad); }
.widget-resize { display: none; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; touch-action: none; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #9aa6b5 50%, #9aa6b5 60%, transparent 60%, transparent 70%, #9aa6b5 70%, #9aa6b5 80%, transparent 80%); }
.customizing .widget { outline: 2px dashed #c3ccd8; outline-offset: -2px; }
.customizing .widget-head { cursor: grab; background: #f6f8fb; margin: -12px -14px 10px; padding: 8px 14px; border-radius: 10px 10px 0 0; }
.customizing .widget-tools { display: inline-flex; }
.customizing .widget-resize { display: block; }
.customizing .widget-link { display: none; }
.customizing .widget-body { pointer-events: none; user-select: none; }
.widget.dragging { opacity: .45; }
.widget.resizing { outline-color: var(--accent); }
@media (max-width: 1000px) { .widget { grid-column: 1 / -1; } }
/* Placed by dashboard.js: an 8px row grid, each widget at its own column and row (x, y), its own height. */
.widgets.placed { grid-auto-rows: 8px; row-gap: 0; column-gap: 16px; grid-auto-flow: row; }
.widgets.placed > .widget { align-self: start; }
.widget-grip { position: absolute; top: 6px; right: 8px; z-index: 2; border: 0; background: #eef1f5; color: var(--muted); border-radius: 6px;
  width: 26px; height: 24px; font-size: 15px; line-height: 1; cursor: grab; touch-action: none; opacity: 0; transition: opacity .12s; }
.widget:hover > .widget-grip, .widget-grip:focus-visible, .customizing .widget-grip { opacity: 1; }
.widget-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: none) { .widget-grip { opacity: .8; } }
.widget:hover > .widget-resize { display: block; opacity: .55; }
.widgets:not(.customizing) .widget-head { cursor: grab; }
.widgets:not(.customizing) .widget-head h3 { user-select: none; }
.customizing .widget-head { padding-right: 44px; }
.widget-link { right: 44px; }
.widget-order { display: none; gap: 2px; }
.widget-order button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; color: var(--muted); }
.customizing .widget-order { display: inline-flex; }
.widget-ghost { border: 2px dashed var(--accent); border-radius: 10px; background: rgba(37, 99, 235, .06); align-self: stretch; }
.widget.dragging { opacity: .85; box-shadow: 0 12px 28px rgba(15, 23, 42, .22); cursor: grabbing; pointer-events: none; }
@media (max-width: 1000px) {
  .widgets.placed { grid-auto-rows: auto; row-gap: 16px; }
  .widgets.placed > .widget { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .widget-resize, .widget:hover > .widget-resize { display: none; }
  .widget-grip { display: none; }
}
/* End dashboard */
.customize-bar[hidden], .hero-results[hidden] { display: none; }

/* ==========================================================================
   View bar (partials/view_bar.html, views.js) on every list, and compact rows.
   ========================================================================== */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.view-bar .spacer { flex: 1; }
.vb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-right: 2px; }
.vb-view-wrap { display: inline-flex; align-items: center; }
.vb-view { padding: 3px 10px; border-radius: 99px; color: var(--text); border: 1px solid transparent; }
.vb-view:hover { background: var(--accent-soft); text-decoration: none; }
.vb-view.on { background: var(--accent-soft); border-color: #c4d3e8; color: var(--accent); font-weight: 600; }
.vb-shared { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.vb-del { display: inline; margin: 0; }
.vb-del button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 14px; opacity: 0; }
.vb-view-wrap:hover .vb-del button, .vb-del button:focus { opacity: 1; }
.vb-del button:hover { color: var(--bad); }
.vb-save { display: flex; flex-direction: column; gap: 8px; padding: 12px; width: 300px; }
.vb-save label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.vb-check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text) !important; font-size: 13px !important; }
.vb-cols .menu { width: 260px; max-height: 60vh; overflow-y: auto; padding: 10px 12px; }
.vb-col-list { display: flex; flex-direction: column; gap: 4px; }
.vb-hint { margin: 0 0 8px; font-size: 12px; }
.compact-rows table.data th, .compact-rows table.data td { padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
.compact-rows .kcard { padding: 5px 8px; margin-bottom: 5px; }
.compact-rows .kcard .sub, .compact-rows .kcard .next { font-size: 11.5px; }
.chips a.chip-alert { border-color: #efc2bd; color: var(--bad); }
.chips a.chip-alert.on { background: var(--bad); border-color: var(--bad); color: #fff; }
/* Land site statuses. */
.site-prospect { background: var(--st-prospect-bg); color: var(--st-prospect); }
.site-review { background: var(--st-qualified-bg); color: var(--st-qualified); }
.site-outreach { background: var(--today-bg); color: var(--today); }
.site-loi { background: var(--st-loi-bg); color: var(--st-loi); }
.site-contract { background: var(--st-lease-bg); color: var(--st-lease); }
.site-acquired { background: var(--st-signed-bg); color: var(--st-signed); font-weight: 600; }
.site-dropped { background: var(--st-lost-bg); color: var(--st-lost); }
/* The investor report reads as a sheet under the Tenant pipeline tabs. */
.report-sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px 6px; }
.report-sheet .panel { border-radius: 8px; }
@media print { .report-sheet { border: 0; padding: 0; } }
/* End view bar */
.tasklist li.task-due-late { box-shadow: inset 3px 0 0 var(--bad); padding-left: 6px; } .tasklist li.task-due-today { box-shadow: inset 3px 0 0 var(--today); padding-left: 6px; }
@media (max-width: 1000px) { .widget[style*="--h"] > .widget-body { height: auto; overflow: visible; } .widget[style*="--h"] .week-day { min-height: 0; } .hero-search kbd { display: none; } .hero-top { flex-wrap: wrap; } }
.welcome-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 14px; background: #eef5ff; border: 1px solid #c9dcf7; border-radius: 10px; font-size: 13.5px; } .welcome-tip[hidden] { display: none; } .welcome-tip span { flex: 1; } .welcome-tip strong:first-child { white-space: nowrap; color: var(--accent); }
/* Tenant pipeline report: the Columns picker (partials/pipeline_head.html). */
.report-cols .rc-form { width: 300px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rc-hint { margin: 0; font-size: 12px; }
.rc-quick { display: flex; gap: 6px; }
.rc-list { display: flex; flex-direction: column; gap: 3px; max-height: 50vh; overflow-y: auto; }
.rc-foot { display: flex; gap: 6px; }
.btn-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   Boards (crm/boards): lists of cards on the CRM's records. board.js moves cards; the card opens in a dialog.
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.req { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bad); margin-left: 6px; }
/* Board colours: a swatch on the page and a stripe on the tile. */
.bc-navy { --bc: #1f3a5f; } .bc-sky { --bc: #1d6fb8; } .bc-teal { --bc: #0e7490; } .bc-green { --bc: #15803d; }
.bc-amber { --bc: #b45309; } .bc-rose { --bc: #be123c; } .bc-violet { --bc: #6d28d9; } .bc-slate { --bc: #475569; }
.bl-h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.bl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bl-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--bc, var(--accent)); border-radius: 10px; color: var(--text); min-height: 108px; }
.bl-tile:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(15, 23, 42, .1); border-color: #c7ccd4; }
.bl-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bl-tile-name { font-weight: 600; font-size: 15px; }
.bl-tile-sub, .bl-tile-meta { font-size: 12.5px; color: var(--muted); }
.bl-tile-due { color: var(--today); font-weight: 600; }
.bl-tile-members { display: flex; gap: 2px; margin-top: auto; padding-top: 6px; }
.bl-pagehead .bl-swatch { width: 14px; height: 28px; border-radius: 4px; background: var(--bc, var(--accent)); }
.bl-members { display: flex; gap: 2px; }
.bl-desc { margin: -8px 0 10px; max-width: 80ch; }
.bl-labels-menu { width: 360px; display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.bl-label-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px auto auto; gap: 6px; align-items: center; }
.bl-label-row input, .bl-label-row select { min-width: 0; }
.bl-settings { width: 320px; padding: 12px; }
.bl-settings .fields p { margin-bottom: 8px; }
.bl-danger { color: var(--bad); }
.bl-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.bl-filters label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.bl-filters select, .bl-filters input { font-size: 13px; padding: 4px 6px; }
.bl-filters .chip-check { cursor: pointer; color: var(--text); }
.bl-filters .chip-check.on { background: var(--accent-soft); border-color: var(--accent); }
.bl-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 2px 14px; min-height: 240px; }
.bl-list { flex: 0 0 272px; width: 272px; background: #eceff3; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; max-height: calc(var(--main-vh, 100vh) - 230px); }
.bl-head { display: flex; align-items: center; gap: 6px; padding: 2px 6px 8px; }
.bl-name { margin: 0; font-size: 14px; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bl-n { font-weight: 400; font-size: 12px; }
.bl-dots { font-size: 18px; line-height: 1; padding: 0 6px; color: var(--muted); }
.bl-dots:hover { color: var(--text); }
.bl-menu .menu { min-width: 230px; }
.bl-rename { display: flex; gap: 6px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bl-rename input { flex: 1; min-width: 0; }
.bl-cards { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 8px; min-height: 24px; overflow-y: auto; border-radius: 8px; transition: background .15s; }
.bl-cards.drop-on { background: #dde6f5; }
.bl-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 8px; cursor: grab; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 1px rgba(15, 23, 42, .05); }
.bl-card:hover { border-color: #b9c2cf; }
.bl-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bl-card.dragging { opacity: .4; }
.bl-card.grabbed { outline: 2px solid var(--accent); box-shadow: 0 8px 20px rgba(31, 58, 95, .25); transform: rotate(-1deg); }
.bl-card.bl-failed { outline: 2px solid var(--bad); }
.bl-card.is-done .bl-title { color: var(--muted); }
.bl-placeholder { border: 2px dashed #b9c2cf; border-radius: 8px; background: rgba(255,255,255,.5); }
.bl-card[class*="cover-"] { border-top-width: 6px; }
.cover-green { border-top-color: #4bce97; } .cover-yellow { border-top-color: #e2b203; } .cover-orange { border-top-color: #faa53d; }
.cover-red { border-top-color: #f87168; } .cover-purple { border-top-color: #9f8fef; } .cover-blue { border-top-color: #579dff; }
.cover-sky { border-top-color: #6cc3e0; } .cover-lime { border-top-color: #94c748; } .cover-pink { border-top-color: #e774bb; } .cover-black { border-top-color: #596773; }
.bl-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.bl-label { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.5; padding: 0 7px; border-radius: 4px; background: #e9edf2; color: #2b3440; border: 1px solid transparent; }
.lbl-green { background: #d7f0dc; color: #14532d; } .lbl-yellow { background: #faeeb5; color: #633f00; } .lbl-orange { background: #fde0c2; color: #7c2d12; }
.lbl-red { background: #fbd6d2; color: #7f1d1d; } .lbl-purple { background: #e6dffb; color: #4c1d95; } .lbl-blue { background: #d8e6fb; color: #1e3a8a; }
.lbl-sky { background: #d4eef7; color: #0c4a6e; } .lbl-lime { background: #e2f0c6; color: #365314; } .lbl-pink { background: #fbd9ec; color: #831843; } .lbl-black { background: #d6dbe1; color: #1f2937; }
.bl-title { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.bl-record { font-size: 11.5px; color: var(--accent); display: flex; gap: 4px; align-items: baseline; }
.bl-record-kind { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
/* Feed and bound lists (crm/boards/bound.py): a feed fills itself and opens the record; a bound list moves it. */
.bl-kind { font-size: 11.5px; margin: -4px 6px 6px; }
.bl-feed .bl-head { border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.bl-feed-item { cursor: default; }
.bl-feed-link { color: inherit; text-decoration: none; }
.bl-feed-link:hover .bl-title, .bl-feed-link:focus-visible .bl-title { text-decoration: underline; }
.bl-card[data-fixed] { cursor: pointer; }
.bl-feed-empty { font-size: 12.5px; padding: 6px; list-style: none; }
.bl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11.5px; color: var(--muted); min-height: 18px; }
.bl-meta .spacer { flex: 1; }
.bl-due { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 4px; font-weight: 600; background: #eef0f3; color: #3c4453; }
.bl-due.late { background: var(--bad-bg); color: var(--bad); } .bl-due.today { background: var(--today-bg); color: var(--today); }
.bl-due.soon { background: var(--warn-bg); color: var(--warn); } .bl-due.done { background: var(--good-bg); color: var(--good); }
.bl-count.all-done { color: var(--good); font-weight: 600; }
.bl-avatar { margin-left: -5px; border: 2px solid #fff; }
.bl-avatar:first-of-type { margin-left: 0; }
.bl-add { padding: 6px 4px 2px; }
.bl-add-open { color: #4a5260; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.bl-add-open:hover { background: #dfe3ea; color: var(--text); text-decoration: none; }
.bl-add-box { display: flex; flex-direction: column; gap: 6px; }
.bl-add-box[hidden], .bl-add-open[hidden] { display: none; }
.bl-add-box textarea, .bl-add-box input { width: 100%; font-size: 13.5px; }
.bl-newlist { background: #e4e8ee; justify-content: flex-start; }
.bl-empty { align-self: center; margin: 40px 10px; }
.bl-hint { font-size: 12px; margin-top: 2px; }
.bl-archived { margin-top: 14px; }
.bl-archived summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.bl-arch-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
/* The card dialog. */
.card-dialog { width: min(1040px, 96vw); max-height: 92vh; border: 0; border-radius: 12px; padding: 0; box-shadow: 0 24px 60px rgba(10, 20, 40, .35); }
.card-dialog::backdrop { background: rgba(15, 22, 33, .5); }
.cd { padding: 18px 22px 22px; }
.cd-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.cd-title { flex: 1; min-width: 0; }
.cd-title [data-view] { display: flex; align-items: center; gap: 6px; }
.cd-title h2 { margin: 0; font-size: 20px; cursor: text; overflow-wrap: anywhere; border-radius: 6px; }
.cd-title h2:hover { background: var(--accent-soft); }
.cd-title form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cd-title input[name=title] { flex: 1 1 260px; font-size: 18px; font-weight: 600; }
.cd-where { font-size: 13px; margin-top: 2px; }
.cd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 18px; align-items: start; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.cd-chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cd-chip-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-right: 3px; width: 100%; }
.cd-member { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.cd-done label { cursor: pointer; font-size: 12.5px; padding: 2px 8px; }
.cd-fact { font-size: 12.5px; }
.cd-panel { margin-bottom: 12px; }
.cd-panel h3 .te-edit { margin-left: 8px; text-transform: none; letter-spacing: 0; }
.cd-items { list-style: none; margin: 0 0 8px; padding: 0; }
.cd-items li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.cd-items li:first-child { border-top: 0; }
.cd-items li.done .cd-item-text { text-decoration: line-through; color: var(--muted); }
.cd-item-text { flex: 1; }
.cd-item-toggle { display: inline-flex; margin: 0; }
.cd-att { font-size: 13.5px; padding: 3px 0; }
.cd-events { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.cd-events li { padding: 3px 0; border-top: 1px solid var(--line); }
.cd-events li:first-child { border-top: 0; }
.cd-side h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.cd-side h3:first-child { margin-top: 0; }
.cd-tool { margin-bottom: 6px; }
.cd-tool > summary { list-style: none; display: block; width: 100%; text-align: left; cursor: pointer; }
.cd-tool > summary::-webkit-details-marker { display: none; }
.cd-tool[open] > summary { background: var(--accent-soft); border-color: var(--accent); }
.cd-pop { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.cd-pop label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 12px; }
.cd-pop label.vb-check { flex-direction: row; }
.cd-pop input, .cd-pop select { font-size: 13px; }
.cd-covers { flex-direction: row; flex-wrap: wrap; }
.cd-cover-btn { cursor: pointer; }
.cd-cover-btn.on { outline: 2px solid var(--accent); }
.cd-hits { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.cd-hit { text-align: left; border: 0; background: none; padding: 5px 6px; border-radius: 6px; font: inherit; font-size: 13px; }
.cd-hit:hover, .cd-hit:focus-visible { background: var(--accent-soft); }
.cd-action { display: block; margin-bottom: 6px; }
.cd-action .btn, .cd-side > a.btn { display: block; width: 100%; text-align: left; margin-bottom: 6px; }
@media (max-width: 760px) {
  .cd-grid { grid-template-columns: minmax(0, 1fr); }
  .cd { padding: 14px; }
  .bl-list { flex-basis: 84vw; width: 84vw; max-height: none; }
  .bl-labels-menu, .bl-settings { width: calc(100vw - 40px); }
}
/* End boards */

/* Drive files panel (crm/dataroom/drive_views.py) */
.drive-panel .dp-folder { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 4px; }
.drive-panel .dp-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.drive-panel .dp-list > li { padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.drive-panel .dp-date { font-size: 12px; margin-left: 4px; }
.drive-panel .dp-older summary, .drive-panel .dp-share summary { font-size: 12px; cursor: pointer; }
.drive-panel .dp-share form { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; align-items: flex-start; }
.drive-panel .dp-confirm { font-size: 12px; }
.drive-panel .dp-hint { font-size: 12px; display: block; }
.drive-panel .dp-stale { background: #fffaf0; border: 1px solid #f0d58c; border-radius: 6px; padding: 8px; font-size: 13px; margin-bottom: 8px; }
.tag.tag-warn { background: #fdecea; color: #a1271b; }

/* Notification settings (crm/push.py) */
.push-panel [hidden] { display: none !important; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.push-sound { margin-left: 4px; font-size: 13px; }
.push-status { margin: 10px 0 0; font-size: 13px; }
.push-status.bad { color: var(--bad); }
.push-devices { margin-top: 12px; }
.push-devices .tag { margin-left: 6px; }
table.notify-kinds .center, table.notify-kinds th.center { text-align: center; width: 110px; }
table.notify-kinds input[type=checkbox] { width: 18px; height: 18px; }
@media (max-width: 600px) { table.notify-kinds .center, table.notify-kinds th.center { width: 64px; padding-left: 4px; padding-right: 4px; } }

/* Mail in the hub: the inbox (crm/templates/crm/inbox.html) */
main:has(.mail-app) { max-width: none; padding: 12px 16px 16px; }
.mail-app { display: grid; grid-template-columns: 190px minmax(300px, 400px) minmax(0, 1fr); gap: 0;
  height: calc(var(--main-vh, 100vh) - var(--topbar-h) - 28px); min-height: 480px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.mail-folders { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0; background: var(--bg); }
.mail-folders a { display: flex; align-items: center; gap: 6px; padding: 6px 14px; color: var(--text); font-size: 13px; }
.mail-folders a:hover { background: var(--accent-soft); text-decoration: none; }
.mail-folders a.on { background: var(--accent-soft); font-weight: 600; color: var(--accent); }
.mail-folders-head { padding: 12px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mail-folders-foot { padding: 12px 14px; }
.mail-count { margin-left: auto; font-size: 12px; font-weight: 600; }
.mail-labels-head { display: flex; width: 100%; justify-content: space-between; border: 0; background: none; cursor: pointer; text-align: left; }
.mail-labels-head:hover { color: var(--text); }
.mail-labels[hidden], .mail-label-row[hidden] { display: none; }
.mail-label-row { display: flex; align-items: center; padding-left: calc(4px + var(--depth, 0) * 14px); padding-right: 4px; }
.mail-label-row:hover, .mail-label-row.on { background: var(--accent-soft); }
.mail-label-row.on a { font-weight: 600; color: var(--accent); }
.mail-folders .mail-label-row a { flex: 1; min-width: 0; padding: 6px 6px 6px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-folders .mail-label-row a:hover { background: none; }
.mail-label-group { flex: 1; min-width: 0; padding: 6px 2px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-twisty { flex: none; width: 18px; height: 22px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
span.mail-twisty { cursor: default; }
.mail-label-menu > summary { padding: 2px 6px; border-radius: 4px; color: var(--muted); visibility: hidden; }
.mail-label-row:hover .mail-label-menu > summary, .mail-label-menu[open] > summary, .mail-label-menu > summary:focus-visible { visibility: visible; }
.mail-label-menu > summary:hover { background: var(--panel); }
.mail-label-menu .mail-menu-pop { position: fixed; width: 240px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mail-label-form { display: flex; flex-direction: column; gap: 4px; }
.mail-label-form input { width: 100%; }
.mail-label-menu .mail-label-delete { color: var(--bad); text-align: left; padding: 0; }
@media (hover: none) { .mail-label-menu > summary { visibility: visible; } }
.mail-dot { width: 9px; height: 9px; border-radius: 50%; background: #c7ccd4; flex: none; }
.mail-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; min-height: 0; }
.mail-search { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.mail-search input { flex: 1; min-width: 0; }
.mail-search { position: relative; }
.mail-adv { position: static; }
.mail-adv > summary { list-style: none; height: 100%; }
.mail-adv > summary::-webkit-details-marker { display: none; }
.mail-adv-pop { position: absolute; z-index: 30; top: calc(100% - 2px); left: 8px; right: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mail-adv-pop label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.mail-adv-pop label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 4px; color: var(--text); }
.mail-adv-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mail-adv-row > label { flex: 1; }
.mail-adv-row > label:has(input[type=checkbox]) { flex: 0 0 auto; }
.mail-widened { margin: 0; padding: 4px 10px; border-bottom: 1px solid var(--line); }
/* Address and search suggestions (recipients.js) */
.addr-host { position: relative; }
.addr-suggest { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 2px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 300px; overflow-y: auto; font-size: 13px; }
.compose-row .addr-suggest { left: 64px; }
.addr-row { padding: 6px 10px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-row.on, .addr-row:hover { background: var(--accent-soft); }
.addr-detail { font-size: 11px; background: #eef0f3; border-radius: 4px; padding: 1px 5px; margin-left: 4px; color: #3c4453; }
.addr-note { padding: 6px 10px; border-top: 1px solid var(--line); white-space: normal; }
.mail-folders-toggle { display: none; }
.mail-list-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.mail-list-head .spacer { flex: 1; }
.mail-tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto;
  scrollbar-width: none; }
.mail-tabs::-webkit-scrollbar { display: none; }
.mail-tabs a { padding: 6px 10px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.mail-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.mail-tabs a:hover { text-decoration: none; color: var(--text); }
.mail-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.mail-row a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); color: var(--text); }
.mail-row a:hover, .mail-row a:focus { background: var(--bg); text-decoration: none; outline: none; }
.mail-row a:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }
.mail-row.on a { background: var(--accent-soft); }
.mail-row.unread .mail-from, .mail-row.unread .mail-subject { font-weight: 700; }
.mail-row.unread a { box-shadow: inset 3px 0 0 var(--accent); }
.mail-from, .mail-subject, .mail-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-subject, .mail-snippet, .mail-row .mail-chips { grid-column: 1 / -1; }
.mail-snippet { color: var(--muted); font-size: 12px; }
.mail-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mail-chip { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-chip.chip-project { background: #efe8fd; color: #6d28d9; }
.mail-chip.chip-deal { background: #dcf3e4; color: #15803d; }
.mail-chip.chip-firm { background: #fdf3d8; color: #8a5a00; }
.mail-chip.chip-new { background: var(--bad-bg); color: var(--bad); }
a.mail-chip:hover { text-decoration: none; filter: brightness(.95); }
.mail-empty, .mail-note, .mail-error { padding: 14px 12px; margin: 0; }
.mail-error { color: var(--bad); background: var(--bad-bg); }
.mail-more { padding: 8px 12px; }
.mail-reader { overflow-y: auto; min-width: 0; padding: 0 20px 24px; }
.mail-reader.loading { opacity: .5; transition: opacity .15s .1s; pointer-events: none; }
.mail-reader-head { position: sticky; top: 0; background: var(--panel); padding: 14px 0 8px; z-index: 1;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.mail-reader-head h2 { font-size: 18px; margin: 0 0 6px; overflow-wrap: anywhere; }
.mail-reader-head p { margin: 6px 0 0; }
.mail-back { display: none; margin-bottom: 8px; }
.mail-reader-empty { display: grid; place-items: center; height: 100%; }
.mail-msg { border-bottom: 1px solid var(--line); padding: 8px 0; scroll-margin-top: 170px; }
.mail-msg > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; cursor: pointer; list-style: none; }
.mail-msg > summary::-webkit-details-marker { display: none; }
.mail-msg-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg-snippet { grid-column: 1 / -1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg[open] .mail-msg-snippet { display: none; }
.mail-msg-to { margin: 4px 0 6px; overflow-wrap: anywhere; }
.mail-frame { width: 100%; border: 0; min-height: 60px; display: block; }
.mail-images { margin: 6px 0; }
.mail-files { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mail-files a { overflow-wrap: anywhere; }
/* Layout follows the width of the mail pane itself (data-w, set by the script in inbox.html), not the window: in a split side it's narrower. */
.mail-app[data-w=mid], .mail-app[data-w=narrow] { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
.mail-app[data-w=mid] .mail-folders, .mail-app[data-w=narrow] .mail-folders { display: none; position: absolute; z-index: 5; width: 220px; max-height: 70vh; box-shadow: 0 8px 24px rgba(0,0,0,.15);
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .mail-app[data-w=mid] .mail-folders.open, .mail-app[data-w=narrow] .mail-folders.open { display: block; }
.mail-app[data-w=mid] .mail-folders-toggle, .mail-app[data-w=narrow] .mail-folders-toggle { display: inline-block; }
.mail-app[data-w=mid], .mail-app[data-w=narrow] { position: relative; }
.mail-app[data-w=mid] .mail-folders, .mail-app[data-w=narrow] .mail-folders { top: 46px; left: 8px; }
.mail-app[data-w=narrow] { grid-template-columns: minmax(0, 1fr); }
.mail-app[data-w=narrow].has-reader .mail-list { display: none; }
.mail-app[data-w=narrow]:not(.has-reader) .mail-reader { display: none; }
.mail-app[data-w=narrow] .mail-back { display: inline-block; }
.mail-app[data-w=narrow] .mail-reader { padding: 0 12px 24px; }
.mail-app[data-w=narrow] .mail-list { border-right: 0; }
.mail-app[data-w=narrow] .mail-reader-head { position: static; }
@media (max-width: 760px) {
  main:has(.mail-app) { padding: 0; }
  .mail-app { height: calc(var(--main-vh, 100vh) - var(--topbar-h)); border: 0; border-radius: 0; }
}
/* In a split side the mail pane fills the frame. */
html.embedded main:has(.mail-app) { padding: 0; }
html.embedded .mail-app { height: 100vh; min-height: 0; border: 0; border-radius: 0; }
/* Long threads (step 3b) */
.mail-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.mail-find { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.mail-find input { width: 200px; max-width: 60vw; }
.mail-parts { margin: 6px 0 0; }
.mail-summary { margin: 10px 0; }
.mail-summary h3 { font-size: 13px; margin: 8px 0 4px; }
.mail-summary p, .mail-summary ul { margin: 0 0 6px; }
.mail-filepanel, .mail-outline { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 10px 0; }
.mail-filepanel > summary, .mail-outline > summary { cursor: pointer; }
.mail-filebar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.mail-filebar input[type=search] { width: 180px; max-width: 100%; }
.mail-filetypes { display: flex; flex-wrap: wrap; gap: 4px; }
.mail-filetypes .on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mail-filelist { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.mail-filelist > li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.mail-filename { font-weight: 600; overflow-wrap: anywhere; }
.mail-versions { flex-basis: 100%; }
.mail-versions ul { margin: 4px 0 0; padding-left: 18px; }
.mail-outline-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.mail-outline-list a { display: grid; grid-template-columns: 2.5em minmax(70px, 9em) minmax(0, 1fr) auto; gap: 8px;
  padding: 4px 2px; border-top: 1px solid var(--line); color: var(--text); align-items: baseline; }
.mail-outline-list a:hover { background: var(--bg); text-decoration: none; }
.mail-outline-list a.unread { font-weight: 600; }
.mail-outline-n { color: var(--muted); text-align: right; font-size: 12px; }
.mail-outline-from, .mail-outline-words { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-new-line { margin: 10px 0 2px; font-size: 12px; font-weight: 600; color: var(--accent); border-top: 2px solid var(--accent); padding-top: 4px; }
.mail-msg.flash { animation: mail-flash 1.6s ease-out; }
@keyframes mail-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.mail-latest[hidden] { display: none; }
.mail-latest { position: sticky; bottom: 12px; float: right; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
@media (max-width: 760px) {
  .mail-outline-list a { grid-template-columns: 2em minmax(0, 1fr) auto; }
  .mail-outline-words { display: none; }
  .mail-latest { bottom: 16px; }
}
.mail-files-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-files-search input[type=search] { flex: 1 1 220px; min-width: 0; }
.mail-files-search select { max-width: 100%; }
.mail-filelist-page { max-height: none; }
/* Mail actions (step 4) */
.mail-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.mail-row > a { flex: 1; min-width: 0; border-bottom: 0; }
.mail-pick { margin: 12px 0 0 10px; flex: none; width: 16px; height: 16px; }
.mail-undo { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--text); color: #fff; font-size: 13px; }
.mail-undo .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.mail-bulk { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 6px 8px; background: var(--accent-soft);
  border-bottom: 1px solid var(--line); }
.mail-bulk[hidden] { display: none; }
.mail-bulk-pick { display: inline-flex; gap: 4px; align-items: center; }
.mail-bulk select { max-width: 150px; font-size: 12px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 6px; }
.mail-actions-main { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-menu { position: relative; }
.mail-menu > summary { list-style: none; cursor: pointer; }
.mail-menu > summary::-webkit-details-marker { display: none; }
.mail-menu-pop { position: absolute; z-index: 6; top: calc(100% + 4px); left: 0; min-width: 210px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px 0; }
.mail-menu-pop form { margin: 0; }
.mail-menu-pop .btn-link { display: block; width: 100%; text-align: left; padding: 6px 12px; color: var(--text); }
.mail-menu-pop .btn-link:hover { background: var(--bg); text-decoration: none; }
.mail-menu-custom { display: flex; gap: 4px; padding: 6px 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.mail-menu-custom input { min-width: 0; flex: 1; font-size: 12px; }
@media (max-width: 760px) {
  .mail-actions { position: relative; }
  .mail-menu { position: static; }
  .mail-menu-pop { left: 0; right: 0; min-width: 0; }
}

/* Compose (step 5) */
.mail-compose-btn { margin: 0 10px 8px; justify-content: center; background: var(--accent); color: #fff !important; border-radius: var(--radius); font-weight: 600; }
.mail-compose-btn:hover { background: var(--accent) !important; filter: brightness(1.1); }
.mail-reply-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.mail-msg-reply { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.mail-reply-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; padding: 12px;
  border: 1px dashed var(--line); border-radius: var(--radius); }
.mail-reply-end .btn, .mail-reply-end .btn-primary { padding: 7px 16px; }
.compose { max-width: 860px; display: flex; flex-direction: column; gap: 8px; }
.compose-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; align-items: center; }
.compose-row > span { color: var(--muted); font-size: 13px; }
.compose-row input, .compose-row select { width: 100%; min-width: 0; }
.compose-more > summary { cursor: pointer; margin-left: 78px; color: var(--accent); }
.compose-more[open] > summary { margin-bottom: 6px; }
.compose-more .compose-row { margin-bottom: 6px; }
.compose-body { width: 100%; min-height: 220px; font: inherit; line-height: 1.45; resize: vertical; }
.compose-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg); margin-bottom: -8px; }
.compose-tool { min-width: 30px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px; background: none;
  color: var(--text); font-size: 14px; line-height: 1; cursor: pointer; }
.compose-tool:hover { background: var(--panel); border-color: var(--line); }
.compose-tool.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.compose-tool-gap { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.compose-toolbar { position: relative; }
.compose-a { border-bottom: 3px solid #c0392b; padding: 0 1px; font-weight: 600; }
.compose-hl { background: #fff176; padding: 0 3px; font-weight: 600; }
.compose-swatches { position: absolute; top: calc(100% + 2px); z-index: 5; display: flex; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.compose-swatches[hidden] { display: none; }
.compose-swatch { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.compose-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.compose-swatch.none { background: linear-gradient(135deg, #fff 45%, #c0392b 45% 55%, #fff 55%); }
.compose-editor { padding: 8px 10px; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--panel);
  overflow: auto; overflow-wrap: anywhere; outline: none; }
.compose-editor:focus { border-color: var(--accent); }
.compose-editor ul, .compose-editor ol { margin: 4px 0; padding-left: 26px; }
.compose-editor blockquote { margin: 4px 0 4px 12px; }
.compose-editor p { margin: 0 0 8px; }
.compose-sig { margin: 0; }
.compose-files { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.compose-attach input { margin-left: 6px; max-width: 100%; }
/* Picked attachments, kept across picks (attach.js). */
.attach-list { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; }
.attach-list li { padding: 2px 0; }
.attach-list .btn-link { font-size: 16px; line-height: 1; padding: 0 4px; }
form.attach-over { outline: 2px dashed var(--accent); outline-offset: 4px; }
.compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose-actions .spacer { flex: 1; }
.compose-countdown { display: inline-flex; gap: 6px; align-items: center; }
.compose-countdown[hidden] { display: none; }
@media (max-width: 600px) {
  .compose-row { grid-template-columns: 1fr; gap: 2px; }
  .compose-more > summary { margin-left: 0; }
}

.compose-sig-preview { border-left: 2px solid var(--line); padding: 4px 10px; margin: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.compose-sig-preview img { max-width: 100%; height: auto; }
.sig-form { display: flex; flex-direction: column; gap: 6px; }

.mail-inline { position: sticky; bottom: 0; z-index: 3; margin: 10px -4px 0; max-width: none; max-height: 78%; overflow-y: auto; gap: 6px;
  border-color: var(--accent); box-shadow: 0 -6px 18px rgba(31,58,95,.12); }
.mail-inline .compose-row { grid-template-columns: 56px minmax(0, 1fr); }
.mail-inline .compose-more > summary { margin-left: 64px; }
.mail-inline .compose-attach { margin: 0; }
.mail-inline-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mail-inline-foot .compose-attach { flex: 1; min-width: 0; }
.mail-inline-foot .compose-actions { flex-direction: row-reverse; }
.mail-inline-head { display: flex; align-items: center; gap: 10px; }
.mail-inline-head .spacer { flex: 1; }
.mail-inline .compose-body { min-height: 120px; }
.mail-inline .compose-editor { min-height: 110px; max-height: 40vh; overflow-y: auto; }
.mail-app[data-w=narrow] .mail-inline { margin: 10px -8px 0; max-height: 85%; }
.mail-inline[hidden] { display: none; }
.compose-files[hidden] { display: none; }

/* Filing, notes (step 6) */
.mail-filed { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mail-filed .inline-form { display: inline; margin: 0; }
.mail-filed .btn-link { padding: 0 0 0 4px; color: inherit; }
.mail-file-pop { min-width: 280px; padding: 8px; }
.mail-file-pop input[type=search] { width: 100%; }
.mail-file-results { margin-top: 6px; max-height: 240px; overflow-y: auto; }
.mail-file-results .btn-link { display: block; width: 100%; text-align: left; padding: 5px 6px; color: var(--text); }
.mail-file-results .btn-link:hover { background: var(--bg); text-decoration: none; }
.mail-file-attach { display: block; margin-top: 6px; }
.mail-notes { margin: 10px 0; padding: 8px 10px; background: var(--warn-bg); border-radius: var(--radius); }
.mail-note-item { padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.mail-note-form textarea { width: 100%; margin-top: 6px; font: inherit; }
.mail-note-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-filed-item { display: inline-flex; align-items: center; }
.mail-notes > summary { cursor: pointer; color: var(--warn); font-weight: 600; }
details.mail-notes:not([open]) { background: transparent; padding: 2px 0; }

/* Shared mailboxes (step 7) */
.mail-boxes { display: flex; flex-direction: column; margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.mail-shared-note { margin: 0 14px 8px; color: var(--muted); overflow-wrap: anywhere; }
.shared-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 8px 0; }
.shared-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.shared-head input[type=text] { width: 140px; }
.shared-grants { margin: 6px 0; }
.shared-grant { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list .inline-form { display: inline; }

/* Company overview as a widget grid (dashboard.js), and its Trello-style activity feed */
.co-tabs .spacer { flex: 1; }
.co-tabs .co-customize { flex: none; align-self: center; margin: 0 0 4px 8px; }
.co-details > h3 { margin-bottom: 8px; }
.co-details .widget-link { position: static; float: right; }
.widget .co-facts { margin-bottom: 0; }
.widget .mcard:last-child { margin-bottom: 0; }
.widget .widget-body > .panel + .panel { margin-top: 14px; }
.feed-compose { display: flex; gap: 10px; }
.feed-compose textarea { width: 100%; }
.feed-compose-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.feed-note { margin: 6px 0 10px 40px; font-size: 12.5px; }
.feed-note > summary { cursor: pointer; color: var(--muted); }
.feed-note form { margin-top: 6px; }
.feed-note textarea { width: 100%; }
.feed-filters { display: flex; gap: 4px; margin: 6px 0 4px; flex-wrap: wrap; }
.feed-filters button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px;
  color: var(--muted); cursor: pointer; }
.feed-filters button.on { background: #eef1f5; color: var(--accent); border-color: transparent; font-weight: 600; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed-item[hidden] { display: none; }
.feed-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #e6ebf2; color: #334155; font-weight: 600;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.feed-icon { background: #f3f5f8; font-size: 15px; }
.feed-upcoming .feed-avatar { background: #e3f4e8; }
.feed-main { flex: 1; min-width: 0; }
.feed-head { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.feed-head .feed-links, .feed-head .feed-delete { margin-left: auto; font-size: 12px; white-space: nowrap; }
.feed-head .feed-links a { margin-left: 10px; }
.feed-body { font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }
.feed-body p { margin: 3px 0; }
.feed-pre { white-space: pre-wrap; }
.feed-excerpt { white-space: pre-wrap; font-size: 13px; color: #3c4453; margin-top: 4px; }
.feed-actions { margin-top: 8px; padding: 8px 10px; background: #fbfcfd; border: 1px solid var(--line); border-radius: var(--radius); }
.feed .more-link { display: inline-block; margin-top: 10px; }

/* The company Overview widget: the description as prose, with the essentials in a row above it */
.co-overview { font-size: 14px; line-height: 1.55; }
.co-overview-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); }
.co-overview-facts .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-right: 5px; }
.co-overview-text p { margin: 0 0 10px; }
.co-overview-text p:last-child, .co-overview-text ul:last-child { margin-bottom: 0; }
.co-overview-text h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.co-overview-text h4:first-child { margin-top: 0; }
.co-overview-text ul { margin: 0 0 10px; padding-left: 20px; }
.co-overview-text li { margin-bottom: 3px; }
.co-overview-text .li-detail { color: var(--muted); font-size: 13px; margin: -2px 0 6px 20px; }
.co-overview-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.widget h3.widget-link { margin: 0; font-size: 12.5px; }

/* A meeting in the feed jumps to its card: stay clear of the sticky tabs, and light the card up on arrival */
.mcard { scroll-margin-top: calc(var(--topbar-h) + 64px); }
.mcard-flash { animation: mcard-flash 1.8s ease-out; }
@keyframes mcard-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }
.feed-meeting-link { color: inherit; text-decoration: none; }
.feed-meeting-link:hover strong { text-decoration: underline; color: var(--accent); }
.feed-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.widget[data-widget="summary"] .ai-headline { font-size: 16.5px; line-height: 1.4; }
.widget[data-widget="summary"] .ai-summary p, .widget[data-widget="summary"] .ai-summary li { font-size: 14px; }

/* Record cards (nav.js "peek"): a company, deal or person over the page you were on */
.peek-dialog { width: min(940px, 96vw); }
.peek-dialog:not([open]) { display: none; }
.pk .scard-head { border-top-color: var(--accent); align-items: center; }
.pk .scard-title h2 { font-size: 19px; }
.pk-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pk-actions [hidden] { display: none; }
.pk-body { padding: 14px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; max-height: calc(92vh - 90px); }
.pk-facts { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.pk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.pk-main, .pk-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pk-act { display: flex; gap: 8px; padding: 5px 0; border-top: 1px solid #f0f2f5; font-size: 13px; }
.pk-act:first-of-type { border-top: 0; }
.pk-icon { flex: none; width: 20px; text-align: center; }
.pk-cmt { padding: 6px 0; border-top: 1px solid #f0f2f5; font-size: 13px; }
.pk-cmt:first-of-type { border-top: 0; }
.pk-cmt p { margin: 2px 0; }
.pk-row-sub { display: block; font-size: 12px; color: var(--muted); }
.pk .scard-sec .muted:only-child { margin: 0; font-size: 13px; }
@media (max-width: 760px) { .pk-cols { grid-template-columns: 1fr; } }
/* Needs filing (crm/needs_filing.py) and the calendar's firm chips and "no record" marker */
.nf-card { padding: 12px 14px; }
.nf-head { display: flex; gap: 10px; align-items: flex-start; }
.nf-verdict { margin: 8px 0 6px 26px; }
.nf-actions { margin-left: 26px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.nf-change > summary { list-style: none; cursor: pointer; }
.nf-change > summary::-webkit-details-marker { display: none; }
.nf-change-form { display: grid; gap: 6px; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); max-width: 460px; }
.nf-change-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.nf-change-form legend { font-weight: 600; font-size: 12px; color: var(--muted); }
.nf-body { margin: 10px 0 0 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.nf-body h4 { margin: 0 0 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.nf-same { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 8px 0; }
.chip-firm { background: #fdf3d8; color: #6b4600; }
.chip-firm .chip-kind { font-weight: 400; }
.cal-firm { display: block; font-size: 10.5px; color: #6b4600; overflow: hidden; text-overflow: ellipsis; }
.week-co.week-firm { color: #6b4600; background: #fdf3d8; }
.unfiled { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; padding: 6px 8px; border-radius: 6px; background: var(--warn-bg); font-size: 12.5px; }
.unfiled-compact { margin: 2px 0 4px; padding: 2px 5px; font-size: 11px; gap: 4px; }
.unfiled-compact .btn-small { padding: 0 6px; font-size: 11px; }
.cal-legend { font-size: 12px; }
.stage.unfiled-tone { background: var(--warn-bg); color: #8a5a00; }

/* Land sales: off-market signal chips, owner group, value range, comps page */
.sig-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.sig-chip { display: inline-block; font-size: 11.5px; padding: 2px 7px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); border: 1px solid #f0dcae; }
.sig-chip.sig-long_hold, .sig-chip.sig-estate { background: #fde9d2; color: #8a3d00; border-color: #f3c99a; }
.lc-group ul { margin: 4px 0 0; padding-left: 16px; }
.lc-range { display: flex; gap: 10px; flex-wrap: wrap; }
.lc-range a { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.lc-range a b { font-size: 15px; }
.team-only-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; margin-left: 6px; }
.comps-stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; }
.comps-stats div { display: flex; flex-direction: column; }
.comps-stats b { font-size: 18px; }
#comps-map { height: 380px; border-radius: var(--radius); margin-bottom: 12px; }
.comp-form .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.comp-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
/* Import from a spreadsheet (crm/sheet_import/) */
.imp-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: -6px 0 14px; font-size: 12.5px; counter-reset: step; flex-wrap: wrap; }
.imp-steps li { counter-increment: step; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: #eef0f3; }
.imp-steps li::before { content: counter(step) ". "; }
.imp-steps li.on { background: var(--accent); color: #fff; }
.imp-steps li.done { background: var(--accent-soft); color: var(--accent); }
.imp-pending { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.imp-pending form { margin: 0; }
.imp-cols td { vertical-align: middle; }
.imp-cols select { width: 100%; }
table.data td.imp-samples { white-space: normal; }
.imp-samples span { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #f3f4f6; border-radius: 4px; padding: 0 6px; margin: 1px 4px 1px 0; font-size: 12.5px; vertical-align: middle; }
.imp-ignored td:not(:last-child) { color: var(--muted); }
.imp-ignored strong { font-weight: 500; }
.imp-opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.imp-opt-grid input[name$=_new] { margin-top: 6px; }
.fields label.imp-radio { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--text); margin: 2px 0; }
.imp-summary { display: grid; gap: 6px; font-size: 13px; }
.imp-go { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
table.data.imp-rows td { white-space: normal; vertical-align: top; }
table.data.imp-rows td:first-child { white-space: nowrap; }
.imp-flags .pill { margin: 0 4px 3px 0; white-space: normal; }
.imp-skip td { background: #fbfbfc; }
.imp-undo form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.imp-undone { background: var(--warn-bg); border-color: #f0dcae; }
@media (max-width: 640px) { .imp-cols th:nth-child(2), .imp-cols td:nth-child(2) { display: none; } }

/* Times: your calendar beside an email, to offer meeting slots (compose.js) */
.compose-times { font-size: 13px; }
.times-panel { position: fixed; top: var(--topbar-h, 52px); right: 0; bottom: 0; width: var(--times-w, clamp(480px, 42vw, 760px));
  max-width: 100vw; z-index: 40;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(0,0,0,.08);
  display: flex; flex-direction: column; padding: 10px 12px; gap: 6px; }
.times-panel[hidden] { display: none; }
@media (min-width: 1100px) { body.times-open main { margin-right: var(--times-w, clamp(480px, 42vw, 760px)); } }
.times-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; }
.times-resize:hover, body.times-resizing .times-resize { background: var(--accent-soft); }
body.times-resizing { user-select: none; cursor: ew-resize; }
.times-head { display: flex; align-items: baseline; gap: 8px; }
.times-head button { margin-left: auto; }
.times-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.times-bar .spacer { flex: 1; }
.times-hint { margin: 0; }
.times-grid-wrap { flex: 1; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; border: 1px solid var(--line); border-radius: var(--radius); }
.times-grid { display: grid; grid-template-columns: 30px repeat(var(--days, 5), minmax(0, 1fr)); position: relative; }
.times-grid.loading { opacity: .5; }
.times-hours { position: relative; margin-top: var(--head, 38px); }
.times-hours span { position: absolute; right: 3px; transform: translateY(-50%); font-size: 10px; color: var(--muted); }
.times-hours span:first-child { transform: none; }
.times-day { border-left: 1px solid var(--line); min-width: 0; }
.times-day-head { position: sticky; top: 0; z-index: 2; height: var(--head, 38px); box-sizing: border-box; padding: 3px 2px; background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: 11px; text-align: center; color: var(--muted); overflow: hidden; }
.times-day-head strong { color: var(--text); }
.times-day-head.today strong { color: var(--accent); }
.times-allday { display: block; font-size: 10px; background: var(--accent-soft); color: var(--accent); border-radius: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.times-col { position: relative; cursor: copy;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour, 44px) - 1px), var(--line) calc(var(--hour, 44px) - 1px) var(--hour, 44px)); }
.times-past { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(45deg, rgba(0,0,0,.03) 0 4px, transparent 4px 8px);
  cursor: not-allowed; }
.times-busy { position: absolute; left: 2px; right: 2px; border-radius: 3px; background: #e3e6eb; border-left: 3px solid #9aa3b0;
  font-size: 11px; line-height: 1.25; padding: 2px 4px; overflow: hidden; color: var(--text); cursor: default; overflow-wrap: anywhere; }
.times-busy-time { color: var(--muted); font-size: 10px; }
.times-busy.short { white-space: nowrap; text-overflow: ellipsis; padding-top: 0; padding-bottom: 0; }
.times-busy.short .times-busy-time, .times-busy.brief .times-busy-time { display: none; }
.times-busy.brief { line-height: 1.15; padding-top: 1px; padding-bottom: 1px; }
.times-slot { position: absolute; left: 4px; right: 4px; z-index: 1; border: 0; border-radius: 3px; background: var(--accent); color: #fff;
  font-size: 10px; line-height: 1.2; padding: 1px 3px; text-align: left; cursor: pointer; overflow: hidden; }
.times-slot.clash { background: var(--warn); }
.times-foot { border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 6px; max-height: 32%; }
.times-picked { list-style: none; margin: 0; padding: 0; overflow-y: auto; font-size: 13px; }
.times-picked li { display: flex; gap: 6px; align-items: center; padding: 2px 0; }
.times-picked .btn-link { margin-left: auto; color: var(--muted); }
.times-actions { display: flex; gap: 8px; align-items: center; }

/* My day: a reply waiting on us opens in the inbox */
.reply-open { color: var(--muted); }
.reply-open:hover { color: var(--accent); text-decoration: underline; }
.reply-dismiss { margin-left: 6px; color: var(--muted); font-size: 15px; line-height: 1; }
.reply-dismiss:hover { color: var(--bad); }
/* Windows draws scrollbars over the content's edge: keep room for them in the inbox columns and the Times grid */
.mail-folders, .mail-rows, .mail-reader, .times-picked { scrollbar-gutter: stable; scrollbar-width: thin; }

/* Split view: another hub page beside this one (split.js). The side is a frame drawn without the top bar. */
html.embedded { --topbar-h: 0px; }
html.embedded .appbar { display: none; }
html.split-on .shell { margin-right: var(--split-w, 560px); }
html.split-on .times-panel { right: var(--split-w, 560px); }
/* Stacked (top and bottom, for a portrait monitor): the side is a bottom pane; pages sized to the window use what's left. */
html.split-on.split-v { --main-vh: calc(100vh - var(--split-h, 50vh)); }
html.split-on.split-v .shell { margin-right: 0; margin-bottom: var(--split-h, 50vh); }
html.split-on.split-v .times-panel { right: 0; bottom: var(--split-h, 50vh); }
/* The main side narrower than 1180 px: the top menus fold into ☰, as they do on a narrow window. */
html.split-narrow .appbar .nav-burger { display: block; }
html.split-narrow .topnav { display: none; position: absolute; left: 0; right: 0; top: var(--topbar-h); height: auto; flex-direction: column;
  background: var(--accent); padding: 8px; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
html.split-narrow.nav-open .topnav { display: flex; }
html.split-narrow .tn-link, html.split-narrow .tn-menu > summary { height: 42px; border: 0; }
html.split-narrow .tn-menu { height: auto; }
html.split-narrow .tn-drop { position: static; box-shadow: none; border-top: 0; border-radius: 8px; margin: 0 0 6px; min-width: 0; }
html.split-narrow .appbar .search-trigger { width: auto; }
html.split-narrow .appbar .search-trigger kbd, html.split-narrow .appbar .search-text { display: none; }
/* The Land map in a side narrower than 900 px keeps its filters beside the map (hide them with ☰ Filters). */
@media (min-width: 560px) and (max-width: 900px) {
  html.embedded .land { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
  html.embedded .land.side-closed { grid-template-columns: 0 minmax(0, 1fr); }
  html.embedded .land-side { max-height: none; }
  html.embedded .land-work { grid-row: 2; }
}
.split-pane { position: fixed; top: 0; right: 0; bottom: 0; width: var(--split-w, 560px); z-index: 45; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -4px 0 16px rgba(0,0,0,.06); }
.split-pane[hidden] { display: none; }
.split-pane.split-pane-v { top: auto; left: 0; width: auto; height: var(--split-h, 50vh); border-left: 0; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.split-pane-v .split-handle { top: -5px; bottom: auto; left: 0; right: 0; width: auto; height: 10px; cursor: row-resize; }
.split-pane-v .split-handle::after { top: 3px; left: 50%; width: 44px; height: 4px; margin: 0 0 0 -22px; }
.split-handle { position: absolute; top: 0; bottom: 0; left: -5px; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.split-handle::after { content: ""; position: absolute; top: 50%; left: 3px; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px;
  background: var(--line); }
.split-handle:hover::after, .split-handle:focus-visible::after, .split-dragging .split-handle::after { background: var(--accent); }
.split-bar { display: flex; align-items: center; gap: 4px; height: var(--topbar-h); padding: 0 8px 0 12px; background: var(--accent); color: #fff; flex: 0 0 auto; }
.split-pick { max-width: 170px; height: 30px; font-size: 13px; }
.split-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbe4f0; font-size: 13px; }
.split-act { border: 0; background: none; color: #fff; font-size: 16px; padding: 4px 7px; border-radius: var(--radius); cursor: pointer; }
.split-act:hover { background: rgba(255,255,255,.14); }
.split-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.split-dragging, .split-dragging * { user-select: none; cursor: col-resize; }
.split-dragging.split-v, .split-dragging.split-v * { cursor: row-resize; }
.split-dragging iframe { pointer-events: none; }  /* the frames would swallow the drag */
@media (max-width: 900px) {
  html.split-on .shell { margin-right: 0; margin-bottom: 0 !important; }
  html.split-on .times-panel { right: 0; bottom: 0 !important; }
  html.split-on.split-v { --main-vh: 100vh; }
  .split-pane, .split-btn { display: none; }
}


/* Dark mode: the page's colours are inverted and the hues turned back, so every panel, table and badge follows,
   including the many that carry their own colours. Pictures, maps and frames are inverted again to look normal.
   Chosen with the profile menu's "Dark mode" button (nav.js); never used for printing. */
html[data-theme="dark"] { filter: invert(.92) hue-rotate(180deg); background: #fff; }
html[data-theme="dark"] img, html[data-theme="dark"] video, html[data-theme="dark"] iframe,
html[data-theme="dark"] canvas, html[data-theme="dark"] picture, html[data-theme="dark"] svg image,
html[data-theme="dark"] .leaflet-container, html[data-theme="dark"] .maplibregl-map, html[data-theme="dark"] .mapboxgl-map,
html[data-theme="dark"] [style*="background-image"] { filter: invert(1) hue-rotate(180deg) brightness(1.087); }
html[data-theme="dark"] .appbar .brand img { filter: none; }
@media print { html[data-theme="dark"] { filter: none; background: #fff; } html[data-theme="dark"] img,
  html[data-theme="dark"] iframe, html[data-theme="dark"] canvas { filter: none; } }
