/* ============================================================
   Clarify — Suite Design System
   Shared visual language for the client suite: Contacts + Email Centre.

   Why this file exists
   --------------------
   These two surfaces are the "cockpit" the agent lives in daily. The brief
   is NOT a new look — it's the SAME look as the rest of the app (light
   tool-page chrome: white surfaces, near-black ink, soft grey borders,
   black primary actions, system font), rebuilt to be more intuitive and
   fast: sensible grouping, generous touch targets, real empty states, a
   slide-in drawer and a clean table. Fast, beautiful, effortless — built
   to replace a paid tool, generic for any agent (no per-user branding).

   How to use
   ----------
   - Page opts in with <body class="tool-page suite"> (tool-page = light
     theme + page transitions from styles.css; suite = this component kit).
   - Everything here is namespaced: classes are `.s-*`, tokens are `--s-*`.
     Nothing collides with styles.css `--color-*` tokens, so other pages
     are untouched even though they also load styles.css.
   - The palette is intentionally monochrome to match the app. The single
     "--s-accent" token IS black; its "soft" variants are neutral greys, so
     hovers/active chips/avatars never introduce a new hue. Colour appears
     ONLY for functional state: CASL consent + send pre-flight + errors, and
     user-defined CRM tag colours (via --tag-c).
   - Components map 1:1 to real controls in Contacts / Email Centre — this
     is not a speculative kit.

   Canadian spelling throughout. No frameworks, no build step.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
    /* Neutral ramp — matches the app's light tool-page chrome. */
    --s-bg: #ffffff;
    --s-surface: #ffffff;
    --s-surface-2: #fafafa;
    --s-surface-3: #f1f1f1;
    --s-border: #e8e8e8;
    --s-border-strong: #dcdcdc;
    --s-text: #0a0a0a;
    --s-text-2: #595959;
    --s-text-3: #8a8a8a;

    /* "Accent" is monochrome ink — primary actions are black, like the rest
       of the app. The soft variants are neutral greys (hovers, active chips,
       avatars, selected rows), so nothing introduces a new hue. */
    --s-accent: #0a0a0a;
    --s-accent-hover: #262626;
    --s-accent-press: #000000;
    --s-accent-soft: #ececec;
    --s-accent-soft-2: #e2e2e2;
    --s-accent-border: #d8d8d8;
    --s-on-accent: #ffffff;
    --s-focus: rgba(10, 10, 10, 0.13);

    /* Semantic — functional state only (CASL consent, send pre-flight, errors).
       Kept restrained so they read as status, not decoration. */
    --s-ok: #168f50;
    --s-ok-soft: #e6f6ec;
    --s-ok-border: #bce6cd;
    --s-warn: #b4720a;
    --s-warn-soft: #fdf2dc;
    --s-warn-border: #f0d9a8;
    --s-danger: #d92d20;
    --s-danger-hover: #b42318;
    --s-danger-soft: #fdecea;
    --s-danger-border: #f5c6c1;

    /* Radii — aligned to the app (20px cards / 12px controls) */
    --s-r-sm: 9px;
    --s-r-md: 12px;
    --s-r-lg: 16px;
    --s-r-xl: 20px;
    --s-r-pill: 999px;

    /* Soft, neutral shadows — the app is mostly flat, so keep these light */
    --s-shadow-xs: 0 1px 2px rgba(10, 10, 10, 0.05);
    --s-shadow-sm: 0 2px 8px -2px rgba(10, 10, 10, 0.08), 0 1px 2px rgba(10, 10, 10, 0.05);
    --s-shadow-md: 0 10px 26px -10px rgba(10, 10, 10, 0.14), 0 2px 6px rgba(10, 10, 10, 0.05);
    --s-shadow-lg: 0 24px 50px -18px rgba(10, 10, 10, 0.22), 0 8px 18px -10px rgba(10, 10, 10, 0.10);

    --s-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --s-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    --s-t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --s-t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --s-topbar-h: 60px;
    --s-page-max: 1160px;
}

