:root {
    --navy: #071827;
    --navy-soft: #10293f;
    --cream: #f7f1e6;
    --cream-deep: #efe3cf;
    --sage: #8ea58e;
    --sage-dark: #536a58;
    --gold: #c99b4a;
    --ink: #17202a;
    --muted: #64706f;
    --line: rgba(7, 24, 39, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    --radius: 24px;
}

/* Dashboard chart: keep plot columns inside the chart instead of inheriting
   fixed heights from earlier responsive dashboard rules. */
.dashboard-call-bar-chart {
    grid-template-rows: minmax(0, 1fr);
    height: 410px;
    min-height: 0;
    padding: 3.45rem 0.85rem 0.8rem;
    overflow: hidden;
}

.dashboard-call-bars {
    height: 100%;
    min-height: 0;
    padding-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
}

.dashboard-call-day-group {
    grid-template-rows: minmax(0, 1fr) 1.25rem;
    height: 100%;
    min-height: 0;
}

.dashboard-call-bar-group,
.dashboard-call-bar-shell {
    height: 100%;
    min-height: 0;
}

.dashboard-call-bar-shell {
    overflow: visible;
}

@media (max-width: 720px) {
    .dashboard-call-bar-chart {
        height: 360px;
        min-height: 0;
        padding: 3.25rem 0.65rem 0.75rem;
    }

    .dashboard-call-bars,
    .dashboard-call-day-group,
    .dashboard-call-bar-group,
    .dashboard-call-bar-shell {
        height: 100%;
        min-height: 0;
        padding-top: 0;
    }
}

/* Delivery timeline: milestone rail and client checkpoint nodes. */
.client-timeline-path { position:relative; display:grid; gap:1.2rem; max-width:1180px; margin:1.3rem auto 3rem; padding:1rem 0; }
.client-timeline-path::before { content:""; position:absolute; top:0; bottom:0; left:50%; width:3px; border-radius:3px; background:linear-gradient(var(--gold,#c4aa50), var(--sage,#748661), var(--forest,#42543b)); transform:translateX(-50%); }
.client-timeline-stage { position:relative; display:grid; grid-template-columns:1fr 88px 1fr; min-height:120px; z-index:1; }
.client-timeline-stage.is-left .client-timeline-stage-card { grid-column:1; }
.client-timeline-stage.is-right .client-timeline-stage-card { grid-column:3; }
.client-timeline-rail { display:grid; grid-column:2; grid-row:1; place-items:start center; padding-top:1.5rem; }
.client-stage-marker { display:grid; place-items:center; width:58px; height:58px; border:5px solid var(--cream,#f4ebd8); border-radius:50%; background:var(--navy,#10253a); color:var(--cream,#f4ebd8); box-shadow:0 0 0 2px var(--sage,#748661), 0 8px 20px rgba(7,21,34,.28); font-size:.84rem; font-weight:900; letter-spacing:.08em; }
.client-timeline-stage-card { position:relative; margin:0; padding:1.1rem; border-top:4px solid var(--sage,#748661); }
.client-timeline-stage-card::after { content:""; position:absolute; top:3rem; width:44px; height:2px; background:var(--sage,#748661); }
.client-timeline-stage.is-left .client-timeline-stage-card::after { right:-44px; }
.client-timeline-stage.is-right .client-timeline-stage-card::after { left:-44px; }
.client-timeline-stage:nth-child(3n + 2) .client-timeline-stage-card { border-top-color:var(--gold,#c4aa50); }
.client-timeline-stage:nth-child(3n) .client-timeline-stage-card { border-top-color:var(--forest,#42543b); }
.client-search-label { position:relative; }
.client-search-results { position:absolute; z-index:5; display:grid; gap:.25rem; width:min(520px,100%); max-height:230px; overflow:auto; margin-top:.25rem; padding:.4rem; border:1px solid rgba(16,37,58,.16); border-radius:14px; background:var(--card-bg,#fffdf8); box-shadow:0 18px 38px rgba(7,21,34,.2); }
.client-search-results:empty { display:none; }
.client-search-results button { display:grid; gap:.15rem; border:0; border-radius:10px; padding:.65rem .75rem; background:transparent; color:var(--ink,#10253a); text-align:left; cursor:pointer; }
.client-search-results button:hover, .client-search-results button:focus { background:rgba(116,134,97,.15); }
.client-search-results small { color:#647176; }
.client-checkpoint-list { display:grid; gap:.45rem; margin-top:.9rem; padding-top:.8rem; border-top:1px solid rgba(16,37,58,.1); }
.client-deliverable-list { display:grid; gap:.45rem; margin-top:.9rem; padding-top:.8rem; border-top:1px solid rgba(16,37,58,.1); }.client-deliverable-heading { display:flex; justify-content:space-between; gap:.5rem; font-size:.82rem; }.client-deliverable-heading span { color:var(--muted); font-size:.75rem; }.client-deliverable-form { display:grid; grid-template-columns:1fr 1fr auto auto; gap:.45rem; align-items:center; margin-top:.25rem; }.client-deliverable-form input { min-width:0; padding:.52rem .62rem; font-size:.78rem; }.client-deliverable-form .check-filter { white-space:nowrap; font-size:.72rem; }.client-deliverable-form .ghost-button { padding:.52rem .7rem; font-size:.76rem; }
.timeline-checkpoint-editor { margin-top:.45rem; }.timeline-checkpoint-editor summary { cursor:pointer; color:var(--forest,#42543b); font-size:.78rem; font-weight:800; }.timeline-checkpoint-editor .timeline-template-form { margin:.65rem 0 0; }
.client-checkpoint { display:grid; grid-template-columns:26px 1fr; gap:.55rem; align-items:start; margin:0; }
.client-deliverable-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.45rem; align-items:start; }
.client-deliverable-delete { min-height:26px; padding:.2rem .35rem; color:#8b3d2f; font-size:.72rem; }
.checkpoint-toggle { display:grid; place-items:center; width:22px; height:22px; margin-top:.05rem; border:2px solid var(--sage,#748661); border-radius:50%; background:var(--card-bg,#fffdf8); color:transparent; font-size:.58rem; font-weight:800; cursor:pointer; }
.client-checkpoint.is-complete .checkpoint-toggle { border-color:var(--forest,#42543b); background:var(--forest,#42543b); color:var(--cream,#f4ebd8); }
.checkpoint-copy { display:grid; gap:.15rem; color:var(--ink,#10253a); font-size:.82rem; line-height:1.25; }
.checkpoint-copy small { color:#647176; }
.checkpoint-timing { display:flex; flex-wrap:wrap; gap:.28rem; color:var(--sage-dark,#53654b); font-size:.7rem; font-weight:800; }
.checkpoint-timing.is-pending { color:#7a8381; font-weight:700; }
.checkpoint-links { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.15rem; }
.checkpoint-links a { color:var(--forest,#42543b); font-size:.72rem; font-weight:800; }
.client-delivery-complete { color:var(--forest,#42543b); font-size:.78rem; font-weight:800; }
.timeline-template-panel { margin-top:1.1rem; }
.timeline-template-heading { display:flex; justify-content:space-between; gap:1.5rem; align-items:start; }
.timeline-template-heading h2 { margin:.3rem 0 .55rem; }
.timeline-template-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; margin:1.2rem 0; padding:1rem; border:1px solid rgba(16,37,58,.12); border-radius:16px; background:var(--card-bg,#fffdf8); }
.timeline-template-form label:nth-child(2), .timeline-template-form label:nth-child(3) { grid-column:span 2; }
.timeline-template-form textarea { min-height:70px; }
.timeline-template-form button { align-self:end; min-height:44px; }
.timeline-template-stage-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
.timeline-template-stage { padding:.8rem; border:1px solid rgba(16,37,58,.12); border-radius:14px; background:rgba(255,253,248,.5); }
.timeline-template-stage header, .timeline-template-row { display:flex; justify-content:space-between; gap:.6rem; }
.timeline-template-stage header { align-items:center; font-weight:800; }
.timeline-template-stage header strong { display:grid; place-items:center; min-width:24px; height:24px; border-radius:50%; background:var(--navy,#10253a); color:var(--cream,#f4ebd8); font-size:.72rem; }
.timeline-template-row { align-items:start; margin-top:.65rem; padding-top:.65rem; border-top:1px solid rgba(16,37,58,.1); }
.timeline-template-row > div { display:grid; gap:.15rem; font-size:.78rem; }
.timeline-template-row small, .timeline-template-row span { color:#647176; }
@media (max-width:820px) { .client-timeline-path::before { left:27px; } .client-timeline-stage, .client-timeline-stage.is-left, .client-timeline-stage.is-right { grid-template-columns:55px 1fr; } .client-timeline-stage.is-left .client-timeline-stage-card, .client-timeline-stage.is-right .client-timeline-stage-card { grid-column:2; } .client-timeline-rail { grid-column:1; } .client-timeline-stage-card::after { display:none; } .client-stage-marker { width:42px; height:42px; border-width:4px; font-size:.7rem; } .timeline-template-stage-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:620px) { .timeline-template-heading { display:grid; } .timeline-template-form, .timeline-template-stage-list { grid-template-columns:1fr; } .timeline-template-form label:nth-child(2), .timeline-template-form label:nth-child(3) { grid-column:auto; } .client-timeline-stage-card { padding:.9rem; } .client-timeline-actions .primary-button { white-space:normal; } }

/* Client delivery timeline */
.client-timeline-hero, .timeline-add-client { display:flex; align-items:start; justify-content:space-between; gap:2rem; }
.client-timeline-hero h2, .timeline-add-client h2 { max-width:760px; margin:.35rem 0 .7rem; }
.client-timeline-hero p, .timeline-add-client p { max-width:720px; }
.client-timeline-metrics { display:grid; grid-template-columns:repeat(3,minmax(116px,1fr)); gap:.65rem; min-width:380px; }
.client-timeline-metrics article { padding:1rem; background:var(--card-bg,#fffdf8); border:1px solid rgba(16,37,58,.12); border-top:4px solid var(--gold,#c4aa50); border-radius:16px; }
.client-timeline-metrics span, .client-timeline-requirement-copy, .client-timeline-client p { color:#647176; }
.client-timeline-metrics span { display:block; font-size:.78rem; font-weight:700; }
.client-timeline-metrics strong { display:block; font-size:1.8rem; margin-top:.25rem; }
.client-timeline-add-form { display:grid; grid-template-columns:minmax(240px,1fr) minmax(190px,.7fr) auto; align-items:end; gap:.85rem; min-width:min(100%,650px); }
.client-timeline-add-form label { margin:0; }
.client-timeline-add-form button { min-height:48px; white-space:nowrap; }
.client-timeline-board { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(290px,330px); gap:1rem; overflow-x:auto; align-items:start; padding:.2rem .1rem 1rem; scroll-snap-type:x proximity; scrollbar-color:var(--gold,#c4aa50) transparent; }
.client-timeline-stage { min-height:400px; margin:0; padding:1.1rem; scroll-snap-align:start; border-top:4px solid var(--sage,#748661); }
.client-timeline-stage:nth-child(3n + 2) { border-top-color:var(--gold,#c4aa50); }
.client-timeline-stage:nth-child(3n) { border-top-color:var(--forest,#42543b); }
.client-timeline-stage-header, .client-timeline-stage-header > div, .client-timeline-client-topline, .client-timeline-actions { display:flex; align-items:center; }
.client-timeline-stage-header { justify-content:space-between; gap:.75rem; }
.client-timeline-stage-header > div { gap:.55rem; min-width:0; }
.client-timeline-stage-header h2 { font-size:1.1rem; margin:0; line-height:1.12; }
.client-timeline-stage-header > strong { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--navy,#10253a); color:var(--cream,#f4ebd8); }
.client-stage-number { color:var(--gold,#c4aa50); font-size:.72rem; letter-spacing:.1em; font-weight:800; }
.client-timeline-requirement-copy { min-height:2.5rem; margin:.7rem 0 1rem; font-size:.84rem; }
.client-timeline-client-list { display:grid; gap:.75rem; }
.client-timeline-client { padding:.9rem; border:1px solid rgba(16,37,58,.13); border-radius:16px; background:var(--card-bg,#fffdf8); box-shadow:0 7px 18px rgba(7,21,34,.07); }
.client-timeline-client.is-waiting { border-color:rgba(196,170,80,.75); box-shadow:0 7px 20px rgba(196,170,80,.14); }
.client-timeline-client-topline { justify-content:space-between; gap:.5rem; }
.client-timeline-client-topline a { color:var(--ink,#10253a); text-decoration:none; line-height:1.25; }
.client-timeline-client p { margin:.4rem 0 0; font-size:.86rem; line-height:1.35; }
.client-waiting-flag { background:rgba(196,170,80,.22); color:#654c0d; padding:.22rem .45rem; border-radius:999px; font-size:.7rem; font-weight:800; }
.client-stage-age { display:flex; align-items:baseline; gap:.35rem; margin-top:.75rem; color:#53615a; font-size:.78rem; }
.client-stage-age strong { font-size:1.25rem; color:var(--ink,#10253a); }
.client-next-action { padding:.55rem .65rem; border-radius:10px; background:rgba(116,134,97,.12); }
.client-next-action span { display:block; color:var(--forest,#42543b); font-size:.66rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.client-timeline-actions { flex-wrap:wrap; gap:.45rem; margin-top:.85rem; }
.client-timeline-actions form { display:flex; align-items:center; gap:.35rem; margin:0; }
.client-timeline-actions select { width:138px; min-height:38px; padding:.35rem .45rem; font-size:.77rem; }
.client-timeline-actions .primary-button, .client-timeline-actions .ghost-button, .client-timeline-actions .text-button { min-height:38px; padding:.45rem .65rem; font-size:.77rem; }
@media (max-width:900px) { .client-timeline-hero, .timeline-add-client { display:grid; } .client-timeline-metrics { min-width:0; } }
@media (max-width:640px) { .client-timeline-metrics { grid-template-columns:repeat(3,1fr); } .client-timeline-metrics article { padding:.75rem; } .client-timeline-metrics strong { font-size:1.4rem; } .client-timeline-add-form { grid-template-columns:1fr; min-width:0; width:100%; } .client-timeline-add-form button { width:100%; } .client-timeline-board { grid-auto-columns:minmax(84vw,84vw); margin-right:-1rem; padding-right:1rem; } }

/* The rail uses the original timeline cards but intentionally overrides the old board layout. */
.client-timeline-path .client-timeline-stage { display:grid; grid-template-columns:1fr 88px 1fr; min-height:120px; margin:0; padding:0; border:0; scroll-snap-align:none; }
.client-timeline-path .client-timeline-stage.is-left .client-timeline-stage-card { grid-column:1; }
.client-timeline-path .client-timeline-stage.is-right .client-timeline-stage-card { grid-column:3; }
.client-timeline-path .client-timeline-stage-card { position:relative; margin:0; padding:1.1rem; border-top:4px solid var(--sage,#748661); }
.client-timeline-path .client-timeline-stage-card::after { content:""; position:absolute; top:3rem; width:44px; height:2px; background:var(--sage,#748661); }
.client-timeline-path .client-timeline-stage.is-left .client-timeline-stage-card::after { right:-44px; }
.client-timeline-path .client-timeline-stage.is-right .client-timeline-stage-card::after { left:-44px; }
.client-timeline-path .client-timeline-stage:nth-child(3n + 2) .client-timeline-stage-card { border-top-color:var(--gold,#c4aa50); }
.client-timeline-path .client-timeline-stage:nth-child(3n) .client-timeline-stage-card { border-top-color:var(--forest,#42543b); }
@media (max-width:820px) { .client-timeline-path .client-timeline-stage, .client-timeline-path .client-timeline-stage.is-left, .client-timeline-path .client-timeline-stage.is-right { grid-template-columns:55px 1fr; } .client-timeline-path .client-timeline-stage.is-left .client-timeline-stage-card, .client-timeline-path .client-timeline-stage.is-right .client-timeline-stage-card { grid-column:2; } .client-timeline-path .client-timeline-stage-card::after { display:none; } }

.call-tree-shell,
.call-manager-list {
    display: grid;
    gap: 1rem;
}

.call-tree-header {
    display: grid;
    gap: 1rem;
}

.call-tree-lead-details {
    gap: 0;
}

.call-tree-lead-details summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 999px;
    padding: 0.75rem 0.9rem 0.75rem 1rem;
    background: rgba(7, 24, 39, 0.08);
    color: var(--navy);
    cursor: pointer;
    font-weight: 950;
    list-style: none;
}

.call-tree-lead-details summary::-webkit-details-marker {
    display: none;
}

.call-tree-lead-details summary span {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.call-tree-lead-details summary strong,
.call-tree-lead-details summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-tree-lead-details summary small {
    color: var(--muted);
    font-size: 0.78rem;
}

.call-tree-lead-details summary::after {
    content: "+";
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 1.25rem;
    font-weight: 950;
    line-height: 1;
}

.call-tree-lead-details[open] summary {
    margin-bottom: 1rem;
}

.call-tree-lead-details[open] summary::after {
    content: "-";
}

.call-tree-lead-body {
    display: grid;
    gap: 1rem;
}

.call-tree-actions,
.call-tree-start-grid,
.call-tree-button-grid,
.quick-requirements-grid,
.call-manager-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.call-tree-actions a,
.call-tree-outcome-menu select,
.call-tree-start-grid button,
.call-tree-start-grid a,
.call-tree-button-grid button {
    min-height: 48px;
}

.call-tree-outcome-menu {
    display: contents;
}

.call-tree-outcome-menu label {
    display: block;
}

.call-tree-outcome-menu select {
    width: auto;
    min-width: 150px;
    border-radius: 999px;
    padding: 0 2.3rem 0 1rem;
    background: rgba(7, 24, 39, 0.08);
    color: var(--navy);
    font-weight: 900;
}

.call-tree-facts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
}

.call-tree-facts span {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(28, 49, 46, 0.12);
    border-radius: 16px;
    padding: 0.75rem;
    color: var(--muted);
}

.call-tree-facts strong {
    display: block;
    color: var(--ink);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.call-tree-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    width: 100%;
}

.call-tree-grid > .panel {
    width: 100%;
}

.say-card {
    background: linear-gradient(135deg, rgba(255, 252, 244, 0.95), rgba(232, 223, 202, 0.45));
    border: 1px solid rgba(217, 181, 109, 0.32);
    border-radius: 20px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 16px 34px rgba(8, 23, 43, 0.08);
}

.say-card span {
    display: block;
    color: var(--sage);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.say-card p {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
    margin: 0;
}

.call-tree-inline-edit {
    margin-top: 0.85rem;
    border-top: 1px solid rgba(8, 23, 43, 0.08);
    padding-top: 0.75rem;
}

.call-tree-inline-edit summary {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    border-radius: 999px;
    background: rgba(8, 23, 43, 0.06);
    color: var(--navy);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.45rem 0.85rem;
}

.call-tree-inline-edit form {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.call-tree-inline-edit textarea {
    min-height: 170px;
}

.compact-button {
    min-height: 42px;
    padding: 0.65rem 1rem;
    width: fit-content;
}

.question-card {
    background: rgba(126, 151, 133, 0.14);
    border-color: rgba(126, 151, 133, 0.28);
}

.call-tree-muted {
    color: var(--muted);
}

.call-tree-transition-form,
.post-call-grid,
.scorecard-grid,
.call-node-edit-form {
    display: grid;
    gap: 1rem;
}

.capture-grid,
.scorecard-grid,
.post-call-grid,
.call-node-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.call-node-edit-form label:has(textarea),
.settings-wide {
    grid-column: 1 / -1;
}

.call-tree-button-grid {
    align-items: stretch;
}

.call-tree-rewind-form {
    margin-bottom: 0.65rem;
}

.call-tree-rewind-form .ghost-button {
    min-height: 40px;
    padding: 0 0.85rem;
    font-size: 0.92rem;
}

.call-tree-resume-required-form {
    margin-bottom: 0.65rem;
}

.call-tree-resume-required-form .ghost-button {
    min-height: 40px;
    padding: 0 0.85rem;
    font-size: 0.92rem;
}

.scorecard-checkpoint-panel {
    display: grid;
    gap: 1rem;
}

.scorecard-context-header,
.scorecard-context-grid,
.scorecard-header-actions,
.scorecard-checkpoint-review,
.scorecard-checkpoint-review-grid,
.scorecard-summary-edit-grid,
.scorecard-comparison-grid,
.scorecard-history-timeline,
.scorecard-note-list,
.scorecard-note-item {
    display: grid;
    gap: 0.9rem;
}

.scorecard-context-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scorecard-comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scorecard-context-grid article,
.scorecard-checkpoint-review-grid article,
.scorecard-compare-card,
.scorecard-history-item {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(8, 23, 43, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.scorecard-context-grid article strong,
.scorecard-checkpoint-review-grid article strong,
.scorecard-compare-card strong,
.scorecard-history-item strong {
    display: block;
    margin-bottom: 0.35rem;
}

.scorecard-context-grid article p,
.scorecard-checkpoint-review-grid article p,
.scorecard-compare-card p,
.scorecard-history-item p,
.scorecard-note-item p {
    margin: 0;
    color: var(--muted);
}

.scorecard-context-alert {
    grid-column: 1 / -1;
}

.scorecard-header-actions {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.scorecard-header-actions form {
    display: contents;
}

.scorecard-checkpoint-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.checkpoint-pill-form {
    margin: 0;
}

.checkpoint-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(8, 23, 43, 0.12);
    background: rgba(8, 23, 43, 0.05);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkpoint-pill span,
.checkpoint-pill small {
    display: block;
}

.checkpoint-pill small {
    font-size: 0.63rem;
    letter-spacing: 0.06em;
}

.checkpoint-pill.is-complete {
    background: rgba(132, 171, 138, 0.22);
    border-color: rgba(132, 171, 138, 0.5);
    color: var(--ink);
}

.checkpoint-pill.needs-review {
    background: rgba(201, 155, 74, 0.14);
    border-color: rgba(201, 155, 74, 0.52);
    color: var(--ink);
}

.checkpoint-pill.is-blocked {
    background: rgba(143, 101, 82, 0.12);
    border-color: rgba(143, 101, 82, 0.2);
    color: var(--muted);
}

.checkpoint-pill.is-current {
    border-color: rgba(219, 177, 77, 0.72);
    box-shadow: 0 0 0 2px rgba(219, 177, 77, 0.2);
    color: var(--ink);
}

.scorecard-checkpoint-review-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
}

.scorecard-checkpoint-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scorecard-empty-state {
    grid-column: 1 / -1;
}

.scorecard-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.scorecard-summary-bar > div {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(8, 23, 43, 0.05);
    border: 1px solid rgba(8, 23, 43, 0.08);
}

.scorecard-summary-bar strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink);
}

.scorecard-summary-bar p {
    margin: 0;
    color: var(--muted);
}

.scorecard-route-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.scorecard-route-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(219, 177, 77, 0.08);
    border: 1px solid rgba(219, 177, 77, 0.18);
}

.scorecard-route-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.scorecard-route-card p {
    margin: 0;
    color: var(--muted);
}

.scorecard-sticky-summary-drawer {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(8, 23, 43, 0.08);
    border-radius: 20px;
    background: rgba(8, 23, 43, 0.035);
    margin-bottom: 1rem;
}

.scorecard-sticky-summary-drawer summary {
    cursor: pointer;
    font-weight: 800;
}

.scorecard-summary-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.9rem;
}

.scorecard-summary-edit-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.call-tree-strength-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    display: grid;
    gap: 0.35rem;
}

.scorecard-exact-wording-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.scorecard-exact-wording-list blockquote {
    margin: 0;
    padding: 0.9rem 1rem;
    border-left: 4px solid rgba(201, 155, 74, 0.78);
    border-radius: 14px;
    background: rgba(8, 23, 43, 0.05);
    color: var(--ink);
}

.scorecard-workflow-summary {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(8, 23, 43, 0.08);
    border-radius: 20px;
    background: rgba(8, 23, 43, 0.035);
}

.scorecard-workflow-summary summary {
    cursor: pointer;
    font-weight: 800;
}

.scorecard-workflow-summary-grid {
    margin-top: 0.9rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.scorecard-workflow-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(8, 23, 43, 0.08);
    display: grid;
    gap: 0.7rem;
}

.scorecard-workflow-card p {
    margin: 0;
}

.scorecard-service-signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.scorecard-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.scorecard-history-item form {
    margin-top: 0.5rem;
}

.scorecard-note-list {
    gap: 0.7rem;
}

.scorecard-note-item,
.scorecard-note-list blockquote {
    margin: 0;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: rgba(8, 23, 43, 0.05);
    border-left: 4px solid rgba(201, 155, 74, 0.7);
}

.scorecard-compare-card.is-primary {
    border-color: rgba(132, 171, 138, 0.5);
    box-shadow: 0 0 0 2px rgba(132, 171, 138, 0.18);
}

.scorecard-close-card {
    margin: 0 0 1rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(8, 23, 43, 0.08);
    background: rgba(8, 23, 43, 0.04);
    display: grid;
    gap: 0.85rem;
}

.scorecard-close-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.scorecard-close-grid article,
.scorecard-close-meta {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(8, 23, 43, 0.08);
    background: rgba(255, 255, 255, 0.74);
}

.scorecard-close-grid article strong,
.scorecard-close-meta strong {
    display: block;
    margin-bottom: 0.35rem;
}

.scorecard-close-grid article p,
.scorecard-close-meta p {
    margin: 0;
    color: var(--muted);
}

.scorecard-close-meta {
    display: grid;
    gap: 0.55rem;
}

.scorecard-close-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.call-tree-global-notes-form {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 1rem;
}

.call-tree-global-note textarea {
    min-height: 130px;
}

.call-tree-global-notes-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.call-tree-button-grid button {
    flex: 1 1 180px;
    white-space: normal;
}

.global-button-drawer {
    background: rgba(8, 23, 43, 0.04);
    border: 1px solid rgba(8, 23, 43, 0.08);
    border-radius: 18px;
    padding: 0.9rem;
}

.call-tree-reading-scripts {
    display: grid;
    gap: 0.55rem;
    padding: 0.9rem;
    border: 1px solid rgba(201, 155, 74, 0.42);
    border-radius: 18px;
    background: rgba(217, 181, 109, 0.13);
}

.call-tree-reading-scripts .eyebrow {
    margin: 0;
}

.call-tree-live-note-actions {
    display: grid;
    justify-items: start;
    gap: 0.55rem;
}

.global-button-drawer summary,
.call-manager-node summary {
    cursor: pointer;
    font-weight: 800;
}

.call-draft-status {
    min-height: 1.2rem;
    color: var(--sage-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.call-manager-node summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.call-manager-node details[open] summary {
    margin-bottom: 1rem;
}

.call-manager-buttons {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(8, 23, 43, 0.1);
    padding-top: 1rem;
}

.call-manager-button-row {
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(8, 23, 43, 0.08);
    border-radius: 14px;
    padding: 0.75rem;
}

@media (max-width: 900px) {
    .call-tree-grid,
    .call-tree-facts,
    .capture-grid,
    .scorecard-grid,
    .post-call-grid,
    .call-node-edit-form {
        grid-template-columns: 1fr;
    }

    .call-tree-actions,
    .call-tree-start-grid,
    .call-tree-button-grid,
    .quick-requirements-grid {
        align-items: stretch;
    }

    .call-tree-actions a,
    .call-tree-outcome-menu select,
    .call-tree-start-grid button,
    .call-tree-start-grid a,
    .call-tree-button-grid button,
    .quick-requirements-grid label {
        flex: 1 1 100%;
    }

    .call-tree-outcome-menu label,
    .call-tree-outcome-menu select {
        width: 100%;
    }

    .call-tree-global-notes-actions {
        align-items: stretch;
    }

    .call-tree-global-notes-actions .ghost-button {
        width: 100%;
    }

    .scorecard-context-grid,
    .scorecard-summary-edit-grid,
    .scorecard-checkpoint-review-grid,
    .scorecard-comparison-grid {
        grid-template-columns: 1fr;
    }

    .scorecard-summary-bar {
        grid-template-columns: 1fr;
    }

    .scorecard-workflow-summary-grid {
        grid-template-columns: 1fr;
    }

    .scorecard-route-summary,
    .scorecard-summary-bar {
        grid-template-columns: 1fr;
    }

    .scorecard-close-grid {
        grid-template-columns: 1fr;
    }

    .scorecard-close-actions form,
    .scorecard-close-actions button {
        width: 100%;
    }

    .scorecard-sticky-summary-drawer {
        position: sticky;
        top: 0.8rem;
        z-index: 5;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(201, 155, 74, 0.18), transparent 34rem),
        linear-gradient(135deg, var(--theme-bg, var(--navy)), var(--navy) 52%, #132c31);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img,
svg,
video {
    max-width: 100%;
}

pre,
code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

button,
a,
input,
select,
textarea,
.panel,
.stat-card,
.mobile-lead-card,
.meeting-card,
.script-card,
.dashboard-action-card {
    min-width: 0;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-wrap {
    width: min(100%, 440px);
}

.login-card,
.panel,
.stat-card,
.logout-card {
    background: var(--panel-bg, rgba(247, 241, 230, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.48);
    box-shadow: var(--shadow);
}

.login-card {
    border-radius: 30px;
    padding: clamp(1.25rem, 5vw, 2rem);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--navy);
    box-shadow: 0 10px 24px rgba(7, 21, 34, 0.24);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand strong {
    display: block;
    letter-spacing: 0.02em;
}

.brand small {
    color: var(--muted);
}

.login-brand {
    margin-bottom: 2rem;
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: var(--sage-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.8rem;
    font-size: clamp(2rem, 9vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0.7rem;
    font-size: clamp(1.5rem, 7vw, 2.4rem);
    letter-spacing: -0.035em;
}

.login-copy,
.panel p {
    color: var(--muted);
    line-height: 1.65;
}

.login-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
}

label {
    display: grid;
    gap: 0.45rem;
    color: var(--navy);
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    background: var(--card-bg, #fffaf0);
    color: var(--ink);
    min-height: 52px;
}

textarea {
    min-height: 280px;
    resize: vertical;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(201, 155, 74, 0.32);
    border-color: var(--gold);
}

.primary-button,
.ghost-button,
.desktop-logout {
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    text-align: center;
}

.action-link,
button.primary-button,
button.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.primary-button {
    background: linear-gradient(135deg, var(--gold), #f1d184);
    color: var(--navy);
    box-shadow: 0 16px 34px rgba(201, 155, 74, 0.3);
}

.ghost-button,
.desktop-logout {
    background: rgba(7, 24, 39, 0.08);
    color: var(--navy);
    padding: 0 1rem;
}

.alert {
    margin: 1rem 0;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    background: #fff0df;
    border: 1px solid rgba(201, 116, 74, 0.28);
    color: #743b25;
    font-weight: 800;
}

.success-alert {
    background: rgba(142, 165, 142, 0.22);
    border-color: rgba(83, 106, 88, 0.28);
    color: var(--sage-dark);
}

.mfa-wrap {
    width: min(100%, 560px);
}

.mfa-card {
    display: grid;
    gap: 1rem;
}

.mfa-qr-panel {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.mfa-qr {
    display: grid;
    place-items: center;
    width: min(100%, 320px);
    margin: 0 auto;
    border-radius: 24px;
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(7, 24, 39, 0.12);
}

.mfa-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.mfa-steps {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
    line-height: 1.45;
    font-weight: 750;
}

.mfa-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1rem 0;
}

.mfa-code-grid code {
    display: block;
    border-radius: 16px;
    padding: 0.8rem;
    background: rgba(7, 24, 39, 0.08);
    color: var(--navy);
    font-weight: 950;
    text-align: center;
    letter-spacing: 0.08em;
}

.mfa-print-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.empty-state {
    border: 1px dashed rgba(7, 24, 39, 0.18);
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: rgba(255, 250, 240, 0.6);
    color: var(--muted);
    line-height: 1.55;
}

.lead-actions {
    display: grid;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.lead-actions .action-link {
    width: 100%;
}

.page-section {
    margin-top: 1rem;
}

.import-panel {
    position: fixed;
    inset: 0;
    /* The desktop sidebar is fixed above page content, so the import dialog
       must sit above it as well rather than being covered by navigation. */
    z-index: 100;
    padding: 0.7rem;
    background: rgba(7, 24, 39, 0.86);
    overflow-y: auto;
}

.import-panel-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    border-radius: 28px;
    padding: clamp(1rem, 4vw, 1.6rem);
    background: var(--cream);
    box-shadow: var(--shadow);
}

.import-heading {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.import-form {
    display: grid;
    gap: 0.85rem;
}

.button-row {
    display: grid;
    gap: 0.6rem;
}

.import-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.compact-stat {
    box-shadow: none;
}

.summary-card,
.review-card,
.duplicate-card {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: var(--card-bg, rgba(255, 250, 240, 0.78));
}

.summary-card h3,
.review-card h3,
.duplicate-card h3 {
    margin-top: 0;
    color: var(--navy);
}

.summary-grid {
    display: grid;
    gap: 0.55rem;
}

.summary-grid span,
.mini-row,
.match-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 0.65rem;
    color: var(--muted);
}

.summary-grid strong,
.mini-row strong,
.match-line strong {
    color: var(--navy);
}

.lead-preview-list,
.duplicate-list {
    display: grid;
    gap: 0.7rem;
}

.lead-preview {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card-bg, rgba(247, 241, 230, 0.82));
}

.lead-preview strong,
.lead-preview span {
    display: block;
}

.lead-preview span,
.duplicate-card p {
    color: var(--muted);
    line-height: 1.45;
}

mark {
    width: fit-content;
    border-radius: 999px;
    padding: 0.4rem 0.6rem;
    background: rgba(201, 155, 74, 0.22);
    color: var(--navy);
    font-weight: 900;
}

.clean-mark {
    background: rgba(142, 165, 142, 0.26);
    color: var(--sage-dark);
}

.duplicate-columns {
    display: grid;
    gap: 0.8rem;
}

.duplicate-actions {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.danger-button {
    color: #7a2f22;
    background: rgba(122, 47, 34, 0.09);
}

.replace-fields {
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 0.8rem;
}

.replace-fields summary {
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.field-checks {
    display: grid;
    gap: 0.45rem;
    margin: 0.8rem 0;
}

.field-checks label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
}

.field-checks input {
    width: auto;
    min-height: 0;
}

.status-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    background: rgba(142, 165, 142, 0.24);
    color: var(--sage-dark);
    font-weight: 900;
}

.follow-up-due-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border: 1px solid #8f2020;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    background: #a92828;
    color: #fffaf0;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.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;
}

.lead-filter-panel,
.bulk-panel {
    display: grid;
    gap: 1rem;
}

.filter-heading {
    display: grid;
    gap: 1rem;
}

.lead-filter-dropdown {
    display: grid;
    gap: 1rem;
}

.lead-filter-dropdown summary {
    width: fit-content;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 999px;
    padding: 0 1rem;
    background: rgba(7, 24, 39, 0.08);
    color: var(--navy);
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.lead-filter-dropdown summary::-webkit-details-marker {
    display: none;
}

.lead-filter-dropdown summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-weight: 950;
    line-height: 1;
}

.lead-filter-dropdown[open] summary {
    margin-bottom: 0.25rem;
}

.lead-filter-dropdown[open] summary::after {
    content: "-";
}

.lead-filters,
.bulk-panel {
    display: grid;
    gap: 0.75rem;
}

.industry-filter-group {
    display: grid;
    gap: 0.65rem;
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 18px;
    padding: 0.85rem;
    background: rgba(255, 250, 240, 0.45);
}

.industry-filter-group legend {
    padding: 0 0.35rem;
    color: var(--navy);
    font-weight: 900;
}

.industry-filter-actions {
    display: flex;
    justify-content: flex-start;
}

.industry-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.55rem;
    max-height: 260px;
    overflow: auto;
    padding-right: 0.2rem;
}

.industry-checkbox-grid .check-filter {
    min-height: 44px;
}

.check-filter {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 48px;
    border-radius: 16px;
    padding: 0 0.75rem;
    background: rgba(142, 165, 142, 0.16);
}

.check-filter input,
.mobile-select-lead input,
.leads-table input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

.filter-buttons {
    display: grid;
    gap: 0.6rem;
}

.desktop-leads-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.72);
}

.lead-sheet-search {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 1.15rem;
}

.lead-sheet-search label {
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 950;
}

.lead-sheet-search-row {
    display: grid;
    gap: 0.65rem;
}

.lead-sheet-search-row input {
    min-height: 54px;
    font-size: 1rem;
}

.lead-list-heading,
.lead-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.lead-list-heading {
    margin-bottom: 1rem;
}

.lead-pagination {
    justify-content: flex-end;
}

.lead-pagination span {
    color: var(--muted);
    font-weight: 900;
}

.lead-pagination-bottom {
    margin-top: 1rem;
    justify-content: center;
}

.mobile-lead-cards {
    display: none;
}

.mobile-lead-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1rem;
    background: rgba(255, 250, 240, 0.84);
    box-shadow: 0 14px 32px rgba(7, 24, 39, 0.08);
}

.mobile-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.mobile-select-lead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-size: 0.85rem;
}

.mobile-lead-card h3 {
    margin: 0 0 0.9rem;
    color: var(--navy);
    font-size: 1.35rem;
    line-height: 1.1;
}

.mobile-lead-facts {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 1rem;
}

.mobile-lead-facts div {
    display: grid;
    gap: 0.1rem;
}

.mobile-lead-facts dt {
    color: var(--sage-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-lead-facts dd {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
}

.mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.mobile-quick-actions .action-link,
.mobile-bad-flow button {
    min-height: 52px;
}

.mobile-bad-flow {
    margin-top: 0.75rem;
    border-top: 1px solid var(--line);
    padding-top: 0.75rem;
}

.mobile-bad-flow summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    color: #7a2f22;
    cursor: pointer;
    font-weight: 900;
}

.mobile-bad-flow form {
    display: grid;
    gap: 0.7rem;
}

.business-link {
    color: var(--navy);
    font-weight: 950;
    letter-spacing: -0.01em;
}

.table-action-link {
    color: var(--sage-dark);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
}

.button-link {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.status-select {
    min-width: 160px;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    color: var(--navy);
    font-weight: 900;
}

.lead-status-control,
.mobile-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.uncalled-dot {
    position: relative;
    flex: 0 0 auto;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    background: #38d778;
    box-shadow:
        0 0 0 3px rgba(56, 215, 120, 0.18),
        0 0 16px rgba(56, 215, 120, 0.72),
        0 0 30px rgba(56, 215, 120, 0.42);
}

.uncalled-dot::after {
    content: "";
    position: absolute;
    inset: -0.35rem;
    border-radius: inherit;
    border: 1px solid rgba(56, 215, 120, 0.42);
    animation: uncalledPulse 1.8s ease-out infinite;
}

@keyframes uncalledPulse {
    0% {
        opacity: 0.8;
        transform: scale(0.72);
    }

    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

.leads-table td:first-child,
.leads-table th:first-child {
    width: 42px;
}

.leads-table {
    min-width: 1120px;
}

.leads-table td {
    vertical-align: middle;
}

.leads-table td:nth-child(2) {
    min-width: 220px;
}

@media (max-width: 760px) {
    .desktop-leads-table {
        margin-inline: -0.35rem;
        border-radius: 14px;
        max-width: calc(100vw - 1.3rem);
    }

    .leads-table {
        min-width: 1080px;
        font-size: 0.8rem;
    }

    .leads-table th,
    .leads-table td {
        padding: 0.62rem 0.55rem;
    }

    .leads-table td:nth-child(2) {
        min-width: 180px;
    }

    .status-select {
        min-width: 138px;
        min-height: 38px;
        padding: 0.45rem 0.55rem;
        font-size: 0.78rem;
    }

    .lead-sticky-header {
        position: static;
        top: auto;
        z-index: auto;
        gap: 0.65rem;
        margin: 0 0 1rem;
        padding: 0.85rem;
        border-radius: 18px;
    }

    .sticky-title-row h2 {
        max-width: 100%;
        font-size: clamp(1.55rem, 8vw, 2.25rem);
        line-height: 1.04;
        overflow-wrap: anywhere;
    }

    .lead-cockpit-details summary {
        min-height: 42px;
        padding: 0 0.8rem;
    }

    .sticky-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sticky-facts span {
        min-height: 50px;
        border-radius: 12px;
        padding: 0.55rem;
        font-size: 0.78rem;
    }

    .sticky-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        gap: 0.5rem;
    }

    .sticky-actions .inline-action-form,
    .sticky-actions .primary-button,
    .sticky-actions .ghost-button,
    .sticky-actions .action-link {
        width: 100%;
        min-width: 0;
    }

    .sticky-actions .inline-action-form {
        display: block;
    }

    .sticky-actions .primary-button,
    .sticky-actions .ghost-button,
    .sticky-actions .action-link {
        min-height: 46px;
        padding-inline: 0.75rem;
        font-size: 0.9rem;
        white-space: normal;
    }
}

.lead-detail-panel {
    display: grid;
    gap: 1.2rem;
}

.lead-detail-heading {
    display: grid;
    gap: 1rem;
}

.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.detail-list {
    display: grid;
    gap: 0.6rem;
}

.detail-list p {
    margin: 0;
    color: var(--muted);
}

.detail-list strong {
    color: var(--navy);
}

.lead-sticky-header {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    gap: 0.9rem;
    margin: -1rem -1rem 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(247, 241, 230, 0.18);
    background:
        linear-gradient(135deg, rgba(7, 24, 39, 0.98), rgba(16, 41, 63, 0.96)),
        var(--navy);
    color: var(--cream);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.lead-cockpit-details {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.lead-cockpit-details summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    border: 1px solid rgba(247, 241, 230, 0.18);
    border-radius: 999px;
    padding: 0 0.95rem;
    background: rgba(247, 241, 230, 0.1);
    color: var(--cream);
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.lead-cockpit-details summary::-webkit-details-marker {
    display: none;
}

.lead-cockpit-details summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    line-height: 1;
}

.lead-cockpit-details[open] summary::after {
    content: "-";
}

.sticky-title-row {
    display: grid;
    gap: 0.8rem;
}

.sticky-title-row h2 {
    margin-bottom: 0.45rem;
    color: var(--cream);
}

.sticky-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.sticky-facts span {
    display: grid;
    gap: 0.2rem;
    min-height: 58px;
    border-radius: 16px;
    padding: 0.65rem;
    background: rgba(247, 241, 230, 0.1);
    color: rgba(247, 241, 230, 0.82);
    font-size: 0.84rem;
}

.sticky-facts strong {
    color: var(--gold);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sticky-actions,
.lead-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.sticky-actions .action-link {
    flex: 0 0 auto;
    min-width: 96px;
}

.sticky-actions .inline-action-form {
    flex: 0 0 auto;
}

.sticky-actions .primary-button,
.sticky-actions .ghost-button,
.sticky-actions .action-link {
    white-space: nowrap;
}

.lead-tabs {
    margin-bottom: 1rem;
    border-radius: 22px;
    padding: 0.45rem;
    background: rgba(247, 241, 230, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.lead-tabs a {
    flex: 0 0 auto;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 0 0.85rem;
    color: var(--muted);
    font-weight: 900;
}

.lead-tabs a.is-active {
    background: var(--navy);
    color: var(--cream);
}

.lead-tab-panel {
    margin-top: 1rem;
}

.overview-signal-grid {
    display: grid;
    gap: 0.75rem;
}

.overview-signal-grid .summary-card {
    margin-top: 0;
}

.overview-signal-grid .summary-card span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--sage-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-signal-grid .summary-card strong {
    display: block;
    color: var(--navy);
    line-height: 1.35;
}

.lead-edit-grid,
.bad-lead-form,
.note-form,
.task-form {
    display: grid;
    gap: 0.85rem;
}

.lead-edit-grid textarea,
.note-form textarea {
    min-height: 150px;
}

.restricted-warning {
    margin-bottom: 1rem;
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: rgba(122, 47, 34, 0.09);
    border: 1px solid rgba(122, 47, 34, 0.22);
    color: #7a2f22;
    font-weight: 900;
    line-height: 1.45;
}

.note-list,
.timeline-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.note-card,
.timeline-item {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 250, 240, 0.86);
}

.note-card.is-pinned {
    border-color: rgba(201, 155, 74, 0.55);
    box-shadow: 0 14px 34px rgba(201, 155, 74, 0.14);
}

.note-card.is-complete {
    opacity: 0.72;
}

.note-card h3,
.timeline-item strong {
    display: block;
    margin: 0 0 0.4rem;
    color: var(--navy);
}

.note-card p,
.timeline-item p {
    color: var(--muted);
    line-height: 1.55;
}

.note-card small,
.timeline-item small {
    color: var(--sage-dark);
    font-weight: 900;
}

.note-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0.35rem 0.45rem 0.15rem 0;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.note-badge--high_priority { background: #f9d9d4; color: #9e2f24; }
.note-badge--info { background: #dbeeff; color: #1f5f95; }
.note-badge--strategy { background: #f8e7b1; color: #725510; }
.note-badge--workflow { background: #dcebd9; color: #3e6a42; }
.note-badge--inefficiency { background: #fde1c3; color: #a74d12; }

.note-badge-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.note-badge-picker legend {
    width: 100%;
    margin-bottom: 0.1rem;
    color: var(--navy);
    font-weight: 800;
}

.note-badge-choice {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
}

.note-badge-choice input { width: auto; min-height: auto; margin: 0 0.3rem 0 0; accent-color: currentColor; }
.note-badge-choice.note-badge--high_priority { background: #f9d9d4; color: #9e2f24; }
.note-badge-choice.note-badge--info { background: #dbeeff; color: #1f5f95; }
.note-badge-choice.note-badge--strategy { background: #f8e7b1; color: #725510; }
.note-badge-choice.note-badge--workflow { background: #dcebd9; color: #3e6a42; }
.note-badge-choice.note-badge--inefficiency { background: #fde1c3; color: #a74d12; }

.rich-note-field {
    display: grid;
    gap: 0.45rem;
    color: var(--navy);
    font-weight: 800;
}

.rich-note-toolbar {
    display: inline-flex;
    width: fit-content;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 12px;
    background: rgba(16, 37, 58, 0.07);
}

.rich-note-toolbar button {
    min-width: 2.25rem;
    min-height: 2rem;
    border: 0;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    color: var(--navy);
    background: var(--card-bg);
    cursor: pointer;
}

.rich-note-editor {
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    color: var(--navy);
    background: var(--soft-cream);
    font-weight: 500;
    line-height: 1.55;
    outline: none;
}

.rich-note-editor:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196, 170, 80, 0.18);
}

.rich-note-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}

.rich-note-editor mark,
.workspace-note-preview-content mark,
.lead-note-content mark {
    border-radius: 0.16em;
    padding: 0 0.08em;
    color: inherit;
    background: #f4d880;
}

.rich-note-editor :is(h1, h2, h3, h4, h5, h6),
.workspace-note-preview-content :is(h1, h2, h3, h4, h5, h6),
.lead-note-content :is(h1, h2, h3, h4, h5, h6) { margin: 0.85em 0 0.42em; color: var(--navy); line-height: 1.18; }

.rich-note-editor :is(ul, ol),
.workspace-note-preview-content :is(ul, ol),
.lead-note-content :is(ul, ol) { margin: 0.65em 0; padding-left: 1.45em; }

.rich-note-editor blockquote,
.workspace-note-preview-content blockquote,
.lead-note-content blockquote { margin: 0.75em 0; padding-left: 0.85em; border-left: 3px solid var(--gold); color: var(--muted); }

.rich-note-editor :is(pre, code),
.workspace-note-preview-content :is(pre, code),
.lead-note-content :is(pre, code) { font-family: Consolas, "Courier New", monospace; }

.rich-note-editor pre,
.workspace-note-preview-content pre,
.lead-note-content pre { overflow-x: auto; padding: 0.75em; border-radius: 10px; background: rgba(16, 37, 58, 0.08); }

.rich-note-editor table,
.workspace-note-preview-content table,
.lead-note-content table { width: 100%; border-collapse: collapse; margin: 0.75em 0; }

.rich-note-editor :is(th, td),
.workspace-note-preview-content :is(th, td),
.lead-note-content :is(th, td) { border: 1px solid var(--line); padding: 0.45em; text-align: left; vertical-align: top; }

.rich-note-field small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.notes-hero,
.notes-workspace-grid {
    display: grid;
    gap: 1.25rem;
}

.notes-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: end;
}

.notes-hero h2,
.note-compose-panel h2,
.notes-folder-panel h2,
.lead-notes-library h2 {
    margin: 0.25rem 0 0.55rem;
}

.notes-hero p,
.lead-notes-library > p {
    color: var(--muted);
    line-height: 1.55;
}

/* Let the working-folder area sit directly on the navy canvas; individual folders retain their own pastel cards. */
.notes-folder-panel {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.notes-folder-panel > .eyebrow,
.notes-folder-panel > h2 {
    color: var(--cream);
}

.notes-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    align-items: center;
}

.notes-search-clear {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.notes-search-clear:hover,
.notes-search-clear:focus-visible {
    color: var(--navy);
    text-decoration: underline;
}

.notes-workspace-grid {
    grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.55fr);
    align-items: start;
}

.note-compose-panel,
.notes-folder-panel,
.lead-notes-library {
    min-width: 0;
}

.panel.note-compose-drawer {
    padding: 0;
    overflow: hidden;
}

.note-compose-drawer:not([open]) {
    width: fit-content;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.note-compose-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0.45rem;
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
    color: var(--navy);
    background: linear-gradient(135deg, var(--gold), #f5d77e);
    box-shadow: 0 10px 24px rgba(196, 170, 80, 0.28);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
}

.note-compose-trigger::-webkit-details-marker { display: none; }
.note-compose-trigger::marker { content: ''; }

.note-compose-trigger:hover,
.note-compose-drawer[open] .note-compose-trigger {
    background: linear-gradient(135deg, #d6ba59, #f8dea0);
    transform: translateY(-1px);
}

.note-compose-trigger:focus-visible {
    outline: 3px solid rgba(116, 134, 97, 0.7);
    outline-offset: 3px;
}

.note-compose-drawer[open] .note-compose-trigger span { transform: rotate(45deg); }

.note-compose-content {
    padding: 0 1.1rem 1.1rem;
}

.note-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-top: 0.7rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #87919a;
    background: transparent;
}

.note-delete-button:hover { color: #5f6870; background: rgba(16, 37, 58, 0.07); }
.note-delete-button:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.note-delete-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.field-help {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.note-folder-create {
    margin-top: 1.1rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.note-folder-create summary,
.workspace-note-card summary {
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.compact-form {
    margin-top: 0.85rem;
}

.notes-folder-list {
    display: grid;
    gap: 1rem;
}

.workspace-folder-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 253, 248, 0.72);
}

.workspace-folder-card > h3 {
    margin: 0 4.25rem 0.75rem 0;
    color: var(--navy);
    font-size: 1.28rem;
}

.workspace-folder-card {
    position: relative;
    padding-bottom: 2.6rem;
}

.workspace-folder-card.folder-color--cream { background: #fff7e7; }
.workspace-folder-card.folder-color--sage { background: #dcebcf; }
.workspace-folder-card.folder-color--sky { background: #d8e9f5; }
.workspace-folder-card.folder-color--gold { background: #f5dfa4; }
.workspace-folder-card.folder-color--peach { background: #f7d8c3; }
.workspace-folder-card.folder-color--rose { background: #f3d4dc; }
.workspace-folder-card.folder-color--lavender { background: #e5dcf3; }
.workspace-folder-card.folder-color--mint { background: #d3eddc; }
.workspace-folder-card.folder-color--aqua { background: #cff0ee; }
.workspace-folder-card.folder-color--lemon { background: #f7edb8; }
.workspace-folder-card.folder-color--apricot { background: #f5cfaa; }
.workspace-folder-card.folder-color--mist { background: #dce4ea; }

.workspace-folder-actions {
    position: absolute;
    top: 0.65rem;
    right: 0.7rem;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

.workspace-folder-actions form { margin: 0; }

.folder-pin-button,
.folder-edit-button {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 8px;
    padding: 0;
    color: rgba(16, 37, 58, 0.5);
    background: transparent;
    cursor: pointer;
}

.folder-pin-button:hover,
.folder-pin-button:focus-visible,
.folder-edit-button:hover,
.folder-edit-button:focus-visible,
.workspace-folder-editor[open] > .folder-edit-button {
    color: var(--navy);
    background: rgba(16, 37, 58, 0.08);
}

.folder-pin-button.is-pinned { color: var(--gold); background: rgba(196, 170, 80, 0.15); }
.folder-pin-button svg,
.folder-edit-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.workspace-folder-editor { position: relative; }
.workspace-folder-editor > summary { list-style: none; }
.workspace-folder-editor > summary::-webkit-details-marker { display: none; }

.folder-edit-form {
    position: absolute;
    z-index: 3;
    top: 2.15rem;
    right: 0;
    display: grid;
    gap: 0.55rem;
    width: min(280px, calc(100vw - 3rem));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.8rem;
    background: var(--card-bg);
    box-shadow: 0 14px 34px rgba(7, 21, 34, 0.18);
}

.folder-edit-form label { display: grid; gap: 0.3rem; color: var(--navy); font-size: 0.78rem; font-weight: 800; }
.folder-edit-form .secondary-button { width: 100%; }

.folder-color-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.folder-color-picker legend { margin-bottom: 0.35rem; color: var(--navy); font-size: 0.78rem; font-weight: 800; }
.folder-color-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
.folder-color-option { position: relative; display: block; min-width: 0; }
.folder-color-option input { position: absolute; opacity: 0; pointer-events: none; }
.folder-color-option span { display: flex; align-items: center; justify-content: center; min-height: 2rem; border: 1px solid rgba(16, 37, 58, 0.14); border-radius: 0.6rem; padding: 0.35rem 0.45rem; color: var(--navy); font-size: 0.72rem; font-weight: 850; line-height: 1.1; text-align: center; cursor: pointer; }
.folder-color-option input:checked + span { border-color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.folder-color-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.folder-color-option--cream span { background: #fff7e7; }
.folder-color-option--sage span { background: #dcebcf; }
.folder-color-option--sky span { background: #d8e9f5; }
.folder-color-option--gold span { background: #f5dfa4; }
.folder-color-option--peach span { background: #f7d8c3; }
.folder-color-option--rose span { background: #f3d4dc; }
.folder-color-option--lavender span { background: #e5dcf3; }
.folder-color-option--mint span { background: #d3eddc; }
.folder-color-option--aqua span { background: #cff0ee; }
.folder-color-option--lemon span { background: #f7edb8; }
.folder-color-option--apricot span { background: #f5cfaa; }
.folder-color-option--mist span { background: #dce4ea; }

.folder-empty {
    margin: 0;
    color: var(--muted);
}

.workspace-note-card {
    position: relative;
    margin-top: 0.7rem;
    border-radius: 18px;
    padding: 0.9rem 0.9rem 2.75rem;
    background: var(--card-bg);
    border: 1px solid rgba(16, 37, 58, 0.11);
}

.workspace-note-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    padding-right: 6rem;
}

.workspace-note-heading h4 {
    margin: 0;
    color: var(--navy);
    font-size: 1rem;
}

.workspace-note-title-group { min-width: 0; }
.workspace-note-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.42rem; }
.workspace-note-tabs { display: flex; min-width: 0; max-width: 100%; gap: 0.35rem; overflow-x: auto; padding: 0.08rem 0; scrollbar-width: none; }
.workspace-note-tabs::-webkit-scrollbar { display: none; }
.workspace-note-tab,
.workspace-note-add-page > summary {
    flex: 0 0 auto;
    border: 1px solid rgba(16, 37, 58, 0.12);
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
    color: var(--navy);
    background: rgba(16, 37, 58, 0.06);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}
.workspace-note-tab.is-active { color: var(--cream); border-color: var(--navy); background: var(--navy); }
.workspace-note-tab:hover,
.workspace-note-tab:focus-visible,
.workspace-note-add-page > summary:hover,
.workspace-note-add-page > summary:focus-visible { border-color: var(--gold); outline: 0; }
.workspace-note-add-page { position: relative; }
.workspace-note-add-page > summary { display: grid; place-items: center; width: 1.8rem; min-height: 1.8rem; padding: 0; list-style: none; font-size: 1.2rem; line-height: 1; }
.workspace-note-add-page > summary::-webkit-details-marker { display: none; }
.workspace-note-add-page form { position: absolute; z-index: 5; top: calc(100% + 0.35rem); right: 0; display: grid; gap: 0.5rem; width: min(250px, calc(100vw - 3rem)); border: 1px solid var(--line); border-radius: 14px; padding: 0.75rem; background: var(--card-bg); box-shadow: 0 14px 34px rgba(7, 21, 34, 0.18); }
.workspace-note-add-page label { display: grid; gap: 0.25rem; color: var(--navy); font-size: 0.76rem; font-weight: 800; }
.workspace-note-add-page .secondary-button { width: 100%; }
.workspace-note-section-panel { position: relative; }
.workspace-note-section-panel.is-editing .workspace-note-body { display: none; }
.workspace-note-section-panel.is-editing .workspace-note-section-editor { margin-top: 0.65rem; }
.workspace-note-empty-page { margin: 0; color: var(--muted); font-style: italic; }
.workspace-note-section-delete-form { margin: 0 0 0.75rem; }
.workspace-note-section-delete-form .note-delete-button { position: static; width: auto; min-height: 2rem; border-radius: 999px; padding: 0.35rem 0.68rem; color: #8d3b2c; background: rgba(165, 70, 47, 0.1); font-size: 0.76rem; font-weight: 800; }

.workspace-note-heading small,
.attachment-count {
    color: var(--muted);
    font-size: 0.8rem;
}

.attachment-count {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    background: rgba(116, 134, 97, 0.13);
    color: var(--sage-dark);
    font-weight: 800;
}

.workspace-note-body {
    margin: 0.65rem 0;
    color: var(--muted);
    line-height: 1.52;
}

.workspace-note-preview-content { overflow: visible; }
.workspace-note-preview-content p { margin: 0 0 0.75rem; }
.workspace-note-preview-content p:last-child { margin-bottom: 0; }

.workspace-note-body.is-truncated .workspace-note-preview-content {
    max-height: calc(10 * 1.52em);
    overflow: hidden;
}

.workspace-note-expand {
    margin-top: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.34rem 0.7rem;
    color: var(--navy);
    background: rgba(16, 37, 58, 0.08);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.workspace-note-expand:hover,
.workspace-note-expand:focus-visible {
    color: var(--cream);
    background: var(--navy);
}

.workspace-note-card details { margin: 0.75rem 0; }

.workspace-note-editor > .note-edit-button {
    position: absolute;
    top: 0.82rem;
    right: 3rem;
    margin: 0;
    border-radius: 999px;
    padding: 0.3rem 0.56rem;
    color: var(--navy);
    background: rgba(16, 37, 58, 0.06);
    font-size: 0.74rem;
}

.workspace-note-section-editor > .note-edit-button {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.3rem 0.56rem;
    color: var(--navy);
    background: rgba(16, 37, 58, 0.06);
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.workspace-note-section-editor > .note-edit-button::-webkit-details-marker { display: none; }

.workspace-note-delete-form {
    position: absolute;
    top: 0.15rem;
    right: 0.58rem;
    margin: 0;
}

.workspace-note-archive-form {
    position: absolute;
    top: 1.95rem;
    right: 0.58rem;
    margin: 0;
}

.note-archive-button {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    border-radius: 8px;
    padding: 0;
    color: rgba(16, 37, 58, 0.42);
    background: transparent;
    cursor: pointer;
}

.note-archive-button:hover,
.note-archive-button:focus-visible { color: var(--navy); background: rgba(16, 37, 58, 0.08); }
.note-archive-button svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.workspace-note-folder { display: block; margin-top: 0.18rem; color: var(--sage-dark); font-weight: 700; }

.workspace-archive-panel { margin-top: 1.25rem; }
.workspace-archive-panel > p:not(.eyebrow) { max-width: 760px; color: var(--muted); line-height: 1.5; }
.workspace-archive-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.workspace-archive-list .workspace-note-card { margin-top: 0; background: rgba(255, 253, 248, 0.72); }

.workspace-folder-order,
.workspace-note-order {
    position: absolute;
    right: 0.72rem;
    bottom: 0.62rem;
    display: flex;
    gap: 0.18rem;
}

.workspace-folder-order form,
.workspace-note-order form { margin: 0; }

.note-order-button {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    border-radius: 8px;
    padding: 0;
    color: rgba(16, 37, 58, 0.52);
    background: transparent;
    cursor: pointer;
}

.note-order-button:hover:not(:disabled),
.note-order-button:focus-visible:not(:disabled) {
    color: var(--navy);
    background: rgba(16, 37, 58, 0.08);
}

.note-order-button:disabled { opacity: 0.25; cursor: default; }
.note-order-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Keep the expanded editor inside its card, with the writing area given priority. */
.workspace-note-editor[open],
.workspace-note-section-editor[open] {
    display: block;
    width: 100%;
    border-top: 1px solid rgba(16, 37, 58, 0.12);
    padding-top: 0.85rem;
}

.workspace-note-editor[open] > .note-edit-button,
.workspace-note-section-editor[open] > .note-edit-button {
    margin-bottom: 0.85rem;
}

.workspace-note-editor .note-form,
.workspace-note-section-editor .note-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr);
    gap: 0.8rem;
    align-items: end;
}

.workspace-note-editor .workspace-note-editor-body,
.workspace-note-editor .note-badge-picker,
.workspace-note-editor .note-form label:has(input[type="file"]),
.workspace-note-editor .note-form button,
.workspace-note-section-editor .workspace-note-editor-body,
.workspace-note-section-editor .note-form button {
    grid-column: 1 / -1;
}

.workspace-note-editor .workspace-note-editor-body textarea,
.workspace-note-section-editor .workspace-note-editor-body textarea {
    min-height: 230px;
    resize: vertical;
}

.workspace-note-editor .note-badge-picker {
    padding-top: 0.1rem;
}

@media (max-width: 640px) {
    .workspace-note-editor .note-form,
    .workspace-note-section-editor .note-form { grid-template-columns: 1fr; }
    .workspace-note-editor .workspace-note-editor-body textarea,
    .workspace-note-section-editor .workspace-note-editor-body textarea { min-height: 190px; }
}

.note-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0.8rem 0;
}

.note-attachments a {
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    background: rgba(196, 170, 80, 0.17);
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 900;
    text-decoration: none;
}

.lead-notes-library { margin-top: 1.25rem; }

.lead-note-library-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.lead-note-library-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0.85rem 1rem;
    background: rgba(255, 253, 248, 0.7);
    color: var(--navy);
    text-decoration: none;
}

.lead-note-library-item strong,
.lead-note-library-item small { display: block; }
.lead-note-library-item small,
.lead-note-library-item > span:last-child { color: var(--muted); font-size: 0.83rem; }

/* Separate adjacent page panels without changing the CRM's compact rhythm. */
.main-content { gap: 4px; }

/* Keep the plot, date labels, and hover layer in separate rows. */
.dashboard-call-bar-chart {
    grid-template-rows: minmax(0, 1fr);
    height: 410px;
    min-height: 410px;
    padding: 1rem 0.85rem 0.85rem;
}

.dashboard-call-bars {
    height: 100%;
    min-height: 0;
    padding-top: 0;
    align-items: stretch;
}

.dashboard-call-day-group {
    grid-template-rows: minmax(0, 1fr) 1.25rem;
    min-height: 0;
    height: 100%;
}

.dashboard-call-bar-group {
    min-height: 0;
    height: auto;
}

.dashboard-call-bar-shell {
    min-height: 0;
    height: 100%;
}

.dashboard-call-date-label {
    position: relative;
    z-index: 4;
    align-self: end;
    line-height: 1.25rem;
}

@media (max-width: 720px) {
    .dashboard-call-bar-chart {
        height: 340px;
        min-height: 340px;
        padding-top: 0.85rem;
    }

    .dashboard-call-bars { min-height: 0; padding-top: 0; }
    .dashboard-call-day-group { min-height: 0; height: 100%; }
    .dashboard-call-bar-group,
    .dashboard-call-bar-shell { min-height: 0; height: auto; }
    .dashboard-call-bar-shell { height: 100%; }
}

/* Notes workspace has a dedicated composer; do not inherit the lead-note grid. */
.notes-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
}

.note-compose-panel .note-form {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
    align-items: end;
}

.note-compose-panel .note-form label:has(textarea),
.note-compose-panel .note-form .rich-note-field,
.note-compose-panel .note-form label:has(input[type="file"]),
.note-compose-panel .note-form button {
    grid-column: 1 / -1;
}

.note-compose-panel .note-form .rich-note-field {
    width: 100%;
}

.note-compose-panel .note-form input,
.note-compose-panel .note-form select,
.note-compose-panel .note-form textarea {
    box-sizing: border-box;
    max-width: 100%;
}

.note-compose-panel .note-form textarea {
    min-height: 170px;
}

.note-compose-panel .note-form button {
    width: fit-content;
    min-width: 190px;
}

@media (max-width: 720px) {
    .note-compose-panel .note-form { grid-template-columns: 1fr; }
    .note-compose-panel .note-form button { width: 100%; }
}

@media (max-width: 760px) {
    .notes-hero,
    .notes-workspace-grid { grid-template-columns: 1fr; }
    .notes-search { grid-template-columns: 1fr; }
    .workspace-note-heading,
    .lead-note-library-item { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
}

.note-card details {
    margin: 0.8rem 0;
    border-top: 1px solid var(--line);
    padding-top: 0.75rem;
}

.note-card summary {
    min-height: 44px;
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.timeline-item {
    position: relative;
    padding-left: 1.2rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -0.32rem;
    top: 1.1rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--gold);
}

.timeline-item span {
    display: inline-flex;
    margin-bottom: 0.35rem;
    border-radius: 999px;
    padding: 0.28rem 0.5rem;
    background: rgba(142, 165, 142, 0.2);
    color: var(--sage-dark);
    font-size: 0.72rem;
    font-weight: 900;
}

.task-actions {
    display: grid;
    gap: 0.55rem;
}

.script-library-panel,
.script-workspace,
.script-editor-form,
.script-reader-edit,
.script-card-list,
.script-secondary-actions,
.script-reader,
.script-reader-content,
.script-attach-form,
.lead-script-grid {
    display: grid;
    gap: 1rem;
}

.script-reader-edit {
    margin-top: 1rem;
}

.script-reader-edit summary {
    cursor: pointer;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 900;
}

.script-email-template-panel {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
}

.script-email-template-panel .script-card-list {
    max-height: none;
    overflow: visible;
}

.visual-tree-hero,
.visual-tree-tabs,
.visual-tree-toolbar,
.visual-tree-tools,
.visual-tree-sidebar-head,
.visual-tree-editor-head,
.visual-tree-card-actions,
.visual-node-actions {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.visual-tree-shell {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(520px, 2.4fr) minmax(340px, 1fr);
    gap: 1rem;
    align-items: start;
}

.visual-tree-sidebar,
.visual-tree-main,
.visual-tree-editor {
    min-width: 0;
}

.visual-tree-card-list,
.visual-editor-form,
.visual-response-editor form,
.visual-add-node form,
.visual-import-panel form {
    display: grid;
    gap: 0.85rem;
}

.visual-tree-card {
    background: rgba(255, 252, 245, 0.7);
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1.4rem;
    padding: 1rem;
    display: grid;
    gap: 0.65rem;
}

.visual-tree-card.is-selected {
    border-color: rgba(224, 181, 83, 0.9);
    box-shadow: 0 0 0 3px rgba(224, 181, 83, 0.16);
}

.visual-tree-stage-wrap {
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 24px 24px, rgba(148, 168, 141, 0.15) 1px, transparent 1px),
        rgba(8, 23, 33, 0.96);
    background-size: 24px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: auto;
    max-height: 72vh;
}

.visual-tree-stage {
    position: relative;
    min-width: 1420px;
    min-height: 1220px;
    padding: 2rem;
}

.visual-tree-connectors {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

.visual-tree-connectors marker path {
    fill: rgba(224, 181, 83, 0.82);
}

.tree-edge {
    fill: none;
    stroke: rgba(148, 168, 141, 0.7);
    stroke-width: 3;
}

.tree-edge-objection,
.tree-edge-global {
    stroke: rgba(224, 181, 83, 0.78);
}

.tree-edge-outcome,
.tree-edge-booking {
    stroke: rgba(141, 176, 153, 0.9);
}

.visual-node-card {
    position: absolute;
    width: 260px;
    min-height: 150px;
    display: grid;
    gap: 0.45rem;
    text-align: left;
    cursor: grab;
    color: #f9f3e6;
    background: linear-gradient(145deg, rgba(22, 35, 36, 0.98), rgba(15, 26, 31, 0.98));
    border: 1px solid rgba(247, 241, 230, 0.12);
    border-left: 6px solid rgba(148, 168, 141, 0.85);
    border-radius: 1.1rem;
    padding: 1rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    touch-action: none;
    z-index: 2;
}

.visual-node-card:active {
    cursor: grabbing;
}

.visual-node-card.is-selected {
    border-color: rgba(224, 181, 83, 0.95);
    box-shadow: 0 0 0 4px rgba(224, 181, 83, 0.18), 0 22px 50px rgba(0, 0, 0, 0.35);
}

.visual-node-card strong {
    font-size: 1.04rem;
    line-height: 1.15;
}

.visual-node-card small,
.visual-node-card em {
    color: rgba(247, 241, 230, 0.72);
    font-style: normal;
}

.node-badge {
    width: max-content;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #10202d;
    background: rgba(224, 181, 83, 0.9);
}

.visual-node-card.category-objection {
    border-left-color: #d4a35d;
}

.visual-node-card.category-outcome,
.visual-node-card.category-booking {
    border-left-color: #8db099;
}

.visual-node-card.category-fit_discovery,
.visual-node-card.category-qualification {
    border-left-color: #8fb5d8;
}

.visual-node-card.category-close,
.visual-node-card.category-recommendation {
    border-left-color: #e8cf78;
}

.visual-layout-form {
    margin-top: 1rem;
}

.visual-tree-editor {
    max-height: 86vh;
    overflow: auto;
    position: sticky;
    top: 1rem;
}

.visual-node-editor {
    display: grid;
    gap: 1rem;
}

.visual-node-editor[hidden] {
    display: none;
}

.visual-response-editor,
.visual-add-node,
.visual-import-panel {
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1rem;
    padding: 0.85rem;
    background: rgba(255, 252, 245, 0.65);
}

.visual-response-editor summary,
.visual-add-node summary,
.visual-import-panel summary {
    cursor: pointer;
    font-weight: 900;
}

.visual-validation {
    margin: 1rem 0;
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(224, 181, 83, 0.35);
    background: rgba(224, 181, 83, 0.12);
}

.visual-validation.is-valid {
    border-color: rgba(148, 168, 141, 0.5);
    background: rgba(148, 168, 141, 0.14);
}

.visual-validation.has-errors {
    border-color: rgba(132, 43, 32, 0.42);
    background: rgba(132, 43, 32, 0.1);
}

.visual-preview-panel {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(3, 16, 24, 0.72);
    padding: 5vh 1rem;
    overflow: auto;
}

.visual-preview-inner {
    max-width: 760px;
    margin: 0 auto;
    background: var(--panel-bg, #f7f1e6);
    border-radius: 2rem;
    padding: 2rem;
    display: grid;
    gap: 1rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.visual-preview-say {
    white-space: pre-wrap;
    font-size: 1.25rem;
    line-height: 1.55;
    background: rgba(255, 252, 245, 0.78);
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1.2rem;
    padding: 1rem;
}

.visual-preview-buttons {
    display: grid;
    gap: 0.75rem;
}

body.visual-tree-fullscreen {
    overflow: hidden;
}

body.visual-tree-fullscreen .shell {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
    padding: 0;
}

body.visual-tree-fullscreen .sidebar,
body.visual-tree-fullscreen .topbar,
body.visual-tree-fullscreen .visual-tree-hero,
body.visual-tree-fullscreen .bottom-nav {
    display: none !important;
}

body.visual-tree-fullscreen .main-content {
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

body.visual-tree-fullscreen .visual-tree-shell {
    height: 100vh;
    grid-template-columns: 250px minmax(900px, 1fr) 430px;
    gap: 0;
}

body.visual-tree-fullscreen .visual-tree-sidebar,
body.visual-tree-fullscreen .visual-tree-main,
body.visual-tree-fullscreen .visual-tree-editor {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
    overflow: auto;
}

body.visual-tree-fullscreen .visual-tree-main {
    padding: 1.1rem;
}

body.visual-tree-fullscreen .visual-tree-stage-wrap {
    max-height: calc(100vh - 160px);
    height: calc(100vh - 160px);
}

body.visual-tree-fullscreen .visual-tree-stage {
    min-width: 2400px;
    min-height: 1800px;
}

body.visual-tree-fullscreen .visual-tree-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--panel-bg, rgba(247, 241, 230, 0.97));
    border-radius: 1.25rem;
    padding: 0.85rem;
    margin-bottom: 0.85rem;
}

body.visual-tree-fullscreen .visual-node-card {
    width: 250px;
}

body.visual-tree-fullscreen .visual-tree-card {
    padding: 0.8rem;
}

@media (max-width: 1100px) {
    .visual-tree-shell {
        grid-template-columns: 1fr;
    }

    .visual-tree-editor {
        position: static;
        max-height: none;
    }

    .visual-tree-stage-wrap {
        max-height: 66vh;
    }
}

@media (max-width: 640px) {
    .visual-tree-stage {
        min-width: 980px;
        min-height: 1100px;
    }

    .visual-node-card {
        width: 230px;
    }

    .visual-tree-tools a,
    .visual-tree-tools button,
    .visual-tree-tabs a {
        width: 100%;
        justify-content: center;
    }
}

.script-page-heading,
.script-list-heading,
.script-reader-header {
    display: grid;
    gap: 1rem;
}

.script-header-actions,
.script-call-tree-entry {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.script-filters {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.script-card {
    display: grid;
    gap: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 250, 240, 0.88);
}

.script-card.is-selected {
    border-color: rgba(201, 155, 74, 0.7);
    box-shadow: 0 16px 34px rgba(201, 155, 74, 0.16);
}

.script-card.is-archived {
    opacity: 0.62;
}

.script-card h3 {
    margin: 0;
    color: var(--navy);
    line-height: 1.2;
}

.script-card p {
    margin: 0;
}

.script-card small {
    color: var(--sage-dark);
    font-weight: 900;
}

.script-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.script-card-actions form,
.script-secondary-actions form {
    display: contents;
}

.timeline-checkpoint-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.timeline-checkpoint-actions form { margin: 0; }
.timeline-checkpoint-actions button { width: auto; min-height: 32px; padding: 0.3rem 0.5rem; }
.timeline-checkpoint-actions button:disabled { cursor: not-allowed; opacity: 0.4; }

.script-card-actions .action-link,
.script-card-actions button,
.script-secondary-actions .action-link,
.script-secondary-actions button {
    width: auto;
    min-height: 48px;
}

.script-editor-form textarea {
    min-height: 170px;
}

.script-editor-form label:has(textarea) {
    gap: 0.55rem;
}

.rich-script-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rich-script-toolbar button {
    width: auto;
    min-width: 42px;
    min-height: 38px;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(15, 35, 54, 0.14);
    border-radius: 10px;
    background: var(--soft-cream);
    color: var(--ink);
    box-shadow: none;
}

.rich-script-toolbar button:hover,
.rich-script-toolbar button:focus-visible {
    border-color: var(--gold);
    background: rgba(196, 170, 80, 0.18);
}

.rich-script-editor {
    min-height: 220px;
    padding: 1rem;
    overflow-wrap: anywhere;
    border: 1px solid rgba(15, 35, 54, 0.14);
    border-radius: 16px;
    background: var(--soft-cream);
    color: var(--ink);
    font: inherit;
    line-height: 1.6;
}

.rich-script-editor:focus {
    outline: 3px solid rgba(196, 170, 80, 0.28);
    border-color: var(--gold);
}

.rich-script-editor p,
.rich-script-editor ul,
.rich-script-editor ol {
    margin: 0 0 0.8rem;
}

.rich-script-editor ul,
.rich-script-editor ol {
    padding-left: 1.35rem;
}

.script-editor-form small {
    color: var(--muted-ink);
    font-weight: 500;
}

.script-secondary-actions {
    margin-top: 1rem;
}

.script-reader {
    color: var(--cream);
}

.script-reader-header {
    position: sticky;
    top: 0;
    z-index: 7;
    border-radius: 26px;
    padding: 1rem;
    background: rgba(7, 24, 39, 0.96);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
}

.script-reader-header h2 {
    margin-bottom: 0.35rem;
    color: var(--cream);
}

.script-reader-header p {
    margin: 0;
    color: rgba(247, 241, 230, 0.78);
}

.script-reader-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.script-reader-content {
    color: var(--ink);
}

.reader-block {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: clamp(1.2rem, 5vw, 2rem);
    background: rgba(247, 241, 230, 0.98);
    box-shadow: var(--shadow);
}

.reader-block h3 {
    margin: 0 0 0.9rem;
    color: var(--sage-dark);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reader-block div,
.reader-block p {
    color: var(--ink);
    font-size: clamp(1.08rem, 4.8vw, 1.35rem);
    line-height: 1.72;
}

.script-attach-panel {
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.call-mode-shell,
.call-outcome-form,
.call-script-text,
.call-mode-header {
    display: grid;
    gap: 1rem;
}

.call-mode-shell {
    padding-bottom: 5.8rem;
}

.call-mode-header {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: -1rem -1rem 0;
    padding: 1rem;
    border-bottom: 1px solid rgba(247, 241, 230, 0.16);
    background:
        linear-gradient(135deg, rgba(7, 24, 39, 0.99), rgba(16, 41, 63, 0.98)),
        var(--navy);
    color: var(--cream);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.call-mode-title h2 {
    margin-bottom: 0.45rem;
    color: var(--cream);
    font-size: clamp(1.65rem, 9vw, 2.7rem);
}

.call-lead-details {
    display: grid;
    gap: 0.75rem;
}

.call-lead-details summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    border: 1px solid rgba(247, 241, 230, 0.18);
    border-radius: 999px;
    padding: 0 0.95rem;
    background: rgba(247, 241, 230, 0.1);
    color: var(--cream);
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.call-lead-details summary::-webkit-details-marker {
    display: none;
}

.call-lead-details summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    line-height: 1;
}

.call-lead-details[open] summary::after {
    content: "-";
}

.call-lead-details[open] .call-mode-stats {
    margin-top: 0.15rem;
}

.call-mode-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.call-mode-stats span {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    min-height: 56px;
    border-radius: 16px;
    padding: 0.62rem;
    background: rgba(247, 241, 230, 0.1);
    color: rgba(247, 241, 230, 0.82);
    font-size: 0.83rem;
    overflow-wrap: anywhere;
}

.call-mode-stats strong {
    color: var(--gold);
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.call-mode-actions,
.call-script-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.call-mode-actions .action-link,
.call-script-actions .action-link,
.call-script-actions button {
    width: 100%;
    min-height: 54px;
}

.call-mode-actions .ghost-button,
.call-script-actions .ghost-button,
.call-save-bar .ghost-button {
    background: var(--cream);
    border: 1px solid rgba(7, 24, 39, 0.12);
    color: var(--navy);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.call-primary {
    grid-column: 1 / -1;
    min-height: 64px;
    font-size: 1.05rem;
}

.call-section-heading {
    display: grid;
    gap: 0.75rem;
}

.call-script-picker {
    margin: 1rem 0;
}

.call-script-actions form {
    display: contents;
}

.call-script-text article {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255, 250, 240, 0.86);
}

.call-script-text h3 {
    margin: 0 0 0.7rem;
    color: var(--sage-dark);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.call-script-text div,
.call-script-text p {
    color: var(--ink);
    font-size: clamp(1.02rem, 4.7vw, 1.22rem);
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.call-quick-note,
.call-outcomes-panel,
.call-followup-panel,
.call-meeting-panel {
    display: grid;
    gap: 0.85rem;
}

.call-quick-note textarea,
.call-meeting-panel textarea {
    min-height: 130px;
}

.call-outcome-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.outcome-choice {
    display: block;
}

.outcome-choice input {
    position: absolute;
    width: 1px;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
}

.outcome-choice span {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(7, 24, 39, 0.1);
    border-radius: 18px;
    padding: 0.7rem;
    background: rgba(255, 250, 240, 0.88);
    color: var(--navy);
    font-weight: 950;
    text-align: center;
    line-height: 1.15;
    box-shadow: 0 12px 28px rgba(7, 24, 39, 0.07);
}

.outcome-choice input:checked + span {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 155, 74, 0.34), rgba(142, 165, 142, 0.24));
    box-shadow: 0 16px 34px rgba(201, 155, 74, 0.2);
}

.call-save-bar {
    position: fixed;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 5.05rem;
    z-index: 12;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 0.55rem;
    border-radius: 24px;
    padding: 0.55rem;
    background: rgba(247, 241, 230, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.call-save-bar .primary-button,
.call-save-bar .action-link {
    width: 100%;
    min-height: 56px;
}

.calendar-toolbar,
.meeting-create-panel,
.booked-heading,
.booked-section,
.meeting-list-panel,
.meeting-form,
.meeting-card-list,
.meeting-card,
.meeting-action-forms {
    display: grid;
    gap: 1rem;
}

.calendar-view-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    border-radius: 22px;
    padding: 0.45rem;
    background: rgba(7, 24, 39, 0.08);
}

.calendar-view-tabs a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--muted);
    font-weight: 900;
}

.calendar-view-tabs a.is-active {
    background: var(--navy);
    color: var(--cream);
}

.calendar-date-controls {
    display: grid;
    gap: 0.65rem;
}

.meeting-form textarea,
.meeting-action-forms textarea,
.meeting-calendar-notes textarea {
    min-height: 120px;
}

.meeting-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1rem;
    background: rgba(255, 250, 240, 0.88);
    box-shadow: 0 14px 32px rgba(7, 24, 39, 0.08);
}

.meeting-card h3 {
    margin: 0 0 0.5rem;
    color: var(--navy);
    line-height: 1.2;
}

.meeting-card p {
    margin: 0.3rem 0;
}

.meeting-saved-notes {
    display: grid;
    gap: 0.32rem;
    margin-top: 0.85rem;
    border-left: 3px solid var(--gold);
    border-radius: 0 12px 12px 0;
    padding: 0.7rem 0.8rem;
    background: rgba(196, 170, 80, 0.1);
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}

.meeting-saved-notes strong { color: var(--navy); }

.meeting-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.meeting-actions .action-link,
.meeting-actions button,
.meeting-action-forms button {
    width: 100%;
    min-height: 48px;
}

.meeting-actions details {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    padding-top: 0.7rem;
}

.meeting-calendar-notes[open] {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.5rem 0.7rem 0.75rem;
    background: rgba(255, 253, 248, 0.72);
}

.meeting-calendar-notes form {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.meeting-actions summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.meeting-action-forms {
    margin-top: 0.8rem;
}

.calendar-month-panel {
    display: none;
}

.app-body {
    min-height: 100vh;
}

.shell {
    width: min(1480px, 100%);
    margin: 0 auto;
    min-height: 100vh;
}

.sidebar {
    display: none;
}

.sidebar-toggle-closed {
    display: none;
}

.nav-link-text {
    display: inline;
    opacity: 1;
    visibility: visible;
    color: inherit;
}

.nav-link > span:first-child {
    display: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 6.5rem;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    color: var(--cream);
}

.topbar h1 {
    margin-bottom: 0;
}

.topbar .eyebrow {
    color: var(--gold);
}

.desktop-logout {
    display: none;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    border-radius: 20px;
    padding: 1rem;
}

.stat-card span {
    display: block;
    min-height: 2.2rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    color: var(--navy);
    font-size: 1.02rem;
}

.panel {
    border-radius: var(--radius);
    padding: clamp(1.15rem, 5vw, 2rem);
}

.placeholder-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.3rem;
}

.placeholder-strip span {
    border-radius: 999px;
    background: rgba(142, 165, 142, 0.24);
    color: var(--sage-dark);
    padding: 0.55rem 0.75rem;
    font-weight: 900;
    font-size: 0.82rem;
}

.data-table-wrap {
    overflow-x: auto;
    margin-top: 1.2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

.data-table th,
.data-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.data-table th {
    color: var(--sage-dark);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bottom-nav {
    position: fixed;
    left: 0.45rem;
    right: 0.45rem;
    bottom: 0.45rem;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.18rem;
    padding: 0.32rem;
    border-radius: 20px;
    background: rgba(247, 241, 230, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.bottom-link {
    min-height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    gap: 0.12rem;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
}

.bottom-link span {
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(7, 24, 39, 0.08);
    font-size: 0.72rem;
}

.bottom-link.is-active {
    background: var(--navy);
    color: var(--cream);
}

.bottom-link.is-active span {
    background: rgba(247, 241, 230, 0.16);
    color: var(--gold);
}

@media (min-width: 760px) {
    .shell {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 1rem;
        padding: 1rem;
        transition: grid-template-columns 180ms ease;
    }

    .sidebar {
        position: sticky;
        top: 1rem;
        height: calc(100vh - 2rem);
        display: flex;
        flex-direction: column;
        border-radius: 30px;
        padding: 1rem;
        background: rgba(247, 241, 230, 0.96);
        box-shadow: var(--shadow);
        overflow: hidden;
        transition: padding 180ms ease;
    }

    .sidebar-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        min-width: 0;
    }

    .brand-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .brand-copy strong,
    .brand-copy small {
        white-space: nowrap;
    }

    .sidebar-toggle {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0 0.95rem;
        border-radius: 999px;
        border: 1px solid rgba(7, 24, 39, 0.08);
        background: rgba(7, 24, 39, 0.06);
        color: var(--navy);
        font-size: 0.76rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .side-nav {
        display: grid;
        gap: 0.45rem;
        margin-top: 2rem;
    }

    .nav-link {
        min-height: 52px;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border-radius: 18px;
        padding: 0 0.9rem;
        color: var(--muted);
        font-weight: 900;
    }

    .nav-link > span:first-child {
        display: none;
    }

    body:not(.sidebar-collapsed) .brand-copy,
    body:not(.sidebar-collapsed) .nav-link-text,
    body:not(.sidebar-collapsed) .sidebar-toggle-open {
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: auto !important;
        overflow: visible !important;
    }

    body:not(.sidebar-collapsed) .brand-copy {
        display: flex !important;
    }

    .nav-link-text {
        display: inline;
        opacity: 1;
        visibility: visible;
        color: inherit;
        white-space: nowrap;
    }

    .nav-link.is-active,
    .nav-link:hover {
        background: var(--navy);
        color: var(--cream);
    }

    .logout-card {
        margin-top: auto;
        border-radius: 22px;
        padding: 1rem;
        box-shadow: none;
    }

    .logout-card p {
        color: var(--muted);
        line-height: 1.5;
    }

    .logout-card strong {
        color: var(--navy);
    }

    .main-content {
        padding: 1.2rem 1rem 2rem;
    }

    .sidebar-collapsed .shell {
        grid-template-columns: 1fr;
    }

    .sidebar-collapsed .sidebar {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 80;
        width: 46px;
        height: 46px;
        padding: 0;
        border-radius: 999px;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .sidebar-collapsed .sidebar-top {
        justify-content: center;
    }

    .sidebar-collapsed .brand {
        display: none;
    }

    .sidebar-collapsed .brand-copy,
    .sidebar-collapsed .nav-link-text,
    .sidebar-collapsed .logout-card p,
    .sidebar-collapsed .sidebar-toggle-open {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        width: 0;
        overflow: hidden;
    }

    .sidebar-collapsed .sidebar-toggle-closed {
        display: none;
    }

    .sidebar-collapsed .sidebar-toggle {
        position: static;
        width: 46px;
        min-height: 46px;
        padding: 0;
        font-size: 0;
        border-radius: 999px;
        background: rgba(255, 252, 244, 0.96);
        border: 1px solid rgba(7, 24, 39, 0.1);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
    }

    .sidebar-collapsed .sidebar-toggle::before {
        content: '+';
        font-size: 1.35rem;
        line-height: 1;
        color: var(--navy);
    }

    .sidebar-collapsed .side-nav {
        display: none;
    }

    .sidebar-collapsed .nav-link {
        justify-content: center;
        padding: 0;
        gap: 0;
        width: 48px;
        min-height: 48px;
        margin: 0 auto;
    }

    .sidebar-collapsed .nav-link > span:first-child {
        display: grid !important;
        place-items: center;
        width: 1.6rem;
        height: 1.6rem;
        border-radius: 999px;
        color: inherit;
        font-size: 0.82rem;
        font-weight: 950;
    }

    .sidebar-collapsed .logout-card {
        display: none;
    }

    .sidebar-collapsed .main-content {
        padding-left: 5.9rem;
    }

    .sidebar-collapsed .logout-card .ghost-button {
        width: 100%;
        min-width: 0;
        padding: 0.8rem 0.35rem;
        font-size: 0.72rem;
    }

    .topbar {
        align-items: center;
        margin-bottom: 1.4rem;
    }

    .desktop-logout {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--cream);
        background: rgba(247, 241, 230, 0.12);
        border: 1px solid rgba(247, 241, 230, 0.22);
    }

    .status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bottom-nav {
        display: none;
    }

    .lead-actions {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .lead-actions .action-link {
        width: auto;
    }

    .import-panel {
        padding: 1.2rem;
    }

    .import-heading {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .button-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .import-counts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lead-preview {
        grid-template-columns: 1.2fr 1fr auto;
        align-items: center;
    }

    .duplicate-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .duplicate-actions {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .replace-fields {
        grid-column: 1 / -1;
    }

    .field-checks {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filter-heading,
    .lead-detail-heading {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .lead-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: end;
    }

    .lead-sheet-search-row {
        grid-template-columns: minmax(280px, 1fr) auto auto;
        align-items: center;
    }

    .filter-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bulk-panel {
        grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
        align-items: end;
    }

    .desktop-leads-table {
        display: block;
        overflow-x: auto;
    }

    .mobile-lead-cards {
        display: none;
    }

    .leads-table {
        min-width: 1120px;
    }

    .leads-table td {
        vertical-align: middle;
    }

    .leads-table td:nth-child(2) {
        min-width: 220px;
    }

    .lead-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lead-sticky-header {
        top: 1rem;
        margin: 0 0 1rem;
        border-radius: 28px;
        padding: 1rem;
    }

    .sticky-title-row {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .sticky-facts {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .sticky-actions {
        flex-wrap: wrap;
    }

    .overview-signal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .lead-edit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
    }

    .lead-edit-grid label:has(textarea) {
        grid-column: span 2;
    }

    .lead-edit-grid button {
        grid-column: 1 / -1;
    }

    .bad-lead-form,
    .task-form {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }

    .note-form {
        grid-template-columns: 220px 1fr 160px auto;
        align-items: end;
    }

    .note-form label:has(textarea) {
        align-self: stretch;
    }

    .task-actions {
        grid-template-columns: repeat(2, max-content);
    }

    .script-page-heading,
    .script-list-heading,
    .script-reader-header {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .script-filters {
        grid-template-columns: 1.4fr 1fr 1fr 1fr auto auto;
        align-items: end;
    }

    .script-workspace {
        grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.6fr);
        align-items: start;
    }

    .script-list-panel {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .script-card-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .script-card-list.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .script-editor-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .script-editor-form label:has(textarea),
    .script-editor-form button {
        grid-column: 1 / -1;
    }

    .script-secondary-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .script-reader {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: start;
    }

    .script-reader-header {
        grid-column: 1 / -1;
        top: 1rem;
    }

    .script-attach-panel {
        position: sticky;
        top: 9rem;
    }

    .lead-script-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-cockpit-details summary {
        display: none;
    }

    .lead-cockpit-details:not([open]) .sticky-facts,
    .lead-cockpit-details:not([open]) .sticky-actions {
        display: grid;
    }

    .call-mode-shell {
        padding-bottom: 0;
    }

    .call-mode-header {
        top: 1rem;
        margin: 0;
        border-radius: 28px;
    }

    .call-lead-details summary {
        display: none;
    }

    .call-lead-details,
    .call-lead-details .call-mode-stats,
    .call-lead-details .call-mode-actions {
        display: grid;
    }

    .call-mode-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .call-mode-actions,
    .call-script-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .call-primary {
        grid-column: auto;
    }

    .call-section-heading {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .call-outcome-form {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
        align-items: start;
    }

    .call-quick-note,
    .call-outcomes-panel {
        grid-column: 1;
    }

    .call-followup-panel,
    .call-meeting-panel {
        grid-column: 2;
    }

    .call-outcome-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .call-save-bar {
        position: sticky;
        grid-column: 1 / -1;
        bottom: 1rem;
        left: auto;
        right: auto;
    }

    .calendar-toolbar,
    .booked-heading {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .calendar-view-tabs,
    .calendar-date-controls {
        grid-column: 1 / -1;
    }

    .calendar-date-controls {
        grid-template-columns: auto 220px auto;
        align-items: end;
    }

    .meeting-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
    }

    .meeting-form label:has(textarea),
    .meeting-form button {
        grid-column: span 3;
    }

    .meeting-card {
        grid-template-columns: minmax(0, 1fr) 360px;
        align-items: start;
    }

    .meeting-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meeting-action-forms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meeting-action-forms form:first-child,
    .meeting-action-forms form:last-child {
        grid-column: 1 / -1;
    }

    .calendar-month-panel {
        display: block;
    }

    .calendar-month-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .calendar-month-grid > strong {
        color: var(--sage-dark);
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .calendar-day {
        min-height: 118px;
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 0.65rem;
        background: rgba(255, 250, 240, 0.74);
        overflow: hidden;
    }

    .calendar-day.is-empty {
        opacity: 0.35;
    }

    .calendar-day span {
        display: block;
        margin-bottom: 0.45rem;
        color: var(--sage-dark);
        font-weight: 900;
    }

    .calendar-day a {
        display: block;
        margin-bottom: 0.35rem;
        border-radius: 10px;
        padding: 0.35rem;
        background: rgba(142, 165, 142, 0.18);
        color: var(--navy);
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1.25;
    }
}

.workflow-reference-panel { margin-top: 1.25rem; }
.workflow-reference-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.workflow-reference-heading h2 { margin: 0.25rem 0 0.55rem; }
.workflow-reference-heading p:not(.eyebrow) { max-width: 720px; color: var(--muted); line-height: 1.5; }
.workflow-reference-path { position: relative; display: grid; gap: 0.9rem; max-width: 1160px; margin: 1.35rem auto 0; padding: 0.25rem 0; }
.workflow-reference-path::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; border-radius: 3px; background: linear-gradient(var(--gold), var(--sage), var(--forest)); transform: translateX(-50%); }
.workflow-reference-stage { position: relative; display: grid; grid-template-columns: 1fr 76px 1fr; min-height: 112px; z-index: 1; }
.workflow-reference-stage.is-left .workflow-reference-card { grid-column: 1; }
.workflow-reference-stage.is-right .workflow-reference-card { grid-column: 3; }
.workflow-reference-rail { display: grid; grid-column: 2; place-items: start center; padding-top: 1.05rem; }
.workflow-reference-rail span { display: grid; place-items: center; width: 44px; height: 44px; border: 4px solid var(--cream); border-radius: 50%; background: var(--navy); color: var(--cream); box-shadow: 0 0 0 2px var(--sage), 0 6px 16px rgba(7, 21, 34, 0.22); font-size: 0.72rem; font-weight: 950; letter-spacing: 0.08em; }
.workflow-reference-card { position: relative; border: 1px solid var(--line); border-top: 4px solid var(--sage); border-radius: 18px; padding: 0.95rem 1rem; background: rgba(255, 253, 248, 0.82); box-shadow: 0 10px 24px rgba(7, 21, 34, 0.07); }
.workflow-reference-card::after { content: ""; position: absolute; top: 2rem; width: 36px; height: 2px; background: var(--sage); }
.workflow-reference-stage.is-left .workflow-reference-card::after { right: -36px; }
.workflow-reference-stage.is-right .workflow-reference-card::after { left: -36px; }
.workflow-reference-stage:nth-child(3n + 2) .workflow-reference-card { border-top-color: var(--gold); }
.workflow-reference-stage:nth-child(3n) .workflow-reference-card { border-top-color: var(--forest); }
.workflow-reference-step { margin: 0; color: var(--sage-dark); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.workflow-reference-card h3 { margin: 0.3rem 0 0.7rem; color: var(--navy); font-size: 1.1rem; }
.workflow-reference-empty { margin: 0; color: var(--muted); }
.workflow-reference-checkpoints { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.workflow-reference-checkpoints li { position: relative; display: grid; gap: 0.15rem; padding: 0.6rem 0.7rem 0.6rem 1.35rem; border-radius: 12px; background: rgba(116, 134, 97, 0.09); color: var(--navy); }
.workflow-reference-checkpoints li::before { content: ""; position: absolute; left: 0.6rem; top: 0.9rem; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--gold); }
.workflow-reference-checkpoints span,
.workflow-reference-checkpoints small { color: var(--muted); line-height: 1.4; }
.workflow-reference-checkpoints small { color: var(--sage-dark); font-weight: 800; }
@media (max-width: 760px) {
    .workflow-reference-heading { display: grid; }
    .workflow-reference-heading .action-link { width: 100%; justify-content: center; }
    .workflow-reference-path::before { left: 22px; }
    .workflow-reference-stage { grid-template-columns: 45px minmax(0, 1fr); }
    .workflow-reference-stage.is-left .workflow-reference-card,
    .workflow-reference-stage.is-right .workflow-reference-card { grid-column: 2; }
    .workflow-reference-rail { grid-column: 1; padding-top: 0.8rem; }
    .workflow-reference-rail span { width: 34px; height: 34px; border-width: 3px; font-size: 0.62rem; }
    .workflow-reference-card::after { display: none; }
}

/* Final Notes composer override after shared desktop lead-note rules. */
@media (min-width: 760px) {
    .notes-workspace-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .note-compose-panel .note-form {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) !important;
        align-items: end;
    }
    .note-compose-panel .note-form label:has(textarea),
    .note-compose-panel .note-form .rich-note-field,
    .note-compose-panel .note-form label:has(input[type="file"]),
    .note-compose-panel .note-form button { grid-column: 1 / -1; }
}

@media (min-width: 1080px) {
    .status-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.settings-hero,
.settings-section {
    display: grid;
    gap: 1rem;
}

.settings-section {
    margin-top: 1.25rem;
    gap: 1.35rem;
}

/* Settings sections stay compact until the corresponding h2 is opened. */
.settings-section-dropdown {
    width: 100%;
}

.settings-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.2rem;
    padding: 0.25rem 0;
    cursor: pointer;
    list-style: none;
}

.settings-section-summary::-webkit-details-marker {
    display: none;
}

.settings-section-title {
    min-width: 0;
    color: var(--navy);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.settings-section-title h2 {
    margin: 0 !important;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.settings-section-indicator {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(17, 44, 51, 0.12);
    border-radius: 999px;
    background: rgba(247, 242, 229, 0.78);
    color: var(--navy);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 160ms ease, background 160ms ease;
}

.settings-section-dropdown[open] .settings-section-indicator {
    transform: rotate(45deg);
    background: rgba(196, 170, 80, 0.24);
}

.settings-section-content {
    display: grid;
    gap: 1.35rem;
    padding-top: 0.7rem;
}

.settings-section-content > .settings-section-heading {
    margin: 0;
}

.settings-hero h2,
.settings-section h2 {
    margin: 0.25rem 0 0.45rem;
}

.settings-jump-nav,
.settings-export-grid,
.settings-chip-list,
.settings-check-row,
.settings-match-strip,
.settings-duplicate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.settings-jump-nav a,
.settings-chip-list span,
.settings-match-strip span {
    border: 1px solid rgba(17, 44, 51, 0.12);
    border-radius: 999px;
    background: rgba(247, 242, 229, 0.78);
    color: var(--navy);
    padding: 0.55rem 0.8rem;
    text-decoration: none;
    font-weight: 700;
}

.settings-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.settings-add-row,
.settings-theme-form,
.settings-grid-form,
.settings-audit-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.settings-add-row label,
.settings-theme-form label,
.settings-grid-form label,
.settings-audit-filters label,
.settings-card-form label,
.status-edit-grid label,
.status-archive-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

.settings-status-list,
.settings-duplicate-list,
.settings-subsection {
    display: grid;
    gap: 1rem;
}

.settings-status-card,
.settings-duplicate-card,
.settings-card-form {
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 1.25rem;
    background: var(--card-bg, rgba(255, 252, 244, 0.8));
    box-shadow: 0 14px 36px rgba(17, 44, 51, 0.08);
    padding: 1rem;
}

.settings-status-card {
    display: grid;
    gap: 0.85rem;
}

.settings-inline-details {
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.35);
    padding: 0.85rem;
}

.settings-inline-details summary {
    cursor: pointer;
    font-weight: 800;
}

.settings-deliverable-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.settings-deliverable-card {
    display: grid;
    gap: 0.35rem;
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 0.85rem;
    padding: 0.75rem;
    background: rgba(255, 252, 244, 0.85);
}

.settings-deliverable-card div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    justify-content: space-between;
}

.settings-deliverable-card span,
.settings-deliverable-card p {
    color: var(--muted);
}

.settings-deliverable-card p {
    margin: 0;
}

.status-edit-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 110px;
    gap: 0.75rem;
    align-items: end;
}

.status-email-action-grid {
    display: grid;
    grid-template-columns: 110px minmax(220px, 0.9fr) minmax(280px, 1.45fr);
    gap: 0.75rem;
    align-items: end;
}

.status-archive-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    border-top: 1px solid rgba(17, 44, 51, 0.08);
    padding-top: 0.85rem;
}

.settings-muted {
    color: var(--muted);
    margin: 0;
}

.settings-image-remove {
    align-self: end;
    grid-template-columns: auto 1fr !important;
    align-items: center;
    min-height: 2.8rem;
}

.email-signature-preview-wrap {
    display: grid;
    gap: 0.55rem;
}

.email-signature-preview {
    max-width: 680px;
    padding: 1.5rem;
    border: 1px solid #d9d3c7;
    border-radius: 0.8rem;
    background: #ffffff;
    color: #203747;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 8px 20px rgba(17, 44, 51, 0.08);
}

.email-signature-preview-copy {
    margin: 0;
}

.email-signature-preview-meta {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 0.25rem 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5dfd5;
}

.email-signature-preview-meta span {
    color: #6c7376;
    font-weight: 700;
}

.email-signature-preview-block {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #d9d3c7;
    white-space: pre-line;
}

.email-signature-preview-block img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border: 0;
}

.settings-wide {
    grid-column: 1 / -1;
}

.alias-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.settings-duplicate-grid,
.settings-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-duplicate-card h3 {
    margin: 0.2rem 0 0.75rem;
}

.settings-subsection {
    padding-top: 0.35rem;
}

.settings-subsection > h3 {
    margin: 0 0 0.85rem;
}

.mini-definition-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.mini-definition-list div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.5rem;
}

.mini-definition-list dt {
    color: var(--muted);
    font-weight: 800;
}

.mini-definition-list dd {
    margin: 0;
    color: var(--navy);
}

.replace-fields-detail {
    flex-basis: 100%;
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 1rem;
    padding: 0.75rem;
    background: var(--card-bg, rgba(247, 242, 229, 0.62));
}

.replace-fields-detail summary {
    cursor: pointer;
    font-weight: 800;
}

.replace-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.75rem 0;
}

.settings-table-wrap {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid rgba(17, 44, 51, 0.09);
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 252, 244, 0.88);
}

.settings-table th,
.settings-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(17, 44, 51, 0.08);
    vertical-align: top;
}

.settings-table th {
    color: var(--navy);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.warning-alert {
    background: rgba(217, 181, 109, 0.2);
    border-color: rgba(217, 181, 109, 0.45);
}

@media (max-width: 900px) {
    .settings-section-heading,
    .settings-two-column,
    .settings-duplicate-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .settings-add-row,
    .settings-theme-form,
    .settings-grid-form,
    .settings-audit-filters,
    .status-edit-grid,
    .status-email-action-grid,
    .status-archive-form {
        grid-template-columns: 1fr;
    }

    .alias-grid,
    .replace-field-grid {
        grid-template-columns: 1fr;
    }

    .mini-definition-list div {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .settings-jump-nav a,
    .settings-export-grid a,
    .settings-duplicate-actions button {
        width: 100%;
        justify-content: center;
    }
}

.dashboard-hero,
.dashboard-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.dashboard-hero h2,
.dashboard-section-heading h2 {
    margin: 0.25rem 0 0.45rem;
}

.dashboard-hero-actions,
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1rem;
    align-items: start;
}

.dashboard-main-flow,
.dashboard-side-flow,
.dashboard-today-panel,
.dashboard-pipeline-panel,
.dashboard-activity-panel,
.dashboard-metrics-panel {
    display: grid;
    gap: 1rem;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-metric-card,
.dashboard-pipeline-card {
    display: grid;
    gap: 0.45rem;
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 1.1rem;
    background: rgba(255, 252, 244, 0.82);
    color: var(--navy);
    padding: 0.9rem;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(17, 44, 51, 0.07);
}

.dashboard-metric-card span,
.dashboard-pipeline-card span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1.25;
}

.dashboard-metric-card strong,
.dashboard-pipeline-card strong {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1;
}

.dashboard-today-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1280px) and (min-width: 721px) {
    .dashboard-today-grid { grid-template-columns: 1fr; }
}

.dashboard-today-column {
    display: grid;
    align-content: start;
    gap: 0.7rem;
}

.dashboard-today-column:first-child {
    grid-column: 1 / -1;
}

.dashboard-today-column h3 {
    margin: 0;
}

.dashboard-action-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    border: 1px solid rgba(17, 44, 51, 0.09);
    border-radius: 1.1rem;
    background: rgba(255, 252, 244, 0.84);
    padding: 0.9rem;
    box-shadow: 0 12px 26px rgba(17, 44, 51, 0.06);
}

.dashboard-action-card.compact {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-action-card h3 {
    margin: 0.15rem 0 0.35rem;
}

.dashboard-action-card p {
    margin: 0;
}

.dashboard-muted {
    color: var(--muted);
}

.dashboard-inline-detail {
    min-width: 220px;
    border: 1px solid rgba(17, 44, 51, 0.1);
    border-radius: 0.9rem;
    padding: 0.65rem;
    background: rgba(247, 242, 229, 0.7);
}

.dashboard-inline-detail summary {
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.dashboard-inline-detail form {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.dashboard-inline-detail label {
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
    font-weight: 800;
}

.dashboard-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-pipeline-card {
    border-top: 5px solid var(--stage-color);
}

.dashboard-top-pipeline {
    margin-bottom: 1rem;
}

.dashboard-call-chart {
    display: grid;
    gap: 0.85rem;
    overflow: visible;
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1.35rem;
    background:
        linear-gradient(135deg, rgba(255, 252, 244, 0.92), rgba(247, 242, 229, 0.74)),
        radial-gradient(circle at 92% 18%, rgba(218, 177, 92, 0.22), transparent 18rem);
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.dashboard-call-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.dashboard-call-chart-head h3 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.dashboard-call-chart-head p:last-child {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    font-weight: 750;
    line-height: 1.45;
}

.dashboard-call-bar-chart {
    display: grid;
    grid-template-columns: 2.8rem minmax(0, 1fr);
    gap: 0.55rem 0.75rem;
    min-height: 350px;
    overflow: visible;
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1.1rem;
    background:
        linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(255, 252, 244, 0.8)),
        repeating-linear-gradient(0deg, rgba(17, 44, 51, 0.10) 0 1px, transparent 1px 33.33%);
    padding: 3.1rem 0.85rem 0.95rem;
}

.dashboard-call-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0.15rem 0 0.05rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
}

.dashboard-call-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    align-items: end;
    gap: 0.85rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 0;
}

.dashboard-call-day-group {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.55rem;
    min-width: 92px;
    min-height: 0;
    height: 100%;
}

.dashboard-call-bar-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(16px, 1fr));
    align-items: end;
    gap: 0.32rem;
    min-height: 0;
    height: auto;
}

.dashboard-call-bar-shell {
    position: relative;
    width: 100%;
    min-width: 16px;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: help;
}

.dashboard-call-bar {
    display: block;
    width: 100%;
    min-width: 16px;
    min-height: 8px;
    height: var(--bar-height);
    padding: 0;
    border: 0;
    border-radius: 999px 999px 0.35rem 0.35rem;
    box-shadow: 0 10px 22px rgba(8, 23, 43, 0.12);
    transition: transform 140ms ease, filter 140ms ease;
}

.dashboard-call-bar-shell:hover .dashboard-call-bar,
.dashboard-call-bar-shell:focus .dashboard-call-bar,
.dashboard-call-bar-shell:focus-visible .dashboard-call-bar {
    transform: translateY(-3px);
    filter: brightness(1.05);
}

.dashboard-call-bar-shell:focus,
.dashboard-call-bar-shell:focus-visible {
    outline: 3px solid rgba(201, 155, 74, 0.26);
    outline-offset: 3px;
}

.dashboard-call-bar.is-calls {
    background: linear-gradient(180deg, #f0a7a1, #d97870);
}

.dashboard-call-bar.is-answered {
    background: linear-gradient(180deg, #f3d680, #d9ad47);
}

.dashboard-call-bar.is-booked {
    background: linear-gradient(180deg, #9fc79f, #5f9868);
}

.dashboard-call-date-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-align: center;
}

.dashboard-call-tooltip {
    position: absolute;
    left: calc(100% + 0.42rem);
    bottom: calc(var(--bar-height) + 0.35rem);
    display: grid;
    gap: 0.18rem;
    min-width: 118px;
    max-width: 152px;
    padding: 0.52rem 0.62rem;
    border: 1px solid rgba(201, 155, 74, 0.28);
    border-radius: 0.9rem;
    background: rgba(7, 24, 39, 0.96);
    color: var(--cream);
    box-shadow: 0 18px 34px rgba(8, 23, 43, 0.24);
    opacity: 0;
    pointer-events: none;
    text-align: left;
    white-space: nowrap;
    z-index: 8;
    transform: translate(0, 0.2rem);
    transition: opacity 140ms ease, transform 140ms ease;
}

.dashboard-call-tooltip strong {
    color: var(--gold);
    font-size: 0.84rem;
}

.dashboard-call-tooltip span {
    color: rgba(255, 250, 240, 0.9);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-call-bar-shell:hover .dashboard-call-tooltip,
.dashboard-call-bar-shell:focus .dashboard-call-tooltip,
.dashboard-call-bar-shell:focus-visible .dashboard-call-tooltip {
    opacity: 1;
    transform: translate(0, 0);
}

.dashboard-call-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
}

.dashboard-call-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dashboard-call-legend i {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
}

.dashboard-call-legend .is-calls {
    background: #d97870;
}

.dashboard-call-legend .is-answered {
    background: #d9ad47;
}

.dashboard-call-legend .is-booked {
    background: #5f9868;
}

.dashboard-activity-list {
    display: grid;
    gap: 0.65rem;
}

.dashboard-activity-list article {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1rem;
    background: rgba(255, 252, 244, 0.78);
    padding: 0.75rem;
}

.dashboard-activity-list article > span {
    border-radius: 999px;
    background: rgba(142, 165, 142, 0.18);
    color: var(--navy);
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.dashboard-activity-list p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.scorecard-metric-grid {
    margin-top: 1rem;
}

.scorecard-metric-card {
    min-height: 124px;
}

.scorecard-report-grid,
.scorecard-followup-grid,
.scorecard-quality-grid,
.scorecard-grounding-grid {
    display: grid;
    gap: 1rem;
}

.scorecard-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.scorecard-followup-grid,
.scorecard-grounding-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.scorecard-quality-grid {
    margin-top: 1rem;
}

.scorecard-report-card,
.scorecard-quality-card {
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1.2rem;
    background: rgba(255, 252, 244, 0.78);
    padding: 1rem;
}

.scorecard-distribution-list,
.scorecard-session-list,
.scorecard-quality-checks,
.scorecard-mini-report {
    display: grid;
    gap: 0.7rem;
}

.scorecard-distribution-row,
.scorecard-session-row,
.scorecard-quality-head {
    display: grid;
    gap: 0.75rem;
    align-items: center;
}

.scorecard-distribution-row,
.scorecard-session-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.scorecard-distribution-row {
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1rem;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 252, 244, 0.7);
}

.scorecard-distribution-row p,
.scorecard-session-row p,
.scorecard-grounding-grid p,
.scorecard-mini-report p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.scorecard-distribution-row span {
    align-self: center;
    border-radius: 999px;
    background: rgba(214, 170, 79, 0.16);
    color: var(--navy);
    padding: 0.45rem 0.7rem;
    font-weight: 900;
}

.scorecard-session-row {
    border-bottom: 1px solid rgba(17, 44, 51, 0.08);
    padding-bottom: 0.75rem;
}

.scorecard-session-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.scorecard-quality-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.scorecard-quality-statuses span,
.scorecard-quality-checks span {
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 900;
}

.scorecard-quality-statuses span {
    background: rgba(214, 170, 79, 0.16);
}

.scorecard-quality-head {
    grid-template-columns: minmax(0, 1fr) auto;
}

.scorecard-quality-checks {
    margin-top: 0.9rem;
}

.scorecard-quality-checks .is-pass {
    background: rgba(95, 152, 104, 0.16);
    color: #22492d;
}

.scorecard-quality-checks .is-warn {
    background: rgba(217, 120, 112, 0.15);
    color: #6f2f2a;
}

.scorecard-grounding-grid {
    margin-top: 1rem;
}

.scorecard-grounding-grid article {
    border: 1px solid rgba(17, 44, 51, 0.08);
    border-radius: 1rem;
    background: rgba(255, 252, 244, 0.65);
    padding: 0.85rem 0.95rem;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-side-flow {
        order: -1;
    }

    .dashboard-pipeline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scorecard-report-grid,
    .scorecard-followup-grid,
    .scorecard-grounding-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-hero,
    .dashboard-section-heading,
    .dashboard-action-card,
    .dashboard-activity-list article {
        grid-template-columns: 1fr;
        display: grid;
    }

    .dashboard-side-flow {
        order: 2;
    }

    .dashboard-main-flow {
        order: 1;
    }

    .dashboard-today-grid,
    .dashboard-pipeline-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-call-chart-head {
        display: grid;
    }

    .dashboard-call-bar-chart {
        grid-template-columns: 2.35rem minmax(0, 1fr);
        min-height: 320px;
        padding: 3rem 0.65rem 0.75rem;
    }

    .dashboard-call-bars {
        grid-auto-flow: column;
        grid-auto-columns: minmax(86px, 1fr);
        grid-template-columns: none;
        min-height: 230px;
    }

    .dashboard-call-day-group {
        grid-template-rows: minmax(190px, 1fr) auto;
        min-width: 86px;
    }

    .dashboard-call-bar-group {
        min-height: 190px;
    }

    .dashboard-call-bar-shell {
        height: 190px;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-actions,
    .dashboard-hero-actions {
        width: 100%;
    }

    .dashboard-actions a,
    .dashboard-actions button,
    .dashboard-actions form,
    .dashboard-hero-actions a,
    .dashboard-inline-detail {
        width: 100%;
    }

    .dashboard-actions .action-link,
    .dashboard-actions button,
    .dashboard-hero-actions .action-link {
        justify-content: center;
        min-height: 44px;
    }

    .scorecard-report-grid,
    .scorecard-followup-grid,
    .scorecard-grounding-grid,
    .scorecard-quality-head,
    .scorecard-session-row,
    .scorecard-distribution-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(201, 155, 74, 0.18), transparent 22rem),
            linear-gradient(145deg, var(--navy), #0b2135 58%, #112b2f);
    }

    h1 {
        font-size: clamp(1.85rem, 8vw, 2.45rem);
        letter-spacing: -0.025em;
        line-height: 1.04;
    }

    h2 {
        font-size: clamp(1.35rem, 6.5vw, 1.9rem);
        letter-spacing: -0.02em;
        line-height: 1.08;
    }

    .main-content {
        padding: 0.75rem 0.75rem 6rem;
    }

    .topbar {
        display: grid;
        gap: 0.45rem;
        margin-bottom: 0.75rem;
    }

    .panel {
        border-radius: 20px;
        padding: 1rem;
    }

    .button-row,
    .script-reader-actions,
    .call-mode-actions,
    .call-script-actions,
    .mobile-quick-actions,
    .meeting-actions,
    .meeting-action-forms,
    .calendar-date-controls {
        grid-template-columns: 1fr;
    }

    .call-primary,
    .call-save-bar {
        grid-column: auto;
    }

    .call-mode-header,
    .lead-sticky-header {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding: 0.85rem;
    }

    .call-mode-stats,
    .sticky-facts,
    .lead-detail-grid {
        grid-template-columns: 1fr;
    }

    .call-save-bar {
        left: 0.45rem;
        right: 0.45rem;
        bottom: 4.65rem;
        border-radius: 20px;
        padding: 0.45rem;
    }

    .call-save-bar .primary-button,
    .call-save-bar .action-link {
        min-height: 50px;
    }

    .bottom-nav {
        left: 0.35rem;
        right: 0.35rem;
        bottom: 0.35rem;
    }

    .bottom-link {
        min-height: 44px;
        font-size: 0.58rem;
    }

    .bottom-link span {
        display: none;
    }

    .mobile-lead-card h3,
    .meeting-card h3,
    .script-card h3 {
        overflow-wrap: anywhere;
    }

    .status-pill {
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    input,
    select,
    textarea {
        min-height: 50px;
        padding: 0.85rem 0.9rem;
    }

    textarea {
        min-height: 180px;
    }

    .import-panel {
        padding: 0.45rem;
    }

    .import-panel-inner {
        border-radius: 22px;
    }
}

.nav-link span,
.bottom-link span {
    display: none;
}

.nav-link {
    gap: 0;
}

.topbar h1 {
    max-width: 100%;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.02;
    overflow-wrap: anywhere;
}

.dashboard-hero {
    margin-bottom: 1.35rem;
}

.dashboard-layout {
    margin-top: 0;
}

.script-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.script-card-actions .action-link,
.script-card-actions button,
.script-secondary-actions .action-link,
.script-secondary-actions button,
.meeting-actions .action-link,
.meeting-actions button,
.sticky-actions .action-link {
    width: auto;
    min-width: 104px;
    min-height: 48px;
    padding: 0 1.15rem;
    white-space: nowrap;
    overflow-wrap: normal;
}

.script-card-actions form {
    display: contents;
}

.check-filter {
    justify-content: flex-start;
    min-height: 48px;
    background: rgba(142, 165, 142, 0.13);
    border: 1px solid rgba(17, 44, 51, 0.08);
}

.check-filter input[type="checkbox"],
.settings-check-row input[type="checkbox"],
.field-checks input[type="checkbox"],
.replace-field-grid input[type="checkbox"],
.mobile-select-lead input[type="checkbox"],
.leads-table input[type="checkbox"] {
    appearance: none;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-height: 22px;
    border: 2px solid rgba(7, 24, 39, 0.35);
    border-radius: 6px;
    background: var(--card-bg, #fffaf0);
    cursor: pointer;
}

.check-filter input[type="checkbox"]:checked,
.settings-check-row input[type="checkbox"]:checked,
.field-checks input[type="checkbox"]:checked,
.replace-field-grid input[type="checkbox"]:checked,
.mobile-select-lead input[type="checkbox"]:checked,
.leads-table input[type="checkbox"]:checked {
    border-color: var(--gold);
    background:
        linear-gradient(135deg, var(--gold), #f1d184);
    box-shadow: inset 0 0 0 4px var(--card-bg, #fffaf0);
}

.settings-check-row {
    align-items: stretch;
}

.settings-check-row .check-filter {
    min-width: 118px;
}

.settings-theme-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.settings-match-strip {
    align-items: flex-start;
}

.settings-match-strip span {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.settings-match-strip span:has(strong) {
    line-height: 1.25;
}

.settings-match-strip span:last-child {
    flex-basis: 100%;
}

.settings-duplicate-card {
    padding: 1.25rem;
}

.settings-duplicate-grid {
    gap: 1.5rem;
}

.mini-definition-list div {
    align-items: baseline;
}

.lead-sticky-header {
    overflow: hidden;
}

.lead-sticky-header .ghost-button,
.lead-sticky-header .desktop-logout {
    background: rgba(247, 241, 230, 0.15);
    border: 1px solid rgba(247, 241, 230, 0.24);
    color: var(--cream);
}

.lead-sticky-header .danger-button {
    color: #ffc6b9;
    background: rgba(122, 47, 34, 0.34);
    border-color: rgba(255, 198, 185, 0.22);
}

.sticky-facts span {
    overflow: hidden;
    overflow-wrap: anywhere;
}

.sticky-facts {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.sticky-actions {
    gap: 0.65rem;
}

.lead-tabs {
    margin-top: 1rem;
}

.quote-builder-shell,
.quote-section,
.quote-status-panel {
    display: grid;
    gap: 1rem;
}

.quote-builder-hero {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.quote-readiness-card,
.quote-summary-grid article,
.quote-scope-card,
.quote-preview-card,
.quote-addon-card,
.quote-deliverable-card,
.quote-pricing-panel,
.quote-needed-panel,
.quote-warning-box {
    border: 1px solid rgba(12, 31, 45, 0.12);
    background: rgba(255, 252, 245, 0.82);
    border-radius: 1.2rem;
    padding: 1rem;
}

.quote-readiness-card strong {
    display: block;
    font-size: clamp(2rem, 7vw, 4rem);
    line-height: 0.95;
    color: var(--navy);
}

.quote-summary-grid,
.quote-evidence-grid,
.quote-form-grid,
.quote-deliverable-grid,
.quote-addon-groups {
    display: grid;
    gap: 0.85rem;
}

.quote-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.quote-summary-grid span,
.quote-readiness-card span,
.quote-addon-card span,
.quote-deliverable-card span {
    color: var(--muted);
    font-weight: 800;
}

.quote-summary-grid strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

.quote-needed-panel h3,
.quote-addon-card h3,
.quote-scope-card h3,
.quote-preview-card h3 {
    margin-top: 0;
}

.quote-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quote-chip-list span,
.quote-mini-row {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    background: rgba(137, 160, 132, 0.18);
    color: var(--navy);
    font-weight: 800;
}

.quote-chip-list .warning-chip,
.quote-warning-box {
    background: rgba(201, 155, 74, 0.18);
}

.quote-help {
    color: var(--muted);
    font-weight: 700;
}

.quote-builder-grid {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.quote-builder-main {
    display: grid;
    gap: 1rem;
}

.quote-form-grid label,
.quote-status-form label,
.quote-drawer label {
    display: grid;
    gap: 0.4rem;
    font-weight: 900;
}

.quote-form-grid input[readonly] {
    background: rgba(12, 31, 45, 0.04);
    color: var(--muted);
}

.quote-form-grid.wide {
    margin-top: 0.85rem;
}

.quote-form-grid.wide textarea,
.quote-preview-card {
    min-height: 130px;
}

.quote-deliverable-card {
    cursor: pointer;
}

.quote-deliverable-card input {
    width: auto;
    margin-right: 0.35rem;
}

.quote-addon-card {
    display: grid;
    gap: 0.75rem;
}

.quote-price-lines {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0;
}

.quote-price-lines article {
    display: grid;
    gap: 0.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(12, 31, 45, 0.12);
}

.quote-price-lines article span {
    font-size: 1.2rem;
    font-weight: 950;
    color: var(--navy);
}

.quote-pricing-panel {
    display: grid;
    gap: 0.85rem;
}

.quote-pricing-panel h2 {
    margin: 0;
}

.quote-drawer {
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.4);
}

.quote-drawer summary {
    cursor: pointer;
    font-weight: 950;
}

.quote-status-form {
    display: grid;
    gap: 0.85rem;
}

.document-builder-shell,
.document-section {
    display: grid;
    gap: 1rem;
}

.document-hero {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.document-filter-form,
.document-template-form,
.document-status-form,
.document-action-grid {
    display: grid;
    gap: 0.85rem;
}

.document-placeholder-list {
    max-height: 220px;
    overflow: auto;
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(7, 24, 39, 0.06);
    color: var(--navy);
    font-weight: 800;
}

.document-field-map,
.document-export-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.document-field-map {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.document-field-map article,
.document-export-card {
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1.1rem;
    padding: 1rem;
    background: rgba(255, 252, 245, 0.82);
}

.document-field-map strong {
    display: block;
    color: var(--sage-dark);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-field-map p,
.document-export-card p {
    margin-bottom: 0;
}

.document-export-card {
    display: grid;
    gap: 0.75rem;
}

.document-export-card h3 {
    margin: 0;
    color: var(--navy);
}

.document-action-grid button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.45);
    opacity: 0.58;
    box-shadow: none;
}

@media (min-width: 900px) {
    .document-hero {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    .document-filter-form,
    .document-status-form,
    .document-action-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .document-template-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-template-form label:has(textarea),
    .document-template-form button {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .quote-builder-hero {
        grid-template-columns: 1fr 240px;
    }

    .quote-builder-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
    }

    .quote-pricing-panel {
        position: sticky;
        top: 1rem;
    }

    .quote-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quote-form-grid.wide,
    .quote-evidence-grid,
    .quote-addon-groups,
    .quote-deliverable-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quote-status-form {
        grid-template-columns: 1fr 1fr auto auto;
        align-items: end;
    }
}

.dashboard-metric-card,
.dashboard-pipeline-card,
.dashboard-action-card,
.mobile-lead-card,
.meeting-card,
.script-card,
.summary-card,
.review-card,
.duplicate-card,
.settings-status-card,
.settings-duplicate-card,
.settings-card-form,
.note-card,
.timeline-item,
.call-script-text article,
.calendar-day {
    background: var(--card-bg, rgba(255, 252, 244, 0.82));
}

.lead-actions {
    order: 10;
}

.lead-filter-panel {
    order: 20;
}

.leads-sheet-section {
    order: 30;
}

.bulk-panel {
    order: 40;
}

#duplicate-review {
    order: 50;
}

@media (min-width: 901px) {
    .script-card-actions {
        grid-template-columns: none;
    }
}

@media (max-width: 900px) {
    .settings-theme-form {
        grid-template-columns: 1fr;
    }

    .script-card-actions .action-link,
    .script-card-actions button,
    .script-secondary-actions .action-link,
    .script-secondary-actions button,
    .meeting-actions .action-link,
    .meeting-actions button {
        width: 100%;
    }
}

.script-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 0.55rem;
}

.script-card-actions .action-link,
.script-card-actions button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.call-mode-header,
.lead-sticky-header,
.script-reader-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

@media (max-width: 760px) {
    .desktop-leads-table {
        max-width: calc(100vw - 1.3rem);
        touch-action: pan-x pan-y pinch-zoom;
    }

    .lead-sticky-header {
        margin: 0 0 1rem !important;
        padding: 0.85rem !important;
        border-radius: 18px;
    }

    .sticky-title-row h2 {
        max-width: 100%;
        font-size: clamp(1.55rem, 8vw, 2.25rem);
        line-height: 1.04;
        overflow-wrap: anywhere;
    }

    .lead-cockpit-details summary {
        display: flex;
        min-height: 42px;
        padding: 0 0.8rem;
    }

    .lead-cockpit-details:not([open]) .sticky-facts,
    .lead-cockpit-details:not([open]) .sticky-actions {
        display: none;
    }

    .sticky-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .sticky-facts span {
        min-height: 50px;
        border-radius: 12px;
        padding: 0.55rem;
        font-size: 0.78rem;
    }

    .sticky-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        gap: 0.5rem;
    }

    .sticky-actions .inline-action-form,
    .sticky-actions .primary-button,
    .sticky-actions .ghost-button,
    .sticky-actions .action-link {
        width: 100%;
        min-width: 0;
    }

    .sticky-actions .inline-action-form {
        display: block;
    }

    .sticky-actions .primary-button,
    .sticky-actions .ghost-button,
    .sticky-actions .action-link {
        min-height: 46px;
        padding-inline: 0.75rem;
        font-size: 0.9rem;
        white-space: normal;
    }
}

.scorecard-workflow-summary + .scorecard-workflow-summary {
    margin-top: 0.9rem;
}

.scorecard-workflow-summary summary {
    cursor: pointer;
}

.scorecard-workflow-actions form {
    margin: 0;
}

.scorecard-config-card,
.scorecard-config-section,
.scorecard-config-nav {
    display: grid;
    gap: 1rem;
}

.scorecard-config-meta {
    display: grid;
    gap: 0.65rem;
}

.scorecard-config-meta span {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(12, 31, 45, 0.12);
    border-radius: 1rem;
    background: rgba(255, 252, 245, 0.76);
}

.scorecard-config-meta strong {
    color: var(--sage-dark);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.call-tree-start-grid.compact {
    margin-top: 0.8rem;
}

.scorecard-config-layout {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.scorecard-config-hero,
.scorecard-config-actions,
.scorecard-config-subsection-header,
.scorecard-config-readiness,
.scorecard-config-preview,
.scorecard-config-activate-row {
    display: grid;
    gap: 0.8rem;
}

.scorecard-config-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-content: start;
}

.scorecard-config-nav a {
    display: block;
    padding: 0.75rem 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(12, 31, 45, 0.12);
    text-decoration: none;
    color: var(--navy);
    background: rgba(255, 252, 245, 0.78);
}

.scorecard-config-form,
.scorecard-config-sidebar,
.scorecard-config-list,
.scorecard-config-checkbox-grid,
.scorecard-configured-service-grid {
    display: grid;
    gap: 1rem;
}

.scorecard-config-checkbox-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.scorecard-configured-plan {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(12, 31, 45, 0.12);
    background: rgba(255, 252, 245, 0.74);
}

.settings-success-text {
    color: #2f6f4f;
    font-weight: 700;
}

.settings-danger-text {
    color: #8c3a2a;
    font-weight: 700;
}

@media (min-width: 900px) {
    .scorecard-config-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .scorecard-config-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scorecard-config-layout {
        grid-template-columns: 220px minmax(0, 1fr) 360px;
        align-items: start;
    }

    .scorecard-config-sidebar {
        position: sticky;
        top: 1rem;
    }

    .scorecard-configured-service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.creative-system-hero,
.creative-editor-panel,
.creative-preview-panel,
.creative-asset-panel {
    background:
        radial-gradient(circle at top right, rgba(196, 170, 80, 0.12), transparent 28%),
        linear-gradient(160deg, rgba(255, 253, 248, 0.98), rgba(244, 235, 216, 0.92));
}

.creative-system-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
}

.creative-hero-actions {
    display: flex;
    align-items: center;
}

.creative-system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.creative-editor-panel,
.creative-preview-panel,
.creative-asset-panel {
    display: grid;
    gap: 1.1rem;
}

.creative-section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.creative-section-head h2 {
    margin: 0.2rem 0 0;
}

.creative-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.creative-editor-form {
    display: grid;
    gap: 0.95rem;
}

.creative-editor-form label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
    color: #0d2236;
}

.creative-editor-form input,
.creative-editor-form textarea,
.creative-editor-form select {
    width: 100%;
    border: 1px solid rgba(13, 34, 54, 0.12);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: rgba(255, 253, 248, 0.92);
    color: #10253a;
    font: inherit;
}

.creative-editor-form textarea {
    min-height: 112px;
    resize: vertical;
}

.creative-safe-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid rgba(13, 34, 54, 0.08);
    border-radius: 999px;
    font-weight: 700;
}

.creative-artboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.creative-artboard-card {
    display: grid;
    gap: 0.8rem;
}

.creative-artboard-card > header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    color: #5d6d61;
    font-size: 0.95rem;
    font-weight: 700;
}

.creative-artboard-card > header > div {
    display: grid;
    gap: 0.15rem;
}

.artboard-safe-toggle {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
}

.creative-artboard {
    position: relative;
    aspect-ratio: var(--ratio);
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(145deg, var(--deep-navy), var(--navy));
    box-shadow: 0 26px 60px rgba(7, 21, 34, 0.2);
    color: var(--soft-cream);
}

.creative-glow {
    position: absolute;
    inset: auto -8% 12% auto;
    width: 34%;
    height: 26%;
    border-radius: 999px;
    background: rgba(244, 235, 216, 0.14);
    filter: blur(24px);
}

.creative-line {
    position: absolute;
    left: 8%;
    top: 10%;
    width: 18%;
    height: 2px;
    background: linear-gradient(90deg, rgba(196, 170, 80, 0.2), rgba(196, 170, 80, 0.95));
}

.creative-safe-area {
    position: absolute;
    top: var(--safe-top);
    right: var(--safe-right);
    bottom: var(--safe-bottom);
    left: var(--safe-left);
    border: 2px dashed rgba(255, 253, 248, 0.22);
    border-radius: 22px;
    opacity: 0;
    pointer-events: none;
}

.creative-artboard[data-show-safe-area="1"] .creative-safe-area {
    opacity: 1;
}

.creative-editorial-layout,
.creative-diagram-layout {
    position: absolute;
    inset: 0;
    padding: 8%;
}

.creative-editorial-layout {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 1.4rem;
    align-items: start;
}

.creative-editorial-layout .creative-copy-block {
    grid-column: 1 / 2;
    max-width: 92%;
}

.creative-brand-block span,
.creative-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: rgba(244, 235, 216, 0.84);
    font-size: clamp(0.72rem, 1.2vw, 1rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 800;
}

.creative-copy-block h3 {
    margin: 0.7rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, calc(var(--headline-size) / 10), 5.3rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    max-width: 10ch;
}

.creative-copy-block p {
    margin: 0;
    font-size: clamp(1rem, calc(var(--support-size) / 10), 2rem);
    line-height: 1.4;
    max-width: 34ch;
    color: rgba(255, 253, 248, 0.9);
}

.creative-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
    margin-top: 1.4rem;
}

.creative-primary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8em;
    padding: 0.75em 1.45em;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--gold), var(--cream));
    color: var(--deep-navy);
    font-size: clamp(0.95rem, calc(var(--cta-size) / 11), 1.7rem);
    font-weight: 800;
    box-shadow: 0 18px 40px rgba(196, 170, 80, 0.22);
}

.creative-price-line {
    color: rgba(116, 134, 97, 0.96);
    font-size: clamp(0.9rem, calc(var(--cta-size) / 13), 1.3rem);
    font-weight: 700;
}

.creative-side-card {
    align-self: stretch;
    padding: 1.35rem;
    border: 1px solid rgba(255, 253, 248, 0.12);
    border-radius: 28px;
    background: rgba(7, 21, 34, 0.28);
    backdrop-filter: blur(10px);
}

.creative-side-card strong {
    display: block;
    margin: 0.5rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.05rem, 1.65vw, 2rem);
    line-height: 1.18;
}

.creative-side-card ul {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.65rem;
    color: rgba(255, 253, 248, 0.88);
    font-size: clamp(0.9rem, 1.2vw, 1.22rem);
    line-height: 1.45;
}

.creative-side-label {
    color: var(--gold);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.84rem;
    font-weight: 800;
}

.creative-diagram-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.2rem;
    align-items: stretch;
}

.creative-diagram-stack {
    display: grid;
    gap: 0.9rem;
    align-content: start;
}

.creative-diagram-stack article {
    padding: 1rem 1.05rem;
    border-radius: 24px;
    border: 1px solid rgba(116, 134, 97, 0.5);
    background: rgba(255, 253, 248, 0.04);
    backdrop-filter: blur(8px);
}

.creative-diagram-stack strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: clamp(0.98rem, 1.2vw, 1.34rem);
}

.creative-diagram-stack p {
    margin: 0;
    color: rgba(255, 253, 248, 0.84);
    font-size: clamp(0.86rem, 1vw, 1.15rem);
    line-height: 1.45;
}

.creative-file-list {
    display: grid;
    gap: 0.85rem;
}

.creative-file-list article {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(13, 34, 54, 0.08);
}

.creative-file-list strong {
    display: block;
    margin-bottom: 0.25rem;
}

.creative-file-list p {
    margin: 0;
    color: #4f6273;
    word-break: break-word;
}

.creative-manifest-detail summary {
    cursor: pointer;
    font-weight: 700;
}

.creative-manifest-detail pre {
    overflow: auto;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(7, 21, 34, 0.92);
    color: #f4ebd8;
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 1080px) {
    .creative-system-grid,
    .creative-artboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .creative-system-hero,
    .creative-section-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .creative-color-grid,
    .creative-editorial-layout,
    .creative-diagram-layout {
        grid-template-columns: 1fr;
    }

    .creative-copy-block h3 {
        max-width: 12ch;
    }
}

/* Shared stability pass: keep the CRM predictable across phones, tablets, and desktop. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

button,
.action-link,
.nav-link,
.bottom-link,
summary {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(201, 155, 74, 0.72);
    outline-offset: 3px;
}

/* The icon-only selector hid labels in some browser cascade orders. */
.nav-link .nav-link-text {
    display: inline !important;
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    color: inherit !important;
}

.nav-link > span:first-child {
    display: none;
}

.lead-tabs,
.sticky-actions,
.call-tree-actions,
.call-tree-start-grid,
.call-tree-button-grid,
.script-card-actions,
.meeting-actions,
.dashboard-actions,
.dashboard-hero-actions {
    scrollbar-width: thin;
}

/* Avoid stale sticky panels covering fields or action buttons while scrolling. */
.call-mode-header,
.lead-sticky-header,
.script-reader-header,
.script-list-panel,
.email-template-panel,
.script-email-template-panel {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

.dashboard-call-chart,
.dashboard-call-bar-chart,
.dashboard-call-bars,
.dashboard-call-day-group,
.dashboard-call-bar-group {
    overflow: visible;
}

.dashboard-call-bar-chart {
    min-height: 410px;
    padding-top: 5.75rem;
}

.dashboard-call-bars {
    min-height: 340px;
    padding-top: 4.75rem;
}

.dashboard-call-day-group,
.dashboard-call-bar-group,
.dashboard-call-bar-shell {
    min-height: 260px;
    height: 260px;
}

.dashboard-call-tooltip {
    left: 50%;
    bottom: calc(var(--bar-height) + 0.55rem);
    transform: translate(-50%, 0.2rem);
    min-width: 126px;
    z-index: 30;
}

.dashboard-call-bar-shell:hover .dashboard-call-tooltip,
.dashboard-call-bar-shell:focus .dashboard-call-tooltip,
.dashboard-call-bar-shell:focus-visible .dashboard-call-tooltip {
    transform: translate(-50%, 0);
}

@media (min-width: 760px) {
    body.sidebar-collapsed .shell {
        grid-template-columns: 0 minmax(0, 1fr) !important;
        gap: 0;
        padding-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.sidebar-collapsed .main-content {
        grid-column: 2;
        width: 100%;
        padding-left: 5.25rem !important;
    }

    body.sidebar-collapsed .sidebar-toggle-closed {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .main-content {
        width: 100%;
        min-width: 0;
        padding: 0.75rem 0.75rem 6.25rem;
    }

    .bottom-nav {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.15rem;
        padding: 0.3rem;
    }

    .bottom-link {
        min-width: 0;
        min-height: 48px;
        padding: 0.35rem 0.15rem;
        font-size: clamp(0.5rem, 2.35vw, 0.66rem);
        overflow-wrap: anywhere;
    }

    .bottom-link span {
        display: none !important;
    }

    .topbar {
        gap: 0.6rem;
    }

    .topbar h1 {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
        overflow-wrap: anywhere;
    }

    .panel,
    .lead-sticky-header,
    .call-tree-lead-details,
    .call-node-panel,
    .call-path-panel {
        min-width: 0;
    }

    .filter-heading,
    .lead-list-heading,
    .dashboard-call-chart-head,
    .creative-system-hero,
    .creative-section-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-heading .action-link,
    .lead-list-heading .lead-pagination,
    .lead-pagination .action-link {
        width: 100%;
    }

    .lead-filter-dropdown summary {
        width: 100%;
        justify-content: space-between;
    }

    .lead-filters,
    .bulk-panel,
    .lead-edit-grid,
    .bad-lead-form,
    .settings-add-row,
    .settings-grid-form,
    .settings-audit-filters,
    .status-edit-grid,
    .status-archive-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .industry-checkbox-grid {
        grid-template-columns: minmax(0, 1fr);
        max-height: none;
    }

    .lead-sheet-search-row,
    .filter-buttons,
    .mobile-quick-actions,
    .call-mode-actions,
    .call-tree-actions,
    .call-tree-start-grid,
    .call-tree-button-grid,
    .sticky-actions,
    .script-card-actions,
    .meeting-actions,
    .dashboard-actions,
    .dashboard-hero-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100%;
        gap: 0.55rem;
    }

    .lead-sheet-search-row input,
    .lead-sheet-search-row .action-link,
    .call-tree-actions > *,
    .call-tree-start-grid > *,
    .call-tree-button-grid > *,
    .sticky-actions > *,
    .script-card-actions > *,
    .meeting-actions > *,
    .dashboard-actions > *,
    .dashboard-hero-actions > * {
        min-width: 0;
        width: 100%;
    }

    .call-tree-outcome-menu {
        display: block !important;
    }

    .call-tree-outcome-menu label,
    .call-tree-outcome-menu select {
        width: 100%;
    }

    .call-tree-facts,
    .sticky-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .call-tree-facts span,
    .sticky-facts span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .call-tree-grid,
    .dashboard-layout,
    .dashboard-today-grid,
    .dashboard-pipeline-grid,
    .scorecard-report-grid,
    .settings-two-column,
    .settings-duplicate-grid,
    .creative-system-grid,
    .creative-artboard-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .lead-tabs {
        margin-inline: 0;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
    }

    .lead-tabs a {
        scroll-snap-align: start;
    }

    .desktop-leads-table {
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
        touch-action: pan-x pan-y pinch-zoom;
    }

    .leads-table {
        min-width: 1040px;
    }

    .mobile-lead-cards {
        display: none !important;
    }

    .dashboard-call-bar-chart {
        min-height: 390px;
        padding-top: 5.3rem;
    }

    .dashboard-call-bars {
        min-height: 295px;
        padding-top: 4.2rem;
    }

    .dashboard-call-day-group,
    .dashboard-call-bar-group,
    .dashboard-call-bar-shell {
        min-height: 225px;
        height: 225px;
    }

    .dashboard-call-tooltip {
        left: 50%;
        max-width: 122px;
        font-size: 0.72rem;
    }

    .call-save-bar {
        position: sticky;
        left: auto;
        right: auto;
        bottom: 5.1rem;
        z-index: 9;
    }
}

/* Final chart containment rules. These intentionally come after the legacy
   responsive dashboard declarations so bar height can never escape the plot. */
.dashboard-call-bar-chart {
    grid-template-rows: minmax(0, 1fr) !important;
    height: 410px !important;
    min-height: 0 !important;
    padding: 3.45rem 0.85rem 0.8rem !important;
    overflow: hidden !important;
}

.dashboard-call-bars {
    height: 100% !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    align-items: stretch !important;
}

.dashboard-call-day-group {
    grid-template-rows: minmax(0, 1fr) 1.25rem !important;
    height: 100% !important;
    min-height: 0 !important;
}

.dashboard-call-bar-group,
.dashboard-call-bar-shell {
    height: 100% !important;
    min-height: 0 !important;
}

.dashboard-call-bar-shell { overflow: visible; }

@media (max-width: 720px) {
    .dashboard-call-bar-chart {
        height: 360px !important;
        min-height: 0 !important;
        padding: 3.25rem 0.65rem 0.75rem !important;
    }
}

/* Keep the reference rail visible between alternating cards. */
.workflow-reference-path { isolation: isolate; }
.workflow-reference-path::before {
    top: 1.15rem;
    bottom: 1.15rem;
    z-index: 0;
    background: linear-gradient(var(--gold), var(--sage), var(--forest)) !important;
}
.workflow-reference-stage { z-index: 1; }
.workflow-reference-rail { position: relative; z-index: 2; }
.workflow-reference-card { z-index: 1; }
.workflow-reference-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .12rem; }
.workflow-reference-links a { color: var(--forest); font-size: .76rem; font-weight: 900; text-decoration: none; }
.workflow-reference-links a:hover,
.workflow-reference-links a:focus { color: var(--navy); text-decoration: underline; }
.client-upcoming-meeting { display: grid; gap: .08rem; margin-top: .65rem; padding: .55rem .65rem; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: rgba(196, 170, 80, .1); color: var(--navy); }
.client-upcoming-meeting span { color: var(--sage-dark); font-size: .68rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.client-upcoming-meeting strong { font-size: .8rem; }
.client-upcoming-meeting small { color: var(--muted); font-size: .74rem; }

/* Draw the workflow rail inside each stage row so card stacking cannot hide it. */
.workflow-reference-path::before { display: none; }
.workflow-reference-rail {
    position: relative;
    align-self: stretch;
    isolation: isolate;
}
.workflow-reference-rail::before {
    content: "";
    position: absolute;
    top: -0.9rem;
    bottom: -0.9rem;
    left: 50%;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(var(--gold), var(--sage), var(--forest));
    transform: translateX(-50%);
    z-index: 0;
}
.workflow-reference-rail span { position: relative; z-index: 1; }
.workflow-reference-stage:first-child .workflow-reference-rail::before { top: 1.05rem; }
.workflow-reference-stage:last-child .workflow-reference-rail::before { bottom: 1.05rem; }

@media (max-width: 760px) {
    .workflow-reference-rail::before { left: 22px; }
}

/* Keep Home actions readable when a dashboard column is narrower than the viewport. */
@media (max-width: 1280px) {
    .dashboard-action-card {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .dashboard-action-card .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
        width: 100%;
    }

    .dashboard-action-card .dashboard-actions > *,
    .dashboard-action-card .dashboard-actions .action-link,
    .dashboard-action-card .dashboard-actions button {
        min-width: 0;
        width: 100%;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }
}

/* Activity keys can be long identifiers; contain them inside the status badge. */
.dashboard-activity-list article > span {
    min-width: 0;
    max-width: 100%;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Use one continuous rail for the read-only workflow reference. */
.workflow-reference-path::before {
    display: block !important;
    top: 1.3rem;
    bottom: 1.3rem;
    z-index: 0;
    background: linear-gradient(var(--gold), var(--sage), var(--forest)) !important;
}

.workflow-reference-rail::before {
    display: none;
}

@media (max-width: 760px) {
    .workflow-reference-path::before {
        left: 22px;
    }
}

/* Align alternating-stage connectors with the center of each numbered workflow node. */
@media (min-width: 761px) {
    .workflow-reference-card::after {
        top: calc(1.05rem + 22px);
        width: 54px;
        z-index: 0;
    }

    .workflow-reference-stage.is-left .workflow-reference-card::after { right: -54px; }
    .workflow-reference-stage.is-right .workflow-reference-card::after { left: -54px; }
}

/* Shared navigation icons replace the former letter markers. */
.nav-link .nav-icon {
    display: grid !important;
    flex: 0 0 auto;
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    color: currentColor;
}

.nav-link .nav-icon svg,
.bottom-link .bottom-nav-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-link .bottom-nav-icon {
    display: grid !important;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    color: currentColor;
}

.bottom-link .bottom-link-text {
    display: block;
    color: inherit;
}

@media (min-width: 760px) {
    .nav-link { gap: 0.72rem; }
    .nav-link .nav-icon { opacity: 0.78; }
    .nav-link.is-active .nav-icon,
    .nav-link:hover .nav-icon { opacity: 1; }

    /* Keep the complete page menu in reach while the main workspace scrolls. */
    body:not(.sidebar-collapsed) .sidebar {
        position: fixed;
        top: 1rem;
        left: max(1rem, calc((100vw - 1480px) / 2 + 1rem));
        z-index: 60;
        width: 280px;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        scrollbar-width: thin;
    }

    /* A fixed sidebar leaves normal grid flow. Reserve its original column so
       the workspace cannot slide underneath the persistent navigation. */
    body:not(.sidebar-collapsed) .main-content {
        grid-column: 2;
        min-width: 0;
    }
}

/* Mobile navigation is an intentionally compact floating menu. It keeps the
   entire CRM menu available without permanently covering page controls. */
.mobile-menu-toggle { display: none; }
.mobile-cold-call-tree-action { display: none; }
.dashboard-call-chart-controls { display: grid; justify-items: end; gap: 0.55rem; }
.dashboard-call-chart-controls p { max-width: 360px; margin: 0; color: var(--muted); font-weight: 750; line-height: 1.45; }
.dashboard-call-range-form label { display: flex; align-items: center; gap: 0.5rem; color: var(--sage-dark); font-size: 0.78rem; font-weight: 900; }
.dashboard-call-range-form select { min-height: 2.35rem; padding: 0.4rem 2rem 0.4rem 0.65rem; border-radius: 0.8rem; font: inherit; }

@media (max-width: 759px) {
    .main-content { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)) !important; }
    .mobile-menu-toggle {
        position: fixed; z-index: 40; left: max(0.8rem, env(safe-area-inset-left)); bottom: calc(0.8rem + env(safe-area-inset-bottom));
        display: grid; place-items: center; width: 3.4rem; height: 3.4rem; padding: 0; border: 2px solid rgba(247, 241, 230, 0.72);
        border-radius: 999px; background: linear-gradient(135deg, var(--gold), #f0ce73); color: var(--navy);
        box-shadow: 0 14px 30px rgba(7, 24, 39, 0.36); font-size: 2rem; font-weight: 700; line-height: 1;
    }
    .mobile-menu-toggle > span { display: block; transition: transform 160ms ease; }
    body.mobile-menu-open .mobile-menu-toggle > span { transform: rotate(45deg); }
    .bottom-nav {
        position: fixed; z-index: 39; left: max(0.8rem, env(safe-area-inset-left)); right: auto; bottom: calc(4.85rem + env(safe-area-inset-bottom));
        display: none !important; grid-template-columns: 1fr !important; gap: 0.22rem; width: min(16.5rem, calc(100vw - 1.6rem));
        max-height: min(68vh, 33rem); overflow-y: auto; padding: 0.45rem; border-radius: 1.25rem;
        background: rgba(247, 241, 230, 0.98); box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
    }
    body.mobile-menu-open .bottom-nav { display: grid !important; }
    .bottom-link {
        display: flex !important; align-items: center; justify-content: flex-start; gap: 0.7rem; min-height: 2.85rem;
        padding: 0.55rem 0.7rem; border-radius: 0.9rem; color: var(--muted); font-size: 0.88rem; text-align: left;
    }
    .bottom-link .bottom-nav-icon, .bottom-link .bottom-link-text { display: grid !important; flex: 0 0 auto; }
    .bottom-link .bottom-link-text { width: auto; height: auto; }
    .bottom-link.is-active { background: var(--navy); color: var(--cream); }
    .dashboard-call-chart-controls { justify-items: start; }

    .desktop-call-tree-link { display: none !important; }
    .mobile-cold-call-tree-action { display: inline-flex; }
    .mobile-cold-call-tree-action button { width: 100%; }
}

/* Follow-up lead details need the full card width; keep its actions underneath. */
.followup-action-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.followup-action-card .dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.followup-action-card .dashboard-actions > *,
.followup-action-card .dashboard-actions .action-link,
.followup-action-card .dashboard-actions button {
    min-width: 0;
    width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.followup-action-card .dashboard-actions form:last-child {
    grid-column: 1 / -1;
}
