.ce-hubspot-lab {
    --ce-hs-blue: #1e90ff;
    --ce-hs-blue-dark: #144a9e;
    --ce-hs-text: #10213d;
    --ce-hs-muted: #64748b;
    --ce-hs-border: #dce6f2;
    --ce-hs-soft: #f7faff;
    --ce-hs-green: #0f8a63;
    --ce-hs-red: #b42318;
    --ce-hubspot-coral: #ff7a59;
    --ce-hubspot-coral-dark: #e85f3d;
    --ce-hubspot-navy: #33475b;
    --ce-hubspot-teal: #00a4bd;
    --ce-hubspot-teal-dark: #007a8c;
    --ce-hubspot-mist: #f5f8fa;
    --ce-hubspot-line: #cbd6e2;
    width: 100%;
    color: var(--ce-hs-text);
}

.ce-hubspot-lab * { box-sizing: border-box; }
.ce-hubspot-lab button,
.ce-hubspot-lab input { font: inherit; }

.ce-hubspot-intro,
.ce-hubspot-workspace,
.ce-hubspot-results,
.ce-hubspot-explainer {
    border: 1px solid var(--ce-hs-border);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(20, 74, 158, 0.07);
}

.ce-hubspot-intro { padding: clamp(26px, 4vw, 46px); }

.ce-hubspot-eyebrow,
.ce-hubspot-section-label {
    color: var(--ce-hs-blue-dark);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ce-hubspot-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
    gap: 34px;
    align-items: start;
    margin-top: 12px;
}

.ce-hubspot-intro h2,
.ce-hubspot-workspace h3,
.ce-hubspot-results h3,
.ce-hubspot-explainer h3 {
    margin: 0;
    color: var(--ce-hs-text);
    letter-spacing: -.035em;
}

.ce-hubspot-intro h2 {
    max-width: 780px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.ce-hubspot-intro p {
    max-width: 800px;
    margin: 20px 0 0;
    color: var(--ce-hs-muted);
    font-size: 17px;
    line-height: 1.72;
}

.ce-hubspot-live-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 16px;
    background: var(--ce-hs-soft);
}

.ce-hubspot-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 6px;
    background: var(--ce-hs-green);
    box-shadow: 0 0 0 5px rgba(15, 138, 99, .1);
    flex: 0 0 auto;
}

.ce-hubspot-live-card strong,
.ce-hubspot-live-card span { display: block; }
.ce-hubspot-live-card strong { font-size: 14px; }
.ce-hubspot-live-card span { margin-top: 4px; color: var(--ce-hs-muted); font-size: 12px; line-height: 1.55; }

