:root {
    color-scheme: light;
    --brand: #d32f2f;
    --brand-dark: #a82424;
    --brand-soft: #fff3f3;
    --ink: #111827;
    --muted: #667085;
    --line: #e4e7ec;
    --soft: #f7f8fa;
    --white: #ffffff;
    --green: #18794e;
    --green-soft: #edf9f2;
    --danger: #b42318;
    --danger-dark: #8f1c13;
    --danger-soft: #fff1f0;
    --shadow: 0 14px 36px rgba(17, 24, 39, .07);
    --radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    color: var(--ink);
    font-size: 15px;
}

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

a {
    color: inherit;
}

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

h1,
h2,
h3 {
    letter-spacing: -.025em;
}

.muted,
.section-heading p,
.admin-heading p {
    color: var(--muted);
    line-height: 1.55;
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.brand-lockup img {
    display: block;
    width: 176px;
    height: auto;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 760;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.section-nav a:focus-visible {
    outline: 3px solid rgba(211, 47, 47, .2);
    outline-offset: 2px;
}

.button-primary {
    background: var(--brand);
    box-shadow: 0 5px 14px rgba(211, 47, 47, .2);
    color: var(--white);
}

.button-primary:hover {
    background: var(--brand-dark);
}

.button-secondary {
    border-color: #d0d5dd;
    background: var(--white);
    color: #344054;
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: #b7bdc7;
    background: var(--soft);
}

.button-quiet {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--brand-dark);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
    box-shadow: 0 5px 14px rgba(180, 35, 24, .2);
    color: var(--white);
}

.button-danger:hover {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
}

.button-danger-quiet {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--danger);
}

.button-danger-quiet:hover {
    border-color: #f1b7b2;
    background: var(--danger-soft);
}

.button-block {
    width: 100%;
}

.button-large {
    min-height: 48px;
    padding: 13px 19px;
    border-radius: 10px;
    font-size: 15px;
}

.admin-header {
    border-top: 5px solid var(--brand);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 92% 20%, rgba(211, 47, 47, .07), transparent 22%),
        var(--white);
}

.admin-header-inner {
    display: grid;
    width: min(1180px, calc(100% - 40px));
    min-height: 148px;
    margin: 0 auto;
    grid-template-columns: 210px minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
}

.admin-heading {
    padding-left: 30px;
    border-left: 1px solid var(--line);
}

.admin-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.12;
}

.admin-heading p {
    margin: 0;
}

.logout {
    align-self: center;
}

.admin-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 26px auto 56px;
}

.section-nav {
    position: sticky;
    z-index: 10;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 6px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 22px rgba(17, 24, 39, .06);
    backdrop-filter: blur(10px);
}

.section-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.section-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.section-nav a[aria-current="page"] {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.section-nav span {
    display: inline-grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef0f3;
    font-size: 11px;
}

.surface {
    scroll-margin-top: 84px;
    margin-bottom: 24px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.collapsible-surface {
    padding: 0;
    overflow: hidden;
}

.collapsible-summary {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    padding: 26px 30px;
    cursor: pointer;
    list-style: none;
    transition: background .16s ease;
}

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

.collapsible-summary:hover {
    background: #fcfcfd;
}

.collapsible-summary:focus-visible {
    outline: 3px solid rgba(211, 47, 47, .2);
    outline-offset: -3px;
}

.collapsible-summary h2 {
    margin: 0 0 7px;
    font-size: 25px;
    letter-spacing: -.025em;
}

.collapsible-summary p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.collapsible-summary .eyebrow {
    margin-bottom: 7px;
}

.collapsible-chevron {
    position: relative;
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid #d8dce3;
    border-radius: 10px;
    background: var(--white);
}

.collapsible-chevron::before,
.collapsible-chevron::after {
    position: absolute;
    top: 18px;
    left: 11px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: #475467;
    content: "";
    transition: transform .16s ease;
}

.collapsible-chevron::after {
    transform: rotate(90deg);
}

.collapsible-surface[open] .collapsible-summary {
    border-bottom: 1px solid var(--line);
}

.collapsible-surface[open] .collapsible-chevron::after {
    transform: rotate(0);
}

.collapsible-content {
    padding: 24px 30px 30px;
}

.dashboard-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin: 0 0 7px;
    font-size: 25px;
}

.section-heading p {
    max-width: 720px;
    margin: 0;
}

.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 24px;
    padding: 16px 18px;
    border: 1px solid;
    border-radius: 12px;
    line-height: 1.45;
}

