/* AdFeeder brand: Navy + Coral, Poppins -- shared palette with topx_picker. */
:root {
    --af-navy: #19233a;
    --af-navy-light: #2b3752;
    --af-coral: #e67c69;
    --af-coral-dark: #c65f4d;
    --af-bg: #f8fafc;
    --af-border: #e2e8f0;
    --af-text-muted: #64748b;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 400;
    margin: 0;
    background: var(--af-bg);
    color: var(--af-navy);
}
h1, h2, h3, .section > .section-header, th {
    font-weight: 700;
}
h1 {
    background: var(--af-navy);
    color: #fff;
    margin: 0;
    padding: 12px 24px;
    font-size: 1.1rem;
    display: flex; align-items: center; gap: 10px;
}
h1 a { color: #fff; text-decoration: none; opacity: .9; display: flex; align-items: center; gap: 10px; }
h1 a:hover { opacity: 1; }
h1 img.brand-logo { height: 28px; width: auto; display: block; }
h1 .app-name { font-weight: 400; color: #cbd5e1; font-size: .85rem; }

nav.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--af-navy); flex-wrap: wrap;
}
nav.topbar .links { padding: 0 24px; display: flex; gap: 16px; flex-wrap: wrap; }
nav.topbar .links a { color: #cbd5e1; text-decoration: none; font-size: .85rem; }
nav.topbar .links a:hover { color: var(--af-coral); }
nav.topbar .whoami { display: flex; gap: 10px; padding: 0 24px; align-items: center; }
nav.topbar .whoami a { color: #cbd5e1; text-decoration: none; font-size: .8rem; }
nav.topbar .whoami a:hover { color: var(--af-coral); }
.nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff0000; vertical-align: middle; margin-left: 2px; }

.container { padding: 20px 24px; }

.section {
    background: #fff; margin: 16px 0; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--af-border); box-shadow: 0 1px 3px rgba(25,35,58,.06);
}
.section > .section-header {
    background: var(--af-navy); color: #fff; padding: 10px 14px;
    display: flex; justify-content: space-between; align-items: center;
}
details.section > summary.section-header {
    cursor: pointer; list-style: none; user-select: none;
}
details.section > summary.section-header::-webkit-details-marker { display: none; }
details.section > summary.section-header::after { content: '\25B8'; font-size: .9rem; }
details.section[open] > summary.section-header::after { content: '\25BE'; }
.activity-log > summary {
    background: var(--af-navy); color: #fff; padding: 10px 14px; font-weight: 700;
    cursor: pointer; list-style: none;
}
.activity-log > summary::-webkit-details-marker { display: none; }
.activity-log[open] > summary { border-bottom: 1px solid var(--af-border); }
.activity-log table { margin: 0; }
.dom { color: var(--af-text-muted); font-weight: 400; font-size: .8rem; }

.alpha-letter {
    margin: 14px 14px 0; color: var(--af-text-muted); font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--af-border); padding-bottom: 4px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 14px; }
.card {
    border: 1px solid var(--af-border); border-radius: 8px; padding: 12px; background: #fff;
}
.card h3 { margin: 0 0 6px; font-size: .95rem; }
.card .spec { color: var(--af-text-muted); font-size: .8rem; margin: 2px 0; }
.card a { text-decoration: none; }

.vehicle-card { display: block; overflow: hidden; color: inherit; }
.vehicle-card img {
    display: block; width: calc(100% + 24px); margin: -12px -12px 8px; height: 100px;
    object-fit: cover;
}
.vehicle-card:hover { border-color: var(--af-coral); }

