:root {
    font-family: Inter, system-ui, sans-serif;
    color: #193c42;
    background: #f3f6f5;
    line-height: 1.5;
    font-synthesis: none;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
header {
    background: #102f36;
    color: #fff;
    padding: 20px 4vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    color: #fff;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -0.6px;
}
.brand span {
    color: #7ee0bd;
}
main {
    max-width: 1500px;
    margin: auto;
    padding: 0 32px;
}
h1 {
    font-size: 32px;
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 0 0 10px;
}
h2 {
    font-size: 18px;
    margin: 0 0 14px;
}
h3 {
    font-size: 15px;
    margin: 0 0 8px;
}
p {
    color: #587174;
    margin: 0 0 16px;
}
a {
    color: #087565;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button,
input,
textarea,
select {
    font: inherit;
}
button,
.button {
    display: inline-block;
    background: #087764;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 650;
    cursor: pointer;
    text-align: center;
}
button:disabled {
    opacity: 0.5;
    cursor: default;
}
.secondary {
    color: #195b51;
    background: #e9f2ef;
    border-color: #d0e2dc;
}
.danger {
    color: #a0392a;
    background: #ffebe6;
}
input,
textarea,
select {
    width: 100%;
    border: 1px solid #bdcfca;
    border-radius: 7px;
    padding: 10px;
    background: white;
    color: #193c42;
}
textarea {
    resize: vertical;
}
label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin: 12px 0 5px;
}
nav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #d3e0dc;
    padding: 16px 0 0;
    overflow-x: auto;
}
nav a,
nav button {
    white-space: nowrap;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: #56716e;
    border-radius: 7px 7px 0 0;
    font-weight: 650;
}
nav [aria-current],
nav [aria-selected="true"] {
    background: #fff;
    color: #096e5a;
    box-shadow: inset 0 -3px #087764;
}
nav button:hover {
    background: #e5efeb;
}
.workspace-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0 24px;
    font-size: 12px;
    color: #587174;
}
.workspace-meta button {
    font-size: 12px;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}
