/* =============================================================================
   yaksign.css
   Application-level styles for the YakSign admin/sender app and signer app.
   PdfAnnotationOverlay.css handles the annotation widget styles separately.
   ============================================================================= */

/* ── Design tokens ──────────────────────────────────────────────────────────────
   YakSign now rides the shared yw-theme.css system (loaded just before this
   file): the neutral light/dark surfaces + the whole yw-* re-skin come from
   there. Here we only set the YakSign BLUE→INDIGO gradient accent (dark-first)
   and ALIAS YakSign's legacy --color-* / --ys-* tokens onto the design tokens,
   so the 2,500 lines of app CSS below follow the theme without per-rule edits.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* non-colour tokens kept */
    --ys-content-max: 1120px;
    --radius-sm: 4px;  --radius-md: 6px;  --radius-lg: 10px;
    --panel-width: 280px;
    --footer-accent: #93b4fb;   /* bright blue link-hover on the dark footer */

    /* typography — Cormorant Garamond (display) + Mulish (body) */
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body:    "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-sans:    var(--font-body);
}

/* —— accents + legacy-token aliases: LIGHT —— */
html.yw-light {
    --accent:          #3b82f6;
    --accent-strong:   #2563eb;
    --accent-soft:     #93c5fd;
    --accent-contrast: #ffffff;
    --accent-tint:     rgba(59,130,246,0.12);
    --accent-ink:      #2563eb;
    /* White ink needs BOTH stops below 4.5, and both were above it: 3.68:1 on
       rgb(59,130,246) and 4.47:1 on rgb(99,102,241). The light stop is where the
       label actually sits, which is why the CTA measured 3.68 in production. */
    --accent-gradient:       linear-gradient(135deg in srgb, rgb(51,114,216) 0%, rgb(97,99,236) 100%);
    --accent-gradient-hover: linear-gradient(135deg in srgb, rgb(37,99,235) 0%, rgb(79,70,229) 100%);

    --color-primary: var(--accent);  --color-primary-dark: var(--accent-strong);
    --color-text: var(--text);  --color-muted: var(--text-muted);  --color-border: var(--surface-border);
    --color-bg: var(--bg);  --color-white: var(--surface);
    --color-danger: #b91c1c;  --color-success: #059669;  --color-warning: #d97706;
    /* semantic tint fills for chips/badges/hint boxes — light theme (solid pastels) */
    --tint-neutral: #f3f4f6;  --tint-info: #eff6ff;  --tint-success: #dcfce7;
    --tint-warning: #fef3c7;  --tint-danger: #fef2f2;  --tint-purple: #eef2ff;
    /* Recessed fill (table headers, read-only inputs). Was referenced but never defined,
       so every use fell back to a near-white literal under light ink in dark mode. */
    --color-bg-subtle: #f7fafc;
    --ys-navy: var(--nav-bg);  --ys-navy-deep: var(--footer-bg);  --ys-accent-light: var(--accent-ink);
}
/* —— accents + aliases: DARK (blue brightens; fill keeps white ink) —— */
html.yw-dark {
    --accent:          #60a5fa;
    --accent-strong:   #93c5fd;
    --accent-soft:     #3b82f6;
    --accent-contrast: #ffffff;
    --accent-tint:     rgba(96,165,250,0.16);
    --accent-ink:      #93b4fb;
    /* White ink needs BOTH stops below 4.5, and both were above it: 3.68:1 on
       rgb(59,130,246) and 4.47:1 on rgb(99,102,241). The light stop is where the
       label actually sits, which is why the CTA measured 3.68 in production. */
    --accent-gradient:       linear-gradient(135deg in srgb, rgb(51,114,216) 0%, rgb(97,99,236) 100%);
    /* Was rgb(96,165,250)/rgb(129,140,248): hover LIGHTENED the fill under white
       ink, down to 2.54:1. Darkens on hover now, as the light theme already did. */
    --accent-gradient-hover: linear-gradient(135deg in srgb, rgb(37,99,235) 0%, rgb(79,70,229) 100%);

    --color-primary: var(--accent);  --color-primary-dark: var(--accent-strong);
    --color-text: var(--text);  --color-muted: var(--text-muted);  --color-border: var(--surface-border);
    --color-bg: var(--bg);  --color-white: var(--surface);
    --color-danger: #ff7b6e;  --color-success: #7fdba4;  --color-warning: #e3c171;
    /* semantic tint fills — dark theme (subtle translucent washes over --surface) */
    --tint-neutral: rgba(148,164,190,0.12);  --tint-info: rgba(96,165,250,0.16);
    --tint-success: rgba(127,219,164,0.15);  --tint-warning: rgba(227,193,113,0.15);
    --tint-danger: rgba(255,123,110,0.15);   --tint-purple: rgba(129,140,248,0.16);
    --color-bg-subtle: rgba(148,164,190,0.12);
    --ys-navy: var(--nav-bg);  --ys-navy-deep: var(--footer-bg);  --ys-accent-light: var(--accent-ink);
}

/* type tuning for Cormorant + Mulish */
body { font-size: 1.0625rem; line-height: 1.7; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.005em; }
::selection { background: var(--accent-tint); }

/* ── Reset / Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
}

/* ── Shared helpers ──────────────────────────────────────────────────────── */
.page-heading {
    display: block;
    font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
    font-weight: 700;
    margin: 24px 0 12px;
}

.section-heading {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-muted);
    margin: 16px 0 6px;
}

/* Team-invite row: email + role + button on one line, wrapping on narrow screens. */
.team-invite-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}
.team-invite-row input { flex: 1 1 240px; min-width: 0; }

/* Saved-contacts management list */
.contacts-list { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--color-border); }
.contact-label { min-width: 0; overflow-wrap: anywhere; }

/* Billing history (Stripe invoices) */
.billing-history-list { display: flex; flex-direction: column; gap: 2px; margin: 6px auto; max-width: 520px; text-align: left; }
.billing-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.billing-history-status { color: var(--color-muted); font-size: 0.8125rem; white-space: nowrap; }

.input-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-muted);
    margin: 8px 0 2px;
}

.empty-state {
    color: var(--color-muted);
    font-style: italic;
    padding: 24px 0;
}
.empty-state-small {
    color: var(--color-muted);
    font-style: italic;
    font-size: 0.9375rem;
}

.error-message {
    color: var(--color-danger);
    font-weight: 500;
    padding: 16px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-primary:hover   { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg); }

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}
.btn-danger:hover { background: #b91c1c; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-draft     { color: var(--color-muted);   }
.status-sent      { color: var(--color-warning);  }
.status-expired   { color: var(--color-danger);   }
.status-completed { color: var(--color-success);  }
.status-voided    { color: var(--color-danger);   }
.status-declined  { color: var(--color-danger);   }

/* ══════════════════════════════════════════════════════════════════════════
   Documents page
   ══════════════════════════════════════════════════════════════════════════ */
.documents-page { padding: 0 24px 40px; }

.documents-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.envelope-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.envelope-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.envelope-title {
    flex: 1;
    font-weight: 500;
}

.envelope-status {
    font-size: 0.9375rem;
    font-weight: 600;
    min-width: 72px;
}

.envelope-date {
    font-size: 0.9375rem;
    color: var(--color-muted);
    min-width: 90px;
}

.envelope-actions {
    display: flex;
    gap: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   Prepare page
   ══════════════════════════════════════════════════════════════════════════ */
.prepare-page { padding: 0 24px 40px; }

.prepare-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.prepare-left-panel {
    width: var(--panel-width);
    min-width: var(--panel-width);
    overflow-y: auto;
    padding: 0 16px 24px;
    border-right: 1px solid var(--color-border);
    background: var(--color-white);
}

.prepare-center {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
    background: var(--color-bg);
}

/* Signers */
.signer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.signer-list-item {
    display: block;
    font-size: 0.9375rem;
    padding: 4px 6px;
    background: var(--tint-info);
    border-radius: var(--radius-sm);
    color: var(--color-primary-dark);
}

.signer-email-input,
.signer-name-input,
.signer-select,
.envelope-title-input,
.page-number-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    margin-bottom: 6px;
}

/* Annotation type toolbar */
.annotation-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.annotation-type-btn {
    padding: 4px 10px;
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    color: var(--color-text); /* the shared base stylesheet paints button text white */
    cursor: pointer;
}

.annotation-type-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.page-number-input { width: 70px; }

.add-field-btn { margin-top: 8px; }

.send-btn { margin-top: 20px; width: 100%; }

.send-success {
    display: block;
    font-weight: 600;
    color: var(--color-success);
    margin-top: 12px;
}

.send-hint {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-muted);
    margin: 8px 0 4px;
}