.ce-hubspot-flow {
    margin-top: 34px;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.ce-hubspot-flow-step {
    min-height: 102px;
    padding: 16px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 16px;
    background: #fff;
}

.ce-hubspot-flow-step span {
    display: block;
    color: var(--ce-hs-blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
}

.ce-hubspot-flow-step strong { display: block; margin-top: 12px; font-size: 14px; }
.ce-hubspot-flow-step small { display: block; margin-top: 4px; color: var(--ce-hs-muted); font-size: 12px; }
.ce-hubspot-flow-arrow { color: #8aa0b8; font-size: 18px; }

.ce-hubspot-workspace,
.ce-hubspot-results,
.ce-hubspot-explainer { margin-top: 24px; }
.ce-hubspot-workspace { overflow: hidden; }

.ce-hubspot-toolbar,
.ce-hubspot-results-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px 30px;
}

.ce-hubspot-workspace h3,
.ce-hubspot-results h3,
.ce-hubspot-explainer h3 { margin-top: 6px; font-size: clamp(22px, 2.5vw, 30px); }

.ce-hubspot-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.ce-hubspot-button {
    border: 0;
    border-radius: 12px;
    padding: 12px 17px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ce-hubspot-button:not(:disabled):hover { transform: translateY(-1px); }
.ce-hubspot-button:disabled { cursor: not-allowed; opacity: .45; }
.ce-hubspot-button-primary { min-width: 174px; background: var(--ce-hs-blue); color: #fff; box-shadow: 0 10px 22px rgba(30, 144, 255, .2); }
.ce-hubspot-button-secondary { background: var(--ce-hs-text); color: #fff; }
.ce-hubspot-button-ghost { border: 1px solid var(--ce-hs-border); background: #fff; color: var(--ce-hs-text); }

.ce-hubspot-notice {
    margin: 0 30px 20px;
    padding: 12px 14px;
    border: 1px solid #d9e8fb;
    border-radius: 12px;
    background: #f7fbff;
    color: #47627e;
    font-size: 12px;
    line-height: 1.55;
}

.ce-hubspot-table-wrap { overflow-x: auto; border-top: 1px solid var(--ce-hs-border); border-bottom: 1px solid var(--ce-hs-border); }
.ce-hubspot-table { width: 100%; min-width: 1260px; border-collapse: collapse; }
.ce-hubspot-table th { padding: 12px 10px; text-align: left; background: #f8fbff; color: #60738a; font-size: 11px; font-weight: 800; white-space: nowrap; border-bottom: 1px solid var(--ce-hs-border); }
.ce-hubspot-table th:first-child,
.ce-hubspot-table td:first-child { padding-left: 20px; }
.ce-hubspot-table th:last-child,
.ce-hubspot-table td:last-child { padding-right: 20px; }
.ce-hubspot-table td { padding: 9px 6px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.ce-hubspot-table tbody tr:last-child td { border-bottom: 0; }
.ce-hubspot-row-number { width: 36px; color: #8da0b3; font-size: 12px; font-weight: 800; }

.ce-hubspot-table input {
    width: 100%;
    min-width: 100px;
    border: 1px solid #d8e3ee;
    border-radius: 9px;
    padding: 10px 9px;
    background: #fff;
    color: var(--ce-hs-text);
    outline: none;
    font-size: 12px;
}
.ce-hubspot-table input[name="customer_name"],
.ce-hubspot-table input[name="product_name"] { min-width: 160px; }
.ce-hubspot-table input:focus { border-color: var(--ce-hs-blue); box-shadow: 0 0 0 3px rgba(30, 144, 255, .09); }
.ce-hubspot-money-input { position: relative; min-width: 110px; }
.ce-hubspot-money-input span { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #8da0b3; font-size: 12px; }
.ce-hubspot-money-input input { padding-left: 20px; }

.ce-hubspot-runbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 22px 30px;
    background: #fff;
}
.ce-hubspot-run-copy strong,
.ce-hubspot-run-copy span { display: block; }
.ce-hubspot-run-copy strong { font-size: 14px; }
.ce-hubspot-run-copy span { margin-top: 4px; max-width: 720px; color: var(--ce-hs-muted); font-size: 12px; line-height: 1.5; }

.ce-hubspot-spinner { display: none; width: 14px; height: 14px; margin-left: 7px; vertical-align: -2px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: ce-hs-spin .7s linear infinite; }
.ce-hubspot-spinner.is-visible { display: inline-block; }
@keyframes ce-hs-spin { to { transform: rotate(360deg); } }

.ce-hubspot-results { padding-bottom: 28px; }
.ce-hubspot-result-status { padding: 8px 11px; border-radius: 999px; background: #e9f9f3; color: var(--ce-hs-green); font-size: 12px; font-weight: 900; }
.ce-hubspot-result-status.is-error { background: #fff1f0; color: var(--ce-hs-red); }

.ce-hubspot-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    padding: 0 30px 24px;
}
.ce-hubspot-metric { padding: 15px 13px; border: 1px solid var(--ce-hs-border); border-radius: 14px; background: var(--ce-hs-soft); }
.ce-hubspot-metric span { display: block; color: var(--ce-hs-muted); font-size: 10px; line-height: 1.3; }
.ce-hubspot-metric strong { display: block; margin-top: 7px; font-size: 22px; letter-spacing: -.03em; }

.ce-hubspot-result-rows { margin: 0 30px; border: 1px solid var(--ce-hs-border); border-radius: 16px; overflow: hidden; }
.ce-hubspot-result-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 16px; border-bottom: 1px solid #edf2f7; }
.ce-hubspot-result-row:last-child { border-bottom: 0; }
.ce-hubspot-result-row.is-error { background: #fff8f7; }
.ce-hubspot-result-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #edf6ff; color: var(--ce-hs-blue-dark); font-size: 12px; font-weight: 900; }
.ce-hubspot-result-main { min-width: 0; }
.ce-hubspot-result-title strong,
.ce-hubspot-result-title span { display: block; }
.ce-hubspot-result-title strong { font-size: 13px; }
.ce-hubspot-result-title span { margin-top: 3px; color: var(--ce-hs-muted); font-size: 11px; }
.ce-hubspot-result-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ce-hubspot-result-badges span { padding: 5px 8px; border-radius: 999px; background: #edf6ff; color: #315d84; font-size: 10px; font-weight: 800; }
.ce-hubspot-result-badges span.is-created { background: #e9f9f3; color: var(--ce-hs-green); }
.ce-hubspot-result-meta { text-align: right; }
.ce-hubspot-result-meta strong,
.ce-hubspot-result-meta span { display: block; }
.ce-hubspot-result-meta strong { font-size: 13px; }
.ce-hubspot-result-meta span { margin-top: 4px; color: var(--ce-hs-muted); font-size: 10px; }

.ce-hubspot-explainer { padding: 30px; }
.ce-hubspot-explainer-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.ce-hubspot-explainer article { padding: 18px; border: 1px solid var(--ce-hs-border); border-radius: 16px; background: var(--ce-hs-soft); }
.ce-hubspot-explainer article > span { color: var(--ce-hs-blue-dark); font-size: 12px; font-weight: 900; }
.ce-hubspot-explainer article p { margin: 10px 0 0; color: var(--ce-hs-muted); font-size: 13px; line-height: 1.65; }
.ce-hubspot-explainer code { padding: 2px 5px; border-radius: 5px; background: #e8f2fc; color: #274d72; font-size: .92em; }

@media (max-width: 980px) {
    .ce-hubspot-intro-grid { grid-template-columns: 1fr; }
    .ce-hubspot-flow { grid-template-columns: repeat(4, 1fr); }
    .ce-hubspot-flow-arrow { display: none; }
    .ce-hubspot-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .ce-hubspot-intro,
    .ce-hubspot-explainer { padding: 22px 18px; border-radius: 18px; }
    .ce-hubspot-workspace,
    .ce-hubspot-results { border-radius: 18px; }
    .ce-hubspot-intro h2 { font-size: 32px; }
    .ce-hubspot-intro p { font-size: 15px; }
    .ce-hubspot-flow { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ce-hubspot-flow-step { min-height: 92px; }
    .ce-hubspot-toolbar,
    .ce-hubspot-results-heading,
    .ce-hubspot-runbar { align-items: flex-start; flex-direction: column; padding: 22px 18px; }
    .ce-hubspot-actions,
    .ce-hubspot-button { width: 100%; }
    .ce-hubspot-notice { margin: 0 18px 18px; }
    .ce-hubspot-table-wrap { overflow: visible; border: 0; }
    .ce-hubspot-table { min-width: 0; display: block; padding: 0 18px; }
    .ce-hubspot-table thead { display: none; }
    .ce-hubspot-table tbody { display: grid; gap: 12px; }
    .ce-hubspot-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; border: 1px solid var(--ce-hs-border); border-radius: 15px; background: #fff; }
    .ce-hubspot-table td { display: block; padding: 0 !important; border: 0; }
    .ce-hubspot-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--ce-hs-muted); font-size: 10px; font-weight: 800; }
    .ce-hubspot-table .ce-hubspot-row-number { grid-column: 1 / -1; width: auto; color: var(--ce-hs-blue-dark); }
    .ce-hubspot-table .ce-hubspot-row-number::before { content: "Transaction row"; display: inline; margin-right: 5px; }
    .ce-hubspot-table input { min-width: 0 !important; }
    .ce-hubspot-runbar .ce-hubspot-button { width: 100%; }
    .ce-hubspot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 18px 18px; }
    .ce-hubspot-result-rows { margin: 0 18px; }
    .ce-hubspot-result-row { grid-template-columns: 32px minmax(0,1fr); }
    .ce-hubspot-result-meta { grid-column: 2; text-align: left; }
    .ce-hubspot-explainer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ce-hubspot-table tr { grid-template-columns: 1fr; }
    .ce-hubspot-metrics { grid-template-columns: 1fr 1fr; }
}


/* =========================================================
 * v1.2 live import progress
 * ========================================================= */

.ce-hubspot-progress[hidden] { display: none !important; }

.ce-hubspot-progress {
    margin-top: 24px;
    padding: 28px 30px 30px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 35, 60, .06);
}

.ce-hubspot-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.ce-hubspot-progress-head h3 {
    margin: 6px 0 0;
    font-size: clamp(22px, 2.5vw, 30px);
}

.ce-hubspot-progress-head p {
    margin: 7px 0 0;
    color: var(--ce-hs-muted);
    font-size: 13px;
    line-height: 1.6;
}

.ce-hubspot-progress-percent {
    min-width: 82px;
    padding: 10px 14px;
    border: 1px solid #cfe2f8;
    border-radius: 999px;
    background: #f1f7fe;
    color: var(--ce-hs-blue-dark);
    text-align: center;
    font-size: 17px;
    font-weight: 900;
}

.ce-hubspot-progress-track {
    height: 12px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaf1f8;
}

.ce-hubspot-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1e90ff 0%, #2bb673 100%);
    transition: width .35s ease;
}

.ce-hubspot-progress-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.ce-hubspot-progress-metrics > div {
    padding: 13px 14px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 14px;
    background: var(--ce-hs-soft);
}

.ce-hubspot-progress-metrics span {
    display: block;
    color: var(--ce-hs-muted);
    font-size: 10px;
    line-height: 1.3;
}

.ce-hubspot-progress-metrics strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

.ce-hubspot-log-shell {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid #18334d;
    border-radius: 16px;
    background: #0d2032;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.ce-hubspot-log-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #dce9f5;
    font-size: 11px;
}

.ce-hubspot-log-head strong {
    font-size: 11px;
    letter-spacing: .02em;
}

.ce-hubspot-log-head > span:last-child {
    margin-left: auto;
    color: #7892a8;
}

.ce-hubspot-live-log {
    min-height: 188px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ce-hubspot-log-line {
    display: grid;
    grid-template-columns: 72px 10px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 7px 15px;
    color: #b9cbdc;
    font-size: 11px;
    line-height: 1.5;
}

.ce-hubspot-log-line + .ce-hubspot-log-line {
    border-top: 1px solid rgba(255,255,255,.025);
}

.ce-hubspot-log-time {
    color: #6f889d;
}

.ce-hubspot-log-dot {
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: #5b7790;
    box-shadow: 0 0 0 3px rgba(91,119,144,.12);
}

.ce-hubspot-log-line.is-created .ce-hubspot-log-dot,
.ce-hubspot-log-line.is-success .ce-hubspot-log-dot {
    background: #2ecb8f;
    box-shadow: 0 0 0 3px rgba(46,203,143,.12);
}

.ce-hubspot-log-line.is-matched .ce-hubspot-log-dot,
.ce-hubspot-log-line.is-linked .ce-hubspot-log-dot {
    background: #5aa9ff;
    box-shadow: 0 0 0 3px rgba(90,169,255,.12);
}

.ce-hubspot-log-line.is-return .ce-hubspot-log-dot {
    background: #ffb44d;
    box-shadow: 0 0 0 3px rgba(255,180,77,.14);
}

.ce-hubspot-log-line.is-error {
    color: #ffc8c4;
}

.ce-hubspot-log-line.is-error .ce-hubspot-log-dot {
    background: #ff6b61;
    box-shadow: 0 0 0 3px rgba(255,107,97,.14);
}

.ce-hubspot-result-badges span.is-return {
    background: #fff3df;
    color: #9a5d00;
}

.ce-hubspot-result-badges span.is-sale {
    background: #e9f9f3;
    color: var(--ce-hs-green);
}

@media (max-width: 720px) {
    .ce-hubspot-progress {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .ce-hubspot-progress-head {
        gap: 14px;
    }

    .ce-hubspot-progress-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ce-hubspot-log-line {
        grid-template-columns: 62px 9px minmax(0, 1fr);
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 480px) {
    .ce-hubspot-progress-head {
        flex-direction: column;
    }

    .ce-hubspot-progress-percent {
        min-width: 0;
    }
}

/* =========================================================
 * v1.3 live HubSpot deal board
 * ========================================================= */

.ce-hubspot-board {
    margin-top: 24px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(20, 74, 158, 0.07);
    overflow: hidden;
}

.ce-hubspot-board-head {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-start;
    padding: 28px 30px 22px;
}

.ce-hubspot-board-head h3 {
    margin: 6px 0 0;
    color: var(--ce-hs-text);
    font-size: clamp(22px, 2.5vw, 30px);
    letter-spacing: -.035em;
}

.ce-hubspot-board-head p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--ce-hs-muted);
    font-size: 13px;
    line-height: 1.6;
}

.ce-hubspot-board-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}

.ce-hubspot-board-sync {
    color: var(--ce-hs-muted);
    font-size: 11px;
    font-weight: 700;
}

.ce-hubspot-board-sync.is-live {
    color: var(--ce-hs-green);
}

.ce-hubspot-refresh-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ce-hubspot-refresh-icon {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
}

.ce-hubspot-refresh-button.is-refreshing .ce-hubspot-refresh-icon {
    animation: ce-hs-spin .75s linear infinite;
}

.ce-hubspot-board-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 30px 20px;
}

.ce-hubspot-board-summary span {
    padding: 7px 10px;
    border: 1px solid var(--ce-hs-border);
    border-radius: 999px;
    background: var(--ce-hs-soft);
    color: var(--ce-hs-muted);
    font-size: 10px;
}

.ce-hubspot-board-summary strong {
    color: var(--ce-hs-text);
}

.ce-hubspot-board-wrap {
    overflow-x: auto;
    padding: 0 30px 30px;
}

.ce-hubspot-board-columns {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: 12px;
    min-width: max-content;
    align-items: start;
}

.ce-hubspot-board-column {
    width: min(320px, 82vw);
    border: 1px solid #dfe7ef;
    border-radius: 17px;
    background: #f6f8fb;
    overflow: hidden;
}

.ce-hubspot-board-column-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 15px 15px 13px;
    border-bottom: 1px solid #e1e8ef;
    background: #f2f5f8;
}

.ce-hubspot-board-column-head strong,
.ce-hubspot-board-column-head span {
    display: block;
}

.ce-hubspot-board-column-head strong {
    color: #26374b;
    font-size: 12px;
}

.ce-hubspot-board-column-head div > span {
    margin-top: 3px;
    color: #7a8a9a;
    font-size: 10px;
}

.ce-hubspot-board-column-total {
    color: #41566d;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.ce-hubspot-board-stack {
    display: grid;
    gap: 9px;
    padding: 10px;
}

.ce-hubspot-board-card {
    position: relative;
    padding: 14px;
    border: 1px solid #d8e1ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(27, 48, 72, .05);
    animation: ce-hs-board-in .28s ease both;
}

@keyframes ce-hs-board-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.ce-hubspot-board-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.ce-hubspot-board-live-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #28745b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ce-hubspot-board-live-chip i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #27b37d;
    box-shadow: 0 0 0 4px rgba(39, 179, 125, .10);
}

.ce-hubspot-board-amount {
    color: #24364b;
    font-size: 13px;
}

.ce-hubspot-board-card h4 {
    margin: 12px 0 0;
    color: #17304a;
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: -.01em;
}

.ce-hubspot-board-company {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 12px;
    padding: 9px 10px;
    border: 1px solid #e2eaf2;
    border-radius: 10px;
    background: #f8fbfe;
}

.ce-hubspot-company-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #e9f4ff;
    color: var(--ce-hs-blue-dark);
}

.ce-hubspot-company-icon svg {
    width: 16px;
    height: 16px;
}

.ce-hubspot-board-company strong,
.ce-hubspot-board-company span {
    display: block;
}

.ce-hubspot-board-company strong {
    color: #24415e;
    font-size: 11px;
}

.ce-hubspot-board-company span {
    margin-top: 2px;
    color: #7a8da1;
    font-size: 9px;
}

.ce-hubspot-board-line-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 13px;
    padding-bottom: 7px;
    border-bottom: 1px solid #edf1f5;
    color: #6d7f91;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.ce-hubspot-board-line-head strong {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #edf5fe;
    color: var(--ce-hs-blue-dark);
    font-size: 9px;
}

.ce-hubspot-board-line-items {
    display: grid;
}

.ce-hubspot-board-line-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f0f3f6;
}

.ce-hubspot-board-line-item:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

.ce-hubspot-board-line-item strong,
.ce-hubspot-board-line-item span {
    display: block;
}

.ce-hubspot-board-line-item strong {
    overflow: hidden;
    color: #2d4359;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-hubspot-board-line-item span {
    margin-top: 2px;
    color: #8796a5;
    font-size: 9px;
}

.ce-hubspot-board-line-math {
    text-align: right;
}

.ce-hubspot-board-line-math strong {
    color: #516579;
    font-size: 9px;
}

.ce-hubspot-board-line-math span {
    color: #1f6f54;
    font-weight: 800;
}

.ce-hubspot-board-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid #edf1f5;
    color: #96a3b0;
    font-size: 8px;
}

.ce-hubspot-board-empty,
.ce-hubspot-board-loading,
.ce-hubspot-board-error {
    padding: 20px 16px;
    border: 1px dashed #d7e1eb;
    border-radius: 12px;
    background: rgba(255,255,255,.75);
    color: #8292a2;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.ce-hubspot-board-loading,
.ce-hubspot-board-error {
    min-width: min(760px, 80vw);
    margin: 4px 0;
}

.ce-hubspot-board-error strong,
.ce-hubspot-board-error span {
    display: block;
}

.ce-hubspot-board-error strong { color: var(--ce-hs-red); }
.ce-hubspot-board-error span { margin-top: 5px; }

@media (max-width: 720px) {
    .ce-hubspot-board {
        border-radius: 18px;
    }

    .ce-hubspot-board-head {
        flex-direction: column;
        padding: 22px 18px 18px;
    }

    .ce-hubspot-board-actions {
        width: 100%;
        align-items: stretch;
    }

    .ce-hubspot-board-sync {
        text-align: left;
    }

    .ce-hubspot-board-summary {
        padding: 0 18px 18px;
    }

    .ce-hubspot-board-wrap {
        padding: 0 18px 22px;
    }

    .ce-hubspot-board-columns {
        grid-auto-columns: minmax(270px, 82vw);
    }
}

/* =========================================================
 * v1.4 expandable transactions + multiple line items
 * ========================================================= */

.ce-hubspot-table {
    min-width: 1080px;
}

.ce-hubspot-transaction-row {
    transition: background .18s ease;
}

.ce-hubspot-transaction-row:hover,
.ce-hubspot-transaction-row.is-expanded {
    background: #fbfdff;
}

.ce-hubspot-transaction-row.is-expanded td {
    border-bottom-color: transparent;
}

.ce-hubspot-row-number > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf6ff;
    color: var(--ce-hs-blue-dark);
}

.ce-hubspot-line-count {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 116px;
    padding: 8px 10px;
    border: 1px solid #d8e5f1;
    border-radius: 10px;
    background: #f8fbff;
    color: var(--ce-hs-text);
    cursor: pointer;
}

.ce-hubspot-line-count > span {
    font-size: 11px;
    font-weight: 850;
}

.ce-hubspot-line-count small {
    font-size: 9px;
    font-weight: 800;
    color: var(--ce-hs-green);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ce-hubspot-line-count small.is-return {
    color: #a35c00;
}

.ce-hubspot-line-count small.is-mixed {
    color: var(--ce-hs-red);
}

.ce-hubspot-row-total {
    white-space: nowrap;
    color: #20364e;
    font-size: 13px;
}

.ce-hubspot-expand-cell {
    width: 50px;
    text-align: right;
}

.ce-hubspot-expand-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #d7e3ee;
    border-radius: 10px;
    background: #fff;
    color: #5f748b;
    cursor: pointer;
}

.ce-hubspot-expand-button span {
    display: block;
    font-size: 20px;
    line-height: 1;
    transform: translateY(-2px);
    transition: transform .18s ease;
}

.ce-hubspot-transaction-row.is-expanded .ce-hubspot-expand-button span {
    transform: rotate(180deg) translateY(2px);
}

.ce-hubspot-line-items-row[hidden] {
    display: none !important;
}

.ce-hubspot-line-items-row > td {
    padding: 0 18px 18px !important;
    border-bottom: 1px solid #edf2f7;
    background: #fbfdff;
}

.ce-hubspot-line-panel {
    padding: 18px;
    border: 1px solid #d9e5f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(21, 63, 104, .06);
}

.ce-hubspot-line-panel-head,
.ce-hubspot-line-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.ce-hubspot-line-panel-head strong,
.ce-hubspot-line-panel-head span {
    display: block;
}

.ce-hubspot-line-panel-head strong {
    color: var(--ce-hs-text);
    font-size: 13px;
}

.ce-hubspot-line-panel-head span {
    margin-top: 3px;
    color: var(--ce-hs-muted);
    font-size: 10px;
    line-height: 1.45;
}

.ce-hubspot-add-line {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid #bcd8f4;
    border-radius: 10px;
    background: #edf6ff;
    color: var(--ce-hs-blue-dark);
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.ce-hubspot-add-line:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.ce-hubspot-line-editor-head,
.ce-hubspot-line-editor {
    display: grid;
    grid-template-columns: 30px minmax(120px, .8fr) minmax(190px, 1.4fr) 90px 130px 34px;
    gap: 9px;
    align-items: end;
}

.ce-hubspot-line-editor-head {
    margin-top: 16px;
    padding: 0 3px 7px;
    color: #72869a;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ce-hubspot-line-editors {
    display: grid;
    gap: 8px;
}

.ce-hubspot-line-editor {
    padding: 10px;
    border: 1px solid #e0e8f1;
    border-radius: 12px;
    background: #fbfdff;
}

.ce-hubspot-line-index {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 8px;
    background: #eaf4fe;
    color: var(--ce-hs-blue-dark);
    font-size: 10px;
    font-weight: 900;
}

.ce-hubspot-line-editor label > span {
    display: block;
    margin: 0 0 5px;
    color: #70849a;
    font-size: 9px;
    font-weight: 800;
}

.ce-hubspot-line-editor input {
    width: 100%;
    min-width: 0 !important;
    padding: 9px;
    border: 1px solid #d8e3ee;
    border-radius: 9px;
    background: #fff;
    color: var(--ce-hs-text);
    font-size: 11px;
    outline: none;
}

.ce-hubspot-line-editor input:focus {
    border-color: var(--ce-hs-blue);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, .09);
}

.ce-hubspot-line-remove {
    width: 32px;
    height: 32px;
    align-self: end;
    border: 1px solid #e7d9d7;
    border-radius: 9px;
    background: #fff;
    color: #a24a42;
    font-size: 18px;
    cursor: pointer;
}

.ce-hubspot-line-remove:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.ce-hubspot-line-panel-foot {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #e8eef5;
    color: var(--ce-hs-muted);
    font-size: 10px;
}

.ce-hubspot-line-panel-foot strong {
    color: var(--ce-hs-text);
    font-size: 11px;
}

.ce-hubspot-line-panel-foot strong span {
    margin-left: 5px;
    font-size: 14px;
}

@media (max-width: 980px) {
    .ce-hubspot-line-editor-head,
    .ce-hubspot-line-editor {
        grid-template-columns: 28px minmax(110px, .8fr) minmax(160px, 1.25fr) 78px 115px 32px;
    }
}

@media (max-width: 720px) {
    .ce-hubspot-table {
        display: block;
        min-width: 0;
        padding: 0 18px;
    }

    .ce-hubspot-table tbody {
        display: block;
    }

    .ce-hubspot-transaction-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 11px;
        margin-bottom: 0;
        padding: 16px;
        border: 1px solid var(--ce-hs-border);
        border-radius: 15px;
        background: #fff;
    }

    .ce-hubspot-transaction-row.is-expanded {
        border-radius: 15px 15px 0 0;
        border-bottom-color: #d9e5f1;
    }

    .ce-hubspot-transaction-row td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
    }

    .ce-hubspot-transaction-row td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--ce-hs-muted);
        font-size: 10px;
        font-weight: 800;
    }

    .ce-hubspot-transaction-row .ce-hubspot-row-number {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .ce-hubspot-transaction-row .ce-hubspot-row-number::before {
        content: "Transaction";
        display: inline;
        margin: 0;
    }

    .ce-hubspot-transaction-row .ce-hubspot-expand-cell {
        position: absolute;
        right: 30px;
        width: auto;
    }

    .ce-hubspot-line-count {
        width: 100%;
    }

    .ce-hubspot-line-items-row {
        display: table-row;
    }

    .ce-hubspot-line-items-row > td {
        display: block !important;
        margin: 0 0 12px;
        padding: 0 !important;
        border: 0 !important;
    }

    .ce-hubspot-line-panel {
        border-top: 0;
        border-radius: 0 0 15px 15px;
        box-shadow: none;
    }

    .ce-hubspot-line-editor-head {
        display: none;
    }

    .ce-hubspot-line-editor {
        grid-template-columns: 30px 1fr 1fr;
        align-items: end;
    }

    .ce-hubspot-line-index {
        grid-row: span 2;
        align-self: start;
        margin-top: 19px;
    }

    .ce-hubspot-line-product {
        grid-column: 2 / 4;
    }

    .ce-hubspot-line-remove {
        grid-column: 3;
        justify-self: end;
    }
}