.notice strong,
.notice span {
    display: block;
}

.notice span {
    margin-top: 2px;
    color: inherit;
    opacity: .82;
}

.notice-success {
    border-color: #a8d7bd;
    background: var(--green-soft);
    color: #145a3d;
}

.notice-error {
    border-color: #efb6bc;
    background: #fff1f2;
    color: #8d1420;
}

.notice-deleted {
    border-color: #d8dce3;
    background: #f7f8fa;
    color: #3f4754;
}

.notice-actions,
.card-actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.prospect-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.prospect-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 21px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--brand);
    border-radius: 13px;
    background: linear-gradient(180deg, #fff, #fdfdfd);
}

.prospect-card-topline {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
}

.status-chip,
.deleted-chip,
.override-chip,
.optional-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.status-chip {
    background: var(--green-soft);
    color: var(--green);
}

.deleted-chip {
    background: #e8eaee;
    color: #515967;
}

.override-chip,
.optional-label {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.prospect-card h3 {
    margin: 0 0 6px;
    font-size: 21px;
}

.calculator-name {
    margin: 0 0 15px;
    color: #344054;
    font-weight: 720;
    line-height: 1.45;
}

.description-preview {
    display: -webkit-box;
    margin: 0 0 16px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.prospect-meta {
    display: grid;
    gap: 7px;
    margin: auto 0 17px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.prospect-meta code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #344054;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-card-metrics {
    display: grid;
    margin: 2px 0 16px;
    overflow: hidden;
    border: 1px solid #e1e4e9;
    border-radius: 10px;
    background: var(--soft);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-card-metrics > div {
    display: grid;
    gap: 2px;
    padding: 11px 10px;
    text-align: center;
}

.analytics-card-metrics > div + div {
    border-left: 1px solid #e1e4e9;
}

.analytics-card-metrics strong {
    color: #202631;
    font-size: 18px;
    line-height: 1.1;
}

.analytics-card-metrics span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.analytics-card-last {
    color: var(--muted) !important;
    font-size: 11px !important;
}

.deleted-surface {
    border-color: #d9dce2;
    background: #fafafa;
    box-shadow: 0 10px 26px rgba(17, 24, 39, .045);
}

.deleted-count {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e8eaee;
    color: #515967;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.deleted-card {
    border-top-color: #8a919e;
    background: #f7f8fa;
}

.deleted-card .calculator-name {
    color: #626b78;
}

.deleted-card .disabled-path {
    color: #7b8492;
    text-decoration: line-through;
}

.deleted-empty-state {
    padding: 28px 20px;
    border: 1px dashed #cfd4dc;
    border-radius: 13px;
    background: var(--white);
    text-align: center;
}

.deleted-empty-state h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.deleted-empty-state p {
    margin: 0;
    color: var(--muted);
}

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

.confirm-dialog {
    width: min(500px, calc(100% - 32px));
    max-width: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 28px 80px rgba(17, 24, 39, .3);
}

.confirm-dialog::backdrop {
    background: rgba(17, 24, 39, .58);
    backdrop-filter: blur(2px);
}

.analytics-dialog {
    width: min(1120px, calc(100% - 32px));
    max-width: none;
    max-height: min(900px, calc(100vh - 32px));
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 17px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 28px 90px rgba(17, 24, 39, .34);
}

.analytics-dialog::backdrop {
    background: rgba(17, 24, 39, .62);
    backdrop-filter: blur(3px);
}

.analytics-dialog-shell {
    display: grid;
    max-height: min(900px, calc(100vh - 32px));
    grid-template-rows: auto minmax(0, 1fr);
}

.analytics-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 23px 26px 20px;
    border-top: 5px solid var(--brand);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #fff, #fffafa);
}

.analytics-dialog-header h2 {
    margin: 0 0 5px;
    font-size: 26px;
}

.analytics-dialog-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.analytics-dialog-close {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0 0 3px;
    border: 1px solid #d5d9e0;
    border-radius: 10px;
    background: var(--white);
    color: #475467;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.analytics-dialog-close:hover {
    border-color: #b7bdc7;
    background: var(--soft);
}

.analytics-loading {
    display: grid;
    min-height: 380px;
    place-items: center;
    padding: 36px;
    color: var(--muted);
    text-align: center;
}

.analytics-error {
    color: var(--danger);
}

.analytics-dialog-content {
    min-height: 0;
    padding: 24px 26px 28px;
    overflow-y: auto;
    background: #f7f8fa;
}

.analytics-range-panel,
.analytics-chart-panel {
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .045);
}

.analytics-range-panel {
    padding: 17px 18px 18px;
}

.analytics-range-heading,
.analytics-chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.analytics-range-heading {
    margin-bottom: 13px;
}

.analytics-range-heading .eyebrow,
.analytics-chart-heading .eyebrow {
    margin-bottom: 4px;
}

.analytics-range-heading h3,
.analytics-chart-heading h3 {
    margin: 0;
    font-size: 18px;
}

.analytics-range-label {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-range-presets,
.analytics-interval-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.analytics-range-presets button,
.analytics-interval-toggle button {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #d4d8df;
    border-radius: 8px;
    background: var(--white);
    color: #475467;
    font: inherit;
    font-size: 11px;
    font-weight: 780;
    cursor: pointer;
}

.analytics-range-presets button:hover,
.analytics-interval-toggle button:hover,
.analytics-range-presets button.is-active,
.analytics-interval-toggle button.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.analytics-custom-range {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.analytics-custom-range label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.analytics-custom-range input[type="date"] {
    width: 155px;
    min-height: 38px;
    margin: 0;
    padding: 7px 9px;
    color: #202631;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.analytics-custom-range .button {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 11px;
}

.analytics-summary-grid {
    display: grid;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .045);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-summary-grid > div {
    display: grid;
    gap: 5px;
    padding: 18px 20px;
}

.analytics-summary-grid > div + div {
    border-left: 1px solid var(--line);
}

.analytics-summary-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.analytics-summary-grid strong {
    font-size: 29px;
    line-height: 1;
}

.analytics-chart-panel {
    overflow: hidden;
}

.analytics-chart-heading {
    padding: 17px 18px 12px;
}

.analytics-chart-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.analytics-interval-toggle {
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 10px;
    background: #f0f2f5;
}

.analytics-interval-toggle button {
    min-width: 58px;
    border-color: transparent;
    background: transparent;
}

.analytics-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 18px 12px;
    color: #596273;
    font-size: 10px;
    font-weight: 750;
}

.analytics-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.analytics-chart-legend i {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.analytics-series-views {
    background: #d32f2f;
    stroke: #d32f2f;
}

.analytics-series-visitors {
    background: #2563a8;
    stroke: #2563a8;
}

.analytics-series-sessions {
    background: #25865b;
    stroke: #25865b;
}

.analytics-series-scenarios {
    background: #7c4bb2;
    stroke: #7c4bb2;
}

.analytics-chart {
    position: relative;
    min-height: 285px;
    padding: 0 10px 8px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fbfbfc);
}

.analytics-chart svg {
    display: block;
    width: 100%;
    min-width: 620px;
    height: 285px;
    overflow: visible;
}

.analytics-chart-grid {
    stroke: #e5e8ed;
    stroke-width: 1;
}

.analytics-chart-axis-label {
    fill: #7b8492;
    font-size: 10px;
    font-weight: 650;
}

.analytics-chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.analytics-chart-focus-line {
    stroke: #aeb5c0;
    stroke-dasharray: 4 4;
    stroke-width: 1;
}

.analytics-chart-focus-dot {
    fill: var(--white);
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.analytics-chart-tooltip {
    position: absolute;
    z-index: 2;
    top: 18px;
    display: grid;
    min-width: 165px;
    gap: 5px;
    padding: 10px 11px;
    border: 1px solid #d8dce3;
    border-radius: 9px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 30px rgba(17, 24, 39, .16);
    color: #344054;
    font-size: 10px;
    pointer-events: none;
}

.analytics-chart-tooltip[hidden] {
    display: none;
}

.analytics-chart-tooltip strong {
    color: #202631;
    font-size: 11px;
}

.analytics-chart-tooltip span {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.analytics-chart-empty {
    display: grid;
    min-height: 285px;
    place-items: center;
    padding: 30px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.analytics-detail-grid {
    display: grid;
    min-height: 430px;
    grid-template-columns: minmax(270px, .75fr) minmax(0, 1.65fr);
    align-items: start;
    gap: 18px;
}

.analytics-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .04);
}

.analytics-panel-heading {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.analytics-panel-heading .eyebrow {
    margin-bottom: 4px;
}

.analytics-panel-heading h3 {
    margin: 0;
    font-size: 18px;
}

.analytics-count-chip,
.analytics-mode-chip,
.analytics-engaged-chip,
.analytics-viewed-chip {
    display: inline-flex;
    width: fit-content;
    min-height: 25px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.analytics-count-chip,
.analytics-mode-chip,
.analytics-viewed-chip {
    background: #eef0f3;
    color: #515967;
}

.analytics-engaged-chip {
    background: var(--green-soft);
    color: var(--green);
}

.analytics-visitor-list,
.analytics-scenario-list {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.analytics-visitor-list {
    max-height: 610px;
    overflow-y: auto;
}

.analytics-visitor-card {
    display: grid;
    width: 100%;
    gap: 6px;
    padding: 13px;
    border: 1px solid #dde1e7;
    border-radius: 10px;
    background: var(--white);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.analytics-visitor-card:hover,
.analytics-visitor-card.is-active {
    border-color: #df9292;
    background: var(--brand-soft);
    box-shadow: 0 0 0 2px rgba(211, 47, 47, .07);
}

.analytics-visitor-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.analytics-visitor-topline strong {
    font-size: 14px;
}

.analytics-visitor-totals {
    color: #344054;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.analytics-visitor-meta,
.analytics-visitor-source {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-filter-copy {
    margin: 0;
    padding: 11px 17px;
    border-bottom: 1px solid var(--line);
    background: #fafafa;
    color: var(--muted);
    font-size: 11px;
}

.analytics-show-all {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
}

.analytics-scenario-list {
    max-height: 545px;
    overflow-y: auto;
}

.analytics-scenario-card {
    overflow: hidden;
    border: 1px solid #dde1e7;
    border-radius: 11px;
    background: var(--white);
}

.analytics-scenario-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fafafa;
}

.analytics-scenario-heading > div {
    display: grid;
    gap: 2px;
}

.analytics-scenario-heading strong {
    font-size: 13px;
}

.analytics-scenario-heading div > span {
    color: var(--muted);
    font-size: 11px;
}

.analytics-input-grid {
    display: grid;
    margin: 0;
    padding: 13px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.analytics-input-grid > div {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--soft);
}

.analytics-input-grid dt {
    margin-bottom: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.analytics-input-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #202631;
    font-size: 13px;
    font-weight: 720;
}

.analytics-empty {
    padding: 28px 18px;
    border: 1px dashed #cfd4dc;
    border-radius: 10px;
    background: var(--soft);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.confirm-dialog form {
    display: grid;
    justify-items: center;
    padding: 30px;
    text-align: center;
}

.confirm-dialog-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 17px;
    place-items: center;
    border-radius: 50%;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 23px;
    font-weight: 900;
}

.confirm-dialog h2 {
    margin: 0 0 9px;
    font-size: 23px;
}

.confirm-dialog p {
    margin: 0;
    color: #4e5867;
    line-height: 1.55;
}

.confirm-dialog-note {
    margin-top: 12px !important;
    padding: 11px 13px;
    border-radius: 9px;
    background: #f4f5f7;
    color: var(--muted) !important;
    font-size: 12px;
}

.confirm-dialog-actions {
    display: grid;
    width: 100%;
    margin-top: 23px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.empty-state {
    padding: 40px 20px;
    border: 1px dashed #cfd4dc;
    border-radius: 13px;
    background: var(--soft);
    text-align: center;
}

.empty-state h3 {
    margin: 12px 0 6px;
}

.empty-state p {
    margin-bottom: 18px;
    color: var(--muted);
}

.empty-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    place-items: center;
    border-radius: 12px;
    background: var(--brand);
    color: var(--white);
    font-size: 27px;
    font-weight: 400;
}

.editor-surface {
    border-top: 5px solid var(--brand);
}

.scenario-form {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
    overflow: visible;
}

.editor-progress {
    display: grid;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    background: #fafafa;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    list-style: none;
}

.editor-progress li {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 17px 22px;
    color: #7b8492;
}

.editor-progress li + li {
    border-left: 1px solid var(--line);
}

.editor-progress li::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: transparent;
    content: "";
}

.editor-progress li > span {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #cdd2da;
    border-radius: 50%;
    background: var(--white);
    color: #687181;
    font-size: 13px;
    font-weight: 850;
}

.editor-progress li div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.editor-progress li strong {
    color: #596273;
    font-size: 13px;
}

.editor-progress li small {
    font-size: 11px;
}

.editor-progress li.is-active {
    background: var(--white);
    color: var(--muted);
}

.editor-progress li.is-active::after {
    background: var(--brand);
}

.editor-progress li.is-active > span,
.editor-progress li.is-complete > span {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.editor-progress li.is-active strong {
    color: var(--ink);
}

.editor-progress li.is-complete > span {
    font-size: 0;
}

.editor-progress li.is-complete > span::before {
    font-size: 14px;
    content: "✓";
}

.editor-step {
    padding: 28px;
    scroll-margin-top: 95px;
}

.step-heading {
    max-width: 700px;
    margin-bottom: 24px;
}

.step-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.step-heading h3,
.calculator-editor-heading h3 {
    margin: 0 0 6px;
    font-size: 21px;
}

.step-heading p,
.calculator-editor-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.field-group {
    min-width: 0;
}

.prospect-name-field {
    max-width: 580px;
}

.field-group > label,
.label-row label,
.auth-card label {
    display: block;
    margin: 0 0 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 780;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.label-row label {
    margin: 0;
}

input[type="password"],
input[type="text"],
select,
textarea {
    width: 100%;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid #c7ccd4;
    border-radius: 9px;
    background: var(--white);
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

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

input:hover,
select:hover,
textarea:hover {
    border-color: #9da4af;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .1);
    outline: none;
}

.field-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.description-field {
    max-width: 760px;
    margin-top: 26px;
}

.rich-content-field {
    max-width: 900px;
    margin-top: 26px;
}

.rich-text-control {
    overflow: hidden;
    border: 1px solid #c7ccd4;
    border-radius: 10px;
    background: var(--white);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rich-text-control:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .1);
}

.rich-text-toolbar {
    display: flex;
    min-height: 45px;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px;
    border-bottom: 1px solid var(--line);
    background: var(--soft);
}

.rich-text-toolbar button,
.rich-text-toolbar select,
.rich-color-control {
    display: inline-flex;
    width: auto;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid #cfd4dc;
    border-radius: 6px;
    background: var(--white);
    color: #344054;
    font-size: 12px;
    line-height: 1;
}

.rich-text-toolbar button {
    cursor: pointer;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar select:hover,
.rich-color-control:hover {
    border-color: #9da4af;
}

.rich-color-control {
    gap: 6px;
}

.rich-color-control input[type="color"] {
    width: 24px;
    height: 22px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.rich-text-editor {
    min-height: 220px;
    max-height: 560px;
    padding: 16px;
    overflow-y: auto;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    outline: none;
}

.rich-text-editor:empty::before {
    color: #98a2b3;
    content: 'Write the larger calculator content here…';
    pointer-events: none;
}

.rich-text-editor h2,
.rich-text-editor h3,
.rich-text-editor h4,
.rich-text-editor p,
.rich-text-editor ul,
.rich-text-editor ol {
    margin-top: 0;
    margin-bottom: 10px;
}

.rich-text-editor h2 {
    font-size: 21px;
}

.rich-text-editor h3 {
    font-size: 18px;
}

.rich-text-editor h4 {
    font-size: 15px;
}

.base-content-fields {
    display: grid;
    gap: 24px;
}

.base-content-fields > .field-group {
    max-width: 900px;
}

.base-content-fields .rich-content-field {
    margin-top: 0;
}

.calculator-picker {
    min-width: 0;
    margin: 27px 0 0;
    padding: 0;
    border: 0;
}

.calculator-picker legend {
    margin: 0 0 2px;
    padding: 0;
    color: #344054;
    font-size: 14px;
    font-weight: 800;
}

.calculator-picker > .field-help {
    margin: 0 0 13px;
}

.calculator-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.calculator-choice-wrap {
    position: relative;
    min-width: 0;
}

.calculator-choice-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.calculator-choice {
    position: relative;
    display: grid;
    min-height: 112px;
    grid-template-columns: 48px minmax(0, 1fr) 24px;
    align-items: start;
    gap: 13px;
    padding: 17px;
    border: 1px solid #d5d9e0;
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.calculator-choice:hover {
    border-color: #e29a9a;
    background: #fffdfd;
    transform: translateY(-1px);
}

.calculator-choice-input:focus-visible + .calculator-choice {
    outline: 3px solid rgba(211, 47, 47, .2);
    outline-offset: 2px;
}

.calculator-choice-input:checked + .calculator-choice {
    border-color: var(--brand);
    background: linear-gradient(135deg, #fff, var(--brand-soft));
    box-shadow: 0 0 0 2px rgba(211, 47, 47, .1), 0 9px 20px rgba(85, 25, 25, .07);
}

.calculator-choice-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 11px;
    background: #f0f2f5;
    color: #596273;
}

.calculator-choice-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.calculator-choice-icon[data-visual="rate"] {
    background: #eef4ff;
    color: #315f9f;
}

.calculator-choice-icon[data-visual="benefits"] {
    background: #edf8f2;
    color: #27704d;
}

.calculator-choice-icon[data-visual="hiring"] {
    background: #f4efff;
    color: #6947a8;
}

.calculator-choice-icon[data-visual="workforce"] {
    background: #fff4e8;
    color: #9a5b1f;
}

.calculator-choice-input:checked + .calculator-choice .calculator-choice-icon {
    background: var(--brand);
    color: var(--white);
}

.calculator-choice-copy {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.calculator-choice-copy strong {
    color: #202631;
    font-size: 14px;
    line-height: 1.35;
}

.calculator-choice-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.calculator-choice-check {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid #cfd4dc;
    border-radius: 50%;
    background: var(--white);
    color: transparent;
    font-size: 12px;
    font-weight: 900;
}

.calculator-choice-input:checked + .calculator-choice .calculator-choice-check {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.step-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.calculator-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.calculator-preview-summary {
    display: grid;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #e7caca;
    border-radius: 10px;
    background: var(--brand-soft);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculator-preview-summary > div {
    display: grid;
    gap: 3px;
    padding: 12px 15px;
}

.calculator-preview-summary > div + div {
    border-left: 1px solid #e7caca;
}

.calculator-preview-summary span {
    color: #8f4545;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.calculator-preview-summary strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calculator-preview-shell {
    overflow: hidden;
    border: 1px solid #cdd2da;
    border-radius: 13px;
    background: #edf0f3;
    box-shadow: inset 0 1px 3px rgba(17, 24, 39, .05);
}

.calculator-preview-bar {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 15px;
    border-bottom: 1px solid #cdd2da;
    background: #f8f9fa;
    color: #5b6472;
    font-size: 12px;
}

.calculator-preview-bar > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calculator-preview-bar strong {
    color: #303744;
    font-size: 12px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, .12);
}

.calculator-preview-status {
    display: grid;
    min-height: 320px;
    place-items: center;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

#calculator-preview {
    display: block;
    width: 100%;
    min-height: 560px;
    border: 0;
    background: var(--white);
}

.save-bar {
    position: sticky;
    z-index: 5;
    top: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin: 0 0 18px;
    padding: 15px 17px;
    border: 1px solid #d6d9df;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 34px rgba(17, 24, 39, .14);
    backdrop-filter: blur(10px);
}

.save-bar-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.save-bar-copy strong {
    font-size: 14px;
}

.save-bar-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.save-bar .form-actions {
    flex: 0 0 auto;
}

#scenario-submit:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: .52;
    transform: none;
}

.base-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.base-card {
    display: grid;
    min-width: 0;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.base-card-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 19px;
    font-weight: 850;
}

.base-card h3 {
    margin: 1px 0 7px;
    font-size: 16px;
    line-height: 1.35;
}

.base-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.base-card .card-actions {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.base-card .analytics-card-metrics,
.base-card .analytics-card-last {
    grid-column: 1 / -1;
}

.base-card .analytics-card-metrics {
    margin: 2px 0 0;
}

.base-card .analytics-card-last {
    margin: -4px 0 0;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 30px 18px;
    background:
        linear-gradient(115deg, rgba(17, 24, 39, .96), rgba(17, 24, 39, .88)),
        repeating-linear-gradient(135deg, transparent, transparent 18px, rgba(255, 255, 255, .025) 18px, rgba(255, 255, 255, .025) 36px);
}

.login-shell {
    width: min(430px, 100%);
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: 35px;
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 25px 70px rgba(0, 0, 0, .28);
}

.auth-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: var(--brand);
    content: "";
}

.auth-brand {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.auth-card .muted {
    margin-bottom: 24px;
}

.auth-card .button-block {
    margin-top: 18px;
}

@media (max-width: 920px) {
    .admin-header-inner {
        grid-template-columns: 180px minmax(0, 1fr) auto;
        gap: 20px;
    }

    .admin-heading {
        padding-left: 20px;
    }

    .prospect-grid,
    .base-grid {
        grid-template-columns: 1fr;
    }

    .calculator-choice-grid {
        grid-template-columns: 1fr;
    }

    .analytics-detail-grid {
        grid-template-columns: 1fr;
    }

    .analytics-visitor-list,
    .analytics-scenario-list {
        max-height: 430px;
    }
}

@media (max-width: 700px) {
    .admin-header-inner {
        width: min(100% - 28px, 1180px);
        grid-template-columns: 1fr auto;
        padding: 22px 0;
    }

    .admin-header .brand-lockup {
        grid-column: 1;
    }

    .admin-header .brand-lockup img {
        width: 145px;
    }

    .admin-heading {
        grid-column: 1 / -1;
        grid-row: 2;
        padding: 18px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .logout {
        grid-column: 2;
        grid-row: 1;
    }

    .admin-shell {
        width: min(100% - 24px, 1180px);
        margin-top: 18px;
    }

    .surface {
        padding: 21px;
    }

    .collapsible-surface {
        padding: 0;
    }

    .collapsible-summary {
        min-height: 104px;
        gap: 16px;
        padding: 21px;
    }

    .collapsible-summary h2 {
        font-size: 22px;
    }

    .collapsible-content {
        padding: 20px 21px 21px;
    }

    .section-heading,
    .notice {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-step {
        padding: 21px;
    }

    .calculator-editor-heading,
    .save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .calculator-preview-summary {
        grid-template-columns: 1fr;
    }

    .calculator-preview-summary > div + div {
        border-top: 1px solid #e7caca;
        border-left: 0;
    }

    .save-bar .form-actions {
        flex: 1 1 auto;
    }

    .analytics-dialog {
        width: calc(100% - 18px);
        max-height: calc(100vh - 18px);
    }

    .analytics-dialog-shell {
        max-height: calc(100vh - 18px);
    }

    .analytics-dialog-header {
        padding: 19px;
    }

    .analytics-dialog-content {
        padding: 16px;
    }

    .analytics-range-heading,
    .analytics-chart-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-range-label {
        width: fit-content;
        white-space: normal;
    }

    .analytics-custom-range {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-custom-range label,
    .analytics-custom-range input[type="date"] {
        width: 100%;
    }

    .analytics-custom-range .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .analytics-interval-toggle {
        width: fit-content;
    }

    .analytics-chart {
        overflow-x: auto;
    }

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

    .analytics-summary-grid > div:nth-child(3) {
        border-left: 0;
    }

    .analytics-summary-grid > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px;
    }

    .section-nav {
        width: 100%;
    }

    .card-actions .button,
    .form-actions .button,
    .notice-actions .button,
    .step-actions .button,
    .dashboard-section-actions .button {
        width: 100%;
    }

    .editor-progress li {
        gap: 8px;
        padding: 13px 10px;
    }

    .editor-progress li > span {
        width: 28px;
        height: 28px;
    }

    .editor-progress li small {
        display: none;
    }

    .calculator-choice {
        grid-template-columns: 42px minmax(0, 1fr) 22px;
        gap: 10px;
        padding: 14px;
    }

    .calculator-choice-icon {
        width: 42px;
        height: 42px;
    }

    .calculator-preview-bar > span {
        display: none;
    }

    .save-bar {
        top: 64px;
        padding: 10px;
    }

    .save-bar-copy {
        display: none;
    }

    .save-bar .form-actions {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .save-bar .form-actions .button {
        width: auto;
        min-height: 42px;
        padding: 10px 13px;
    }

    .analytics-input-grid {
        grid-template-columns: 1fr;
    }
}
