/* ============================================================
   SMAffiliate — theme
   A deliberately distinct look from our other tools: a light
   sidebar, a teal→emerald accent, and the Plus Jakarta Sans
   typeface (vs. the dark-navy/indigo Email Campaign Manager).
   ============================================================ */
:root {
    --bg:            #eef2f3;
    --card:          #ffffff;
    --sidebar-bg:    #fbfdfd;
    --sidebar-fg:    #475569;
    --sidebar-fg-mut:#94a3b8;
    --accent:        #0d9488;   /* teal-600 */
    --accent-2:      #10b981;   /* emerald-500 */
    --accent-hover:  #0f766e;
    --accent-soft:   #d8f1ec;   /* tint for active nav / highlights */
    --text:          #0f2a33;
    --muted:         #64748b;
    --line:          #e2e8e9;
    --line-soft:     #eef2f2;
    --good:          #059669;
    --warn:          #d97706;
    --bad:           #dc2626;
    --radius:        16px;
    --radius-sm:     10px;
    --shadow:        0 1px 2px rgba(15,42,48,.05), 0 1px 3px rgba(15,42,48,.08);
    --shadow-md:     0 8px 24px rgba(13,148,136,.12);
    --sidebar-w:     248px;
    --sidebar-w-col: 74px;
    --topbar-h:      64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 .25rem; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; margin: 1.6rem 0 .6rem; }