@media (max-width: 480px) {
    .ce-hubspot-transaction-row {
        grid-template-columns: 1fr;
    }

    .ce-hubspot-transaction-row .ce-hubspot-expand-cell {
        right: 26px;
    }

    .ce-hubspot-line-panel {
        padding: 14px;
    }

    .ce-hubspot-line-panel-head,
    .ce-hubspot-line-panel-foot {
        align-items: flex-start;
        flex-direction: column;
    }

    .ce-hubspot-add-line {
        width: 100%;
    }

    .ce-hubspot-line-editor {
        grid-template-columns: 1fr 1fr;
    }

    .ce-hubspot-line-index {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 0;
    }

    .ce-hubspot-line-product {
        grid-column: 1 / -1;
    }

    .ce-hubspot-line-remove {
        grid-column: 2;
    }
}

@media (max-width: 720px) {
    .ce-hubspot-table .ce-hubspot-transaction-row {
        position: relative;
    }

    .ce-hubspot-table .ce-hubspot-line-items-row {
        display: table-row;
        grid-template-columns: none;
        gap: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .ce-hubspot-table .ce-hubspot-line-items-row[hidden] {
        display: none !important;
    }

    .ce-hubspot-table .ce-hubspot-line-items-row > td::before {
        display: none;
        content: none;
    }
}

.ce-hubspot-progress-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .ce-hubspot-progress-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
 * v1.5 HubSpot CRM board/list views + recent import emphasis
 * ========================================================= */

.ce-hubspot-board {
    border-color: var(--ce-hubspot-line);
    box-shadow: 0 20px 50px rgba(51, 71, 91, .10);
}

.ce-hubspot-board-head {
    border-top: 5px solid var(--ce-hubspot-coral);
    background: linear-gradient(180deg, #fff 0%, #fff 70%, #fbfcfd 100%);
}

.ce-hubspot-board .ce-hubspot-section-label {
    color: var(--ce-hubspot-teal-dark);
}

.ce-hubspot-board-head h3,
.ce-hubspot-board-card h4,
.ce-hubspot-list-row strong {
    color: var(--ce-hubspot-navy);
}

.ce-hubspot-board-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ce-hubspot-view-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--ce-hubspot-line);
    border-radius: 9px;
    background: var(--ce-hubspot-mist);
}

