/*
 * tool-estimate-builder.css
 * Page-scoped under .eb-page. Forces light theme regardless of the app's
 * global data-theme. Not bundled into clientflow.css.
 */

body:has(.eb-page) {
    background:
        radial-gradient(1100px 600px at 80% -10%, rgba(79, 70, 229, 0.06) 0%, transparent 60%),
        radial-gradient(900px 500px at -5% 110%, rgba(245, 158, 11, 0.04) 0%, transparent 55%),
        #f6f5f1;
    color: #16161a;
}

.eb-page {
    --eb-accent: #4F46E5;
    --eb-accent-deep: #312E81;
    --eb-accent-soft: rgba(79, 70, 229, 0.08);
    --eb-bg: #f6f5f1;
    --eb-card: #ffffff;
    --eb-border: #e9e7df;
    --eb-border-strong: #d6d2c4;
    --eb-rule: #1f1d1a;
    --eb-text: #16161a;
    --eb-text-strong: #0b0b0d;
    --eb-muted: #6b6a64;
    --eb-muted-soft: #9a978d;
    --eb-soft: #fafaf6;
    --eb-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
    --eb-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;

    max-width: 1280px;
    margin: 0 auto;
    padding: 2.75rem 1.5rem 5rem;
    color: var(--eb-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.eb-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--eb-muted);
    text-decoration: none;
    margin-bottom: 1rem;
}
.eb-back:hover { color: var(--eb-text); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.eb-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2.75rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--eb-border);
}
@media (min-width: 768px) {
    .eb-hero { grid-template-columns: minmax(0, 1fr) auto; }
}

.eb-hero__lead { max-width: 38rem; }

.eb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--eb-muted);
    margin-bottom: 1.25rem;
}
.eb-eyebrow::before {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 1px;
    background: var(--eb-rule);
    opacity: 0.4;
}

.eb-hero__title {
    margin: 0 0 1rem;
    font-family: var(--eb-serif);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: var(--eb-text-strong);
    font-variation-settings: "opsz" 48;
}
.eb-hero__accent {
    font-style: italic;
    color: var(--eb-text-strong);
    padding: 0 0.06em;
    background: linear-gradient(180deg, transparent 60%, rgba(79, 70, 229, 0.22) 60%, rgba(79, 70, 229, 0.22) 92%, transparent 92%);
    border-radius: 2px;
}
.eb-hero__period { color: var(--eb-accent); font-style: normal; }

.eb-hero__sub {
    margin: 0 0 1.5rem;
    color: var(--eb-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
    max-width: 32rem;
}

.eb-proof {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--eb-text);
}
.eb-proof__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.eb-proof__dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: #2f7d4f;
    box-shadow: 0 0 0 3px rgba(47, 125, 79, 0.12);
}
.eb-proof__sep { color: var(--eb-muted-soft); }

.eb-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 999px;
    background: var(--eb-text-strong);
    color: #f6f5f1;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--eb-text-strong);
    white-space: nowrap;
    align-self: end;
}
.eb-hero__link:hover { background: #000; }

/* ── Anonymous hint card ──────────────────────────────────────────── */
.eb-hint {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    background: var(--eb-card);
    border: 1px solid var(--eb-border-strong);
    border-left: 3px solid var(--eb-accent);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--eb-text);
    box-shadow: 0 1px 0 rgba(15, 14, 12, 0.02);
}
.eb-hint__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--eb-accent-soft);
    color: var(--eb-accent-deep);
    flex-shrink: 0;
}
.eb-hint__body { line-height: 1.5; color: var(--eb-muted); }
.eb-hint__body strong { display: block; color: var(--eb-text-strong); font-weight: 600; margin-bottom: 0.125rem; }
.eb-hint__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    background: var(--eb-accent);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--eb-accent);
}
.eb-hint__cta:hover { background: var(--eb-accent-deep); border-color: var(--eb-accent-deep); }
@media (max-width: 640px) {
    .eb-hint { grid-template-columns: 1fr; }
    .eb-hint__icon { display: none; }
}

/* ── Two-pane grid ────────────────────────────────────────────────── */
.eb-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .eb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
}

.eb-pane { min-width: 0; }

.eb-form { display: flex; flex-direction: column; gap: 1.125rem; }

