/* ============================================================
   Blue Lacuna — Portal.css
   Styles for the authenticated portal / admin / auth pages only.
   Site.css (the marketing theme) is loaded first; this extends it.
   ============================================================ */

/* ---- Auth card (login, set/reset password) ---- */
.auth-shell {
    display: flex;
    justify-content: center;
    padding: 56px 16px 72px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px 34px 30px;
}

.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.auth-card .auth-sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-card .form-label {
    font-size: 0.875rem;
}

.auth-links {
    margin-top: 18px;
    font-size: 0.85rem;
    text-align: center;
}

.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ---- Page band (hero strip for portal/admin pages) ---- */
.app-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--surface) 100%);
    padding: 30px 24px 26px;
    border-bottom: 3px solid var(--accent);
}

.app-hero h1 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.02em;
}

.app-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.app-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.app-hero .app-hero-sub {
    color: var(--muted);
    font-size: 0.925rem;
    margin: 6px 0 0;
}

/* ---- Admin tab strip ---- */
.admin-tabs {
    display: flex;
    gap: 6px;
    padding: 14px 24px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.admin-tabs a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 2px solid transparent;
}

.admin-tabs a:hover {
    color: var(--accent);
}

.admin-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(212, 165, 116, 0.08);
}

/* ---- App content padding ---- */
.app-body {
    padding: 26px 24px 48px;
}

/* ---- Tables ---- */
.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.app-table th {
    text-align: left;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}

.app-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-color);
    vertical-align: middle;
}

.app-table tr:hover td {
    background: rgba(212, 165, 116, 0.05);
}

.app-table .muted {
    color: var(--muted);
}

