/* KwikStartup Manager — Frontend CSS v1.0.0 */
:root {
    --ksm-primary: #16815e;
    --ksm-dark:    #0f0f0f;
    --ksm-white:   #ffffff;
    --ksm-light:   #f5f5f5;
    --ksm-border:  #e2e2e2;
    --ksm-text:    #111111;
    --ksm-muted:   #666666;
    --ksm-shadow:  0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
}

/* ════════════════════════════════════════
   PACKAGES SECTION
════════════════════════════════════════ */
.ksm-packages-section { padding: 40px 0; box-sizing: border-box; }
.ksm-packages-section *,
.ksm-packages-section *::before,
.ksm-packages-section *::after { box-sizing: border-box; }
.ksm-packages-section ul, .ksm-packages-section ol { list-style: none; margin: 0; padding: 0; }
.ksm-packages-section p { margin: 0; }

.ksm-section-header { text-align: center; margin-bottom: 40px; }
.ksm-section-title  { font-size: clamp(24px, 4vw, 36px); font-weight: 900; color: var(--ksm-dark); margin: 0 0 10px; }
.ksm-section-sub    { font-size: 16px; color: var(--ksm-muted); margin: 0; }

/* Grid */
.ksm-packages-grid { display: grid; gap: 24px; }
.ksm-cols-1 { grid-template-columns: 1fr; }
.ksm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ksm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ksm-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Package Card */
.ksm-package-card {
    background: var(--ksm-white);
    border: 1px solid var(--ksm-border);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ksm-package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.ksm-featured {
    border-color: var(--ksm-primary);
    box-shadow: 0 0 0 2px var(--ksm-primary);
}

/* Badge */
.ksm-pkg-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 4px 12px;
    text-transform: uppercase;
}