/* ---------- Canvas ---------- */
body.suite {
    background: var(--s-bg);
    color: var(--s-text);
    font-family: var(--s-font);
    -webkit-font-smoothing: antialiased;
}
.suite *, .suite *::before, .suite *::after { box-sizing: border-box; }
.suite ::selection { background: var(--s-accent-soft-2); }

/* ---------- Top bar ---------- */
/* Sticky app-style header: back chip · title · actions. */
.s-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--s-topbar-h);
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--s-border);
}
.s-topbar-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--s-r-md);
    color: var(--s-text-2);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--s-t-fast), color var(--s-t-fast);
}
.s-topbar-back:hover { background: var(--s-surface-3); color: var(--s-text); }
.s-topbar-back svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; }
.s-topbar-title {
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--s-text);
}
.s-topbar-sub {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--s-text-3);
    margin-left: 0.1rem;
}
.s-topbar-spacer { flex: 1; }
.s-topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Cross-link pill (Contacts <-> Email) so the suite feels like one product */
.s-suitenav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: var(--s-r-pill);
    background: var(--s-surface-3);
    color: var(--s-text-2);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--s-t-fast);
}
.s-suitenav:hover { background: var(--s-accent-soft); color: var(--s-accent); }
.s-suitenav svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ---------- Page container ---------- */
.s-page {
    max-width: var(--s-page-max);
    margin: 0 auto;
    padding: 1.75rem 1.25rem 4rem;
}
.s-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.s-h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.025em; }
.s-h1-count { font-size: 1.05rem; font-weight: 600; color: var(--s-text-3); margin-left: 0.5rem; }
.s-h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; }
.s-lede { font-size: 0.95rem; color: var(--s-text-2); margin-top: 0.25rem; }
.s-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--s-text-2);
    margin-bottom: 0.4rem;
}
.s-hint { font-size: 0.76rem; color: var(--s-text-3); line-height: 1.5; }
.s-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--s-text-3);
}

/* ---------- Buttons ---------- */
.s-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 1.05rem;
    border-radius: var(--s-r-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--s-t-fast), border-color var(--s-t-fast),
                box-shadow var(--s-t-fast), transform 0.08s, color var(--s-t-fast);
}
.s-btn:active { transform: scale(0.975); }
.s-btn:disabled, .s-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.s-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }

.s-btn-primary {
    background: var(--s-accent);
    color: var(--s-on-accent);
    box-shadow: var(--s-shadow-xs);
}
.s-btn-primary:hover { background: var(--s-accent-hover); box-shadow: var(--s-shadow-sm); }
.s-btn-primary:active { background: var(--s-accent-press); }

.s-btn-secondary {
    background: var(--s-surface);
    color: var(--s-text);
    border-color: var(--s-border-strong);
}
.s-btn-secondary:hover { background: var(--s-surface-2); border-color: var(--s-text-3); }

.s-btn-ghost { background: transparent; color: var(--s-text-2); }
.s-btn-ghost:hover { background: var(--s-surface-3); color: var(--s-text); }

.s-btn-danger { background: var(--s-danger); color: #fff; }
.s-btn-danger:hover { background: var(--s-danger-hover); }
.s-btn-danger-ghost { background: transparent; color: var(--s-danger); }
.s-btn-danger-ghost:hover { background: var(--s-danger-soft); }

.s-btn-sm { height: 32px; padding: 0 0.75rem; font-size: 0.8rem; border-radius: var(--s-r-sm); }
.s-btn-sm svg { width: 15px; height: 15px; }
.s-btn-lg { height: 48px; padding: 0 1.5rem; font-size: 0.95rem; border-radius: var(--s-r-lg); }
.s-btn-block { width: 100%; }

/* Square icon-only button */
.s-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--s-r-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--s-text-2);
    cursor: pointer;
    transition: background var(--s-t-fast), color var(--s-t-fast);
}
.s-icon-btn:hover { background: var(--s-surface-3); color: var(--s-text); }
.s-icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ---------- Fields / inputs ---------- */
.s-field { display: flex; flex-direction: column; gap: 0; margin-bottom: 0; }
.s-field + .s-field { margin-top: 1rem; }
.s-input, .s-textarea, .s-select {
    width: 100%;
    font-family: inherit;
    font-size: 16px; /* >=16px prevents iOS zoom-on-focus */
    color: var(--s-text);
    background: var(--s-surface);
    border: 1px solid var(--s-border-strong);
    border-radius: var(--s-r-md);
    padding: 0.62rem 0.8rem;
    outline: none;
    transition: border-color var(--s-t-fast), box-shadow var(--s-t-fast), background var(--s-t-fast);
}
.s-input::placeholder, .s-textarea::placeholder { color: var(--s-text-3); }
.s-input:focus, .s-textarea:focus, .s-select:focus {
    border-color: var(--s-accent);
    box-shadow: 0 0 0 3px var(--s-focus);
}
.s-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.s-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2390909a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}