/* ── Cards (form sections — "sheets of paper") ───────────────────── */
.eb-card {
    background: var(--eb-card);
    border: 1px solid var(--eb-border);
    border-radius: 0.625rem;
    padding: 1.5rem 1.5rem 1.375rem;
    box-shadow:
        0 1px 0 rgba(15, 14, 12, 0.04),
        0 1px 2px rgba(15, 14, 12, 0.03);
}
.eb-card__title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-family: var(--eb-serif);
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
    text-transform: none;
    letter-spacing: -0.005em;
    color: var(--eb-text-strong);
    margin: 0 0 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--eb-border);
    width: 100%;
}
.eb-card__title::before {
    content: counter(eb-section, decimal-leading-zero);
    counter-increment: eb-section;
    font-family: var(--eb-mono);
    font-size: 0.6875rem;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--eb-accent);
    background: var(--eb-accent-soft);
    padding: 0.1875rem 0.4375rem;
    border-radius: 3px;
    line-height: 1;
}
.eb-form { counter-reset: eb-section; }

.eb-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 600px) {
    .eb-row--2 { grid-template-columns: 1fr 1fr; }
    .eb-row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

.eb-field { display: flex; flex-direction: column; gap: 0.25rem; }
.eb-field__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--eb-muted);
    letter-spacing: 0.01em;
}

.eb-form input[type="text"],
.eb-form input[type="email"],
.eb-form input[type="number"],
.eb-form input[type="date"],
.eb-form input[type="file"],
.eb-form select,
.eb-form textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--eb-border-strong);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    box-sizing: border-box;
    background: var(--eb-card);
    color: var(--eb-text);
    font-family: inherit;
}
.eb-form input::placeholder,
.eb-form textarea::placeholder { color: var(--eb-muted-soft); }
.eb-form input:focus,
.eb-form select:focus,
.eb-form textarea:focus {
    outline: none;
    border-color: var(--eb-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.eb-form textarea {
    min-height: 4rem;
    resize: vertical;
    font-family: inherit;
}
.eb-form input[type="color"] {
    padding: 0.125rem;
    height: 2.25rem;
    cursor: pointer;
}

/* ── Segmented toggle ─────────────────────────────────────────────── */
.eb-toggle {
    display: inline-flex;
    padding: 0.25rem;
    background: var(--eb-soft);
    border: 1px solid var(--eb-border);
    border-radius: 0.5rem;
    gap: 0.125rem;
}
.eb-toggle button {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--eb-muted);
    border-radius: 0.375rem;
    cursor: pointer;
    font-family: inherit;
}
.eb-toggle button.is-active {
    background: var(--eb-card);
    color: var(--eb-text-strong);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.eb-toggle--full { display: flex; width: 100%; }
.eb-toggle--full button { flex: 1; }
.eb-toggle--sm {
    padding: 0.1875rem;
    background: rgba(11, 11, 13, 0.04);
    border-color: rgba(11, 11, 13, 0.08);
}
.eb-toggle--sm button {
    padding: 0.3125rem 0.625rem;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    color: var(--eb-muted);
    font-weight: 500;
}
.eb-toggle--sm button.is-active {
    background: var(--eb-card);
    color: var(--eb-text-strong);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: no-preference) {
    .eb-toggle button { transition: background 120ms ease, color 120ms ease; }
}

/* ── Sections + line items ────────────────────────────────────────── */
.eb-sections { display: flex; flex-direction: column; gap: 0.875rem; }

.eb-section {
    border: 1px solid var(--eb-border);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--eb-soft);
}
.eb-section__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}
.eb-section__header input[type="text"] {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.eb-line-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.75rem 4.5rem 5.75rem 1.5rem;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--eb-muted);
    padding: 0 0.125rem 0.375rem;
}
.eb-line-head__num { text-align: right; }

.eb-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.75rem 4.5rem 5.75rem 1.5rem;
    gap: 0.375rem;
    align-items: center;
    margin-bottom: 0.375rem;
}
.eb-line--lump {
    grid-template-columns: minmax(0, 1fr) 5.75rem 1.5rem;
}
.eb-line input,
.eb-line select {
    padding: 0.4375rem 0.5rem;
    font-size: 0.8125rem;
    min-width: 0;
}