.ce-hubspot-view-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #516f90;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.ce-hubspot-view-button:hover {
    color: var(--ce-hubspot-navy);
}

.ce-hubspot-view-button.is-active {
    background: #fff;
    color: var(--ce-hubspot-teal-dark);
    box-shadow: 0 1px 4px rgba(51, 71, 91, .14);
}

.ce-hubspot-view-icon {
    font-size: 15px;
    line-height: 1;
}

.ce-hubspot-refresh-button {
    border-color: var(--ce-hubspot-line) !important;
    color: var(--ce-hubspot-teal-dark) !important;
    background: #fff !important;
}

.ce-hubspot-refresh-button:hover {
    border-color: var(--ce-hubspot-teal) !important;
    background: #f2fbfc !important;
}

.ce-hubspot-board-sync.is-live {
    color: var(--ce-hubspot-teal-dark);
}

.ce-hubspot-board-summary span {
    border-color: var(--ce-hubspot-line);
    background: var(--ce-hubspot-mist);
}

.ce-hubspot-board-summary .ce-hubspot-summary-new {
    border-color: rgba(255, 122, 89, .35);
    background: #fff4f0;
    color: #a83f27;
}

.ce-hubspot-board-summary .ce-hubspot-summary-new strong {
    color: var(--ce-hubspot-coral-dark);
}