/* ---- Status badges ---- */
.badge-active,
.badge-inactive,
.badge-role {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

.badge-active   { background: rgba(72, 187, 120, 0.18);  color: #7ce0a3; }
.badge-inactive { background: rgba(229, 96, 96, 0.18);   color: #f1a0a0; }
.badge-role     { background: rgba(212, 165, 116, 0.18); color: var(--accent); }

/* ---- Forms ---- */
.app-form {
    max-width: 640px;
}

.app-form .form-label {
    font-size: 0.875rem;
}

.form-hint {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ---- Portal dashboard cards ---- */
.portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.portal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    box-shadow: var(--shadow-sm);
}

.portal-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 10px 0 6px;
}

.portal-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.portal-card .bi {
    font-size: 1.4rem;
    color: var(--accent);
}

.portal-card.coming-soon {
    opacity: 0.65;
    border-style: dashed;
}

/* ---- Stat tiles (admin dashboard) ---- */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.stat-tile .stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.stat-tile .stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

/* ---- Invite link box ---- */
.invite-link-box {
    background: var(--navy);
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    color: var(--text-color);
    word-break: break-all;
    margin: 10px 0;
}

/* ---- Alerts on dark theme ---- */
.app-alert-success {
    background: rgba(72, 187, 120, 0.14);
    border: 1px solid rgba(72, 187, 120, 0.4);
    color: #a8e6c1;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.app-alert-error {
    background: rgba(229, 96, 96, 0.12);
    border: 1px solid rgba(229, 96, 96, 0.4);
    color: #f1b7b7;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

/* Something to know, not a failure. */
.app-alert-note {
    background: rgba(212, 165, 116, 0.12);
    border: 1px solid rgba(212, 165, 116, 0.4);
    color: #ecd3b8;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

/* ---- Portal card that opens a whole screen (admin's prospects card) ---- */
.portal-card-link {
    position: relative;
    transition: border-color var(--transition), transform var(--transition);
}

.portal-card-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.portal-card .portal-card-meta {
    color: var(--accent);
    font-weight: 600;
    margin: 10px 0 4px;
}

/* ---- Prospects screen (admin only) ---- */
.app-body .muted {
    color: var(--muted);
}

.app-body p.muted {
    font-size: 0.9rem;
}

.prospect-crumb {
    font-size: 0.85rem;
    margin: 0 0 10px;
}

.prospect-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    margin: 0 0 14px;
}

.prospect-toolbar .prospect-crumb {
    margin: 0;
}

/* The Prospects list's page band (Eric, 5 Oct 2026): title left; the Portal link centred, which puts it over the gap
   between the second and third stat tiles; the search box flush with the right edge of the last tile (the band and
   the page body share the same 24px side padding). */
.prospects-hero-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.prospects-hero-top h1 {
    justify-self: start;
}

.prospects-hero-top .prospect-crumb {
    justify-self: center;
    margin: 0;
}

.prospects-hero-top .prospect-search {
    justify-self: end;
    position: relative;
}

/* 25% thinner than a standard box (40px to 30px). */
.prospects-hero-top .prospect-search input {
    height: 30px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.95rem;
}

/* Room for the match count under the box; the subtitle is one short line on the left (9 Oct 2026), so a little is enough. */
.app-hero .prospects-hero-top + .app-hero-sub {
    margin-top: 12px;
}

/* The match count sits under the box, so the box itself reaches the right edge. */
.prospects-hero-top .prospect-search-count {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .prospects-hero-top {
        grid-template-columns: 1fr;
    }

    .prospects-hero-top h1,
    .prospects-hero-top .prospect-crumb,
    .prospects-hero-top .prospect-search {
        justify-self: start;
    }

    .prospects-hero-top .prospect-search-count {
        position: static;
        margin-top: 0;
    }

    .app-hero .prospects-hero-top + .app-hero-sub {
        margin-top: 6px;
    }
}

.prospect-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.prospect-search[hidden] {
    display: none;
}

.prospect-search label {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
}

.prospect-search input {
    width: min(340px, 70vw);
    background: var(--navy);
    color: var(--text-color);
    border: 2px solid var(--accent);
}

.prospect-search input::placeholder {
    color: var(--muted);
}

.prospect-search-count {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 4.5em;
}

.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.th-sort i {
    font-size: 0.95em;
    opacity: 0.55;
}

.th-sort:hover i,
th[aria-sort="ascending"] .th-sort i,
th[aria-sort="descending"] .th-sort i {
    opacity: 1;
}

.th-sort:hover {
    color: var(--text-color);
}

.th-sort:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.prospect-crumb a {
    color: var(--muted);
    text-decoration: none;
}

.prospect-crumb a:hover {
    color: var(--accent);
}

.app-hero .app-hero-sub a {
    color: var(--accent);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    vertical-align: middle;
    background: rgba(245, 247, 250, 0.1);
    color: var(--text-color);
}

.chip-hot      { background: rgba(229, 96, 96, 0.22);   color: #f5a8a8; }
.chip-warm     { background: rgba(212, 165, 116, 0.2);  color: var(--accent); }
.chip-cool     { background: rgba(96, 165, 250, 0.18);  color: #9cc7fb; }
.chip-good     { background: rgba(72, 187, 120, 0.18);  color: #7ce0a3; }
.chip-off      { background: rgba(229, 96, 96, 0.14);   color: #f1a0a0; }
.chip-muted    { background: rgba(245, 247, 250, 0.08); color: var(--muted); }
.chip-internal { background: rgba(229, 96, 96, 0.12);   color: #f1b7b7; margin-left: 4px; }

/* Their words (Eric, 3 Oct 2026): the prospect's own vocabulary on the Demo tab; Avoid gets a warning tint. */
.words { margin: 0; display: grid; gap: 6px; }
.words-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 12px; padding: 6px 8px; border-radius: 6px; }
.words-row dt { font-weight: 700; margin: 0; }
.words-row dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.words-hint { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.word-tag { display: inline-block; font-size: 0.8rem; padding: 2px 9px; border-radius: 999px;
            background: rgba(245, 247, 250, 0.1); border: 1px solid var(--border); }
.words-avoid { background: rgba(229, 96, 96, 0.1); border: 1px solid rgba(229, 96, 96, 0.35); }
.words-avoid .word-tag { background: rgba(229, 96, 96, 0.16); border-color: rgba(229, 96, 96, 0.4); color: #f5b4b4; }
.words-sources { margin-top: 12px; }
.words-sources summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.words-sources ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.85rem; }
.words-sources a { margin-left: 4px; }
@media (max-width: 700px) { .words-row { grid-template-columns: 1fr; gap: 4px; } }

/* Who did it, on the activity log */
.who-petey    { background: rgba(167, 139, 250, 0.2);  color: #c9b8fd; }
.who-claude   { background: rgba(217, 119, 87, 0.22);  color: #f2ae95; }
.who-eric     { background: rgba(212, 165, 116, 0.2);  color: var(--accent); }
.who-portal   { background: rgba(72, 187, 120, 0.18);  color: #7ce0a3; }
.who-prospect { background: rgba(96, 165, 250, 0.18);  color: #9cc7fb; }

.tab-count {
    display: inline-block;
    min-width: 1.6em;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(245, 247, 250, 0.1);
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

.prospect-table .prospect-name {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.prospect-table .prospect-name:hover {
    color: var(--accent);
    text-decoration: underline;
}

.prospect-table tr.prospect-parked td {
    opacity: 0.6;
}

.prospect-table .prospect-next {
    min-width: 260px;
    max-width: 460px;
    font-size: 0.84rem;
}

.prospect-table td,
.people-table td,
.sources-table td {
    vertical-align: top;
}

.next-step {
    border-left: 3px solid var(--accent);
    background: rgba(212, 165, 116, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 10px 14px;
    margin-bottom: 22px;
    font-size: 0.9rem;
}

.next-step-label {
    color: var(--accent);
    font-weight: 700;
    margin-right: 6px;
}

/* Last step and Next step, side by side in the space the Next step bar had (Eric, 29 Sep); one column when narrow. */
.step-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.step-pair .next-step {
    margin-bottom: 0;
    min-width: 0;
}

.step-when {
    color: var(--muted);
    font-size: 0.85rem;
}

.step-due {
    font-weight: 600;
}

.step-link {
    font-weight: 600;
    white-space: nowrap;
}

.prospect-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 22px;
    align-items: start;
}

@media (max-width: 960px) {
    .prospect-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.panel h2,
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin: 0 0 12px;
}

.section-title {
    margin: 26px 0 12px;
}

.panel-internal {
    border-color: rgba(229, 96, 96, 0.45);
}

.lead-text {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 14px;
}

.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 7px 18px;
    font-size: 0.88rem;
    margin: 0;
}

.facts dt {
    color: var(--muted);
    font-weight: 600;
}

.facts dd {
    margin: 0;
}

.facts-stacked {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
}

.facts-stacked dd {
    margin-bottom: 10px;
}

.score-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.score-bars {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.84rem;
}

.score-bars li {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.score-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(245, 247, 250, 0.1);
    overflow: hidden;
}

.score-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.score-value {
    color: var(--muted);
    text-align: right;
}

/* Petey's reports, rendered from Markdown */
details.report {
    margin-top: 8px;
}

details.report > summary,
details.message-details > summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.report-body {
    margin-top: 10px;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.86rem;
    line-height: 1.55;
    overflow-x: auto;
}

.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.1em 0 0.4em;
}

.report-body p,
.report-body ul,
.report-body ol {
    margin-bottom: 0.7em;
}

.report-body table {
    border-collapse: collapse;
    margin-bottom: 0.8em;
}

.report-body th,
.report-body td {
    border: 1px solid var(--border);
    padding: 4px 8px;
}

.report-body pre,
.message-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    color: var(--text-color);
}

/* Activity log */
.timeline-day {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin: 22px 0 6px;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 64px 72px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.timeline-time {
    color: var(--muted);
    font-size: 0.8rem;
    padding-top: 2px;
    white-space: nowrap;
}

.timeline-what {
    font-weight: 700;
    margin-right: 4px;
}

@media (max-width: 600px) {
    .timeline-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
}

/* Communication */
.message {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.message-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
}

.message-head .bi {
    color: var(--accent);
}

.message-date {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Open Draft in Mac Mail (Eric, 2 Oct 2026): top right of a draft's card, after the date. */
.message-head .message-mail {
    margin-left: auto;
}

.message-date + .message-mail {
    margin-left: 4px;
}

.message-mail-result {
    margin: 6px 0 0;
}

/* A line of its own for the Mac Mail button and the private link. */
.message-break {
    flex-basis: 100%;
    height: 0;
}

.message-head .message-break + .message-mail {
    margin-left: 0;
}

/* The envelope on the Mac Mail button is the button's dark blue, like its words (Eric, 19 Oct 2026); other icons in the
   card's head stay gold. */
.message-head .message-mail .bi {
    color: inherit;
}

/* A draft's private link with a copy button, on the Mac Mail button's line, from the middle of the card (Eric, 8 Oct 2026). */
.message-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 50%;
    margin-left: auto;
    min-width: 0;
}

.message-link-label {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.message-link-label .bi {
    color: var(--accent);
}

.message-link-url {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
}

.message-link-copy {
    min-width: 36px;
}

.message-link-note {
    margin: 0;
    white-space: nowrap;
}

.message-link-note:empty {
    display: none;
}

/* A narrow window: the link takes its own full line. */
@media (max-width: 900px) {
    .message-link {
        flex-basis: 100%;
        margin-left: 0;
    }
}

.message-subject {
    font-weight: 700;
    margin: 8px 0 4px;
}

.message-body {
    margin: 10px 0 0;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}

/* Blue Lacuna's demo for advisers (Eric, 27 Sep 2026): its panel on the Prospects screen, and "Copy the link for" */
.internal-panel {
    margin-bottom: 18px;
}

.internal-panel p {
    margin: 8px 0 0;
}

.internal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.adviser-link {
    margin: 14px 0 6px;
}

.adviser-row {
    display: flex;
    gap: 8px;
    margin: 4px 0 8px;
}

.adviser-row input {
    max-width: 320px;
}

/* Prospects screen: Outreach due (Eric, 27 Sep 2026) */
.due-panel {
    margin-bottom: 18px;
}

.due-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.due-head h2 {
    margin: 0;
}

.due-table {
    width: 100%;
    margin: 10px 0 6px;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.due-table td {
    padding: 6px 12px 6px 0;
    vertical-align: top;
    border-top: 1px solid var(--border);
}

.due-when {
    white-space: nowrap;
    font-weight: 600;
}

.due-late .due-when {
    color: #feb2b2;
}

.due-today .due-when {
    color: #90cdf4;
}

/* The private link above the drafts (Eric, 6 Oct 2026). */
.link-strip {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.link-strip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.link-strip-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.link-strip .app-alert-success,
.link-strip .app-alert-error {
    margin-bottom: 8px;
}

.link-strip-host {
    margin: 6px 0 0;
}

/* The first note's day (Eric, 20 Oct 2026): a date and Set / Change / Clear, at the right of its bar. */
.first-note-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.first-note-form input[type="date"] {
    width: auto;
}

.reminders-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Communication tab: Mark as sent, Undo and due dates (Eric, 26 Sep 2026) */
.mark-sent {
    margin-top: 10px;
    font-size: 0.88rem;
}

.mark-sent summary {
    display: inline-block;
    cursor: pointer;
    padding: 4px 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    font-weight: 600;
}

.mark-sent-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    margin: 10px 0 4px;
}

.mark-sent-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.8rem;
}

.mark-sent-form input[type="text"] {
    min-width: 240px;
}

.mark-sent-undo {
    margin-top: 8px;
}

.chip-due {
    background: rgba(66, 153, 225, 0.18);
    color: #90cdf4;
}

.chip-due-late {
    background: rgba(245, 101, 101, 0.2);
    color: #feb2b2;
}

.message-foot {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 8px;
}

/* Demo */
.demo-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.demo-actions {
    display: flex;
    gap: 16px;
    font-size: 0.86rem;
}

.demo-frame {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 620px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    margin: 6px 0 24px;
}

/* Demo: the private link's buttons and password box */
.link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.link-clear {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 4px 0 10px;
}

.link-clear .form-hint {
    margin: 0;
    flex: 1 1 260px;
}

.link-password {
    margin-top: 12px;
    font-size: 0.88rem;
}

.link-password summary {
    cursor: pointer;
    color: var(--accent);
}

.link-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 4px;
    max-width: 420px;
}

.link-password-form .btn {
    white-space: nowrap;
}

.access-list {
    padding-left: 18px;
    margin: 0;
    font-size: 0.88rem;
}

.access-list li {
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

/* Demo: the welcome message box, and the private demo link to its right (Eric, 29 Sep). The box has no preview;
   the demo below it shows the real thing. The signature sits under the message, name and title side by side. */
.demo-top {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    gap: 22px;
    align-items: start;
}

.demo-top > .panel {
    min-width: 0;
}

@media (max-width: 1100px) {
    .demo-top {
        grid-template-columns: minmax(0, 1fr);
    }
}

.welcome-signature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 14px;
}

@media (max-width: 600px) {
    .welcome-signature {
        grid-template-columns: minmax(0, 1fr);
    }
}

.welcome-form fieldset {
    min-width: 0;
}

.welcome-form fieldset:disabled {
    opacity: 0.55;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.welcome-actions .form-hint {
    margin: 0;
}

.char-count {
    float: right;
    font-variant-numeric: tabular-nums;
}

.char-count.over,
.char-count .over {
    color: #f1a0a0;
    font-weight: 600;
}

.welcome-message-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 0.5rem;
}

.welcome-message-head .form-label {
    margin: 0;
}

.welcome-message-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Demo: Draft first touch email (Eric, 29 Sep). The email sits on white, as Mac Mail shows it. */
.touch-dialog {
    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 20px 22px;
    background: var(--surface);
    color: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.touch-dialog::backdrop {
    background: rgba(8, 12, 20, 0.6);
}

.touch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.touch-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.touch-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.touch-tab {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-weight: 600;
}

.touch-tab[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: currentColor;
}

.touch-tab-note {
    font-weight: 400;
    color: var(--muted);
}

.touch-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 14px;
    margin: 0 0 12px;
}

.touch-meta dt {
    color: var(--muted);
    font-weight: 600;
}

.touch-meta dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    overflow-wrap: anywhere;
}

.touch-warn {
    color: #f1a0a0;
    font-weight: 600;
}

.touch-mail {
    max-height: 48vh;
    overflow: auto;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: #fff;
    color: #000;
    overflow-wrap: anywhere;
}

.touch-mail a {
    color: #0b57d0;
}

.touch-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 12px;
}

.touch-actions .form-hint,
.touch-note {
    margin: 0;
}

.touch-note {
    margin-top: 12px;
}

.touch-url {
    overflow-wrap: anywhere;
}

.touch-empty {
    margin: 0;
}

/* ---- Privacy page ---- */
.privacy {
    max-width: 820px;
}

.privacy h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 6px 0 10px;
}

.privacy section {
    margin-bottom: 26px;
}

.privacy li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.auth-links-sep {
    color: var(--muted);
    margin: 0 6px;
}

/* Communication tab: what isn't due today, behind a click (Eric, 9 Oct 2026). */
.comm-more {
    margin: 4px 0 18px;
}

.comm-more > summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.comm-more > summary:hover {
    color: var(--text-color);
    border-color: var(--accent);
}

/* Prospects screen: the counts and the advisers' demo in one compact row (Eric, 9 Oct 2026; smaller, one line). */
.stat-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
    min-width: 0;
}

.stat-chip-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-chip-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.stat-chip-advisers {
    margin-left: auto;
    padding: 3px 4px 3px 11px;
}

.stat-chip-advisers a.stat-chip-label {
    color: var(--accent);
    text-decoration: none;
}

.stat-chip-advisers a.stat-chip-label:hover {
    text-decoration: underline;
}

.stat-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-color);
    font-size: 0.75rem;
    text-decoration: none;
}

.stat-chip-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* A narrow window: the tiles wrap, the advisers' one first in line with the rest. */
@media (max-width: 860px) {
    .stat-strip {
        flex-wrap: wrap;
    }

    .stat-chip-advisers {
        margin-left: 0;
    }
}

/* The draft card, trimmed (Eric, 19 Oct 2026): Mark As Sent is a checkbox at the right of the subject line that records
   today and the draft's address in the background. The copy icons went the same evening (Eric); the private link keeps its own. */
.message-subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.message-subject-row .message-subject {
    margin: 8px 0 4px;
    min-width: 0;
}

.mark-sent-check {
    margin: 0;
    white-space: nowrap;
}

.mark-sent-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.mark-sent-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ---- Prospecting dashboard (Eric, 4 Nov 2026): spoke slicers, the funnel, notes per week, spokes side by side ---- */
.dash-slicers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.dash-slicer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.dash-slicer:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dash-slicer.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a2740;
}

.dash-slicer-count {
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.dash-funnel {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 1100px) {
    .dash-funnel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dash-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
}

.dash-tile-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.dash-tile-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

.dash-tile-sub {
    font-size: 0.75rem;
    color: var(--muted);
    min-height: 1.1em;
}

.dash-lines p {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.dash-lines {
    margin-bottom: 20px;
}

/* One series: thin bars with 4px rounded tops on the baseline, 2px apart; the column is the hover target. */
.dash-chart {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 150px;
    padding-top: 18px;
    border-bottom: 1px solid var(--border);
    border-top: 1px dashed rgba(245, 247, 250, 0.08);
}

.dash-chart-max {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.dash-col {
    position: relative;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    outline: none;
}

.dash-bar {
    display: block;
    width: 60%;
    max-width: 44px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
}

.dash-col:hover .dash-bar,
.dash-col:focus-visible .dash-bar {
    background: var(--accent-dark);
}

.dash-bar-label {
    font-size: 0.75rem;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    margin-bottom: 2px;
}

.dash-col:hover::after,
.dash-col:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 8px;
    border-radius: var(--radius);
    background: #0f1a2c;
    border: 1px solid var(--border);
    color: var(--text-color);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

.dash-chart-axis {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.dash-chart-axis span {
    flex: 1 1 0;
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
}

.dash-table-view {
    margin-top: 12px;
    font-size: 0.85rem;
}

.dash-table-view summary {
    color: var(--muted);
    cursor: pointer;
}

.dash-spokes td:not(:first-child),
.dash-spokes th:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-row-current td {
    background: rgba(212, 165, 116, 0.10);
}

.dash-row-total td {
    font-weight: 700;
    border-top: 1px solid var(--border);
}

/* The spoke key (Eric, 6 Nov 2026): a link beside the slicers, and the table it jumps to. */
.dash-key-link {
    align-self: center;
    margin-left: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.dash-key-link:hover {
    color: var(--accent);
}

.dash-key-group td {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 14px;
}

.dash-key-range {
    text-transform: none;
}

.dash-key-number {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.dash-key-name {
    font-weight: 600;
    white-space: nowrap;
}

.dash-notes {
    font-size: 0.78rem;
}

/* The end columns' tooltips open inward, so they stay inside the panel. */
.dash-col:first-of-type:hover::after,
.dash-col:first-of-type:focus-visible::after {
    left: 0;
    transform: none;
}

.dash-col:last-of-type:hover::after,
.dash-col:last-of-type:focus-visible::after {
    left: auto;
    right: 0;
    transform: none;
}