/* Search box with leading icon */
.s-search { position: relative; display: flex; align-items: center; }
.s-search svg {
    position: absolute;
    left: 0.7rem;
    width: 17px; height: 17px;
    stroke: var(--s-text-3); stroke-width: 2; fill: none;
    pointer-events: none;
}
.s-search .s-input { padding-left: 2.25rem; }

/* ---------- Chips & tags ---------- */
.s-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 30px;
    padding: 0 0.7rem;
    border-radius: var(--s-r-pill);
    background: var(--s-surface-3);
    color: var(--s-text-2);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--s-t-fast);
    user-select: none;
}
.s-chip:hover { background: var(--s-accent-soft); color: var(--s-accent); }
.s-chip.is-active {
    background: var(--s-accent);
    color: var(--s-on-accent);
}
.s-chip-x {
    display: inline-flex;
    align-items: center;
    margin: 0 -0.2rem 0 0.1rem;
    opacity: 0.7;
}
.s-chip-x:hover { opacity: 1; }
.s-chip-x svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.4; fill: none; }

/* Coloured CRM tag — colour set inline via --tag-c */
.s-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 22px;
    padding: 0 0.55rem;
    border-radius: var(--s-r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--tag-c, #8e8e96) 14%, white);
    color: color-mix(in srgb, var(--tag-c, #8e8e96) 72%, #1c1c1e);
    border: 1px solid color-mix(in srgb, var(--tag-c, #8e8e96) 26%, white);
}
.s-tag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tag-c, #8e8e96); }

/* ---------- Badges / status pills ---------- */
.s-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 22px;
    padding: 0 0.5rem;
    border-radius: var(--s-r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--s-surface-3);
    color: var(--s-text-2);
    border: 1px solid var(--s-border);
}
.s-badge-ok { background: var(--s-ok-soft); color: var(--s-ok); border-color: var(--s-ok-border); }
.s-badge-warn { background: var(--s-warn-soft); color: var(--s-warn); border-color: var(--s-warn-border); }
.s-badge-danger { background: var(--s-danger-soft); color: var(--s-danger); border-color: var(--s-danger-border); }
.s-badge-accent { background: var(--s-accent-soft); color: var(--s-accent); border-color: var(--s-accent-border); }

/* ---------- Avatar ---------- */
.s-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--s-accent-soft);
    color: var(--s-accent);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}
.s-avatar-lg { width: 48px; height: 48px; font-size: 1.05rem; }

/* ---------- Panels / cards ---------- */
.s-panel {
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: var(--s-r-lg);
    box-shadow: var(--s-shadow-xs);
}
.s-panel-pad { padding: 1.25rem; }
.s-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--s-border);
}
.s-card {
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: var(--s-r-lg);
    padding: 1.1rem;
    box-shadow: var(--s-shadow-xs);
    transition: box-shadow var(--s-t), border-color var(--s-t), transform var(--s-t);
}
.s-card.is-clickable { cursor: pointer; }
.s-card.is-clickable:hover {
    border-color: var(--s-border-strong);
    box-shadow: var(--s-shadow-md);
    transform: translateY(-2px);
}

/* Toolbar row (filters, bulk actions) */
.s-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.s-toolbar-spacer { flex: 1; }