.ce-hubspot-board-column {
    border-color: var(--ce-hubspot-line);
    background: #f5f8fa;
}

.ce-hubspot-board-column-head {
    border-bottom-color: var(--ce-hubspot-line);
    background: #eaf0f6;
}

.ce-hubspot-board-column-head strong {
    color: var(--ce-hubspot-navy);
}

.ce-hubspot-board-column-total {
    color: var(--ce-hubspot-teal-dark);
}

.ce-hubspot-board-card {
    border-color: var(--ce-hubspot-line);
}

.ce-hubspot-board-card.is-new,
.ce-hubspot-list-row.is-new {
    border-color: rgba(255, 122, 89, .52);
    box-shadow: 0 6px 20px rgba(255, 122, 89, .10);
}

.ce-hubspot-board-card.is-just-imported,
.ce-hubspot-list-row.is-just-imported {
    border-color: var(--ce-hubspot-coral);
    box-shadow: 0 0 0 2px rgba(255, 122, 89, .15), 0 10px 30px rgba(255, 122, 89, .16);
    animation: ce-hs-new-record 1.6s ease both;
}

@keyframes ce-hs-new-record {
    0% { background: #fff1eb; transform: translateY(-3px); }
    45% { background: #fff8f5; transform: translateY(0); }
    100% { background: #fff; }
}

.ce-hubspot-board-new-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff1ec;
    color: #a83f27;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ce-hubspot-board-new-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ce-hubspot-coral);
    box-shadow: 0 0 0 3px rgba(255, 122, 89, .13);
}

.ce-hubspot-board-new-badge.is-just-imported {
    background: var(--ce-hubspot-coral);
    color: #fff;
}

.ce-hubspot-board-new-badge.is-just-imported i {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.ce-hubspot-board-live-chip {
    color: var(--ce-hubspot-teal-dark);
}

.ce-hubspot-board-live-chip i {
    background: var(--ce-hubspot-teal);
    box-shadow: 0 0 0 4px rgba(0, 164, 189, .10);
}

.ce-hubspot-company-icon {
    background: #e5f5f8;
    color: var(--ce-hubspot-teal-dark);
}

.ce-hubspot-board-line-math span {
    color: var(--ce-hubspot-teal-dark);
}

/* List view */
.ce-hubspot-board-list {
    min-width: 860px;
    border: 1px solid var(--ce-hubspot-line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.ce-hubspot-list-head,
.ce-hubspot-list-row {
    display: grid;
    grid-template-columns: minmax(300px, 1.55fr) minmax(250px, 1.25fr) minmax(130px, .65fr) minmax(145px, .7fr);
    gap: 18px;
    align-items: center;
}

.ce-hubspot-list-head {
    padding: 11px 16px;
    border-bottom: 1px solid var(--ce-hubspot-line);
    background: #eaf0f6;
    color: #516f90;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.ce-hubspot-list-body {
    display: grid;
}

.ce-hubspot-list-row {
    position: relative;
    padding: 14px 16px;
    border-bottom: 1px solid #eaf0f6;
    background: #fff;
    transition: background .16s ease, border-color .16s ease;
}

.ce-hubspot-list-row:last-child {
    border-bottom: 0;
}

.ce-hubspot-list-row:hover {
    background: #fbfcfd;
}

.ce-hubspot-list-title-line {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.ce-hubspot-list-title-line > strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-hubspot-list-main > span,
.ce-hubspot-list-products > span,
.ce-hubspot-list-amount > span {
    display: block;
    margin-top: 4px;
    color: #7c98b6;
    font-size: 9px;
}

.ce-hubspot-list-products strong,
.ce-hubspot-list-amount strong {
    display: block;
    color: var(--ce-hubspot-navy);
    font-size: 10px;
}

.ce-hubspot-list-products > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-hubspot-list-stage span {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e5f5f8;
    color: var(--ce-hubspot-teal-dark);
    font-size: 9px;
    font-weight: 800;
}

.ce-hubspot-list-amount {
    text-align: right;
}

@media (max-width: 720px) {
    .ce-hubspot-board-toolbar {
        width: 100%;
        justify-content: space-between;
    }

    .ce-hubspot-view-toggle {
        flex: 1 1 auto;
    }

    .ce-hubspot-view-button {
        justify-content: center;
        flex: 1 1 50%;
    }

    .ce-hubspot-board-list {
        min-width: 760px;
    }
}