.eb-icon-btn {
    appearance: none;
    border: 1px solid var(--eb-border-strong);
    background: var(--eb-card);
    color: var(--eb-muted);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.eb-icon-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.eb-icon-btn svg { width: 0.875rem; height: 0.875rem; }

.eb-add {
    appearance: none;
    margin-top: 0.375rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px dashed var(--eb-border-strong);
    border-radius: 0.375rem;
    background: var(--eb-card);
    color: var(--eb-text);
    cursor: pointer;
    font-family: inherit;
}
.eb-add:hover { background: var(--eb-soft); border-style: solid; }
.eb-add--block { display: block; width: 100%; text-align: center; }

/* ── Sticky totals strip ──────────────────────────────────────────── */
.eb-sticky-totals {
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    margin-top: 0.5rem;
    background: var(--eb-text-strong);
    color: #f1efe7;
    border: 1px solid var(--eb-text-strong);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, auto) 1fr;
    align-items: end;
    gap: 1.25rem;
    box-shadow:
        0 12px 32px rgba(11, 11, 13, 0.18),
        0 2px 4px rgba(11, 11, 13, 0.12);
}
.eb-sticky-totals__cell { display: flex; flex-direction: column; gap: 0.25rem; }
.eb-sticky-totals__cell:last-child {
    justify-self: end;
    text-align: right;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(241, 239, 231, 0.18);
}
.eb-sticky-totals__label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(241, 239, 231, 0.55);
}
.eb-sticky-totals__value {
    font-family: var(--eb-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(241, 239, 231, 0.92);
    font-variant-numeric: tabular-nums;
}
.eb-sticky-totals__value--grand {
    font-family: var(--eb-serif);
    font-size: 1.875rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
    .eb-sticky-totals { grid-template-columns: 1fr 1fr; }
    .eb-sticky-totals__cell:last-child { grid-column: 1 / -1; border-left: none; border-top: 1px solid rgba(241, 239, 231, 0.18); padding-left: 0; padding-top: 0.625rem; }
}

/* ── Submit row ───────────────────────────────────────────────────── */
.eb-submit {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
}
.eb-submit__caption {
    margin: 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--eb-muted);
    line-height: 1.5;
}
.eb-submit__caption a { color: var(--eb-text-strong); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.eb-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    letter-spacing: -0.005em;
}
.eb-btn--primary {
    background: var(--eb-text-strong);
    color: #f6f5f1;
    width: 100%;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 8px 18px rgba(11, 11, 13, 0.18);
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.eb-btn--primary:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 14px 28px rgba(11, 11, 13, 0.22);
}
.eb-btn--primary:active { transform: translateY(0); }
.eb-btn--secondary {
    background: var(--eb-card);
    color: var(--eb-text);
    border-color: var(--eb-border-strong);
}
.eb-btn--secondary:hover { background: var(--eb-soft); }
.eb-btn--ghost {
    background: transparent;
    color: var(--eb-text);
    border-color: var(--eb-border);
}
.eb-btn--ghost:hover { background: var(--eb-soft); }
.eb-btn--danger {
    background: var(--eb-card);
    color: #b91c1c;
    border-color: #fca5a5;
}
.eb-btn--danger:hover { background: #fee2e2; }
.eb-btn--block { width: 100%; }
.eb-btn svg { width: 1rem; height: 1rem; }

/* ── Preview pane ─────────────────────────────────────────────────── */
.eb-preview-wrap {
    position: sticky;
    top: 1.5rem;
}
.eb-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding: 0 0.125rem;
}
.eb-preview-bar__live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--eb-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--eb-muted);
}
.eb-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #2f7d4f;
    box-shadow: 0 0 0 0 rgba(47, 125, 79, 0.55);
}
@media (prefers-reduced-motion: no-preference) {
    .eb-live-dot { animation: eb-pulse 2s ease-in-out infinite; }
    @keyframes eb-pulse {
        0%   { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0.55); }
        50%  { box-shadow: 0 0 0 6px rgba(47, 125, 79, 0); }
        100% { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0); }
    }
}
.eb-preview {
    background: #fff;
    border: 1px solid var(--eb-border);
    border-radius: 0.75rem;
    padding: 2.5rem;
    min-height: 38rem;
    box-shadow:
        0 1px 0 rgba(15, 14, 12, 0.04),
        0 18px 40px rgba(15, 14, 12, 0.05),
        0 2px 6px rgba(15, 14, 12, 0.04);
    font-size: 0.8125rem;
    color: var(--eb-text);
    line-height: 1.55;
    overflow: hidden;
    position: relative;
}
.eb-preview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(15, 14, 12, 0.06) 30%, rgba(15, 14, 12, 0.06) 70%, transparent 100%);
}
.eb-preview[data-layout="modern"] { font-family: 'Inter', sans-serif; }
.eb-preview[data-layout="classic"] { font-family: 'Source Serif 4', Georgia, serif; }
.eb-preview[data-layout="minimal"] { font-family: 'Inter', sans-serif; font-weight: 400; }