.page-heading p {
    margin: 0;
}
.card {
    border: 1px solid #dae5e0;
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
    min-width: 0;
}
.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.row > div {
    flex: 1;
    min-width: 100px;
}
.muted {
    font-size: 12px;
    color: #607a75;
    overflow-wrap: anywhere;
}
.notice {
    padding: 14px 18px;
    border: 1px solid #d5e3dd;
    border-radius: 9px;
    background: #e9f2ee;
    margin-bottom: 20px;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.notice.warn {
    background: #fff3de;
    border-color: #efd6ab;
    color: #795110;
}
.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.metric {
    padding: 20px;
    border: 1px solid #d9e3df;
    border-radius: 12px;
    background: #fff;
}
.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1.3;
    color: #173e3b;
}
.metric span {
    font-size: 12px;
    color: #587174;
}
.filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: end;
}
.filters > div {
    flex: 1;
    min-width: 140px;
}
.filters > div:first-child {
    flex: 2;
}
.filters label {
    margin-top: 0;
}
.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
td,
th {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid #e2eae6;
    vertical-align: top;
    overflow-wrap: anywhere;
}
th {
    font-size: 12px;
    font-weight: 650;
    color: #627b75;
}
td {
    max-width: 320px;
}
.campaign-name {
    font-weight: 700;
    display: block;
    padding: 0;
    background: transparent;
    color: #076a59;
    border: 0;
    text-align: left;
}
.status {
    display: inline-block;
    font-size: 12px;
    border-radius: 5px;
    padding: 4px 7px;
    background: #e8f2ed;
    color: #17684d;
    white-space: nowrap;
}
.status.warn {
    background: #fff0d8;
    color: #815512;
}
.status.neutral {
    background: #edf0f1;
    color: #52666b;
}
.status.error {
    background: #ffebe6;
    color: #9f3e2c;
}
.next-action {
    max-width: 240px;
    color: #60756f;
    font-size: 12px;
}
.queue-group > summary {
    font-weight: 650;
    cursor: pointer;
    padding: 3px 0 15px;
}
.queue-group {
    margin: 14px 0;
}
.job {
    scroll-margin-top: 20px;
}
.queue-group .table-wrap {
    margin: 0 -8px;
}
.job > div {
    min-width: 0;
}
.job:not(tr) {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #e5ece8;
    overflow-wrap: anywhere;
}
.job:not(tr) > div {
    flex: 1;
}
#queue-controls > summary {
    cursor: pointer;
    font-weight: 650;
}
#queue-controls[open] > summary {
    margin-bottom: 16px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.detail-grid > div {
    min-width: 0;
    border: 1px solid #e1e9e6;
    border-radius: 10px;
    padding: 16px;
}
.detail-grid .status {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
#detail-tabs {
    margin-bottom: 22px;
    padding-top: 0;
}
dl {
    margin: 15px 0 0;
}
dt {
    font-size: 12px;
    font-weight: 650;
    color: #60766e;
}
dd {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}
.activity {
    border-left: 2px solid #d6e4de;
    padding: 10px 20px;
    margin-left: 5px;
}
.empty {
    text-align: center;
    padding: 32px 12px;
    color: #647e76;
}
.hidden,
[hidden] {
    display: none !important;
}
dialog {
    border: 1px solid #cbddd4;
    border-radius: 14px;
    padding: 24px;
    width: min(680px, calc(100vw - 30px));
    max-height: 90vh;
    overflow-y: auto;
    color: #193c42;
}
dialog::backdrop {
    background: #0b302b70;
}
.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.login {
    max-width: 550px;
    margin: 60px auto;
}
#message {
    display: none;
    margin: 20px 0;
    padding: 14px 18px;
    border-radius: 9px;
    background: #dcf0e6;
    overflow-wrap: anywhere;
}
#message.error {
    background: #ffebe5;
    color: #9c382b;
}
#pagination {
    margin-top: 16px;
    justify-content: flex-end;
}
#leads details {
    max-width: 300px;
    margin-top: 8px;
}
footer {
    color: #6a8077;
    font-size: 12px;
    padding: 30px 0;
}
pre {
    font-size: 12px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid #dfae50;
    outline-offset: 3px;
}
@media (max-width: 1050px) {
    main {
        padding: 0 20px;
    }
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .page-heading {
        align-items: start;
        flex-direction: column;
    }
}
@media (max-width: 650px) {
    main {
        padding: 0 14px;
    }
    header {
        padding: 18px 16px;
    }
    .brand {
        font-size: 20px;
    }
    header .row {
        font-size: 12px;
        justify-content: flex-end;
    }
    h1 {
        font-size: 28px;
    }
    .card {
        padding: 16px;
    }
    .metrics {
        gap: 10px;
    }
    .metric {
        padding: 15px;
    }
    nav a,
    nav button {
        padding: 12px 11px;
        font-size: 13px;
    }
    .workspace-meta {
        align-items: start;
    }
    .filters > div {
        min-width: 125px;
    }
    .filters > div:first-child {
        flex-basis: 100%;
    }
    .campaign-table thead {
        display: none;
    }
    .campaign-table tr {
        display: block;
        border: 1px solid #dde8e2;
        border-radius: 10px;
        margin: 10px 0;
        padding: 6px;
    }
    .campaign-table td {
        display: block;
        border: 0;
        padding: 7px;
        max-width: none;
    }
    .campaign-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 650;
        color: #698175;
        margin-bottom: 3px;
    }
    .next-action {
        max-width: none;
    }
    .queue-group .table-wrap {
        margin: 0;
    }
    .job:not(tr) {
        flex-direction: column;
    }
    .row > div {
        min-width: 100px;
    }
    .table-wrap table:not(.campaign-table) {
        min-width: 620px;
    }
    dialog {
        padding: 18px;
    }
}

.email-preview-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #f4f7f5;
    padding: 16px;
    border-radius: 8px;
    max-height: 45vh;
    overflow: auto;
    font: inherit;
}
.email-signature {
    display: block;
    max-width: 100%;
    height: auto;
}
#email-review-submit {
    margin-top: 14px;
}
#email-review-state {
    margin-top: 16px;
}

/* Consistent actions stay with the record on desktop and phone. */
.campaign-progress {
    margin: 9px 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.progress-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}