.vehicle-carousel-wrap { position: relative; padding: 14px; }
.vehicle-carousel {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.vehicle-carousel::-webkit-scrollbar { height: 6px; }
.vehicle-carousel::-webkit-scrollbar-thumb { background: var(--af-border); border-radius: 999px; }
.vehicle-carousel .vehicle-card { flex: 0 0 160px; scroll-snap-align: start; }
.carousel-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--af-border);
    background: #fff; color: var(--af-navy); font-size: 1rem; line-height: 1; cursor: pointer;
    box-shadow: 0 1px 4px rgba(25,35,58,.15); display: flex; align-items: center; justify-content: center;
}
.carousel-nav:hover { border-color: var(--af-coral); color: var(--af-coral); }
.carousel-nav.prev { left: 4px; }
.carousel-nav.next { right: 4px; }
body.portal-theme .carousel-nav { background: var(--af-card); color: #fff; }
.card button, .card input[type=submit] {
    margin-top: 8px; background: var(--af-coral); color: #fff; border: none; border-radius: 6px;
    padding: 6px 10px; cursor: pointer; font-size: .8rem; font-weight: 700;
}
.card button:hover, .card input[type=submit]:hover { background: var(--af-coral-dark); }

table { border-collapse: collapse; width: 100%; }
th { background: var(--af-navy); color: #fff; padding: 7px 10px; text-align: left; }
td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }

.filter-row th { background: var(--af-bg); padding: 6px 8px; }
.filter-row select, .filter-row input[type=text] {
    width: 100%; padding: 4px 6px; border: 1px solid var(--af-border); border-radius: 6px;
    font-size: .8rem; box-sizing: border-box; font-family: inherit; color: var(--af-navy);
}
.filter-row button {
    background: #64748b; color: #fff; border: none; border-radius: 6px;
    padding: 5px 10px; cursor: pointer; font-size: .75rem; font-weight: 700;
}
.filter-row button:hover { background: #475569; }

a { color: var(--af-coral); }
a:hover { color: var(--af-coral-dark); }

form.entity-form label { display: block; margin: 10px 0 4px; font-size: .85rem; color: var(--af-text-muted); }
form.entity-form input[type=text], form.entity-form input[type=number], form.entity-form select, form.entity-form textarea {
    width: 100%; padding: 6px; border: 1px solid var(--af-border); border-radius: 6px; font-size: .85rem;
    box-sizing: border-box; font-family: inherit;
}
form.entity-form input[type=submit] {
    background: var(--af-coral); color: #fff; border: none; border-radius: 6px;
    padding: 8px 16px; cursor: pointer; font-size: .9rem; font-weight: 700; margin-top: 12px;
}
form.entity-form input[type=submit]:hover { background: var(--af-coral-dark); }

.flash { background: #22c55e; color: #fff; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-weight: 700; }
.flash.error { background: #ef4444; }

.option-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 4px 0; }
.option-checks label { display: flex; align-items: center; gap: 6px; font-size: .85rem; }

.status-options-bar {
    display: flex; align-items: center; gap: 20px; flex-wrap: nowrap; padding: 12px 16px;
}
.status-options-bar label { font-size: .8rem; font-weight: 700; color: var(--af-text-muted); margin-right: 8px; }
.status-inline { display: flex; align-items: center; flex-shrink: 0; }
.status-inline select { padding: 5px 8px; border: 1px solid var(--af-border); border-radius: 6px; font-size: .85rem; }
.status-options-divider { width: 1px; align-self: stretch; background: var(--af-border); flex-shrink: 0; }
.options-inline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.options-inline .option-checks { padding: 0; flex: 1 1 auto; min-width: 0; }
.options-inline input[type=submit] {
    background: var(--af-coral); color: #fff; border: none; border-radius: 6px;
    padding: 6px 12px; cursor: pointer; font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.options-inline input[type=submit]:hover { background: var(--af-coral-dark); }

.progress-bar {
    background: var(--af-border); border-radius: 999px; height: 10px; overflow: hidden; width: 100%;
}
.progress-bar > div { background: var(--af-coral); height: 100%; }
.progress-label { font-size: .75rem; color: var(--af-text-muted); margin-top: 4px; }
.progress-pct { font-size: .75rem; color: var(--af-coral-dark); font-weight: 700; margin-top: 2px; }

.status-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge.onboarding { background: #f97316; }
.status-badge.onboarding_live { background: linear-gradient(90deg, #f97316, #22c55e); }
.status-badge.live { background: #22c55e; }
.status-badge.paused { background: #94a3b8; }
.status-badge.open { background: #f97316; }
.status-badge.awaiting_customer { background: #3b82f6; }
.status-badge.closed { background: #94a3b8; }

.checklist-grid { align-items: start; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.checklist-platform.card { padding: 0; overflow: hidden; }
.checklist-platform.card > summary {
    padding: 12px; cursor: pointer; user-select: none; list-style: none; position: relative;
}
.checklist-platform.card > summary::-webkit-details-marker { display: none; }
.checklist-platform.card > summary::after {
    content: '▸'; color: var(--af-text-muted); font-size: 1.2rem; line-height: 1;
    position: absolute; top: 12px; right: 12px;
}
.checklist-platform.card[open] > summary::after { content: '▾'; }
.checklist-platform.card > summary:hover { background: var(--af-bg); }
.checklist-platform.card > summary > .group-name { margin: 0 26px 6px 0; font-size: .95rem; font-weight: 700; display: block; }
.checklist-platform.card.complete > summary > .group-name { color: #16a34a; }
.checklist-category { padding: 6px 12px 10px; border-top: 1px solid var(--af-border); }
.checklist-category > .cat-name {
    display: flex; justify-content: flex-start; align-items: baseline; gap: 10px;
    font-size: .75rem; color: var(--af-text-muted); font-weight: 700; text-transform: uppercase; margin: 6px 0 4px;
}
.checklist-category > .cat-name > .dom { text-transform: none; font-weight: 400; }
.checklist-category.complete > .cat-name > .group-name { color: #16a34a; }
.check-icon { color: #16a34a; font-weight: 700; }
.checklist-item { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; text-align: left; }
.checklist-item input[type=checkbox] { margin: 3px 0 0; flex-shrink: 0; cursor: pointer; }
.checklist-item .task-text { flex: 1 1 auto; min-width: 0; }
.checklist-item .task-name {
    font-size: .78rem; line-height: 1.3;
    white-space: normal;
}
.checklist-item.done .task-name { text-decoration: line-through; color: var(--af-text-muted); }
.checklist-item .task-name.has-description { border-bottom: 1px dotted var(--af-text-muted); cursor: help; width: fit-content; max-width: 100%; }
.checklist-item .task-meta { display: block; color: var(--af-text-muted); font-size: .68rem; margin-top: 1px; }
.option-tag { display: inline-block; background: var(--af-navy-light); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .65rem; margin-left: 4px; }

.checklist-item.na { opacity: .55; }
.checklist-item.na .task-name { text-decoration: line-through; }
.na-badge { display: inline-block; background: #94a3b8; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .65rem; margin-left: 4px; font-weight: 700; }
.checklist-item.done .na-checkbox { display: none; }
.na-checkbox {
    accent-color: #ef4444; width: 12px; height: 12px; margin: 4px 0 0; flex-shrink: 0; cursor: pointer;
    visibility: hidden;
}
.checklist-item:hover .na-checkbox, .checklist-item.na .na-checkbox { visibility: visible; }

.portal-task-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 0;
    border-top: 1px solid var(--af-border);
}
.portal-task-item:first-child { border-top: none; }
.portal-task-item .task-text { flex: 1 1 220px; min-width: 0; }
.portal-task-item .task-name { font-size: .85rem; }
.portal-task-item.done .task-name { text-decoration: line-through; color: var(--af-text-muted); }
.portal-task-x { color: var(--af-coral); font-weight: 700; flex-shrink: 0; }
.portal-task-item.done .portal-task-x { display: none; }
.portal-status-options { display: flex; gap: 12px; flex-shrink: 0; font-size: .82rem; }
.portal-status-options label { display: flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.portal-task-link { color: var(--af-coral); font-weight: 600; font-size: .82rem; text-decoration: none; }
.portal-task-link:hover { text-decoration: underline; }
.portal-task-item.issue { background: #fef2f2; border-radius: 6px; padding-left: 8px; padding-right: 8px; }
.portal-task-item.blocked { opacity: .6; }
.portal-task-item.blocked .portal-status-options input[type=radio] { cursor: not-allowed; }
.portal-issue-note {
    flex: 1 1 100%; width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--af-border);
    border-radius: 6px; font-family: inherit; font-size: .85rem; resize: vertical; min-height: 44px;
}
.info-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
    border-radius: 50%; background: var(--af-navy-light); color: #fff; font-size: .68rem; font-weight: 700;
    cursor: pointer; flex-shrink: 0; user-select: none;
}
.info-popup {
    display: none; position: absolute; top: 22px; left: 0; z-index: 10; background: #19233a; color: #fff;
    padding: 8px 10px; border-radius: 6px; font-size: .78rem; font-weight: 400; line-height: 1.4;
    width: max-content; max-width: 280px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.notes-summary-item { padding: 8px 0; border-top: 1px solid var(--af-border); font-size: .88rem; }
.notes-summary-item:first-child { border-top: none; }
.notes-summary-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: .75rem; }

.budget-donut {
    position: relative; width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--af-coral) calc(var(--pct) * 1%), var(--af-border) 0);
    display: flex; align-items: center; justify-content: center;
}
.budget-donut-hole {
    position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.budget-donut-pct { font-size: 1.3rem; font-weight: 700; color: var(--af-navy); line-height: 1.1; }
.budget-donut-label { font-size: .68rem; color: var(--af-text-muted); text-transform: uppercase; letter-spacing: .03em; }
body.portal-theme .budget-donut-hole { background: var(--af-card); }
body.portal-theme .budget-donut-pct { color: #fff; }

/* Target-pacing marker: a thin radial line pinned to the donut's center
   (transform-origin: bottom center, so rotating it sweeps its top end
   around the ring), same 0deg-at-12-o'clock/clockwise convention as the
   conic-gradient it overlays. budget-donut-hole sits on top (z-index 1)
   and is opaque, so only the outer ring-width segment of this line is
   ever visible -- it reads as a tick on the ring, not a spoke to the
   center. */
.budget-target-line {
    position: absolute; top: 0; left: 50%; width: 2px; height: 50%; margin-left: -1px;
    background: var(--af-navy); transform-origin: bottom center;
}
body.portal-theme .budget-target-line { background: #fff; }

.period-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.period-tab {
    padding: 6px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600; text-decoration: none;
    color: var(--af-text-muted); background: #fff; border: 1px solid var(--af-border);
}
.period-tab:hover { color: var(--af-navy); }
.period-tab.active { background: var(--af-navy); color: #fff; border-color: var(--af-navy); }
body.portal-theme .period-tab { background: var(--af-card); border-color: var(--af-border); color: rgba(255,255,255,.6); }
body.portal-theme .period-tab:hover { color: #fff; }
body.portal-theme .period-tab.active { background: var(--af-coral); border-color: var(--af-coral); color: #fff; }

.kpi-row {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 12px;
}
.kpi-tile {
    display: block; background: #fff; border: 1px solid var(--af-border); border-radius: 10px; padding: 14px;
    box-shadow: 0 1px 3px rgba(25,35,58,.06); text-decoration: none; cursor: pointer;
}
.kpi-tile:hover { border-color: var(--af-coral); }
.kpi-tile.active { box-shadow: 0 0 0 2px var(--af-coral) inset; }
.kpi-tile .kpi-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
    color: var(--af-text-muted); margin-bottom: 6px;
}
.kpi-tile .kpi-value { font-size: 1.4rem; font-weight: 700; color: var(--af-navy); }
body.portal-theme .kpi-tile { background: var(--af-card); border-color: var(--af-border); box-shadow: none; }
body.portal-theme .kpi-tile.active { box-shadow: 0 0 0 2px var(--af-coral) inset; }
body.portal-theme .kpi-tile .kpi-value { color: #fff; }
@media (max-width: 900px) {
    .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; min-width: max-content; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 22px; height: 100%; }
.bar {
    width: 100%; background: var(--af-coral); border-radius: 3px 3px 0 0; min-height: 2px;
}
.bar-label { font-size: .62rem; color: var(--af-text-muted); margin-top: 4px; }

.stats-grid {
    display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; margin-top: 16px;
    align-items: start;
}
.stats-grid > .section { margin: 0; }
@media (max-width: 700px) {
    .stats-grid { grid-template-columns: 1fr; }
}

.inline-toggle { display: inline; }
.inline-toggle button { background: none; border: none; color: var(--af-coral); cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }

.platform-reorder { list-style: none; margin: 0; padding: 0; max-width: 640px; }
.platform-reorder li {
    display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--af-border);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; cursor: grab; user-select: none;
}
.platform-reorder li:active { cursor: grabbing; }
.platform-reorder li.empty { color: var(--af-text-muted); cursor: default; }
.platform-reorder .drag-handle { color: var(--af-text-muted); font-size: 1.1rem; }
.platform-reorder .platform-name { font-weight: 700; }

.modal-box { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ------------------------------------------------------------------------
   Client portal dark theme -- matches webdev.adfeeder.com's look & feel
   (dark navy, coral accents, pill buttons, bold rounded headings). Scoped
   entirely to body.portal-theme so the internal staff app (same stylesheet,
   same class names) is completely unaffected. --af-navy/--af-coral already
   match the marketing site's own brand colors exactly -- this mostly just
   swaps which end of the palette is "background" vs "surface" and re-tones
   the light-mode-only literals (borders, muted text, input fills) that
   don't go through a variable.
   ------------------------------------------------------------------------ */
body.portal-theme {
    --af-bg: #19233a;
    --af-card: #3d4d6b;
    --af-border: rgba(255, 255, 255, .12);
    --af-text-muted: rgba(255, 255, 255, .6);
    color: #fff;
}
body.portal-theme h1 .app-name { color: rgba(255, 255, 255, .55); }
body.portal-theme h2 { font-size: 1.6rem; letter-spacing: -.01em; }
body.portal-theme a { color: var(--af-coral); }
body.portal-theme a:hover { color: var(--af-coral-dark); }

body.portal-theme .section {
    background: var(--af-card); border-color: var(--af-border); border-radius: 16px;
    box-shadow: none;
}
body.portal-theme .section > .section-header {
    background: transparent; color: #fff; font-size: 1.05rem;
    border-bottom: 1px solid var(--af-border);
}

body.portal-theme table { color: #fff; }
body.portal-theme th { background: transparent; color: rgba(255, 255, 255, .55); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
body.portal-theme td { border-bottom: 1px solid var(--af-border); }

body.portal-theme form.entity-form label { color: rgba(255, 255, 255, .6); }
body.portal-theme form.entity-form input[type=text],
body.portal-theme form.entity-form input[type=email],
body.portal-theme form.entity-form input[type=number],
body.portal-theme form.entity-form input[type=url],
body.portal-theme form.entity-form select,
body.portal-theme form.entity-form textarea {
    background: var(--af-bg); border: 1px solid var(--af-border); color: #fff;
}
body.portal-theme form.entity-form input:focus,
body.portal-theme form.entity-form select:focus,
body.portal-theme form.entity-form textarea:focus {
    outline: none; border-color: var(--af-coral);
}
body.portal-theme form.entity-form input[type=submit],
body.portal-theme button:not(.inline-toggle button) {
    background: var(--af-coral); color: #fff; border: none; border-radius: 50px;
    padding: 10px 24px; font-weight: 700; cursor: pointer;
}
body.portal-theme form.entity-form input[type=submit]:hover,
body.portal-theme button:not(.inline-toggle button):hover {
    background: var(--af-coral-dark);
}

body.portal-theme .progress-bar { background: rgba(255, 255, 255, .12); }
body.portal-theme .option-tag { background: rgba(230, 124, 105, .18); color: var(--af-coral); font-weight: 700; }
body.portal-theme .info-icon { background: rgba(255, 255, 255, .15); }
body.portal-theme .info-popup { background: #0f1626; border: 1px solid var(--af-border); }

body.portal-theme input[type=radio],
body.portal-theme input[type=checkbox] { accent-color: var(--af-coral); }
body.portal-theme .portal-task-item { border-top-color: var(--af-border); }
body.portal-theme .portal-task-item.issue { background: rgba(239, 68, 68, .12); }
body.portal-theme .portal-issue-note { background: var(--af-bg); border-color: var(--af-border); color: #fff; }
body.portal-theme .notes-summary-item { border-top-color: var(--af-border); }
body.portal-theme .flash { background: rgba(34, 197, 94, .18); color: #86efac; border: 1px solid rgba(34, 197, 94, .3); }
body.portal-theme .flash.error { background: rgba(239, 68, 68, .15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }

/* Clickable glossary term found in client-facing note text (Dave,
   2026-09-20) -- dotted underline signals it's interactive without
   permanently colouring/bolding the word, since it's still the client's
   own note text, not a UI control. See glossary_highlight.py /
   _portal_base.html's shared popup script. */
.glossary-term {
    border-bottom: 1px dotted var(--af-coral); cursor: pointer;
}
.glossary-popup {
    position: absolute; z-index: 1000; background: var(--af-navy); color: #fff;
    padding: 10px 14px 12px; border-radius: 8px; max-width: 280px; font-size: .82rem; line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.glossary-popup strong { display: block; margin: 0 0 4px; color: var(--af-coral); font-size: .85rem; }
.glossary-popup p { margin: 0; }
/* !important here beats body.portal-theme button:not(.inline-toggle
   button)'s big coral pill styling (higher specificity, would otherwise
   win) -- this close control needs to stay a small, quiet icon, not look
   like a primary action button (Dave, 2026-09-20: "can we make the large
   coral X a little smaller"). */
.glossary-popup-close {
    position: absolute !important; top: 0 !important; right: 4px !important;
    background: none !important; border: none !important; color: #94a3b8 !important;
    border-radius: 0 !important; font-weight: 400 !important;
    font-size: .85rem !important; line-height: 1 !important; cursor: pointer !important; padding: 4px !important;
}
.glossary-popup-close:hover { color: #fff !important; background: none !important; }

/* Extending portal-theme to the staff-facing app too (2026-09-12) --
   the client portal never used these, so they weren't dark-themed yet:
   plain .card (settings pages, checklist platform cards), the platform
   reorder list, and any input/select/textarea outside form.entity-form
   (status bar fields, filter rows, the email/data-check pop-up modals). */
body.portal-theme .card,
body.portal-theme .platform-reorder li,
body.portal-theme .modal-box {
    background: var(--af-card); border-color: var(--af-border);
}
/* Checklist platform panels (e.g. "Data Procurement") sit darker than the
   category sub-panels nested inside them (e.g. "Data Feed", "CRM") --
   categories previously had no background of their own at all, just
   inheriting the platform card's, so there was no visual nesting. */
body.portal-theme .checklist-platform.card {
    background: var(--af-bg);
}
body.portal-theme .checklist-category {
    background: var(--af-card); border-radius: 8px; margin: 6px 0; border-top: none;
}
body.portal-theme input:not([type=checkbox]):not([type=radio]):not([type=submit]),
body.portal-theme select,
body.portal-theme textarea {
    background: var(--af-bg); border: 1px solid var(--af-border); color: #fff;
}
body.portal-theme input:not([type=checkbox]):not([type=radio]):not([type=submit]):focus,
body.portal-theme select:focus,
body.portal-theme textarea:focus {
    outline: none; border-color: var(--af-coral);
}
body.portal-theme .status-options-divider,
body.portal-theme .checklist-category { border-color: var(--af-border); }
body.portal-theme td { border-bottom: 1px solid var(--af-border); }
body.portal-theme .filter-row th { background: var(--af-bg); }
body.portal-theme .checklist-platform.card > summary:hover { background: rgba(255, 255, 255, .04); }