/* ---------- Table ---------- */
.s-table-wrap {
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: var(--s-r-lg);
    box-shadow: var(--s-shadow-xs);
    /* clip (not hidden) so the rounded corners stay clipped WITHOUT turning the
       wrap into a scroll container. hidden made the wrap the scroll ancestor for
       the sticky thead, so on a short table (header + 1 row) the sticky `top`
       offset pushed the header down onto the only data row and clipped it out of
       view. clip keeps the visual clip but lets sticky resolve against the page. */
    overflow: clip;
}
.s-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.s-table thead th {
    position: sticky;
    top: var(--s-topbar-h);
    z-index: 2;
    background: var(--s-surface-2);
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--s-text-3);
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--s-border);
    white-space: nowrap;
}
.s-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--s-border);
    color: var(--s-text);
    vertical-align: middle;
}
.s-table tbody tr:last-child td { border-bottom: none; }
.s-table tbody tr { transition: background var(--s-t-fast); cursor: pointer; }
.s-table tbody tr:hover { background: var(--s-accent-soft); }
.s-table tbody tr.is-selected { background: var(--s-accent-soft-2); }
.s-cell-name { font-weight: 600; }
.s-cell-muted { color: var(--s-text-3); }
.s-checkbox {
    width: 17px; height: 17px;
    accent-color: var(--s-accent);
    cursor: pointer;
}

/* ---------- Drawer (slide-in from right) ---------- */
.s-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(20, 20, 24, 0.42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--s-t), visibility var(--s-t);
}
.s-drawer-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.s-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100%;
    width: min(480px, 100%);
    z-index: 81;
    display: flex;
    flex-direction: column;
    background: var(--s-surface);
    box-shadow: var(--s-shadow-lg);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.s-drawer.is-open { transform: translateX(0); }
.s-drawer-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--s-border);
    flex-shrink: 0;
}
.s-drawer-title { font-size: 1.05rem; font-weight: 700; flex: 1; }
.s-drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.s-drawer-foot {
    display: flex;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--s-border);
    background: var(--s-surface-2);
    flex-shrink: 0;
}

/* Grouped field set inside drawer/forms.
   Flex + gap evenly spaces every direct row (.s-field OR .s-grid-2) so we
   don't depend on adjacent-sibling margins, which break inside grids. */
.s-fieldgroup {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}
.s-fieldgroup:last-child { margin-bottom: 0; }
.s-fieldgroup .s-field { margin: 0; }
.s-fieldgroup .s-field + .s-field { margin-top: 0; }
.s-fieldgroup-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
    color: var(--s-text);
}
.s-fieldgroup-head svg { width: 16px; height: 16px; stroke: var(--s-accent); stroke-width: 2; fill: none; flex-shrink: 0; }
.s-fieldgroup-head .s-section-label { color: var(--s-text); }
.s-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin: 0; }
.s-grid-2 .s-field + .s-field { margin-top: 0; }

/* Tappable checkbox/consent row */
.s-check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--s-border);
    border-radius: var(--s-r-md);
    background: var(--s-surface-2);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--s-text);
    cursor: pointer;
    transition: border-color var(--s-t-fast), background var(--s-t-fast);
}
.s-check-row:hover { border-color: var(--s-border-strong); }
.s-check-row input { margin: 0; }

/* ---------- Modal ---------- */
.s-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 20, 24, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--s-t), visibility var(--s-t);
}
.s-modal-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.s-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--s-surface);
    border-radius: var(--s-r-xl);
    box-shadow: var(--s-shadow-lg);
    padding: 1.5rem;
    transform: translateY(8px) scale(0.99);
    transition: transform var(--s-t);
}
.s-modal-overlay.is-open .s-modal { transform: none; }
.s-modal-wide { max-width: 640px; }
.s-modal-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.s-modal-desc { font-size: 0.88rem; color: var(--s-text-2); line-height: 1.55; margin-top: 0.35rem; }
.s-modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ---------- Segmented control / tabs ---------- */
.s-segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--s-surface-3);
    border-radius: var(--s-r-md);
}
.s-segmented button {
    appearance: none;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--s-text-2);
    padding: 0.4rem 0.9rem;
    border-radius: calc(var(--s-r-md) - 3px);
    cursor: pointer;
    transition: all var(--s-t-fast);
}
.s-segmented button.is-active {
    background: var(--s-surface);
    color: var(--s-text);
    box-shadow: var(--s-shadow-xs);
}