.progress-heading strong {
    white-space: nowrap;
}
.progress-track {
    display: flex;
    height: 9px;
    margin: 6px 0;
    background: #e4ece8;
    border: 1px solid #ccdad3;
    border-radius: 5px;
    overflow: hidden;
}
.progress-fill {
    background: #087764;
    height: 100%;
    flex-shrink: 0;
}
.progress-fill.held {
    background: #b54131;
}
.progress-fill.paused {
    background: #8c6a2d;
}
.progress-fill.waiting {
    background: #3669a1;
}
.progress-fill.replied {
    background: #695298;
}
.progress-caption,
.progress-provider,
.progress-stale {
    font-size: 11px;
    line-height: 1.5;
    margin-top: 5px;
    color: #526a63;
    overflow-wrap: anywhere;
}
.progress-provider {
    margin: 8px 0;
}
.progress-stale {
    color: #815512;
    font-weight: 650;
}
.is-stale .progress-track {
    opacity: 0.55;
}
.ai-billing-help summary {
    cursor: pointer;
    font-weight: 650;
}
.ai-billing-help p {
    margin: 12px 0;
}
.ai-billing-help a {
    display: block;
    padding: 6px 0;
}
.context-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: flex-start;
    min-width: 0;
}
.context-actions button,
.context-actions .button,
.action-menu > summary {
    font-size: 12px;
    padding: .3rem .625rem;
    min-height: 2rem;
    line-height: 1.5;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.context-actions .button:hover {
    text-decoration: none;
    background: #dbece5;
}
.action-menu {
    flex-basis: 100%;
    min-width: 0;
}
.action-menu > summary {
    cursor: pointer;
    color: #245e53;
    border: 1px solid #d0e2dc;
    border-radius: 8px;
    width: fit-content;
    font-weight: 650;
}
.action-menu[open] > summary {
    margin-bottom: 8px;
}
.action-menu > .context-actions {
    padding: 10px;
    background: #f4f8f6;
    border: 1px solid #dbe7e0;
    border-radius: 9px;
}
.action-help {
    display: block;
    flex-basis: 100%;
    color: #62766f;
    font-size: 12px;
}
.detail-actions {
    margin: 0 0 18px;
}
.detail-actions .action-menu {
    flex-basis: auto;
    max-width: 360px;
}
.metric-action {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 650;
}
.selected-queue {
    border-left: 3px solid #087764;
    padding-left: 12px !important;
    background: #f2f8f5;
}
#campaign-copy-note:empty {
    display: none;
}
.action-menu > summary:focus-visible {
    outline: 3px solid #dfae50;
    outline-offset: 3px;
}
@media (max-width: 650px) {
    .table-wrap table.responsive-table {
        min-width: 0;
    }
    .responsive-table thead {
        display: none;
    }
    .responsive-table tr {
        display: block;
        border: 1px solid #dde8e2;
        border-radius: 10px;
        margin: 10px 0;
        padding: 6px;
    }
    .responsive-table td {
        display: block;
        border: 0;
        padding: 7px;
        max-width: none;
    }
    .responsive-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 650;
        color: #698175;
        margin-bottom: 3px;
    }
    .context-actions button,
    .context-actions .button,
    .action-menu > summary {
        min-height: 44px;
    }
    .detail-actions .action-menu {
        flex-basis: 100%;
        max-width: none;
    }
    #leads details {
        max-width: none;
    }
    .status {
        white-space: normal;
    }
}
@media (max-width: 650px) {
    nav[aria-label="Workspace"] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: visible;
    }
    nav[aria-label="Workspace"] a {
        white-space: normal;
        text-align: center;
        padding: 10px 6px;
        font-size: 12px;
    }
}

/* Match compact Ops actions while preserving comfortable touch controls. */
button, .button {
    min-height: 2rem;
    padding: .3rem .75rem;
    border-radius: .45rem;
    font-size: .8125rem;
    line-height: 1.25rem;
}
a:not(.button):not(.brand):not(nav a) { text-decoration: underline; text-underline-offset: .2em; }
nav a { text-decoration: none; }
.secondary { border-color: #78958e; }
button:hover:not(:disabled), .button:hover { box-shadow: inset 0 0 0 1px currentColor; }
button:disabled { opacity: 1; color: #526174; background: #e8edef; border-color: #8493a5; cursor: not-allowed; }
textarea:focus-visible { outline: 2px solid #087565; outline-offset: 3px; }
@media (pointer: coarse), (max-width: 640px) {
    button, .button, nav a { min-height: 2.75rem; }
}

.context-actions .button:not(.secondary):not(.danger):hover { background: #065f50; color: #fff; }

.activity-header { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:12px 24px; border-bottom:1px solid #e2e8f0; background:#f8fafc; }
.activity-header.hidden { display:none; }
.activity-card { min-width:0; border:1px solid #e2e8f0; border-radius:10px; background:white; }
.activity-card summary { display:flex; gap:8px; padding:10px 12px; list-style:none; cursor:pointer; font-size:13px; }
.activity-card summary::-webkit-details-marker { display:none; }
.activity-card summary:focus-visible { outline:2px solid #2563eb; border-radius:10px; }
.activity-label { display:block; font-size:11px; color:#64748b; }
.activity-card strong { display:block; font-size:14px; color:#0f172a; }
.activity-caption { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:11px; color:#64748b; margin-top:3px; }
.activity-dot { width:7px; height:7px; background:#94a3b8; border-radius:50%; margin-top:5px; flex-shrink:0; }
.activity-success .activity-dot { background:#10b981; }.activity-info .activity-dot { background:#3b82f6; }.activity-warning .activity-dot { background:#f59e0b; }
.activity-detail { padding:0 12px 12px; font-size:12px; color:#475569; }
@media(max-width:700px) { .activity-header { grid-template-columns:repeat(2,minmax(0,1fr)); padding:10px 12px; gap:8px; } }
.activity-actions { padding:0 12px 10px; }
.activity-resume-row { display:grid; gap:4px; margin-top:4px; font-size:12px; }
.activity-resume-row small { color:#64748b; overflow-wrap:anywhere; }
.activity-resume-row button { justify-self:start; padding:5px 8px; font-size:11px; }
.activity-resume-row a { font-size:11px; color:#0f766e; }
.activity-header { align-items: start; }