code { background: var(--accent-soft); color: var(--accent-hover); padding: .08rem .4rem; border-radius: 6px; font-size: .85em; }
pre { background: #0b2b2b; color: #d7f5ee; padding: .9rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .82rem; }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .18s ease;
    flex-shrink: 0;
}
.sidebar-top {
    display: flex; align-items: center; gap: .65rem;
    padding: 1rem 1.1rem; height: var(--topbar-h);
    border-bottom: 1px solid var(--line);
}
.sidebar-top .logo { width: 34px; height: 34px; flex-shrink: 0; }
.sidebar-top .wordmark {
    font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; white-space: nowrap;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.collapse-btn {
    margin-left: auto; background: transparent; border: none; color: var(--sidebar-fg-mut);
    cursor: pointer; font-size: 1.15rem; padding: .2rem; border-radius: 6px; line-height: 1;
}
.collapse-btn:hover { color: var(--accent); background: var(--accent-soft); }

.nav { padding: .8rem .6rem; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-section { color: var(--sidebar-fg-mut); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; padding: .9rem .7rem .35rem; }
.nav-item {
    display: flex; align-items: center; gap: .8rem;
    color: var(--sidebar-fg); text-decoration: none;
    padding: .62rem .75rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
    white-space: nowrap; transition: background .12s, color .12s;
}
.nav-item i { font-size: 1.12rem; width: 22px; text-align: center; flex-shrink: 0; color: var(--sidebar-fg-mut); transition: color .12s; }
.nav-item span { transition: opacity .15s; }
.nav-item:hover { background: var(--line-soft); color: var(--text); text-decoration: none; }
.nav-item:hover i { color: var(--accent); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); box-shadow: inset 3px 0 0 0 var(--accent); }
.nav-item.active i { color: var(--accent); }

/* Collapsed state */
.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-col); }
.app.sidebar-collapsed .wordmark,
.app.sidebar-collapsed .nav-item span,
.app.sidebar-collapsed .nav-section { display: none; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: .62rem; }
.app.sidebar-collapsed .sidebar-top { justify-content: center; padding: 1rem .5rem; }
.app.sidebar-collapsed .collapse-btn { margin-left: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h); background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 10;
}
.topbar::before {
    /* slim accent strip along the top of the content area */
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.topbar-title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.user-chip {
    display: inline-flex; align-items: center; gap: .5rem; color: var(--muted);
    font-weight: 600; font-size: .9rem; padding: .35rem .6rem; border-radius: 999px;
}
.user-chip i { font-size: 1.4rem; color: var(--accent); }

.content { padding: 1.7rem 1.9rem; flex: 1; }

/* ---------- Cards ---------- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.2rem 1.3rem;
}
.card-title { font-weight: 700; font-size: 1rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .55rem; }
.card-title > i:first-child { color: var(--accent); }
.card-title .muted { font-weight: 400; color: var(--muted); font-size: .82rem; margin-left: auto; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; margin: 0 0 1.4rem; }
.kpi {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.2rem 1.3rem; display: flex; align-items: flex-start; gap: 1rem;
    transition: box-shadow .15s, transform .15s;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi .kpi-icon {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
    font-size: 1.35rem; color: #fff; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.kpi .kpi-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.kpi .kpi-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi .kpi-icon.slate { background: linear-gradient(135deg, #64748b, #475569); }
.kpi h4 { margin: 0 0 .2rem; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .sub { color: var(--muted); font-size: .78rem; margin-top: .15rem; }

/* ---------- Tables ---------- */
.grid { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--card);
        border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid th, .grid td { padding: .72rem .9rem; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.grid thead th { background: #f3f8f7; color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: #f6fbfa; }
.grid a { color: var(--accent); font-weight: 600; }

/* ---------- Buttons ---------- */
button, .btn {
    font-family: inherit; font-size: .9rem; font-weight: 600;
    padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--card); color: var(--text); cursor: pointer; transition: all .12s;
    display: inline-flex; align-items: center; gap: .4rem;
}
button:hover { background: #f6fbfa; border-color: var(--accent); color: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; box-shadow: 0 6px 16px rgba(13,148,136,.28); }
button.primary:hover { filter: brightness(1.05); color: #fff; }
.btn-danger { border: 1px solid var(--bad); background: #fff; color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

/* ---------- Forms ---------- */
input, textarea, select {
    font-family: inherit; font-size: .92rem; padding: .52rem .68rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.16); }
input[type=text], input:not([type]) { min-width: 320px; }
label { display: block; margin-bottom: .25rem; }
.form-row { margin-bottom: 1.1rem; max-width: 640px; }
.form-row label { font-weight: 700; font-size: .88rem; }
.form-row small { display: block; color: var(--muted); margin-top: .25rem; font-size: .8rem; }
.actions { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.actions .status { margin-left: .25rem; color: var(--muted); font-style: italic; }
.status { color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 1.3rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap;
           background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.filters label { font-weight: 600; display: inline; margin: 0; }

/* ---------- Status pills ---------- */
.status-pill { padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; display: inline-block; }
.status-active   { background: var(--accent-soft); color: var(--accent-hover); }
.status-pending  { background: #fef3c7; color: #92400e; }
.status-inactive { background: #fee2e2; color: #991b1b; }

.row-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.row-actions button { padding: .35rem .7rem; font-size: .82rem; }

/* ---------- Mapping / lists ---------- */
.attr-list { list-style: none; padding: 0; margin: .4rem 0; }
.attr-list li { display: flex; align-items: center; gap: .45rem; padding: .4rem 0; border-bottom: 1px solid var(--line-soft); }
.attr-list .name { flex: 1; max-width: 260px; }
.add-row { display: flex; gap: .45rem; align-items: center; margin-top: .7rem; flex-wrap: wrap; }
.add-row input { min-width: 160px; }

.empty { background: var(--card); padding: 1.6rem; border: 1px dashed #b9d8d2; border-radius: var(--radius); color: var(--muted); }

/* select-all checkbox labels (Choose products) */
.selall { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; margin: 0; }
.selall input { width: auto; min-width: 0; cursor: pointer; }

/* Rx / OTC sections within a category (Choose products) */
.prod-section { border-radius: 12px; padding: .45rem .65rem .35rem; margin-top: .8rem; border: 1px solid transparent; }
.prod-section.rx  { background: #eff6ff; border-color: #dbeafe; }   /* very light blue */
.prod-section.otc { background: #f3fbf6; border-color: #e4f3ea; }   /* very soft green */
.sec-label { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
             padding: .25rem .25rem .45rem; display: inline-flex; align-items: center; gap: .4rem; }
.prod-section.rx  .sec-label { color: #1d4ed8; }
.prod-section.otc .sec-label { color: #15803d; }
.prod-section .grid { background: transparent; box-shadow: none; border: none; border-radius: 0; }
.prod-section .grid thead th { background: transparent; }
.prod-section .grid th, .prod-section .grid td { border-bottom: 1px solid rgba(15,42,48,.07); }
.prod-section .grid tbody tr:hover { background: rgba(255,255,255,.55); }

/* autocomplete dropdown (widget "Links to") */
.autocomplete {
    position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: var(--shadow-md); max-height: 260px; overflow: auto; margin-top: 3px;
}
.ac-item { padding: .5rem .7rem; cursor: pointer; font-size: .88rem; display: flex; gap: .8rem; justify-content: space-between; align-items: center; }
.ac-item:hover { background: var(--accent-soft); }
.ac-item .muted { font-size: .74rem; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* program picker cards (affiliate with multiple programs) */
.program-cards { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1rem; }
.program-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem;
    width: 220px; height: 170px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; padding: 1rem;
}
.program-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.program-card img { max-height: 64px; max-width: 160px; object-fit: contain; }
.program-card span { font-weight: 700; font-size: 1rem; color: var(--text); }

.page-head { display: flex; align-items: center; margin-bottom: 1.3rem; gap: 1rem; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.muted { color: var(--muted); }

/* ---------- Carded edit form ---------- */
.edit-card { margin-bottom: 1.2rem; max-width: 980px; }

/* form on the left, sticky preview on the right */
.edit-2col { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.2rem; align-items: start; }
.edit-2col .edit-card { max-width: none; }
.edit-2col .preview-pane { position: sticky; top: 80px; }

/* HTML-widget preview: mirror the live renderer so images fit the box */
.html-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.html-preview img { max-width: 100%; max-height: 100%; height: auto; min-height: 0; display: block; }
@media (max-width: 980px) { .edit-2col { grid-template-columns: 1fr; } .edit-2col .preview-pane { position: static; } }
.edit-card .form-row { max-width: none; }
.edit-card input:not([type=checkbox]), .edit-card select { width: 100%; min-width: 0; box-sizing: border-box; }

/* Forms builder: give the live preview more room so multi-column layouts show */
.form-2col { grid-template-columns: minmax(0, 1fr) 600px; }
@media (max-width: 1280px) { .form-2col { grid-template-columns: minmax(0, 1fr) 420px; } }
@media (max-width: 980px)  { .form-2col { grid-template-columns: 1fr; } }

/* ---------- Lead-form field builder ---------- */
.builder-page { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; margin-bottom: 1rem; background: #fafbfc; }
.bp-head { display: flex; align-items: center; gap: .35rem; margin-bottom: .7rem; }
.bp-badge { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bp-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-bottom: .7rem; }
@media (max-width: 620px) { .bp-row3 { grid-template-columns: 1fr; } }
.builder-field { border: 1px solid var(--line); border-radius: 8px; padding: .55rem; margin-bottom: .5rem; background: #fff; }
.bf-main { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.bf-main > input, .bf-main > select { min-width: 0; }
.bf-req { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; white-space: nowrap; }
.bf-sub { width: 100%; margin-top: .4rem; box-sizing: border-box; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: .3rem .45rem; cursor: pointer; color: var(--muted); line-height: 1; }
.icon-btn:hover:not(:disabled) { background: #f2f4f7; color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.btn-danger { color: var(--bad); }
.add-field, .add-page { border: 1px dashed var(--line); background: #fff; border-radius: 8px; padding: .5rem .8rem; cursor: pointer; color: var(--muted); font-weight: 600; }
.add-field { width: 100%; margin-top: .3rem; }
.add-page { width: 100%; margin-top: .3rem; }
.add-field:hover, .add-page:hover { border-color: var(--brand, #2563eb); color: var(--text); }

/* ---------- Leads review ---------- */
.detail-row > td { background: #fafbfc; }
.lead-detail { padding: .6rem .2rem; }
.lead-answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem .9rem; margin-bottom: .6rem; }
.ans { display: flex; flex-direction: column; }
.ans-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.ans-v { font-size: .92rem; }
.deny-box { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }

/* ---------- Affiliate portal section heading ---------- */
.portal-section { font-size: 1.05rem; font-weight: 700; margin: 0 0 .2rem; padding-bottom: .35rem; border-bottom: 2px solid var(--line); max-width: 860px; }

/* ---------- Affiliate sign-up — TelehealthCash-style (red / Archivo / light) ---------- */
.signup-card {
    background: #fff; border: 1px solid #e8e8ea; border-radius: 20px;
    box-shadow: 0 24px 60px rgba(10,10,10,.08); max-width: 460px; margin: 0 auto; padding: 2.2rem;
}
.signup-card h1 { font-family: 'Archivo', sans-serif; font-weight: 900; text-transform: uppercase; font-size: 26px; letter-spacing: -.01em; color: #0a0a0a; margin: .1rem 0 .3rem; }
.signup-card label { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: #0a0a0a; }
.signup-card input { border: 1.5px solid #e8e8ea; border-radius: 10px; padding: 13px 15px; font-size: 15px; }
.signup-card input:focus { outline: none; border-color: #e11d2a; box-shadow: 0 0 0 4px rgba(225,27,34,.12); }
.signup-card .primary { background: #e11d2a !important; border: none; box-shadow: 0 10px 24px rgba(225,27,34,.28); font-family: 'Archivo', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 10px; padding: 15px 28px; }
.signup-card .primary:hover { filter: brightness(1.04); }
.signup-card .ref-note { background: rgba(225,27,34,.06); border: 1px solid rgba(225,27,34,.25); color: #0a0a0a; }

/* ---------- Sign-up 2-step indicator ---------- */
.wiz-steps { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.wiz-step { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.wiz-step.active { color: var(--text); }
.wiz-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; background: #e5e7eb; color: var(--muted); }
.wiz-step.active .wiz-dot { background: #e11d2a; color: #fff; }
.wiz-line { flex: 1; height: 2px; background: #e5e7eb; }

/* ---------- Form embed & share panel ---------- */
.embed-box { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.embed-label { display: block; font-weight: 700; font-size: .82rem; margin: .8rem 0 .3rem; }
.embed-hint { font-size: .78rem; margin: .35rem 0 0; }

/* ---------- Inline warning banner ---------- */
.warn-banner {
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    padding: .7rem .9rem; border-radius: var(--radius-sm); margin: 1rem 0; font-size: .9rem;
    display: flex; align-items: flex-start; gap: .55rem;
}
.warn-banner i { font-size: 1.1rem; margin-top: .05rem; }

/* ---------- Public signup ---------- */
.signup-card {
    background: var(--card); border-radius: 20px; box-shadow: var(--shadow-md);
    padding: 2.2rem; width: 100%; max-width: 460px; margin: 2rem auto;
}
.signup-card h1 { margin: .2rem 0 .2rem; }
.signup-card .form-row { max-width: none; margin-bottom: .9rem; }
.signup-card input { width: 100%; min-width: 0; }
.ref-note {
    background: var(--accent-soft); color: var(--accent-hover); border-radius: 8px;
    padding: .5rem .7rem; font-size: .85rem; margin-bottom: 1rem;
    display: flex; align-items: center; gap: .4rem; font-weight: 700;
}

/* ---------- Auth ---------- */
.auth-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 2rem;
    background: #f7f7f8;
}
.auth-card {
    background: var(--card); border: 1px solid #e8e8ea; border-radius: 20px; box-shadow: 0 24px 60px rgba(10,10,10,.08);
    padding: 2.2rem 2.2rem 2rem; width: 100%; max-width: 400px;
}
.auth-card h1 { margin: .2rem 0 0; }
.auth-card .muted { margin: 0 0 1.4rem; }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand-text {
    font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-card .form-row { max-width: none; }
.auth-card input { width: 100%; min-width: 0; }
.auth-error {
    background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
    padding: .6rem .8rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .88rem;
    display: flex; align-items: center; gap: .4rem;
}

/* -------------------------------------------------------------------------------------
   Segmented Yes/No toggle.

   Used for choices where both options need a visible label, so neither reads as the
   "off" state of a checkbox. The coupon binding choice is the first: "For life" and
   "One-time" are equally valid, and a bare checkbox would not say which is which.
   ------------------------------------------------------------------------------------- */
.seg-toggle {
    display: inline-flex;
    border: 1px solid var(--line, #d8dee9);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.seg-toggle .seg {
    border: 0;
    background: transparent;
    padding: .38rem 1.1rem;
    font: inherit;
    font-weight: 600;
    color: #5b6673;
    cursor: pointer;
    transition: background .12s, color .12s;
}

.seg-toggle .seg + .seg { border-left: 1px solid var(--line, #d8dee9); }
.seg-toggle .seg:hover:not(.on) { background: var(--accent-soft); color: var(--accent-hover); }

.seg-toggle .seg.on {
    background: var(--accent);
    color: #fff;
}

.seg-toggle .seg:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: -2px;
}

/* -------------------------------------------------------------------------------------
   Chip picker — a horizontal set of choices shown all at once.

   Preferred over a <select> when the list is short and the options are worth seeing
   without a click: picking a coupon's affiliate, for instance, where "All" needs to sit
   visibly beside the individual names rather than hiding as one entry in a dropdown.
   ------------------------------------------------------------------------------------- */
.chip-picker {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .55rem;
    border: 1px solid var(--line, #d8dee9);
    border-radius: 10px;
    background: #fbfcfd;
}

.chip-picker .chip {
    border: 1px solid var(--line, #d8dee9);
    background: #fff;
    color: #3d4753;
    padding: .34rem .85rem;
    border-radius: 999px;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}

.chip-picker .chip:hover:not(.on) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.chip-picker .chip.on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* "All" reads as a different kind of choice from a person's name, so it is set apart
   by a dashed edge rather than a different colour. */
.chip-picker .chip-all { border-style: dashed; }
.chip-picker .chip-all.on { border-style: solid; }

.chip-picker .chip:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
}