.signing-link {
    display: block;
    font-size: 0.875rem;
    font-family: monospace;
    background: var(--tint-neutral);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    margin-bottom: 4px;
}

/* Upload panel */
.upload-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 480px;
    box-shadow: var(--shadow-sm);
}

.pdf-upload-input { margin: 10px 0; }
/* Import-from-cloud row (Dropbox / Google Drive / OneDrive). */
.ys-cloud-import { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 6px; }
.ys-cloud-label { margin: 0 2px 0 0; }
.ys-cloud-btn { white-space: nowrap; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.upload-doc-status { font-weight: 500; }
.upload-doc-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.upload-doc-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-white); }
.upload-doc-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ══════════════════════════════════════════════════════════════════════════
   PDF scroll viewer (shared between admin and signer views)
   ══════════════════════════════════════════════════════════════════════════ */
.pdf-scroll-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.pdf-page-image {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════════════════════════════════
   Signer application layout
   ══════════════════════════════════════════════════════════════════════════ */
.signer-root { height: 100vh; display: flex; flex-direction: column; }

/* Consent screen */
.signer-consent-screen {
    max-width: 560px;
    margin: 60px auto;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.signer-consent-heading {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.signer-consent-doc-name {
    display: block;
    font-size: 1rem;
    margin-bottom: 16px;
}

.signer-consent-text {
    display: block;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 24px;
}

.signer-consent-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-bottom: 8px;
}

.signer-decline-btn,
.signer-reassign-btn {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    cursor: pointer;
    text-align: center;
    margin-top: 8px;
}
.signer-decline-btn:hover,
.signer-reassign-btn:hover { background: var(--color-bg); }
.signer-reassign-form { max-width: 480px; margin: 0 auto; }
.signer-reassign-form .signer-text-input { width: 100%; margin-bottom: 6px; }

/* Signing layout */
.signer-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.signer-sidebar {
    width: var(--panel-width);
    min-width: var(--panel-width);
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    overflow-y: auto;
    box-shadow: 2px 0 6px rgba(0,0,0,.04);
}

.signer-sidebar-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    word-break: break-word;
}

.signer-sidebar-label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-top: 8px;
}

.signer-sidebar-email {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-primary-dark);
    word-break: break-all;
}

.signer-sidebar-name {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-muted);
}

.signer-sidebar-hint {
    display: block;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin: 10px 0 4px;
}

/* Field list */
.signer-field-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 16px;
}

.signer-field-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}

.field-status {
    font-size: 1rem;
    flex-shrink: 0;
}

.field-status--pending { color: var(--color-muted); }
.field-status--done    { color: var(--color-success); }

.signer-field-link {
    font-size: 0.9375rem;
    color: var(--accent-ink);
    cursor: pointer;
    flex: 1;
    text-decoration: underline;
}
.signer-field-link:hover { color: var(--color-primary-dark); }

/* Complete button */
.signer-complete-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: auto;
}

/* Main PDF area */
.signer-main-area {
    flex: 1;
    overflow-y: auto;
    background: var(--color-bg);
    padding: 12px 24px;
}

.signer-scroll-viewer { max-width: 900px; margin: 0 auto; }