.eb-pv__head {
    margin: -1rem -1rem 1.25rem;
    padding: 1.125rem 1.25rem;
    background: var(--eb-accent);
    color: #fff;
    border-radius: 0.375rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}
.eb-pv__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.eb-pv__brand {
    font-size: 0.75rem;
    opacity: 0.92;
    margin-top: 0.125rem;
}
.eb-pv__logo {
    max-height: 2.75rem;
    max-width: 6.25rem;
    background: #fff;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.eb-preview[data-layout="classic"] .eb-pv__head {
    background: transparent;
    color: var(--eb-text-strong);
    border-bottom: 1px solid var(--eb-text-strong);
    border-radius: 0;
    padding: 0 0 0.875rem;
    margin: 0 0 1.25rem;
    text-align: center;
    grid-template-columns: 1fr;
    justify-items: center;
}
.eb-preview[data-layout="classic"] .eb-pv__title { font-weight: 400; }
.eb-preview[data-layout="minimal"] .eb-pv__head {
    background: transparent;
    color: var(--eb-text-strong);
    border-radius: 0;
    padding: 0 0 0.75rem;
    margin: 0 0 1rem;
}
.eb-preview[data-layout="minimal"] .eb-pv__brand { color: var(--eb-muted); }

.eb-pv__meta-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    font-size: 0.6875rem;
    margin-bottom: 1.125rem;
}
.eb-pv__meta-cell .eb-pv__label { color: var(--eb-muted); }
.eb-pv__meta-cell strong { color: var(--eb-text-strong); font-size: 0.8125rem; }

.eb-pv__parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.eb-pv__label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--eb-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.eb-pv__phase { margin-bottom: 1rem; }
.eb-pv__phase-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--eb-accent);
    font-weight: 600;
    margin: 0 0 0.375rem;
}
.eb-preview[data-layout="classic"] .eb-pv__phase-name,
.eb-preview[data-layout="minimal"] .eb-pv__phase-name { color: var(--eb-text-strong); }

.eb-pv__items {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.eb-pv__items th {
    text-align: left;
    padding: 0.5rem 0.375rem;
    font-size: 0.625rem;
    color: var(--eb-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--eb-border-strong);
}
.eb-pv__items td {
    padding: 0.5rem 0.375rem;
    border-bottom: 1px solid #f0f1f4;
    vertical-align: top;
}
.eb-pv__num { text-align: right; white-space: nowrap; }
.eb-pv__muted { color: var(--eb-muted-soft); font-style: italic; }

.eb-pv__subtotal td {
    border-bottom: none;
    font-weight: 600;
    color: var(--eb-text-strong);
    padding-top: 0.625rem;
}

.eb-pv__totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    margin-top: 1rem;
    font-size: 0.75rem;
}
.eb-pv__totals > div {
    display: grid;
    grid-template-columns: auto 6rem;
    gap: 1.25rem;
    min-width: 14rem;
}
.eb-pv__grand {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--eb-accent);
    padding-top: 0.375rem;
    border-top: 1px solid var(--eb-accent);
    margin-top: 0.25rem;
}
.eb-preview[data-layout="classic"] .eb-pv__grand,
.eb-preview[data-layout="minimal"] .eb-pv__grand {
    color: var(--eb-text-strong);
    border-top-color: var(--eb-text-strong);
}

/* ── Status pills ─────────────────────────────────────────────────── */
.eb-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.eb-pill--draft    { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.eb-pill--sent     { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.eb-pill--accepted { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.eb-pill--declined { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.eb-pill--expired  { background: #fef3c7; color: #92400e; border-color: #fde68a; text-decoration: line-through; }

/* ── List page ────────────────────────────────────────────────────── */
.eb-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.eb-list__header h1 {
    margin: 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.75rem;
    color: var(--eb-text-strong);
}
.eb-table-wrap {
    background: var(--eb-card);
    border: 1px solid var(--eb-border);
    border-radius: 0.75rem;
    overflow: hidden;
}
.eb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.eb-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--eb-muted);
    background: var(--eb-soft);
    border-bottom: 1px solid var(--eb-border);
}
.eb-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--eb-border);
    color: var(--eb-text);
}
.eb-table tbody tr { cursor: pointer; }
.eb-table tbody tr:hover { background: var(--eb-soft); }
.eb-table tbody tr:last-child td { border-bottom: none; }
.eb-table__num { text-align: right; white-space: nowrap; }
.eb-table__muted { color: var(--eb-muted); }

.eb-empty {
    background: var(--eb-card);
    border: 1px dashed var(--eb-border-strong);
    border-radius: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
}
.eb-empty h2 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: var(--eb-text-strong);
}
.eb-empty p { margin: 0 0 1.25rem; color: var(--eb-muted); }