.s-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--s-border); }
.s-tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--s-text-3);
    padding: 0.6rem 0.4rem;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color var(--s-t-fast), border-color var(--s-t-fast);
}
.s-tab:hover { color: var(--s-text); }
.s-tab.is-active { color: var(--s-accent); border-bottom-color: var(--s-accent); }

/* ---------- Checklist (e.g. send pre-flight) ---------- */
.s-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--s-border);
    font-size: 0.86rem;
}
.s-check-item:last-child { border-bottom: none; }
.s-check-ico {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.s-check-ico svg { width: 13px; height: 13px; stroke-width: 2.6; fill: none; }
.s-check-pass .s-check-ico { background: var(--s-ok-soft); color: var(--s-ok); }
.s-check-fail .s-check-ico { background: var(--s-danger-soft); color: var(--s-danger); }
.s-check-warn .s-check-ico { background: var(--s-warn-soft); color: var(--s-warn); }

/* ---------- Empty state ---------- */
/* First-run is the FIRST thing the agent sees (zero contacts), so it must
   delight + guide, not look broken. */
.s-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3.5rem 1.5rem;
    max-width: 420px;
    margin: 0 auto;
}
.s-empty-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border-radius: var(--s-r-xl);
    background: var(--s-accent-soft);
    color: var(--s-accent);
    margin-bottom: 1.1rem;
}
.s-empty-ico svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 1.7; fill: none; }
.s-empty-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.s-empty-text { font-size: 0.92rem; color: var(--s-text-2); line-height: 1.6; margin-top: 0.4rem; }
.s-empty-actions { display: flex; gap: 0.6rem; margin-top: 1.4rem; flex-wrap: wrap; justify-content: center; }

/* ---------- Toast ---------- */
.s-toast-host {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}
.s-toast {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: var(--s-r-pill);
    background: #1c1c1e;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--s-shadow-lg);
    pointer-events: auto;
    animation: s-toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.s-toast svg { width: 16px; height: 16px; stroke-width: 2.2; fill: none; }
.s-toast-ok svg { stroke: #4ade80; }
.s-toast-err { background: var(--s-danger); }
@keyframes s-toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Recipient / count callout ---------- */
.s-callout {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--s-r-md);
    background: var(--s-accent-soft);
    border: 1px solid var(--s-accent-border);
    color: var(--s-accent-press);
    font-size: 0.85rem;
    font-weight: 600;
}
.s-callout svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }
.s-callout-warn { background: var(--s-warn-soft); border-color: var(--s-warn-border); color: var(--s-warn); }

/* ---------- Spinner ---------- */
.s-spin {
    width: 16px; height: 16px;
    border: 2px solid var(--s-accent-soft-2);
    border-top-color: var(--s-accent);
    border-radius: 50%;
    animation: s-spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes s-spin { to { transform: rotate(360deg); } }

/* ---------- Char counter ---------- */
.s-counter { font-size: 0.72rem; font-weight: 600; color: var(--s-text-3); }
.s-counter.is-warn { color: var(--s-warn); }
.s-counter.is-over { color: var(--s-danger); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .s-page { padding: 1.25rem 0.9rem 3.5rem; }
    .s-grid-2 { grid-template-columns: 1fr; }
    .s-drawer { width: 100%; }
    .s-modal { max-width: 100%; border-radius: var(--s-r-lg); }
    .s-h1 { font-size: 1.45rem; }
    /* Tables go horizontally scrollable rather than crushing columns */
    .s-table-wrap { overflow-x: auto; }
    .s-table { min-width: 560px; }
    .s-table thead th { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    .suite *, .s-drawer, .s-modal, .s-toast {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