/* ── Signer annotation widgets ───────────────────────────────────────────── */
.signer-annotation {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed var(--color-primary);
    border-radius: 3px;
    background: rgba(59,130,246,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    z-index: 20;
}

.signer-annotation:hover {
    border-color: var(--color-primary-dark);
    background: rgba(59,130,246,0.15);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.signer-annotation.required { border-color: #ef4444; background: rgba(239,68,68,.07); }
.signer-annotation.required:hover { border-color: #dc2626; background: rgba(239,68,68,.14); }

.signer-annotation--filled {
    border-style: solid;
    border-color: var(--color-success) !important;
    background: rgba(5,150,105,0.1) !important;
}

.signer-annotation--unfilled {}

/* Type-specific colours */
.signer-annotation.signature  { border-color: #7c3aed; background: rgba(124,58,237,.07); }
.signer-annotation.initials   { border-color: #0891b2; background: rgba(8,145,178,.07); }
.signer-annotation.date       { border-color: #059669; background: rgba(5,150,105,.07); }
.signer-annotation.textfield  { border-color: #d97706; background: rgba(217,119,6,.07); }
.signer-annotation.checkbox   { border-color: #dc2626; background: rgba(220,38,38,.07); }
.signer-annotation.dropdown   { border-color: #2563eb; background: rgba(37,99,235,.07); }
.signer-annotation.radio      { border-color: #6d28d9; background: rgba(109,40,217,.07); }
.signer-annotation.attachment { border-color: #b45309; background: rgba(180,83,9,.07); }

/* Radio-group input inside the signer fill dialog */
.signer-radio-group { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.signer-radio-group label { font-weight: 400; }
/* Sender's per-field options textarea (Dropdown / Radio) */
.field-options-input { width: 100%; min-height: 64px; resize: vertical; }
/* Bulk-send CSV textarea */
.bulk-csv-input { width: 100%; min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.875rem; }

.signer-annotation-placeholder {
    font-size: 10px;
    color: var(--color-muted);
    text-align: center;
    user-select: none;
    pointer-events: none;
}

.signer-annotation-value {
    font-size: 11px;
    font-weight: 500;
    color: #111;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

/* ── Signer fill dialog ───────────────────────────────────────────────────── */
.signer-dialog-hint {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-muted);
    margin-bottom: 10px;
}

.signer-text-input,
.signer-date-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    margin-bottom: 4px;
}

/* ── Status / completion pages ────────────────────────────────────────────── */
.signer-status-page {
    max-width: 480px;
    margin: 80px auto;
    padding: 32px;
    text-align: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-size: 1rem;
    line-height: 1.7;
}

.signer-error { border-color: #fca5a5; }
.signer-info  { border-color: #93c5fd; }

.signer-complete {
    border-color: #6ee7b7;
    border-left: 4px solid var(--color-success);
}

.signing-complete-heading {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: 12px;
}

.signing-complete-message {
    display: block;
    color: var(--color-text);
}

/* ── Verification gates (access code / SMS OTP) & PowerForm capture ──────────── */
.access-code-input {
    width: 100%;
    max-width: 320px;
    margin: 8px auto 4px;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.access-code-prompt { display: block; font-size: 1.0625rem; margin-bottom: 8px; }
.access-code-error  { display: block; color: #b91c1c; font-size: 0.9375rem; margin: 6px 0; min-height: 1.2em; }
.sms-otp-gate .btn-secondary { margin-top: 8px; }

/* PowerForm minting dialog: readable, one-gesture-copy link rows. */
.ys-powerform-links { margin-top: 14px; }
.ys-powerform-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    flex-wrap: wrap;
}
.ys-powerform-url {
    flex: 1;
    min-width: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle, #f8f8fb);
}
.ys-powerform-url.is-disabled { opacity: 0.55; }

/* ── YakSign home page (logged-out) ──────────────────────────────────────── */
.yaksign-home {
    max-width: 560px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
}

.yaksign-home-heading {
    display: block;
    font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.5rem);
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 24px;
}

.yaksign-sso-label {
    display: block;
    color: var(--color-muted);
    margin-bottom: 10px;
}

/* ── Account page ─────────────────────────────────────────────────────────── */
.yaksign-account-page { padding: 0 24px 40px; max-width: 760px; }

/* ── Enterprise: crypto-signature annotation (signer view) ────────────────── */
.signer-annotation.crypto-signature {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.08);
}

/* Toolbar: disabled enterprise-only button */
.annotation-type-btn.enterprise-only {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Crypto signature dialog sections */
.crypto-dialog-section {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.crypto-dialog-section:last-child { border-bottom: none; }

.cert-details {
    font-size: 0.9375rem;
    font-family: monospace;
    white-space: pre-wrap;
    background: var(--tint-neutral);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin: 6px 0;
    word-break: break-all;
}

.p12-upload-input { margin: 6px 0; }

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

/* ── Routing groups ───────────────────────────────────────────────────────── */
.routing-group-heading {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    padding: 6px 0 2px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
}
.routing-group-heading:first-child { border-top: none; margin-top: 0; }

.group-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
}

.group-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-primary);
}

.btn-sm {
    font-size: 0.875rem;
    padding: 3px 8px;
}

.routing-hint {
    font-size: 0.9375rem;
    background: var(--tint-info);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin: 6px 0;
}

.send-hint--muted {
    color: var(--color-muted);
    font-size: 0.9375rem;
}

/* ── Requests page ────────────────────────────────────────────────────────── */
.requests-page { padding: 0 24px 48px; max-width: 900px; }

.requests-result-count {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-muted);
    margin: 0 0 12px;
}

/* Filter bar */
.requests-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.filter-pill-row { display: flex; flex-wrap: wrap; gap: 16px; }

.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-muted);
    margin-right: 2px;
    white-space: nowrap;
}

.filter-pill {
    font-size: 0.875rem;
    padding: 3px 10px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.filter-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.filter-search-row { display: flex; gap: 8px; align-items: center; }

.requests-search-input {
    flex: 1;
    max-width: 320px;
    padding: 5px 10px;
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.requests-search-input:focus { outline: none; border-color: var(--color-primary); }

/* Request cards */
.requests-list { display: flex; flex-direction: column; gap: 12px; }

.request-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.request-card--draft      { border-left-color: var(--color-muted); }
.request-card--sent       { border-left-color: var(--color-primary); }
.request-card--expired    { border-left-color: var(--color-warning); background: var(--tint-warning); }
.request-card--completed  { border-left-color: var(--color-success); }
.request-card--voided     { border-left-color: #d1d5db; opacity: 0.65; }
.request-card--declined   { border-left-color: var(--color-danger); }

.request-expiry {
    font-size: 0.8125rem;
    color: var(--color-muted);
    white-space: nowrap;
}
.request-expiry--past {
    color: var(--color-danger);
    font-weight: 600;
}

.extend-notify-check {
    display: block;
    margin-top: 12px;
    font-size: 0.9375rem;
}

.request-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.request-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-date {
    font-size: 0.875rem;
    color: var(--color-muted);
    white-space: nowrap;
    margin-left: auto;
}

/* Progress bar */
.request-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.request-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--tint-neutral);
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
}

.request-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s;
}
.request-card--completed .request-progress-fill { background: var(--color-success); }

.request-progress-label {
    font-size: 0.875rem;
    color: var(--color-muted);
    white-space: nowrap;
}

/* Signer list inside card */
.request-signer-section { margin-bottom: 10px; }

.request-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
}

.request-signer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 4px;
    font-size: 0.9375rem;
}

.signer-dot {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.signer-dot--signed  { color: var(--color-success); }
.signer-dot--pending { color: var(--color-muted); }
.signer-dot--waiting { color: #d1d5db; }

.signer-row-email {
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signer-timestamp {
    font-size: 0.875rem;
    color: var(--color-success);
    white-space: nowrap;
    margin-left: auto;
}

.signer-waiting-note {
    font-size: 0.875rem;
    color: var(--color-muted);
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
}

.group-status-chip {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 7px;
    border-radius: 10px;
}
.group-status-chip--complete { background: var(--tint-success); color: var(--color-success); }
.group-status-chip--signing  { background: var(--tint-info); color: var(--color-primary); }
.group-status-chip--waiting  { background: var(--tint-neutral); color: var(--color-muted); }

.request-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.btn-danger-text {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s;
}
.btn-danger-text:hover { background: var(--tint-danger); }

.routing-group-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--tint-info);
    color: var(--color-primary);
    border-radius: 12px;
    padding: 1px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Kebab menu ─────────────────────────────────────────────────────────── */

.kebab-btn {
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
}
.kebab-btn:hover { color: var(--color-text); background: var(--color-border); }

/* ── Dialog helpers ─────────────────────────────────────────────────────── */

.dialog-hint {
    display: block;
    font-size: 1rem;
    color: var(--color-muted);
    margin-bottom: 10px;
}

.dialog-input,
.signing-link-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
}

.signing-link-input {
    font-family: monospace;
    font-size: 0.9375rem;
    background: var(--color-white);
    color: var(--color-text);
}

.dialog-error {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-danger);
    margin-top: 4px;
    min-height: 1em;
}

/* ================================================================
   YakSign marketing page styles (ygsign-* prefix)
   Shared design-system classes (yg-*) live in yk-marketing.css
   ================================================================ */

/* ── Document preview hero mockup ─────────────────────────────── */

.ygsign-hero-doc {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.07);
    width: 340px;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.82rem;
}

.ygsign-doc-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid #e5e7eb;
}

.ygsign-doc-icon {
    width: 20px;
    height: 24px;
    background: var(--color-primary, #3b5bdb);
    border-radius: 3px;
    opacity: 0.85;
    flex-shrink: 0;
    position: relative;
}

.ygsign-doc-icon::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    height: 2px;
    background: rgba(255,255,255,0.7);
    box-shadow: 0 4px 0 rgba(255,255,255,0.7), 0 8px 0 rgba(255,255,255,0.7);
}

.ygsign-doc-name {
    font-weight: 600;
    color: #374151;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ygsign-doc-pill {
    font-size: 0.75rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ygsign-doc-body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ygsign-text-line {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
}

.ygsign-line-full { width: 100%; }
.ygsign-line-lg   { width: 78%; }
.ygsign-line-md   { width: 55%; }
.ygsign-line-sm   { width: 35%; }

.ygsign-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ygsign-field-row .ygsign-text-line {
    flex: 1;
}

.ygsign-field-badge {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 3px 7px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.ygsign-badge-sig {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

.ygsign-badge-date {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.ygsign-badge-text {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.ygsign-doc-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #f0f0f2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ygsign-signers {
    display: flex;
    gap: 4px;
}

.ygsign-signer-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d1d5db;
}

/* The initials inside these dots are 9.92px, so they need the 4.5 minimum, not the
   3.0 large-text one. White on #059669 measured 3.77:1 and #6b7280 on #f3f4f6
   measured 4.39:1; both are darkened just enough, keeping the hue. */
.ygsign-dot-done {
    background: #047857;
    color: #fff;
    box-shadow: 0 0 0 1px #047857;
}

.ygsign-dot-wait {
    background: #f3f4f6;
    color: #565f6c;
}

.ygsign-progress-wrap {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.ygsign-progress-fill {
    height: 100%;
    background: #059669;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Feature card icons ────────────────────────────────────────── */

.ygsign-feat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin-bottom: 12px;
    background: var(--color-primary, #3b5bdb);
    opacity: 0.85;
    position: relative;
}

.ygsign-icon-fields  { background: #6d28d9; }
.ygsign-icon-route   { background: #0891b2; }
.ygsign-icon-track   { background: #059669; }
.ygsign-icon-audit   { background: #d97706; }
.ygsign-icon-pdf     { background: #dc2626; }
.ygsign-icon-cert    { background: #1d4ed8; }

/* ── SSO entry on home page ────────────────────────────────────── */

.ygsign-sso-entry {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.ygsign-sso-label {
    display: block;
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}


/* ── Templates page ─────────────────────────────────────────────────────── */
.templates-page { padding: 0 24px 48px; max-width: 900px; }
.templates-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.template-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.template-title { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.template-meta, .template-roles { display: block; color: var(--color-muted); font-size: 0.9375rem; margin-bottom: 6px; }
.template-actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); }
.template-pick-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.template-pick-name { flex: 1; font-weight: 600; }
.role-email-input, .template-name-input { width: 100%; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.role-map-heading { display: block; color: var(--color-muted); font-size: 0.9375rem; margin: 12px 0 8px; }

/* ── Operations readiness ───────────────────────────────────────────────── */
.section-subheading { display: block; font-weight: 700; margin: 8px 0; }
.ops-check-list { display: flex; flex-direction: column; gap: 6px; }
.ops-check-row {
    display: grid;
    grid-template-columns: 54px minmax(120px, 1fr) 2fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
}
.ops-check-state { font-size: 0.8125rem; font-weight: 800; text-align: center; border-radius: 10px; padding: 2px 6px; }
.ops-check-row--ok .ops-check-state { background: var(--tint-success); color: var(--color-success); }
.ops-check-row--warn .ops-check-state { background: var(--tint-warning); color: var(--color-warning); }
.ops-check-label { font-weight: 600; font-size: 0.9375rem; }
.ops-check-detail { color: var(--color-muted); font-size: 0.9375rem; word-break: break-word; }

/* Production-seal warning: shown to account admins when YAKSIGN_PLATFORM_P12_BASE64 is unset, so
   completed documents are being sealed with an ephemeral per-restart certificate. Not dismissible
   by design — dismissible warnings get dismissed, and this one is why /verify has to tell every
   recipient the seal is a development certificate. */
.yaksign-seal-warning {
    display: block;
    margin: 0 0 20px;
    padding: 14px 18px;
    border: 1px solid var(--color-danger, #b42318);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--tint-danger, rgba(180, 35, 24, 0.08));
    color: var(--color-danger, #b42318);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   Responsive — phones & small tablets
   The signer ceremony is the surface most often opened on a phone (the signer
   never chose the device); the layout stacks, the field checklist becomes a
   horizontal strip, and the Complete button stays within thumb reach.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Sender app pages ── */
    .documents-page, .prepare-page, .requests-page, .yaksign-account-page {
        padding: 0 12px 32px;
    }

    .documents-toolbar { flex-wrap: wrap; gap: 8px; }

    .envelope-row     { flex-wrap: wrap; gap: 6px; }
    .envelope-actions { width: 100%; justify-content: flex-start; }

    .prepare-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .prepare-left-panel {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    .prepare-center { padding: 12px; }

    .yaksign-home { padding: 24px 16px; margin: 24px auto; }

    /* The shared yk-marketing hero is a side-by-side flex row; stack it on
       phones or the copy column collapses to zero width. */
    .yg-hero { flex-direction: column; }
    .yg-hero-content, .yg-hero-visual { width: 100%; flex: 1 1 auto; }

    /* ── Signer ceremony ── */
    .signer-root   { height: auto; min-height: 100vh; }
    .signer-layout { flex-direction: column; overflow: visible; }

    .signer-sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        box-shadow: none;
        padding: 12px;
    }

    /* Field checklist collapses to a swipeable strip. */
    .signer-field-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        margin: 8px 0;
        -webkit-overflow-scrolling: touch;
    }
    .signer-field-item { flex: 0 0 auto; }

    /* Keep the primary action within thumb reach. */
    .signer-complete-btn {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        z-index: 50;
        box-shadow: var(--shadow-md);
    }
    .signer-main-area {
        overflow: visible;
        padding: 8px 8px 96px; /* room for the fixed Complete button */
    }

    .signer-consent-screen {
        margin: 16px 12px;
        padding: 20px;
        max-width: none;
    }

    /* ── Dialogs ── */
    /* The create/template modals set a fixed px width via WDialog.resize()
       (420–460px), which overflows a phone. Pin the dialog to the viewport
       gutters and override the inline width/centering so it can never extend
       off-screen; let the body scroll if its content is intrinsically wider. */
    .Wt-dialog {
        left: 3vw !important;
        right: 3vw !important;
        width: auto !important;
        max-width: 94vw !important;
        transform: none !important;
        margin-left: 0 !important;
        box-sizing: border-box;
    }
    .Wt-dialog .body,
    .Wt-dialog .Wt-dialog-body {
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }
    /* form controls inside dialogs go fluid so they don't force overflow */
    .Wt-dialog input, .Wt-dialog select, .Wt-dialog textarea,
    .envelope-title-input, .role-email-input {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Signature dialog footer: the legal line goes full-width so the
       Insert/Cancel buttons wrap onto their own row instead of overflowing. */
    .ys-sig-legal { display: block; max-width: 100%; margin: 0 0 8px; }

    /* ── Touch targets (WCAG 2.5.8) ── */
    .btn-primary, .btn-secondary, .btn-danger, .annotation-type-btn,
    .signer-consent-btn, .signer-decline-btn {
        min-height: 44px;
    }
    .btn-sm { min-height: 0; }
    .signer-field-item { min-height: 40px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Pricing page (tiers mirror SignPlanLimits — keep in sync)
   ══════════════════════════════════════════════════════════════════════════ */
.ys-pricing-hero .yg-hero-content { max-width: 720px; }

.ys-pricing-reassure {
    color: var(--color-muted);
    font-size: 1rem;
    margin-top: 12px;
}

.ys-pricing-teaser-sub {
    color: var(--color-muted);
    max-width: 560px;
    margin: 8px 0 16px;
}

.ys-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    align-items: stretch;
    margin: 24px 0 12px;
}

.ys-price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

.ys-price-card-popular {
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-md);
}

.ys-price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.ys-price-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.ys-price-amount {
    font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem);
    font-weight: 800;
    margin: 0;
}

.ys-price-note {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-muted);
}

.ys-price-persona {
    font-size: 0.9375rem;
    color: var(--color-muted);
    margin: 6px 0 14px;
    min-height: 2.4em;
}

.ys-price-cta { width: 100%; text-align: center; }

.ys-price-features {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9375rem;
}

.ys-price-features li {
    padding-left: 22px;
    position: relative;
}

.ys-price-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 700;
}

.ys-pricing-footnote {
    text-align: center;
    color: var(--color-muted);
    font-size: 0.9375rem;
    margin-top: 16px;
}

.ys-pricing-faq { max-width: 720px; }

.ys-faq-q {
    font-size: 1rem;
    font-weight: 700;
    margin: 20px 0 6px;
}

.ys-faq-a {
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    /* Shared marketing sections keep 48px desktop gutters by default, which
       made pricing cards unnecessarily narrow on phones. */
    .yg-section {
        padding: 56px 20px;
    }
    .ys-pricing-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .ys-price-card {
        width: 100%;
        box-sizing: border-box;
    }

    /* Text links used as primary mobile actions need a reliable touch target. */
    .yg-hero-note, .yg-cta-link, .yw-footer a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

/* ── Plan usage card (dashboard / account) ─────────────────────────────────── */
.plan-usage-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 360px;
}

.plan-usage-plan { font-weight: 700; }

.plan-usage-line {
    font-size: 0.9375rem;
    color: var(--color-muted);
}

.plan-usage-upgrade { align-self: flex-start; margin-top: 8px; }

/* ── Account settings: group each section into a card ──────────────────────────
   The account page was a flat stack of bare headings + widgets that blended into
   one wall of text. Wrapping each section (see buildAccountPage) in .account-section
   gives every group a distinct panel with breathing room. */
.account-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    margin: 0 0 18px;
}
.account-section > .section-heading:first-child { margin-top: 0; }
/* PlanUsageWidget renders its own inner card; flatten it inside a section so we
   don't nest a card in a card. */
.account-section .plan-usage-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

/* Section hint paragraphs render as bare inline WText — make them block, muted,
   and spaced so they read as descriptions, not run-on text. */
.section-hint {
    display: block;
    color: var(--color-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 2px 0 12px;
}

/* Shared UserRoleManagerWidget appends bare WText (inline <span>) headings/hints;
   without these rules "User Roles" and its description ran together on one line. */
.user-role-manager-widget { display: block; }
.user-role-manager-heading {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin: 6px 0 2px;
}
.user-role-manager-hint {
    display: block;
    color: var(--color-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 10px;
}
.user-role-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
}
.user-role-row:last-child { border-bottom: 0; }
.user-role-header {
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: .04em;
}

/* Routable-but-hidden nav items (flow pages like Prepare). Hide via CSS, not
   setHidden(): WMenu skips Wt-hidden items when resolving internal paths. */
.nav-item-hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   Send wizard (Upload → Recipients → Place fields → Review & send)
   ══════════════════════════════════════════════════════════════════════════ */
.ys-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px 0 20px;
}

.ys-step-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    user-select: none;
}

.ys-step-chip--current {
    border-color: var(--color-primary);
    background: var(--tint-info);
}
.ys-step-chip--current .ys-step-num { background: var(--color-primary); }
.ys-step-chip--current .ys-step-label { color: var(--color-primary-dark); font-weight: 700; }

.ys-step-chip--reachable { cursor: pointer; }
.ys-step-chip--reachable:hover { background: var(--color-bg); }

.ys-step-chip--disabled { opacity: .55; }

.ys-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-muted);
    color: var(--color-white);
    font-size: 0.8125rem;
    font-weight: 700;
}

.ys-step-label { font-size: 0.9375rem; }

.ys-step-dash { color: var(--color-border); }

.ys-step-pane { padding-bottom: 16px; }

.ys-wizard-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}
.ys-wizard-footer .btn-primary { margin-left: auto; }

/* Recipients step */
.ys-recipients-pane { max-width: 640px; }

.ys-signer-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.ys-signer-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.ys-signer-card-title { flex: 1; font-size: 1rem; word-break: break-all; }

.ys-cc-chip {
    background: var(--tint-purple);
    color: var(--color-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.ys-add-recipient-form {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    max-width: 480px;
}

.ys-add-recipient-heading { margin-top: 0; }

/* Review step */
.ys-review-pane { max-width: 640px; }

.ys-review-summary {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.ys-review-line { font-size: 1rem; }
.ys-review-fields { color: var(--color-muted); font-size: 0.9375rem; }

.ys-review-message {
    width: 100%;
    min-height: 90px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-sans);
}

.ys-quota-note { font-weight: 600; color: var(--color-warning); }

/* ══════════════════════════════════════════════════════════════════════════
   Dashboard
   ══════════════════════════════════════════════════════════════════════════ */
.ys-bucket-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 16px 0 20px;
    /* Five status buckets: 5×150 + 4×14 gap ≈ 806px, so a 760px cap forced the
       fifth card to wrap onto its own row. Widen just enough to keep all five on
       one row on desktop; auto-fit still wraps gracefully on narrow screens. */
    max-width: 820px;
}

.ys-bucket-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
.ys-bucket-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }

.ys-bucket-num {
    display: block;
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
    font-weight: 800;
    line-height: 1.1;
}

.ys-bucket-label {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-muted);
    margin-top: 2px;
}

.ys-bucket--draft     .ys-bucket-num { color: var(--color-warning); }
.ys-bucket--sent      .ys-bucket-num { color: var(--color-primary-dark); }
.ys-bucket--expired   .ys-bucket-num { color: var(--color-danger); }
.ys-bucket--completed .ys-bucket-num { color: var(--color-success); }
.ys-bucket--voided    .ys-bucket-num { color: var(--color-muted); }
.ys-bucket--declined  .ys-bucket-num { color: var(--color-danger); }

.ys-dashboard-usage { margin: 4px 0 8px; }

/* Reports page metric cards */
.ys-metric-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 20px; }
.ys-metric-card {
    flex: 1 1 140px;
    min-width: 140px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    padding: 16px;
}
.ys-metric-num { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.ys-metric-label { display: block; font-size: 0.8125rem; color: var(--color-muted); margin-top: 4px; }
.ys-reports-footnote { margin-top: 12px; }

/* First-run onboarding checklist — a soft card that self-hides once complete. */
.ys-onboarding {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    /* Was `var(--color-bg-subtle, #f7fafc)` — that token is undefined, so it fell back
       to a hardcoded near-white in BOTH themes. In dark mode the light card made the
       light --color-text / --color-muted labels invisible (WCAG contrast fail). Use the
       theme surface token (matches the stat-tile cards, dark in dark mode). */
    background: var(--color-white);
    padding: 16px 18px;
    margin: 4px 0 16px;
}
.ys-onboarding-title { font-size: 1.0625rem; font-weight: 700; }
.ys-onboarding-progress { display: block; font-size: 0.8125rem; color: var(--color-muted); margin: 2px 0 10px; }
.ys-onboarding-list { display: flex; flex-direction: column; gap: 6px; }
.ys-onboarding-row { display: flex; align-items: center; gap: 10px; }
.ys-onboarding-check { font-weight: 700; width: 1.25rem; text-align: center; color: var(--color-muted); }
.ys-onboarding-row--done .ys-onboarding-check { color: var(--color-success); }
.ys-onboarding-row--done .ys-onboarding-label { color: var(--color-muted); text-decoration: line-through; }
.ys-onboarding-label { flex: 1; min-width: 0; }
.ys-onboarding-action { white-space: nowrap; }

.ys-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    max-width: 760px;
}

.ys-activity-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 9px 14px;
    border-bottom: 1px solid var(--color-border);
}
.ys-activity-row:last-child { border-bottom: none; }

/* min-width:0 lets this flex item shrink below its content width so the
   time column beside it can't be pushed off the right edge on narrow screens;
   overflow-wrap breaks long unbroken strings (e.g. emails) instead of overflowing. */
.ys-activity-text { flex: 1; min-width: 0; font-size: 0.9375rem; overflow-wrap: anywhere; }

.ys-activity-time {
    font-size: 0.875rem;
    color: var(--color-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* "View full activity →" — links the dashboard preview to the complete audit trail. */
.ys-activity-empty {
    display: block;
    margin-bottom: 8px;
}

.ys-activity-viewall {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: none;
}
.ys-activity-viewall:hover,
.ys-activity-viewall:focus { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   Adopt-signature dialog (Draw | Type)
   ══════════════════════════════════════════════════════════════════════════ */
.ys-sig-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 14px;
}

.ys-sig-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
}

.ys-sig-tab.active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary);
}

.ys-sig-canvas-wrap {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.ys-sig-canvas {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
    cursor: crosshair;
}

.ys-sig-baseline {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 34px;
    border-bottom: 1px solid var(--color-border);
    pointer-events: none;
}

.ys-sig-hidden-value { display: none; }

.ys-sig-clear { margin-top: 8px; }

.ys-sig-typed-input { width: 100%; margin-bottom: 10px; }

.ys-sig-style-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

/* Upload-a-signature tab */
.ys-sig-upload-pane { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.ys-sig-upload-hint { font-size: 0.875rem; color: var(--color-muted); }
.ys-sig-upload-preview {
    max-width: 100%;
    max-height: 140px;
    align-self: flex-start;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    padding: 6px;
}
.ys-sig-upload-status { font-size: 0.8125rem; color: var(--color-muted); }

/* Reuse a saved signature */
.ys-sig-saved-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; margin-bottom: 6px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.ys-sig-saved-preview { max-height: 48px; max-width: 180px; border: 1px solid var(--color-border); border-radius: 4px; background: #fff; padding: 2px; }
.ys-sig-saved-text { font-size: 0.875rem; color: var(--color-muted); }

.ys-sig-style-chip {
    padding: 4px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-white);
    cursor: pointer;
}

.ys-sig-style-chip.active {
    border-color: var(--color-primary);
    background: var(--tint-info);
    color: var(--color-primary-dark);
}

.ys-sig-type-preview {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 88px;
    font-size: 2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    padding: 0 16px 14px;
    overflow: hidden;
}

.ys-sig-legal {
    font-size: 0.8125rem;
    color: var(--color-muted);
    margin-right: auto;
    max-width: 230px;
    text-align: left;
}

.ys-sig-remember {
    display: block;
    flex-basis: 100%;
    width: 100%;
    margin: 4px 0 8px;
    color: var(--color-text);
    font-size: 0.875rem;
    text-align: left;
}

/* Drawn signature rendered inside the field box */
.signer-annotation-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Guided next-field navigation */
.ys-guide-btn { width: 100%; margin: 10px 0 2px; }

@keyframes ys-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(59,130,246,.55); }
    70%  { box-shadow: 0 0 0 12px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

.ys-field-pulse { animation: ys-pulse 0.8s ease-out 2; }

/* Adopt-signature dialog: responsive width that never overflows a phone. */
.ys-signature-dialog { width: min(94vw, 440px); }


/* ═══════════════════════════════════════════════════════════════════════════
   CHROME — navbar + footer + marketing reconciliation.

   These rules MUST win over the shared rsc/css/style.css, which loads before
   yaksign.css and paints the navbar with `!important` (#2c3e50 links, white
   header). yaksign.css loads last, so equal-or-higher specificity + !important
   out-ranks it. See YakSignApplication CSS load order.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Navigation bar — blue header (mirrors the yakdocs/yak-ware treatment) ─── */
.navbar.navbar-default {
    background-color: var(--ys-navy) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ys-navy-deep) !important;
    border-radius: 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 0;
}
/* style.css forces `.navbar-header, .navbar-collapse { background: white }` —
   override with higher specificity so the bar reads as one navy surface. */
.navbar.navbar-default .navbar-header,
.navbar.navbar-default .navbar-collapse,
.navbar.navbar-default .navbar-form {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, .15) !important;
}

.navbar.navbar-default .navbar-brand {
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0 18px;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -.01em;
    line-height: 60px;           /* base pins .navbar height: 60px */
}
.navbar.navbar-default .navbar-brand:hover,
.navbar.navbar-default .navbar-brand:focus { color: var(--ys-accent-light) !important; }

.navbar.navbar-default .navbar-nav > li > a {
    color: #cdd9ea !important;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .01em;
    padding: 20px 16px;
    background: transparent !important;
    position: relative;
    transition: color .2s ease;
}
.navbar.navbar-default .navbar-nav > li > a::after {
    content: "";
    position: absolute;
    left: 15px; right: 15px; bottom: 10px;
    height: 2px;
    background: var(--ys-accent-light);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}
.navbar.navbar-default .navbar-nav > li > a:hover,
.navbar.navbar-default .navbar-nav > li > a:focus { color: #ffffff !important; }
.navbar.navbar-default .navbar-nav > li > a:hover::after { transform: scaleX(1); }

/* Active item: the base style.css highlights it with a LIGHT (aliceblue)
   background, which left light text on a light fill — low contrast. Force a
   DARKENED pill (never lighter than the navy bar) with white text so contrast
   is always high. Cover both the Bootstrap `.active` li and JWt's `.Wt-selected`. */
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > li.active > a,
.navbar.navbar-default .navbar-nav > .Wt-selected > a,
.navbar.navbar-default .navbar-nav > .active > a:hover,
.navbar.navbar-default .navbar-nav > .active > a:focus,
.navbar.navbar-default .navbar-nav > li.active > a:hover,
.navbar.navbar-default .navbar-nav > li.active > a:focus {
    color: #ffffff !important;
    background-color: rgba(0, 0, 0, .22) !important;
    font-weight: 700 !important;
}
.navbar.navbar-default .navbar-nav > .active > a::after,
.navbar.navbar-default .navbar-nav > li.active > a::after,
.navbar.navbar-default .navbar-nav > .Wt-selected > a::after { transform: scaleX(1); }

/* ── Login / auth form ─────────────────────────────────────────────────────
   The shared framework auth widget (.Wt-auth-login) renders as a bare
   Bootstrap-3 horizontal form — floated col-sm-* labels, teal .btn-link / help
   text — which clashed with the rest of the app. Restyle it here (this
   stylesheet is loaded only by YakSign, so other Jak apps are unaffected) as a
   centred card with stacked, full-width fields. */
.Wt-auth-login {
    width: 100%;
    max-width: 440px;
    margin: 48px auto;
    padding: 32px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    float: none;            /* cancel Bootstrap-3 .span8.offset2 float/offset */
    text-align: left;
    color: var(--color-text);
}
.Wt-auth-login legend {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    border: none;
    margin: 0 0 18px;
    padding: 0;
}
/* stack each row vertically, full width (undo the horizontal grid) */
.Wt-auth-login .form-group { display: block; margin: 0 0 16px; }
.Wt-auth-login .control-label,
.Wt-auth-login .col-sm-2,
.Wt-auth-login .col-sm-8,
.Wt-auth-login .col-sm-offset-2 {
    display: block;
    width: 100%;
    float: none;
    margin-left: 0;
    padding: 0;
    text-align: left;
}
/* higher specificity than Bootstrap's `.form-horizontal .control-label` so the
   labels sit left-aligned above their inputs, not right-aligned. */
.Wt-auth-login .form-horizontal .control-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
    margin-bottom: 6px;
    text-align: left;
}
.Wt-auth-login .form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-text);
}
.Wt-auth-login .form-control:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.Wt-auth-login .help-block,
.Wt-auth-login .help-block span {
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-weight: 400;
    margin-top: 4px;
}
/* the "Remember me" row carries Bootstrap's .has-success green — neutralise it */
.Wt-auth-login .has-success .control-label,
.Wt-auth-login .has-success .help-block { color: var(--color-muted); }
.Wt-auth-login .checkbox label { color: var(--color-text); font-size: 0.9375rem; font-weight: 400; }
.Wt-auth-login .btn-primary { width: 100%; margin-top: 4px; }
.Wt-auth-login .btn-link {
    color: var(--color-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
}
.Wt-auth-login .btn-link:hover { text-decoration: underline; }
/* On phones narrower than the 440px card the `width:100% + margin:auto` rule
   fills the viewport edge-to-edge (auto side margins resolve to 0), so the card
   sits flush against both screen sides. Give it a small gutter so it still
   reads as a card. (box-sizing:border-box is Bootstrap-global, so the 32px
   padding stays inside the reduced width.) */
@media (max-width: 480px) {
    .Wt-auth-login {
        width: auto;
        margin: 32px 16px;
    }
}

/* Right-hand auth menu (Sign in / account / Sign out) on the dark bar */
.navbar.navbar-default .navbar-right > li > a,
.navbar.navbar-default .navbar-right > li > a > span {
    color: #cdd9ea !important;
}
.navbar.navbar-default .navbar-right > li > a:hover,
.navbar.navbar-default .navbar-right > li > a:hover > span { color: #ffffff !important; }

/* Mobile hamburger (BaseApplication injects .jak-navbar-toggle) on navy */
.navbar.navbar-default .jak-navbar-toggle > span { background: #ffffff !important; }
@media (max-width: 992px) {
    /* Open dropdown must be fully OPAQUE — the bar's --nav-bg is a translucent
       rgba paired with a backdrop blur that doesn't carry to this panel, so the
       page bled through and the light menu text was unreadable. --ys-navy-deep
       (--footer-bg #0a1320) is opaque in both themes and already carries light
       text, matching the nav links. */
    .navbar.navbar-default.jak-nav-open .navbar-collapse {
        background-color: var(--ys-navy-deep) !important;
    }
}

/* ── Footer — full-width blue bar that sticks to the bottom ─────────────────
   FootedPage adds .footer in its super-init BEFORE the page content, so the
   footer is DOM-first. Lay the page out as a flex column and push the footer
   down with order + margin-top:auto so it sits beneath content and sticks to
   the bottom on short pages (mirrors the yakdocs footer mechanism). */
.footed-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);   /* 60px = navbar height */
    padding-bottom: 0;
}
/* style.css styles `.footer` as a short grey (#ecf0f1) position:absolute bar.
   Put it back in normal flow, drop the grey, and break it out of the
   .footed-page 30px side padding so the blue spans edge-to-edge. */
.footed-page > .footer {
    order: 100;
    position: static;
    height: auto;
    background: transparent;
    margin: auto -30px 0;              /* top:auto sticks to bottom; -30px cancels side padding */
    padding: 0;
    width: auto;
    /* Span edge-to-edge even when the page centers its content (e.g. the
       billing page sets contentAlignment=Center, which would otherwise shrink
       this flex item to its content width and float it in the middle). */
    align-self: stretch;
}
/* Always leave breathing room between the page content and the footer on
   tall pages (the footer's margin-top:auto only opens a gap when short). */
.footed-page > :last-child:not(.footer) { margin-bottom: 72px; }
@media (max-width: 600px) {
    .footed-page > :last-child:not(.footer) { margin-bottom: 48px; }
}

.yw-footer {
    background: var(--ys-navy-deep);
    color: #c6d4e6;
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 56px 0 26px;
    font-family: var(--font-sans);
    text-align: left;
}
.yw-wrap { max-width: var(--ys-content-max); margin: 0 auto; padding: 0 28px; }
.yw-footer a { color: #d7e2ef; text-decoration: none; }
.yw-footer a:hover { color: var(--ys-accent-light); }
.yw-footer__top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 34px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.yw-footer__brand {
    font-weight: 800;
    font-size: 1.45rem;
    color: #ffffff;
    margin-bottom: .5rem;
    letter-spacing: -.01em;
}
.yw-footer__tag { color: #93a6bd; max-width: 42ch; font-size: .95rem; line-height: 1.6; }
.yw-footer h4 {
    font-size: .8125rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: #7e91a8; margin: 0 0 .9rem;
}
.yw-footer ul { list-style: none; padding: 0; margin: 0; }
.yw-footer li { margin-bottom: .5rem; font-size: 1rem; }
.yw-footer__bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap;
    gap: 10px; padding-top: 22px; font-size: .875rem; color: #7e91a8;
}
@media (max-width: 768px) {
    .yw-footer__top { grid-template-columns: 1fr; gap: 26px; }
}

/* ── Marketing reconciliation ──────────────────────────────────────────────
   The marketing templates (sign-templates.xml) use a few class names that the
   shared yk-marketing.css doesn't define, so those blocks fell back to
   unstyled defaults (the "narrow columns / odd layout"). Style them here. */

/* Home "How it works": template uses a flat .yg-step-num + .yg-step-title +
   .yg-step-desc (no .yg-step-body wrapper yk-marketing.css expects). Re-flow
   each step as a vertical card. */
.yg-steps { gap: 24px; }
.yg-step {
    flex: 1 1 200px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.yg-step-title { font-size: 1.05rem; font-weight: 700; color: var(--color-text); margin: 0; }
.yg-step-desc  { font-size: .9rem; color: var(--color-muted); line-height: 1.6; margin: 0; }
/* The arrows between steps are empty <div>s; hide them (they misalign once the
   steps are vertical cards, and the cards read clearly on their own). */
.yg-step-arrow { display: none; }

/* Home benefits column: template uses .yg-two-col-text (yk-marketing.css has
   .yg-col-text) — without flex:1 it collapses to a narrow column. */
.yg-two-col-text { flex: 1; min-width: 280px; }

/* Hero/section alignment: yk-marketing's .yg-hero caps at max-width:1120px
   INCLUDING its 48px side padding, while .yg-section-inner caps at 1120px with
   the section's 48px padding OUTSIDE — so the hero copy sat 48px inboard of the
   feature/step cards below it and the page looked off-centre. Widen the hero to
   1120 + 2×48 so its content edges line up exactly with the cards. */
.yg-hero { max-width: 1216px; }

/* Hero / CTA action rows: button + inline link, laid out on one line. */
.yg-hero-cta, .yg-cta-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.yg-cta-actions { justify-content: center; }
/* "Read the docs →" link sits on the dark CTA gradient — keep it readable. */
.yg-cta-link { color: rgba(255, 255, 255, .92); text-decoration: none; font-weight: 600; }
.yg-cta-link:hover { color: #ffffff; text-decoration: underline; }

/* Bottom CTA band (home "Ready to go paperless?" / pricing "Try every feature
   free…"): shared .yg-cta-section is only a full-bleed gradient with no padding
   or radius — make it a rounded, padded card like the feature/stat cards. */
.yg-cta-section {
    margin: 8px 48px 0;
    padding: 56px 40px;
    border-radius: 18px;
    box-shadow: 0 14px 36px -18px rgba(30, 58, 95, .45);
}
.yg-cta-inner { max-width: 720px; margin: 0 auto; }
@media (max-width: 768px) {
    .yg-cta-section { margin: 8px 16px 0; padding: 40px 22px; }
}

/* Getting-started routing cards: template uses .yg-gs-cto-* (yk-marketing.css
   has .yg-cto-*). */
.yg-gs-cto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.yg-gs-cto-card {
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 18px;
}
.yg-gs-cto-card h4 { font-size: .98rem; font-weight: 700; color: var(--color-text); margin: 0 0 6px; }
.yg-gs-cto-card p  { font-size: .86rem; color: var(--color-muted); line-height: 1.55; margin: 0; }

/* Getting-started "what's next" cards: template uses .yg-gs-next-* anchors
   (yk-marketing.css has .yg-next-*). */
.yg-gs-next-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.yg-gs-next-card {
    display: block; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px;
    padding: 20px 18px; text-decoration: none;
    transition: box-shadow .15s, border-color .15s, transform .15s;
}
.yg-gs-next-card:hover {
    border-color: var(--color-primary); box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.yg-gs-next-card h4 { font-size: .95rem; font-weight: 700; color: var(--color-primary); margin: 0 0 6px; }
.yg-gs-next-card p  { font-size: .84rem; color: var(--color-muted); line-height: 1.55; margin: 0; }

/* Getting-started numbered steps: template puts a bare <span> after .yg-gs-num
   instead of yk-marketing's .yg-gs-num-body. */
.yg-gs-num-step { align-items: flex-start; }
.yg-gs-num-step > span:not(.yg-gs-num) {
    font-size: .92rem; color: var(--color-text); line-height: 1.55; padding-top: 4px;
}

/* Docs sidebar TOC: template uses .yg-docs-toc-group-label / -sep / -link
   (yk-marketing.css has .yg-toc-group-label / .yg-toc-sep and a `.yg-docs-toc
   li a` selector — but these links are direct <a> children, not in <li>). */
.yg-docs-toc-group-label {
    font-size: .75rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--color-muted); padding: 2px 8px; margin-top: 6px;
}
.yg-docs-toc-sep { height: 1px; background: var(--color-border); margin: 8px 0; }
.yg-docs-toc-link {
    display: block; font-size: .83rem; color: var(--color-muted); text-decoration: none;
    padding: 4px 8px; border-radius: 5px; line-height: 1.4;
    transition: background .12s, color .12s;
}
.yg-docs-toc-link:hover { background: var(--tint-info); color: var(--color-primary); }

/* Feature-card icons: render the FontAwesome glyph centred in the coloured
   tile. The boxes were previously blank (the "missing icons"). */
.ygsign-feat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #ffffff;
    opacity: 1;
}
.ygsign-feat-icon::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.3rem;
    line-height: 1;
}
.ygsign-icon-fields::before { content: "\f5b7"; }  /* signature  */
.ygsign-icon-route::before  { content: "\f0e8"; }  /* sitemap    */
.ygsign-icon-track::before  { content: "\f201"; }  /* chart-line */
.ygsign-icon-audit::before  { content: "\f3ed"; }  /* shield-alt */
.ygsign-icon-pdf::before    { content: "\f1c1"; }  /* file-pdf   */
.ygsign-icon-cert::before   { content: "\f0a3"; }  /* certificate */

/* ── Logged-in pages — centre with side margins (like YakDocs) ──────────────
   These were left-aligned (or full-bleed); give them a max-width and auto
   side margins so content is centred with comfortable gutters. */
.documents-page,
.requests-page,
.templates-page,
.prepare-page,
.yaksign-account-page {
    margin-left: auto;
    margin-right: auto;
}
.documents-page,
.requests-page,
.templates-page,
.prepare-page {
    max-width: var(--ys-content-max);
}
.yaksign-account-page { max-width: 880px; }

/* ── Legal pages (Privacy / Terms) ─────────────────────────────────────────
   These plain WContainerWidget pages had no width constraint, so the text ran
   flush to the viewport edges. Give them the same centred gutters as the other
   content pages. */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 8px 28px 64px;
}
.legal-page .legal-body h3 { margin-top: 1.6rem; }
.legal-page .legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9375rem;
}
.legal-page .legal-table th,
.legal-page .legal-table td {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    vertical-align: top;
}
.legal-page .legal-table th { background: var(--color-bg-subtle, #f7fafc); font-weight: 600; }
@media (max-width: 600px) {
    .legal-page { padding: 8px 18px 48px; }
}

/* =============================================================================
   DESIGN-LANGUAGE ADOPTION (appended last so it wins the cascade)
   YakSign keeps its existing navbar/footer markup + the shared .yg-* marketing
   structure, but those were authored for an always-dark navy bar + light pages.
   Re-point them at the theme tokens so they follow yw-dark / yw-light.
   ============================================================================= */

/* —— Navbar: keep the layout, fix the (previously hardcoded) text colours —— */
.navbar.navbar-default .navbar-nav > li > a,
.navbar.navbar-default .navbar-nav > li > a > span,
.navbar.navbar-default .navbar-nav > li > a > span > span { color: var(--nav-muted) !important; }
.navbar.navbar-default .navbar-nav > li > a:hover,
.navbar.navbar-default .navbar-nav > li > a:hover > span,
.navbar.navbar-default .navbar-nav > li > a:focus,
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > .active > a > span,
.navbar.navbar-default .navbar-nav > .Wt-selected > a,
.navbar.navbar-default .navbar-nav > .Wt-selected > a > span { color: var(--nav-fg) !important; }
.navbar.navbar-default .navbar-brand,
.navbar.navbar-default .navbar-brand > span { color: var(--nav-fg) !important; }
.navbar.navbar-default .navbar-brand .yw-wm { color: var(--accent-ink) !important; }

/* —— Marketing components (.yg-*): map onto the design language, theme-aware —— */
.yg-page, .yg-section { color: var(--text); }
.yg-section-alt { background: var(--surface-2); }
/* page-header banner: yk-marketing.css hardcodes a light gradient (#f8fafc→#eff6ff)
   + grey border, so in dark mode it rendered as a white island (with the now-light
   title/subtitle on it). Re-point it at the surface tokens so it tracks yw-dark/yw-light. */
.yg-page-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border-bottom-color: var(--surface-border);
}
.yg-section-title, .yg-page-title { color: var(--text); font-family: var(--font-display); }
.yg-page-subtitle { color: var(--text-muted); }
.yg-eyebrow { color: var(--accent-ink); }

/* hero + closing-CTA panels: the fixed dark gradient panel, light text */
.yg-hero, .yg-cta-section {
    background: var(--hero-panel-bg) !important;
    border: 1px solid var(--hero-panel-border);
    border-radius: 22px;
    color: #f3f1ea;
}
.yg-hero-headline, .yg-hero-headline *, .yg-cta-headline { color: #f3f1ea; font-family: var(--font-display); }
/* --hero-accent, not --accent: this sits on the fixed dark .yg-hero panel, where
   the light-page accent measured 1.45:1 against a 3:1 large-text minimum. */
.yg-headline-accent { color: var(--hero-accent); font-style: italic; }
.yg-hero-sub, .yg-hero-note, .yg-cta-sub, .yg-cta-link { color: #bcc6d8 !important; }

/* feature / CTA cards: surface + amber-style accent rail (here, blue) */
.yg-feature-card, .yg-cto-card, .yg-nm-card, .yg-next-card, .yg-gs-cto-card, .yg-gs-next-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-left: 3px solid var(--accent);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    color: var(--text);
}
.yg-feature-card h3, .yg-feature-card h4,
.yg-cto-card h4, .yg-next-card h4 { color: var(--text); }
.yg-feature-card p, .yg-cto-card p, .yg-next-card p { color: var(--text-muted); }
.yg-feature-icon, .yg-cto-icon, .yg-nm-icon, .yg-next-icon { color: var(--accent-ink); }

/* stats, callouts, code, steps */
.yg-stat-num { color: var(--accent-ink); font-family: var(--font-display); }
.yg-stat-label { color: var(--text-muted); }
.yg-step-num { background: var(--accent-gradient); color: var(--accent-contrast); }
.yg-step-title { color: var(--text); }
.yg-step-desc, .yg-benefit-list { color: var(--text-muted); }
.yg-code-block { background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); }
.yg-callout, .yg-callout-info, .yg-callout-tip {
    background: var(--surface-2); border: 1px solid var(--surface-border); color: var(--text-muted);
}

/* CTA buttons → the blue→indigo gradient fill */
.yg-cta-btn { background: var(--accent-gradient) !important; color: var(--accent-contrast) !important; border: 0; }
.yg-cta-btn:hover { background: var(--accent-gradient-hover) !important; }
.yg-cta-btn-inverse {
    background: transparent !important; color: #fff !important; border: 1px solid rgba(255,255,255,.45) !important;
}

/* Getting Started + Docs prose & components: yk-marketing.css authored these
   light-only (near-black headings on white, #374151 body, #6b7280 captions), so
   on dark pages they rendered near-invisible / failed WCAG contrast. Re-point at
   the theme tokens — applies in both themes (light resolves to original-ish). */

/* card titles use <strong> (not h3/h4) + section/step headings → high-contrast text */
.yg-gs-section-title,
.yg-docs-section h2, .yg-docs-section h3,
.yg-feature-card strong, .yg-cto-card strong, .yg-nm-card strong, .yg-next-card strong,
.yg-gs-cto-card strong, .yg-gs-next-card strong, .yg-gs-num-body strong { color: var(--text); }

/* primary reading prose → --text (WCAG AA on both surfaces) */
.yg-gs-text,
.yg-gs-list li,
.yg-benefit-list li,
.yg-docs-section p,
.yg-docs-ol li, .yg-docs-ul li { color: var(--text); }

/* secondary / caption text → --text-muted; faint labels → --text-faint */
.yg-nm-card p, .yg-gs-num-body p,
.yg-docs-toc li a { color: var(--text-muted); }
/* TOC section labels: --text-faint fails WCAG AA (~4:1) on the dark bg, so use
   --text-muted (~6.5:1) even though the original design intent was "faint". */
.yg-docs-toc-title, .yg-toc-group-label { color: var(--text-muted); }

/* links → contrast-safe accent ink */
.yg-docs-section a { color: var(--accent-ink); }
.yg-docs-toc li a:hover { background: var(--nav-hover); color: var(--accent-ink); }

/* pills / neutral badge */
.yg-gs-step-label { background: var(--accent-tint); border-color: var(--accent-soft); color: var(--accent-ink); }
.yg-badge-neutral { background: var(--surface-2); border-color: var(--surface-border); color: var(--text-muted); }

/* inline code chips → surface-2 with readable text */
.yg-nm-card code, .yg-docs-section code, .yg-docs-table code {
    background: var(--surface-2); border-color: var(--surface-border); color: var(--text);
}

/* section dividers + docs sidebar/layout borders → token borders */
.yg-gs-section, .yg-docs-section { border-bottom-color: var(--surface-border-soft); }
.yg-docs-layout { border-top-color: var(--surface-border); }
.yg-docs-sidebar { border-right-color: var(--surface-border-soft); }
.yg-toc-sep { background: var(--surface-border-soft); }

/* info / reference tables (Getting Started + Docs) → themed surface/head/stripe */
.yg-gs-table, .yg-docs-table { border-color: var(--surface-border); }
.yg-gs-table thead, .yg-docs-table thead { background: var(--surface-2); }
.yg-gs-table th, .yg-docs-table th { color: var(--text); border-bottom-color: var(--surface-border); }
.yg-gs-table td, .yg-docs-table td { color: var(--text); border-bottom-color: var(--surface-border-soft); }
.yg-gs-table tr:nth-child(even) td, .yg-docs-table tr:nth-child(even) td { background: var(--surface-2); }

/* First-visit privacy choice: the .gdpr-consent-* styling is now injected by the
   shared GdprConsentModal widget (com.aldecorp.widgets.misc.GdprConsentModal) so
   every product renders the banner consistently — no per-product CSS needed. */

/* ══════════════════════════════════════════════════════════════════════════
   Agreements — the post-signature workspace
   ══════════════════════════════════════════════════════════════════════════ */
.agreements-page, .agreement-detail-page { padding: 0 24px 40px; max-width: 980px; }
.page-subheading { display: block; color: var(--color-muted); margin: -6px 0 18px; max-width: 60ch; }

.agreements-upsell {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin: 0 0 18px; padding: 14px 18px;
    border: 1px solid rgba(67, 56, 202, 0.35); border-radius: var(--radius-sm);
    background: rgba(67, 56, 202, 0.06);
}

.agreements-list { display: flex; flex-direction: column; gap: 10px; }
.agreement-row {
    padding: 12px 16px; border: 1px solid var(--color-border, rgba(128,128,128,.28));
    border-radius: var(--radius-sm); background: var(--color-white);
}
.agreement-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.agreement-title { font-weight: 700; font-size: 1.0625rem; }
.agreement-title-link {
    border: 0; background: none; padding: 0; cursor: pointer;
    font-weight: 700; font-size: 1.0625rem; color: var(--color-primary, #4338ca); text-align: left;
}
.agreement-title-link:hover { text-decoration: underline; }

.agreement-status {
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
    padding: 2px 8px; border-radius: 10px;
}
/* Expiring is a warning, not an error: there is still time to act on it. */
.agreement-status--active     { background: var(--tint-success, rgba(22,163,74,.12));  color: var(--color-success, #16a34a); }
.agreement-status--expiring   { background: var(--tint-warning, rgba(217,119,6,.14));  color: var(--color-warning, #b45309); }
.agreement-status--expired    { background: var(--tint-danger,  rgba(180,35,24,.12));  color: var(--color-danger,  #b42318); }
.agreement-status--renewed    { background: rgba(67,56,202,.12); color: #4338ca; }
.agreement-status--terminated,
.agreement-status--archived   { background: rgba(128,128,128,.16); color: var(--color-muted, #6b7280); }

.agreement-row-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.agreement-meta-item { font-size: 0.875rem; color: var(--color-muted); }
.agreement-meta-hint { font-size: 0.8125rem; font-style: italic; color: var(--color-warning, #b45309); }
.agreement-tag {
    font-size: 0.75rem; padding: 1px 8px; border-radius: 10px;
    background: rgba(67,56,202,.10); color: #4338ca;
}

.agreement-dates-grid {
    display: grid; grid-template-columns: minmax(9rem, max-content) 1fr;
    gap: 8px 16px; align-items: center; margin-bottom: 12px;
}
.agreement-derived-value { font-weight: 600; }
.agreement-value-row { display: flex; gap: 10px; align-items: center; }
.agreement-reminder-line, .agreement-doc-line { display: block; margin: 4px 0; }
.agreement-signer-line, .agreement-audit-line {
    display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem; color: var(--color-muted); white-space: pre-wrap;
}
.field-hint { display: block; font-size: 0.8125rem; color: var(--color-muted); margin: 4px 0 10px; }
.form-status { display: block; font-size: 0.875rem; margin-top: 6px; }

@media (max-width: 40rem) {
    .agreements-page, .agreement-detail-page { padding: 0 14px 32px; }
    .agreement-dates-grid { grid-template-columns: 1fr; gap: 4px; }
    .agreement-row-meta { gap: 4px 10px; }
}

/* Keep the recipient editor usable on phones; CSS functions belong in CSS, not WLength. */
.bulk-send-dialog {
    width: min(35rem, 94vw) !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
}
.bulk-send-dialog .dialog-layout { width: 100% !important; }

/* Keep field instructions legible over arbitrary uploaded PDF artwork. */
.signer-annotation-placeholder { background: #fff; color: #475670; }
.signer-main-area:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }

.bulk-send-progress:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