/* ── Detail page ──────────────────────────────────────────────────── */
.eb-detail__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.eb-detail__title {
    margin: 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.5rem;
    color: var(--eb-text-strong);
}
.eb-detail__title-sub {
    display: block;
    font-size: 0.8125rem;
    color: var(--eb-muted);
    font-family: 'Inter', sans-serif;
    margin-top: 0.25rem;
    font-weight: 400;
}

.eb-detail__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .eb-detail__grid { grid-template-columns: minmax(0, 1fr) 18rem; gap: 2rem; }
}

.eb-snapshot {
    background: var(--eb-card);
    border: 1px solid var(--eb-border);
    border-radius: 0.75rem;
    padding: 2rem 2.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.eb-snapshot__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--eb-border);
}
.eb-snapshot__parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}
.eb-snapshot__meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    background: var(--eb-soft);
    border-radius: 0.5rem;
}
.eb-snapshot__phase { margin-bottom: 1.25rem; }
.eb-snapshot__phase-name {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--eb-accent);
}
.eb-snapshot__items {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.eb-snapshot__items th,
.eb-snapshot__items td {
    padding: 0.625rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--eb-border);
}
.eb-snapshot__items th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--eb-muted);
    font-weight: 600;
}
.eb-snapshot__items td.eb-pv__num,
.eb-snapshot__items th.eb-pv__num { text-align: right; }
.eb-snapshot__subtotal { font-weight: 600; color: var(--eb-text-strong); }
.eb-snapshot__totals {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--eb-border);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    font-size: 0.875rem;
}
.eb-snapshot__totals > div {
    display: grid;
    grid-template-columns: auto 8rem;
    gap: 1.5rem;
    min-width: 16rem;
}
.eb-snapshot__grand {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--eb-accent);
    padding-top: 0.5rem;
    border-top: 1px solid var(--eb-border);
    margin-top: 0.375rem;
}
.eb-snapshot__terms {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--eb-border);
    display: grid;
    gap: 1rem;
}
.eb-snapshot__terms h3 {
    margin: 0 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--eb-muted);
}
.eb-snapshot__terms p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--eb-text);
    white-space: pre-wrap;
    line-height: 1.55;
}

.eb-sidebar {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.eb-sidebar__card {
    background: var(--eb-card);
    border: 1px solid var(--eb-border);
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
}
.eb-sidebar__card h3 {
    margin: 0 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--eb-muted);
}
.eb-sidebar__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.eb-sidebar__actions form { margin: 0; }

.eb-locked-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

/* ── Editorial close ─────────────────────────────────────────────── */
.eb-cta {
    margin-top: 5rem;
    padding: 3rem 2rem 3.25rem;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    border-top: 1px solid var(--eb-border);
    border-bottom: 1px solid var(--eb-border);
}
@media (min-width: 760px) {
    .eb-cta {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        padding: 4rem 0 4.25rem;
        gap: 0;
    }
}
.eb-cta__mark {
    font-family: var(--eb-serif);
    font-size: 7rem;
    line-height: 0.7;
    color: var(--eb-accent);
    opacity: 0.55;
    font-weight: 500;
    user-select: none;
}
.eb-cta__inner { max-width: 48rem; }
.eb-cta__quote {
    margin: 0 0 2rem;
    font-family: var(--eb-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: var(--eb-text-strong);
}
.eb-cta__quote-em {
    font-style: italic;
    background: linear-gradient(180deg, transparent 65%, rgba(79, 70, 229, 0.16) 65%, rgba(79, 70, 229, 0.16) 92%, transparent 92%);
    padding: 0 0.06em;
}
.eb-cta__byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.eb-cta__byline .eb-btn {
    background: var(--eb-text-strong);
    color: #f6f5f1;
    padding: 0.875rem 1.5rem;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(11, 11, 13, 0.16);
}
.eb-cta__byline .eb-btn:hover { background: #000; }
.eb-cta__fine {
    color: var(--eb-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.005em;
}

.eb-party {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem;
    border: 1px solid var(--eb-border, #e5e7eb);
    border-radius: 8px;
    background: #fafbfc;
}
.eb-party__heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--eb-muted, #6b7280);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--eb-border, #e5e7eb);
    margin-bottom: 0.25rem;
}