/* Card Top */
.ksm-pkg-top { padding: 24px 24px 16px; }
.ksm-pkg-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
    line-height: 1.2;
}
.ksm-pkg-tagline {
    font-size: 13px;
    color: var(--ksm-muted);
    margin: 0 0 14px;
}
.ksm-pkg-price {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

/* Card Body */
.ksm-pkg-body { padding: 0 24px 16px; flex: 1; }
.ksm-pkg-desc { font-size: 13px; color: var(--ksm-muted); margin: 0 0 14px; }
.ksm-pkg-includes {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.ksm-pkg-includes li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--ksm-text);
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    line-height: 1.4;
}
.ksm-check {
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.ksm-pkg-bestfor {
    font-size: 12px;
    color: var(--ksm-muted);
    background: #f9f9f9;
    padding: 8px 10px;
    margin: 0;
    border-left: 3px solid var(--ksm-primary);
}

/* Card Footer */
.ksm-pkg-footer { padding: 16px 24px 24px; }
/* Protect all KSM buttons from theme hover overrides */
.ksm-cta-btn,
.ksm-bundle-pay-btn {
    color: #fff !important;
}

.ksm-cta-btn {
    width: 100%;
    padding: 13px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .02em;
    transition: opacity .2s, transform .15s;
}
.ksm-cta-btn:hover { filter: brightness(0.85); transform: scale(1.01); color: #fff !important; }
.ksm-cta-btn:active { transform: scale(.98); }

/* ── Layout: Minimal ── */
.ksm-layout-minimal .ksm-package-card {
    border: none;
    border-bottom: 2px solid var(--ksm-border);
    padding-bottom: 20px;
}
.ksm-layout-minimal .ksm-pkg-top { padding-left: 0; padding-right: 0; }
.ksm-layout-minimal .ksm-pkg-body { padding-left: 0; padding-right: 0; }
.ksm-layout-minimal .ksm-pkg-footer { padding-left: 0; padding-right: 0; }

/* ── Layout: Bold ── */
.ksm-layout-bold .ksm-package-card { background: var(--ksm-dark); border-color: #333; }
.ksm-layout-bold .ksm-pkg-name    { color: #fff; }
.ksm-layout-bold .ksm-pkg-tagline { color: rgba(255,255,255,.6); }
.ksm-layout-bold .ksm-pkg-includes li { color: rgba(255,255,255,.85); border-color: #222; }
.ksm-layout-bold .ksm-pkg-bestfor { background: #1a1a1a; color: rgba(255,255,255,.6); }
.ksm-layout-bold .ksm-pkg-desc { color: rgba(255,255,255,.5); }

/* ════════════════════════════════════════
   PAYMENT MODAL
════════════════════════════════════════ */
.ksm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ksm-fadein .2s ease;
}
.ksm-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: ksm-slidein .25s cubic-bezier(.34,1.3,.64,1);
}
@keyframes ksm-fadein  { from { opacity:0; } to { opacity:1; } }
@keyframes ksm-slidein { from { transform:translateY(30px); opacity:0; } to { transform:none; opacity:1; } }

.ksm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: var(--ksm-dark);
    color: #fff;
}
.ksm-modal-header h3 { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.ksm-modal-price { margin: 4px 0 0; font-size: 22px; font-weight: 900; color: #fff !important; }
.ksm-modal-close {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ksm-modal-close:hover { background: rgba(255,255,255,.25); }

.ksm-modal-body { padding: 24px; }
.ksm-modal-intro { font-size: 13px; color: var(--ksm-muted); margin: 0 0 20px; }

.ksm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ksm-form-field { margin-bottom: 14px; }
.ksm-form-field label { display: block; font-size: 12px; font-weight: 700; color: var(--ksm-text); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.ksm-req { color: var(--ksm-primary); }
.ksm-form-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--ksm-border);
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.ksm-form-field input:focus {
    border-color: var(--ksm-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22,129,94,.1);
}
.ksm-form-hint { display: block; font-size: 11px; color: var(--ksm-muted); margin-top: 4px; }
.ksm-form-error { background: #fee2e2; color: #991b1b; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

.ksm-pay-btn {
    width: 100%;
    padding: 14px;
    background: #16815e !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
    transition: background .2s, filter .2s;
    border-radius: 4px;
}
.ksm-pay-btn:hover    { background: #0f6349 !important; color: #fff !important; }
.ksm-pay-btn:disabled { opacity: .6; cursor: wait; }
.ksm-secure-note { font-size: 12px; color: var(--ksm-muted); text-align: center; margin: 12px 0 0; }

/* ════════════════════════════════════════
   CHAT WIDGET
════════════════════════════════════════ */
#ksm-widget-launcher {
    position: fixed;
    bottom: 24px;
    z-index: 99998;
    background: var(--ksm-primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(22,129,94,.45);
    transition: transform .2s cubic-bezier(.34,1.5,.64,1), box-shadow .2s;
    user-select: none;
}
#ksm-widget-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(22,129,94,.55);
}
#ksm-launcher-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 700;
}
#ksm-launcher-inner svg { width: 20px; height: 20px; stroke: #fff; flex-shrink: 0; }
#ksm-widget-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff3b5c;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: ksm-pulse 2s infinite;
}
@keyframes ksm-pulse {
    0%,100% { box-shadow:0 0 0 0 rgba(255,59,92,.5); }
    50%      { box-shadow:0 0 0 6px rgba(255,59,92,0); }
}

#ksm-widget-window {
    position: fixed !important;
    bottom: 88px !important;
    z-index: 99999 !important;
    width: 380px !important;
    max-width: calc(100vw - 32px) !important;
    height: 580px !important;
    max-height: calc(100vh - 110px) !important;
    background: var(--ksm-widget-bg, #ffffff) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.4) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform-origin: bottom right;
    transform: scale(.85) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s cubic-bezier(.34,1.4,.64,1), opacity .25s ease;
    font-family: -apple-system, 'Segoe UI', sans-serif;
    border-radius: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    top: auto !important;
}
#ksm-widget-window.ksm-w-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

#ksm-widget-header {
    background: linear-gradient(135deg, var(--ksm-dark) 0%, #1e1e1e 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#ksm-widget-header-left { display:flex; align-items:center; gap:10px; }
#ksm-widget-avatar {
    width: 38px;
    height: 38px;
    background: var(--ksm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#ksm-widget-avatar svg { width:20px; height:20px; fill:#fff; }
#ksm-widget-name   { font-size:14px; font-weight:700; }
#ksm-widget-status { font-size:11px; color:rgba(255,255,255,.7); display:flex; align-items:center; gap:5px; margin-top:2px; }
.ksm-w-dot { width:6px; height:6px; background:#4ade80; border-radius:50%; animation:ksm-blink 2.5s infinite; }
@keyframes ksm-blink { 0%,100%{opacity:1;} 50%{opacity:.35;} }
#ksm-widget-close {
    background: rgba(255,255,255,.1);
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .2s;
}
#ksm-widget-close:hover { background: rgba(255,255,255,.22); }

#ksm-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    scroll-behavior: smooth;
    background: var(--ksm-widget-bg, #fff);
}
#ksm-widget-messages::-webkit-scrollbar { width:3px; }
#ksm-widget-messages::-webkit-scrollbar-thumb { background:#ddd; }

.ksm-w-msg { display:flex; flex-direction:column; max-width:84%; animation:ksm-msg-in .25s ease; }
@keyframes ksm-msg-in { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:none;} }
.ksm-w-msg.ksm-w-ai   { align-self:flex-start; }
.ksm-w-msg.ksm-w-user { align-self:flex-end; }
.ksm-w-bubble {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}
.ksm-w-ai   .ksm-w-bubble { background:var(--ksm-widget-bubble-ai, #f0f0f0); color:var(--ksm-widget-text, #111); }
.ksm-w-user .ksm-w-bubble { background:var(--ksm-primary); color:#fff; }
.ksm-w-time { font-size:10px; color:#aaa; margin-top:3px; padding:0 2px; }
.ksm-w-user .ksm-w-time { text-align:right; }

.ksm-w-typing { display:flex; align-items:center; gap:4px; padding:12px 14px; background:#f0f0f0; width:fit-content; }
.ksm-w-typing span { width:6px; height:6px; background:#aaa; border-radius:50%; animation:ksm-typ 1.2s infinite; }
.ksm-w-typing span:nth-child(2) { animation-delay:.2s; }
.ksm-w-typing span:nth-child(3) { animation-delay:.4s; }
@keyframes ksm-typ { 0%,100%{transform:none;opacity:.4;} 50%{transform:translateY(-4px);opacity:1;} }

#ksm-widget-qr { padding:4px 14px 6px; display:flex; flex-wrap:wrap; gap:6px; flex-shrink:0; }
.ksm-w-qr-btn {
    background:#fff;
    border:1.5px solid var(--ksm-primary);
    color:var(--ksm-primary);
    padding:5px 12px;
    font-size:12px;
    font-weight:600;
    cursor:pointer;
    transition:background .2s,color .2s;
    font-family:inherit;
}
.ksm-w-qr-btn:hover { background:var(--ksm-primary); color:#fff; }

/* input/send now inside #ksm-widget-footer */
#ksm-widget-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--ksm-widget-border, rgba(0,0,0,.1));
    flex-shrink: 0;
    background: var(--ksm-widget-bg, #fff);
}
#ksm-widget-footer #ksm-widget-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid var(--ksm-border);
    padding: 9px 14px;
    font-size: 13px;
    font-family: inherit;
    background: var(--ksm-widget-input-bg, #f9f9f9);
    color: var(--ksm-widget-text, #111);
    outline: none;
    border-radius: 20px;
    transition: border-color .2s, box-shadow .2s;
}
#ksm-widget-footer #ksm-widget-input:focus { border-color: var(--ksm-primary); box-shadow: 0 0 0 2px rgba(22,129,94,.1); }
#ksm-widget-footer #ksm-widget-send {
    width: 38px;
    height: 38px;
    background: var(--ksm-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background .2s, transform .15s;
    box-shadow: 0 3px 8px rgba(22,129,94,.35);
}
#ksm-widget-footer #ksm-widget-send:hover { background: #0f6349; transform: scale(1.07); }
#ksm-widget-footer #ksm-widget-send svg { width: 16px; height: 16px; }

/* Links inside chat */
.ksm-w-bubble a { color:var(--ksm-primary); text-decoration:underline; font-weight:600; word-break:break-all; }
.ksm-w-user .ksm-w-bubble a { color:#fff; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) { .ksm-cols-4 { grid-template-columns:repeat(2,1fr); } .ksm-cols-3 { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 600px) {
    .ksm-cols-2,.ksm-cols-3,.ksm-cols-4 { grid-template-columns:1fr; }
    .ksm-form-row { grid-template-columns:1fr; }
    #ksm-widget-window { bottom:0 !important; right:0 !important; left:0 !important; width:100% !important; max-width:100% !important; height:85vh !important; max-height:85vh !important; border-radius:16px 16px 0 0 !important; transform:translateY(100%); transition:transform .3s cubic-bezier(.34,1.2,.64,1),opacity .2s; }
    #ksm-widget-window.ksm-w-open { transform:translateY(0); opacity:1; }
    #ksm-widget-launcher { bottom:16px; right:16px!important; }
}

/* ════════════════════════════════════════
   IDEA HUB
════════════════════════════════════════ */
.ksm-ideahub-wrap {
    background: #fff;
    border: 2px solid var(--ksm-primary);
    overflow: hidden;
    font-family: -apple-system, 'Segoe UI', sans-serif;
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}
/* Defensive resets so the theme can't break ideahub children */
.ksm-ideahub-wrap *, .ksm-ideahub-wrap *::before, .ksm-ideahub-wrap *::after { box-sizing: border-box; }
.ksm-ideahub-wrap ul, .ksm-ideahub-wrap ol { list-style: none; margin: 0; padding: 0; }
.ksm-ideahub-wrap p  { margin: 0; }
.ksm-ideahub-wrap h3 { margin: 0; }
.ksm-ideahub-wrap button { font-family: inherit; }

.ksm-ideahub-header {
    background: linear-gradient(135deg, var(--ksm-dark) 0%, #1e1e1e 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}
.ksm-ideahub-avatar {
    width: 48px;
    height: 48px;
    background: var(--ksm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.ksm-ideahub-title { margin: 0; font-size: 18px; font-weight: 800; color: #fff !important; text-align: left; }
.ksm-ideahub-sub   { margin: 4px 0 0; font-size: 13px; color: rgba(255,255,255,.75) !important; text-align: left; }

.ksm-ideahub-messages {
    overflow-y: auto;
    padding: 20px 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafafa;
    scroll-behavior: smooth;
    text-align: left;
}
.ksm-ideahub-messages::-webkit-scrollbar { width: 4px; }
.ksm-ideahub-messages::-webkit-scrollbar-thumb { background: #ddd; }

.ksm-ih-msg { display: flex; flex-direction: column; max-width: 85%; animation: ksm-msg-in .25s ease; }
.ksm-ih-ai   { align-self: flex-start; }
.ksm-ih-user { align-self: flex-end; }
.ksm-ih-bubble {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.ksm-ih-ai   .ksm-ih-bubble { background: #fff; border: 1px solid #e8e8e8; color: #111; }
.ksm-ih-user .ksm-ih-bubble { background: var(--ksm-primary); color: #fff; }
.ksm-ih-bubble a { color: var(--ksm-primary); text-decoration: underline; font-weight: 600; }
.ksm-ih-user .ksm-ih-bubble a { color: #fff; }
.ksm-ih-time { font-size: 10px; color: #bbb; margin-top: 4px; padding: 0 2px; }
.ksm-ih-user .ksm-ih-time { text-align: right; }

.ksm-ih-typing { display: flex; align-items: center; gap: 5px; }
.ksm-ih-typing span { width: 8px; height: 8px; background: #bbb; border-radius: 50%; animation: ksm-typ 1.2s infinite; }
.ksm-ih-typing span:nth-child(2) { animation-delay: .2s; }
.ksm-ih-typing span:nth-child(3) { animation-delay: .4s; }

.ksm-ideahub-qr {
    padding: 6px 20px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fafafa;
}
.ksm-ih-qr-btn {
    background: #fff;
    border: 1.5px solid var(--ksm-primary);
    color: var(--ksm-primary);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    font-family: inherit;
}
.ksm-ih-qr-btn:hover { background: var(--ksm-primary); color: #fff; }

.ksm-ideahub-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid #e8e8e8;
    background: #fff;
}
.ksm-ideahub-input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
}
.ksm-ideahub-send {
    width: 52px;
    height: 52px;
    background: var(--ksm-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.ksm-ideahub-send:hover { background: #0f6349; }
.ksm-ideahub-send svg { width: 18px; height: 18px; }
.ksm-ideahub-powered { text-align: center; font-size: 11px; color: #aaa; padding: 6px; background: #fff; border-top: 1px solid #f0f0f0; }
.ksm-ideahub-powered strong { color: var(--ksm-primary); }

/* ── Bundle card (inline in chat) ── */
.ksm-ih-bundle-card {
    background: #fff;
    border: 2px solid var(--ksm-primary);
    border-radius: 10px;
    overflow: hidden;
    margin: 4px 0;
    max-width: 340px;
    align-self: flex-start;
}
.ksm-bundle-header {
    background: var(--ksm-primary);
    color: #fff;
    padding: 12px 16px;
}
.ksm-bundle-tag {
    display: inline-block;
    background: rgba(255,255,255,.2);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 4px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.ksm-bundle-header strong { display: block; font-size: 15px; }
.ksm-bundle-items {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}
.ksm-bundle-items li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: #333;
}
.ksm-bundle-pricing {
    padding: 10px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.ksm-bundle-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #555;
}
.ksm-bundle-total {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid #e0e0e0;
}

/* ── Bundle payment form (inline, replaces the old modal) ── */
.ksm-bundle-form {
    padding: 14px 16px 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.ksm-bundle-form-title {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}
.ksm-bundle-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.ksm-bundle-form-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    color: #111;
    border-radius: 4px;
    transition: border-color .15s;
    display: block;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.ksm-bundle-form-input:focus { outline: none; border-color: var(--ksm-primary); background: #fff; }
.ksm-bundle-form-err {
    color: #c00;
    font-size: 12px;
    min-height: 16px;
    margin: 0 0 8px;
}
.ksm-bundle-pay-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--ksm-primary);
    color: #fff !important;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .2s;
    border-radius: 4px;
    margin-bottom: 6px;
}
.ksm-bundle-pay-btn:hover    { opacity: .88; }
.ksm-bundle-pay-btn:disabled { opacity: .55; cursor: wait; }
.ksm-bundle-secure {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin: 0;
}
.ksm-bundle-success {
    padding: 20px 16px;
    text-align: center;
}
.ksm-bundle-success-icon  { font-size: 40px; margin-bottom: 8px; }
.ksm-bundle-success-title { font-size: 16px; font-weight: 800; color: var(--ksm-primary); margin-bottom: 4px; }
.ksm-bundle-success-msg   { font-size: 13px; color: #555; }


/* ════════════════════════════════════════
   ONBOARDING FORM
════════════════════════════════════════ */
.ksm-ob-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: inherit;
    box-sizing: border-box;
}
.ksm-ob-wrap *, .ksm-ob-wrap *::before, .ksm-ob-wrap *::after { box-sizing: border-box; }
.ksm-ob-wrap ul, .ksm-ob-wrap ol { list-style: none; }
.ksm-ob-wrap p { margin: 0; }
.ksm-ob-header {
    text-align: center;
    padding: 40px 24px 32px;
    margin-bottom: 24px;
}
.ksm-ob-logo {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ksm-primary);
    margin-bottom: 12px;
}
.ksm-ob-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #111;
}
.ksm-ob-subtitle {
    color: #555;
    font-size: 15px;
    margin: 0;
}

/* Customer details block */
.ksm-ob-customer {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.ksm-ob-customer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 12px;
}
.ksm-ob-cfield { display: flex; flex-direction: column; gap: 2px; }
.ksm-ob-clabel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #999; font-weight: 600; }
.ksm-ob-cval   { font-size: 14px; font-weight: 600; color: #111; }
.ksm-ob-locked-note { font-size: 12px; color: #888; margin: 0; }

/* Section cards */
.ksm-ob-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ksm-ob-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--ksm-dark, #0f0f0f) 0%, #1a1a1a 100%);
    color: #fff;
}
.ksm-ob-section-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff !important;
}
.ksm-ob-section-header p {
    margin: 3px 0 0;
    font-size: 13px;
    color: rgba(255,255,255,.65);
}
.ksm-ob-section-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.ksm-ob-fields {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.ksm-ob-fields .ksm-ob-field-row {
    width: 100%;
}

/* Fields */
.ksm-ob-field { display: flex; flex-direction: column; gap: 6px; }
.ksm-ob-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.ksm-ob-field input[type="text"],
.ksm-ob-field input[type="email"],
.ksm-ob-field input[type="tel"],
.ksm-ob-field select,
.ksm-ob-field textarea {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    background: #fff;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
}
.ksm-ob-field input:focus,
.ksm-ob-field select:focus,
.ksm-ob-field textarea:focus {
    outline: none;
    border-color: var(--ksm-primary);
    box-shadow: 0 0 0 3px rgba(22,129,94,.1);
}
.ksm-ob-hint {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}
.ksm-ob-req { color: var(--ksm-primary); }
.ksm-ob-field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 600px) {
    .ksm-ob-field-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Radio and checkbox groups */
.ksm-ob-check-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 600px) {
    .ksm-ob-check-group {
        grid-template-columns: 1fr 1fr;
    }
}
.ksm-ob-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ksm-ob-radio,
.ksm-ob-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    transition: all .15s;
    width: 100%;
    box-sizing: border-box;
}
.ksm-ob-radio:hover,
.ksm-ob-check:hover { border-color: var(--ksm-primary); background: #f0fdf8; }
.ksm-ob-radio input,
.ksm-ob-check input { accent-color: var(--ksm-primary); flex-shrink: 0; }

/* File upload */
.ksm-ob-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color .2s;
}
.ksm-ob-upload-area:hover { border-color: var(--ksm-primary); }
.ksm-ob-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px;
    cursor: pointer;
    text-align: center;
    color: #555;
    font-size: 13px;
}
.ksm-ob-upload-icon { font-size: 32px; }
.ksm-ob-upload-hint { font-size: 12px; color: #999; }
.ksm-ob-upload-area input[type="file"] { display: none; }
.ksm-ob-file-list { padding: 0 16px 12px; }
.ksm-ob-file-item {
    font-size: 12px;
    color: #166534;
    padding: 4px 0;
    border-top: 1px solid #e8f5e9;
}

/* Submit */
.ksm-ob-submit-wrap {
    margin-top: 28px;
    text-align: center;
}
.ksm-ob-submit-note {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}
.ksm-ob-submit-btn {
    background: var(--ksm-primary) !important;
    color: #fff !important;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity .2s;
    font-family: inherit;
    width: 100%;
    max-width: 400px;
}
.ksm-ob-submit-btn:hover { opacity: .88; }
.ksm-ob-form-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    text-align: left;
}

/* Success banner */
.ksm-ob-success-banner {
    text-align: center;
    padding: 60px 24px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}
.ksm-ob-success-icon { font-size: 56px; margin-bottom: 16px; }
.ksm-ob-success-banner h2 { color: #166534; margin: 0 0 8px; }
.ksm-ob-success-banner p { color: #555; margin: 0; }

.ksm-ob-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 20px 24px;
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 600px) {
    .ksm-ob-customer-grid { grid-template-columns: 1fr; }
}

/* ── Director rows ── */
.ksm-directors-wrap { display: flex; flex-direction: column; gap: 16px; }
.ksm-director-row {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}
.ksm-director-header {
    margin-bottom: 12px;
    font-size: 13px;
    color: #444;
    overflow: hidden;
}
.ksm-add-director-btn {
    margin-top: 10px;
    background: none;
    border: 2px dashed var(--ksm-primary, #16815e);
    color: var(--ksm-primary, #16815e);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
    transition: background .15s;
}
.ksm-add-director-btn:hover {
    background: #f0fdf8;
}

/* ── Founders Room block ── */
.ksm-ob-founders-room {
    margin-top: 28px;
    padding: 24px;
    background: #f0fdf8;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    text-align: center;
}
.ksm-ob-founders-room h3 {
    margin: 0 0 8px;
    color: #16815e;
    font-size: 18px;
}
.ksm-ob-founders-room p {
    color: #555;
    font-size: 14px;
    margin: 0 0 20px;
}
.ksm-ob-founders-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.ksm-ob-founders-btn {
    display: inline-block;
    padding: 13px 28px;
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity .2s;
}
.ksm-ob-founders-btn:hover { opacity: .88; }
.ksm-ob-founders-wa { background: #25D366; }
.ksm-ob-founders-tg { background: #229ED9; }

/* ════════════════════════════════════════
   CUSTOMER PORTAL
════════════════════════════════════════ */
.ksm-portal-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: inherit;
    box-sizing: border-box;
}
.ksm-portal-wrap *, .ksm-portal-wrap *::before, .ksm-portal-wrap *::after { box-sizing: border-box; }
.ksm-portal-wrap p { margin: 0; }

/* Login box */
.ksm-portal-login-box {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 460px;
    margin: 40px auto;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.ksm-portal-login-icon { font-size: 40px; margin-bottom: 12px; }
.ksm-portal-login-box h2 { margin: 0 0 8px; color: #111; font-size: 22px; }
.ksm-portal-login-box p  { color: #666; font-size: 14px; margin: 0 0 24px; }

.ksm-portal-form { text-align: left; }
.ksm-portal-field { margin-bottom: 16px; }
.ksm-portal-field label { display: block; font-size: 12px; font-weight: 700; color: #444; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.ksm-portal-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.ksm-portal-field input:focus { outline: none; border-color: var(--ksm-primary); box-shadow: 0 0 0 3px rgba(22,129,94,.1); }
.ksm-portal-hint { font-size: 12px; color: #888; display: block; margin-top: 4px; }
.ksm-portal-btn {
    width: 100%;
    padding: 13px;
    background: var(--ksm-primary, #16815e) !important;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: filter .2s;
    font-family: inherit;
}
.ksm-portal-btn:hover { filter: brightness(.88); }
.ksm-portal-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

/* Portal dashboard header */
.ksm-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.ksm-portal-greeting { font-size: 13px; color: #888; margin-bottom: 4px; }
.ksm-portal-pkg      { font-size: 22px; font-weight: 800; margin: 0 0 4px; color: #111; }
.ksm-portal-ref      { font-size: 12px; color: #aaa; }
.ksm-portal-logout   { font-size: 13px; color: #888; text-decoration: none; padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; white-space: nowrap; }
.ksm-portal-logout:hover { color: #c00; border-color: #c00; }

/* Progress bar */
.ksm-portal-progress-wrap { margin-bottom: 28px; }
.ksm-portal-progress-bar  { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.ksm-portal-progress-fill { height: 100%; background: var(--ksm-primary, #16815e); border-radius: 4px; transition: width .4s; }
.ksm-portal-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #888; }

/* Item cards */
.ksm-portal-items { display: flex; flex-direction: column; gap: 12px; }
.ksm-portal-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ksm-portal-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.ksm-portal-item-name { font-weight: 700; font-size: 15px; color: #111; }
.ksm-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.ksm-portal-note {
    font-size: 13px;
    color: #555;
    background: #f9f9f9;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.ksm-portal-files { margin-top: 10px; }
.ksm-portal-files-label { font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.ksm-portal-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--ksm-primary, #16815e);
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin: 3px 4px 3px 0;
    transition: filter .15s;
}
.ksm-portal-download:hover { filter: brightness(.88); }
.ksm-portal-download span  { font-size: 11px; opacity: .8; }

@media (max-width: 600px) {
    .ksm-portal-login-box { padding: 28px 20px; }
    .ksm-portal-item-top  { flex-direction: column; align-items: flex-start; }
}

/* ── Human handoff bar ── */
#ksm-human-bar {
    border-top: 1px solid var(--ksm-widget-border, rgba(0,0,0,.1));
    padding: 8px 14px;
    background: var(--ksm-widget-bg, #fff);
    display: none;
}
#ksm-human-bar.ksm-visible { display: block; }
#ksm-human-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #25D366;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
}
#ksm-human-btn:hover { opacity: .8; }

/* ── Lead capture form ── */
#ksm-lead-form {
    background: #1e1e1e;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 16px;
}
#ksm-lead-form-inner p {
    font-size: 12px;
    color: #aaa;
    margin: 0 0 12px;
    line-height: 1.5;
}
#ksm-lead-form-inner input {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s;
}
#ksm-lead-form-inner input:focus { outline: none; border-color: var(--ksm-primary); }
#ksm-lead-submit {
    width: 100%;
    padding: 10px;
    background: var(--ksm-primary, #16815e);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 6px;
}
#ksm-lead-skip {
    width: 100%;
    padding: 7px;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
#ksm-lead-skip:hover { color: #999; }

/* badge info */
.ksm-badge-info { background: #dbeafe; color: #1e40af; }

/* ════════════════════════════════════════
   AFFILIATE PORTAL (frontend shortcode)
════════════════════════════════════════ */
.ksm-aff-portal-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: inherit;
}

/* Login */
.ksm-aff-login-box {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    max-width: 440px;
    margin: 40px auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.ksm-aff-login-icon { font-size: 40px; margin-bottom: 12px; }
.ksm-aff-login-box h2 { margin: 0 0 8px; font-size: 22px; color: #111; }
.ksm-aff-login-box p  { color: #666; font-size: 14px; margin: 0 0 24px; }
.ksm-aff-login-error { background:#fee2e2; color:#991b1b; padding:10px 14px; border-radius:6px; font-size:13px; margin-bottom:16px; text-align:left; }

/* Reuse portal form styles */
.ksm-aff-portal-form { text-align: left; }
.ksm-aff-portal-field { margin-bottom: 16px; }
.ksm-aff-portal-field label { display:block; font-size:12px; font-weight:700; color:#444; margin-bottom:5px; text-transform:uppercase; letter-spacing:.04em; }
.ksm-aff-portal-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .2s;
}
.ksm-aff-portal-field input:focus { outline:none; border-color:var(--ksm-primary); box-shadow:0 0 0 3px rgba(22,129,94,.1); }
.ksm-aff-portal-btn {
    width: 100%;
    padding: 13px;
    background: var(--ksm-primary, #16815e) !important;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
    transition: filter .2s;
}
.ksm-aff-portal-btn:hover { filter: brightness(.88); }

/* Dashboard */
.ksm-aff-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}
.ksm-aff-dash-greeting { font-size: 13px; color: #888; margin-bottom: 4px; }
.ksm-aff-dash-title    { font-size: 22px; font-weight: 800; margin: 0 0 6px; color: #111; }
.ksm-aff-logout { font-size:13px; color:#888; text-decoration:none; padding:6px 12px; border:1px solid #ddd; border-radius:6px; white-space:nowrap; }
.ksm-aff-logout:hover { color:#c00; border-color:#c00; }

/* Ref link bar */
.ksm-aff-reflink-bar {
    background: #f0fdf8;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ksm-aff-reflink-label { font-size: 12px; font-weight: 700; color: #166534; white-space: nowrap; }
.ksm-aff-reflink-url   { flex: 1; font-size: 13px; color: #16815e; word-break: break-all; font-family: monospace; }
.ksm-aff-copy-btn {
    padding: 6px 14px;
    background: var(--ksm-primary, #16815e);
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

/* Stats */
.ksm-aff-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 600px) { .ksm-aff-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.ksm-aff-stat-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-top: 3px solid var(--ksm-primary, #16815e);
    padding: 16px;
    text-align: center;
    border-radius: 6px;
}
.ksm-aff-stat-num   { font-size: 22px; font-weight: 900; color: #111; }
.ksm-aff-stat-label { font-size: 11px; color: #888; margin-top: 4px; }

/* Referral table */
.ksm-aff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ksm-aff-table th { text-align:left; padding:8px 12px; background:#f5f5f5; border-bottom:2px solid #e0e0e0; font-weight:700; font-size:11px; text-transform:uppercase; color:#555; }
.ksm-aff-table td { padding:10px 12px; border-bottom:1px solid #f0f0f0; vertical-align:middle; }
.ksm-aff-table tr:hover td { background:#fafafa; }

/* Status pills */
.ksm-aff-pill-paid    { display:inline-block; padding:2px 10px; background:#dcfce7; color:#166534; border-radius:20px; font-size:11px; font-weight:700; }
.ksm-aff-pill-pending { display:inline-block; padding:2px 10px; background:#fff7ed; color:#9a3412; border-radius:20px; font-size:11px; font-weight:700; }
