/* ============================================================
   IndexPulse — application styles (Bootstrap 5.3 + light/dark)
   ============================================================ */
:root {
  --ip-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ip-primary: #4f46e5;
  --ip-primary-600: #4338ca;
  --ip-accent: #06b6d4;
  --ip-radius: 14px;
  --ip-sidebar-w: 260px;
  --ip-surface: #ffffff;
  --ip-surface-2: #f6f7fb;
  --ip-border: #e6e8f0;
  --ip-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --bs-primary: var(--ip-primary);
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: var(--ip-primary);
  --bs-link-hover-color: var(--ip-primary-600);
  --bs-body-font-family: var(--ip-font);
  --bs-body-bg: var(--ip-surface-2);
  --bs-border-radius: 10px;
}
[data-bs-theme="dark"] {
  --ip-surface: #141827;
  --ip-surface-2: #0e1120;
  --ip-border: #252a3d;
  --ip-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --bs-body-bg: var(--ip-surface-2);
  --bs-body-color: #e6e8f0;
  --bs-secondary-color: #9aa3b8;
  --bs-tertiary-bg: #1a1f33;
}
html { scroll-behavior: smooth; }
body { font-family: var(--ip-font); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn, .nav-link, .page-link, .dropdown-item { text-decoration: none !important; }
h1, h2, h3, h4, h5, .display-5, .display-4 { letter-spacing: -.02em; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--ip-primary); --bs-btn-border-color: var(--ip-primary); --bs-btn-hover-bg: var(--ip-primary-600); --bs-btn-hover-border-color: var(--ip-primary-600); --bs-btn-active-bg: var(--ip-primary-600); font-weight: 600; }
.btn-outline-primary { --bs-btn-color: var(--ip-primary); --bs-btn-border-color: var(--ip-primary); --bs-btn-hover-bg: var(--ip-primary); --bs-btn-hover-border-color: var(--ip-primary); }
.btn-ghost { --bs-btn-color: var(--bs-body-color); --bs-btn-hover-bg: rgba(127, 127, 160, .12); --bs-btn-border-color: transparent; }
.card { border: 1px solid var(--ip-border); border-radius: var(--ip-radius); background: var(--ip-surface); box-shadow: var(--ip-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--ip-border); font-weight: 600; padding: .9rem 1.25rem; }
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); font-weight: 600; border-bottom-color: var(--ip-border); white-space: nowrap; }
.table td { vertical-align: middle; border-bottom-color: var(--ip-border); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(79, 70, 229, .04); }
.form-control, .form-select { border-color: var(--ip-border); background: var(--ip-surface); }
.form-control:focus, .form-select:focus { border-color: var(--ip-primary); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.badge { font-weight: 600; letter-spacing: .01em; }
.status-badge { font-size: .72rem; padding: .35em .6em; white-space: nowrap; }
.text-truncate-url { max-width: 420px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.brand-mark { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ip-primary), var(--ip-accent)); color: #fff; font-size: 1.05rem; }
.brand-mark.admin { background: linear-gradient(135deg, #0f172a, #4f46e5); }
.avatar { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--ip-primary), var(--ip-accent)); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }

/* ---------- public site ---------- */
.site-nav { background: color-mix(in srgb, var(--ip-surface) 85%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--ip-border); }
.site-nav .nav-link { font-weight: 500; color: var(--bs-body-color); opacity: .85; padding: .5rem .9rem; border-radius: 8px; }
.site-nav .nav-link.active, .site-nav .nav-link:hover { opacity: 1; background: rgba(79, 70, 229, .08); color: var(--ip-primary); }
.hero { position: relative; overflow: hidden; padding: 5.5rem 0 4rem; }
.hero::before { content: ""; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(600px 300px at 20% 20%, rgba(79, 70, 229, .18), transparent 60%), radial-gradient(500px 300px at 80% 0%, rgba(6, 182, 212, .18), transparent 60%); z-index: 0; pointer-events: none; }
.hero > .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; }
.hero .lead { font-size: 1.15rem; max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ip-primary); background: rgba(79, 70, 229, .1); padding: .35rem .75rem; border-radius: 999px; }
.hero-panel { border-radius: 18px; border: 1px solid var(--ip-border); background: var(--ip-surface); box-shadow: var(--ip-shadow); padding: 1.25rem; }
.feature-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; background: rgba(79, 70, 229, .1); color: var(--ip-primary); margin-bottom: .9rem; }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--ip-surface); border-top: 1px solid var(--ip-border); border-bottom: 1px solid var(--ip-border); }
.step-number { width: 40px; height: 40px; border-radius: 50%; background: var(--ip-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.pricing-card.featured { border-color: var(--ip-primary); box-shadow: 0 20px 50px -20px rgba(79, 70, 229, .45); position: relative; }
.pricing-card .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.pricing-card ul li { padding: .35rem 0; }
.site-footer { border-top: 1px solid var(--ip-border); background: var(--ip-surface); }
.site-footer a { color: var(--bs-secondary-color); }
.site-footer a:hover { color: var(--ip-primary); }
.prose { max-width: 820px; }
.prose h2 { margin-top: 2.2rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.6rem; font-size: 1.15rem; }
.prose pre { background: var(--bs-tertiary-bg); border: 1px solid var(--ip-border); border-radius: 10px; padding: 1rem; overflow: auto; font-size: .85rem; }
.prose code { font-size: .88em; }
.doc-toc a { display: block; padding: .3rem 0; color: var(--bs-secondary-color); }
.doc-toc a:hover { color: var(--ip-primary); }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #fff; padding: 2rem 1rem; position: relative; overflow-x: hidden; }
[data-bs-theme="dark"] .auth-page { background: #0b1020; }
.auth-wrap { width: 100%; max-width: 460px; position: relative; z-index: 2; }
.auth-card { border-radius: 18px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 30px 80px -20px rgba(49, 46, 129, .25), 0 0 0 1px rgba(99, 102, 241, .08) !important; animation: authCardIn .7s cubic-bezier(.2, .8, .2, 1) both; }
[data-bs-theme="dark"] .auth-card { background: rgba(17, 24, 39, .88); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(148, 163, 184, .12) !important; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
.auth-blob.b1 { width: 520px; height: 520px; left: -140px; top: -160px; background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, .55), rgba(99, 102, 241, 0) 70%); animation: authBlob1 22s ease-in-out infinite alternate; }
.auth-blob.b2 { width: 460px; height: 460px; right: -120px; bottom: -140px; background: radial-gradient(circle at 60% 60%, rgba(6, 182, 212, .5), rgba(6, 182, 212, 0) 70%); animation: authBlob2 26s ease-in-out infinite alternate; }
.auth-blob.b3 { width: 340px; height: 340px; left: 55%; top: 8%; background: radial-gradient(circle, rgba(236, 72, 153, .28), rgba(236, 72, 153, 0) 70%); animation: authBlob3 30s ease-in-out infinite alternate; }
[data-bs-theme="dark"] .auth-blob { opacity: .35; }
@keyframes authBlob1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(160px, 120px) scale(1.15); } }
@keyframes authBlob2 { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-180px, -100px) scale(.95); } }
@keyframes authBlob3 { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(-220px, 260px) rotate(40deg); } }
@keyframes authCardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-blob, .auth-card { animation: none !important; } }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--ip-sidebar-w); flex: 0 0 var(--ip-sidebar-w); background: var(--ip-surface); border-right: 1px solid var(--ip-border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; font-weight: 700; font-size: 1.1rem; color: var(--bs-body-color); border-bottom: 1px solid var(--ip-border); }
.sidebar-nav { padding: .75rem; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: .7rem; padding: .5rem .85rem; border-radius: 10px; color: var(--bs-body-color); font-weight: 500; opacity: .85; margin-bottom: 2px; }
.sidebar-nav a i { font-size: 1.1rem; width: 22px; text-align: center; opacity: .8; }
.sidebar-nav a:hover { background: rgba(79, 70, 229, .08); opacity: 1; text-decoration: none; }
.sidebar-nav a.active { background: var(--ip-primary); color: #fff; opacity: 1; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .8); }
.sidebar-nav a.active i { opacity: 1; }
.sidebar-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--bs-secondary-color); padding: 1rem .85rem .35rem; font-weight: 600; }
.sidebar-footer { padding: .75rem; border-top: 1px solid var(--ip-border); }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.5rem; background: color-mix(in srgb, var(--ip-surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ip-border); position: sticky; top: 0; z-index: 1020; }
.topbar-title { font-weight: 700; font-size: 1.1rem; }
.content { padding: 1.5rem; flex: 1; }
.content-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--ip-border); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1025; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .content { padding: 1rem; }
}

/* ---------- widgets ---------- */
.stat-card { padding: 1.1rem 1.25rem; height: 100%; }
.stat-card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); font-weight: 600; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: .25rem; }
.stat-card .icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-primary .icon { background: rgba(79, 70, 229, .12); color: var(--ip-primary); }
.stat-success .icon { background: rgba(25, 135, 84, .12); color: #198754; }
.stat-warning .icon { background: rgba(255, 193, 7, .16); color: #b58105; }
.stat-danger .icon { background: rgba(220, 53, 69, .12); color: #dc3545; }
.stat-info .icon { background: rgba(6, 182, 212, .14); color: #0891b2; }
.stat-secondary .icon { background: rgba(108, 117, 125, .14); color: #6c757d; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.progress { background: var(--bs-tertiary-bg); }
.stage-track { display: flex; gap: .4rem; flex-wrap: wrap; }
.stage-track .stage { flex: 1; min-width: 100px; text-align: center; font-size: .72rem; padding: .45rem .3rem; border-radius: 8px; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-weight: 600; }
.stage-track .stage.done { background: rgba(25, 135, 84, .15); color: #198754; }
.stage-track .stage.current { background: var(--ip-primary); color: #fff; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: .4rem 1rem; font-size: .92rem; }
.kv dt { color: var(--bs-secondary-color); font-weight: 500; }
.kv dd { margin: 0; word-break: break-all; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: .4rem; } }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--ip-border); }
.timeline li { position: relative; padding-left: 30px; padding-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--ip-primary); border: 2px solid var(--ip-surface); }
.dropzone { border: 2px dashed var(--ip-border); border-radius: 12px; padding: 1.25rem; text-align: center; background: var(--bs-tertiary-bg); transition: border-color .15s; }
.dropzone.dragover { border-color: var(--ip-primary); }
.preview-list { max-height: 320px; overflow: auto; font-size: .85rem; }
.copy-field { font-family: ui-monospace, monospace; background: var(--bs-tertiary-bg); border: 1px solid var(--ip-border); border-radius: 8px; padding: .55rem .75rem; word-break: break-all; }
.wp-preview { max-height: 480px; overflow: auto; border: 1px solid var(--ip-border); border-radius: 10px; padding: 1rem; background: var(--bs-tertiary-bg); font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.table-responsive { border-radius: 10px; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--bs-secondary-color); }
.empty i { font-size: 2.4rem; opacity: .4; display: block; margin-bottom: .5rem; }
.nav-tabs .nav-link { font-weight: 500; color: var(--bs-secondary-color); }
.nav-tabs .nav-link.active { color: var(--ip-primary); border-bottom-color: var(--ip-surface); }
.note { border-left: 4px solid var(--ip-accent); background: rgba(6, 182, 212, .08); padding: .8rem 1rem; border-radius: 0 10px 10px 0; font-size: .92rem; }
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }
.cursor-pointer { cursor: pointer; }

/* ---------- filter bars inside card headers: compact controls instead of full-width ---------- */
.card-header form.d-flex > .form-select,
.card-header form.d-flex > .form-control { width: auto; flex: 0 1 auto; min-width: 140px; max-width: 280px; }
.card-header form.d-flex > input[type="search"] { min-width: 200px; }
@media (max-width: 575.98px) {
  .card-header form.d-flex > .form-select, .card-header form.d-flex > .form-control { max-width: 100%; flex: 1 1 100%; }
}

/* ---------- compact stage tracker inside the homepage preview card ---------- */
.hero-panel .stage-track { flex-wrap: nowrap; gap: .25rem; }
.hero-panel .stage-track .stage { min-width: 0; flex: 1 1 0; font-size: .62rem; padding: .4rem .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Support contact (WhatsApp / Telegram) ---------- */
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: #25D366; --bs-btn-border-color: #25D366; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1ebe5a; --bs-btn-hover-border-color: #1ebe5a; --bs-btn-active-bg: #19a94f; --bs-btn-active-color: #fff; font-weight: 600; }
.btn-telegram { --bs-btn-color: #fff; --bs-btn-bg: #229ED9; --bs-btn-border-color: #229ED9; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1c8cc2; --bs-btn-hover-border-color: #1c8cc2; --bs-btn-active-bg: #187aa9; --bs-btn-active-color: #fff; font-weight: 600; }
.support-strip { border-left: 4px solid #25D366; }
.support-strip-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(37, 211, 102, .12); color: #1ebe5a; font-size: 1.35rem; }
.support-compact a { color: inherit; text-decoration: none; white-space: nowrap; }
.support-compact a:hover { color: var(--ip-primary); }
.support-compact .bi-whatsapp { color: #25D366; }
.support-compact .bi-telegram { color: #229ED9; }

/* ---------- Live chat widget ---------- */
.ip-chat { position: fixed; right: 20px; bottom: 20px; z-index: 1080; font-size: .925rem; }
.ip-chat-launcher { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; padding: .75rem 1.1rem; background: var(--ip-primary); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(79, 70, 229, .35); position: relative; }
.ip-chat-launcher .bi { font-size: 1.25rem; }
.ip-chat-launcher:hover { background: var(--ip-primary-600); }
.ip-chat.is-open .ip-chat-launcher { display: none; }
.ip-chat-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: #dc3545; color: #fff; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border: 2px solid #fff; }
.ip-chat-panel { width: min(370px, calc(100vw - 24px)); height: min(560px, calc(100vh - 40px)); background: var(--bs-body-bg); color: var(--bs-body-color); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--bs-border-color); }
.ip-chat-panel[hidden] { display: none; }
.ip-chat-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; background: var(--ip-primary); color: #fff; }
.ip-chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.ip-chat-close { border: 0; background: transparent; color: #fff; font-size: 1.1rem; padding: .25rem .4rem; border-radius: 8px; }
.ip-chat-close:hover { background: rgba(255, 255, 255, .15); }
.ip-chat-alt { display: flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-bottom: 1px solid var(--bs-border-color); flex-wrap: wrap; }
.ip-chat-pill { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; text-decoration: none; color: #fff; font-weight: 600; }
.ip-chat-pill.wa { background: #25D366; } .ip-chat-pill.tg { background: #229ED9; }
.ip-chat-pill:hover { color: #fff; filter: brightness(.95); }
.ip-chat-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ip-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.ip-chat-intro { padding: 0 1rem 1rem; }
.ip-msg { display: flex; flex-direction: column; max-width: 85%; }
.ip-msg.me { align-self: flex-end; align-items: flex-end; }
.ip-msg.agent { align-self: flex-start; align-items: flex-start; }
.ip-bubble { padding: .5rem .75rem; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.ip-msg.me .ip-bubble { background: var(--ip-primary); color: #fff; border-bottom-right-radius: 4px; }
.ip-msg.agent .ip-bubble { background: rgba(127, 127, 160, .14); border-bottom-left-radius: 4px; }
.ip-time { font-size: .7rem; color: var(--bs-secondary-color); margin-top: 2px; }
.ip-empty { text-align: center; margin: auto 0; }
.ip-chat-form { display: flex; gap: .5rem; padding: .65rem; border-top: 1px solid var(--bs-border-color); align-items: flex-end; }
.ip-chat-form[hidden] { display: none; }
.ip-chat-form textarea { flex: 1; resize: none; border: 1px solid var(--bs-border-color); border-radius: 12px; padding: .5rem .75rem; background: var(--bs-body-bg); color: var(--bs-body-color); max-height: 120px; }
.ip-chat-form textarea:focus { outline: none; border-color: var(--ip-primary); }
.ip-chat-send { border: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--ip-primary); color: #fff; flex: none; }
.ip-chat-send:hover { background: var(--ip-primary-600); }
@media (max-width: 575.98px) { .ip-chat { right: 12px; bottom: 12px; } .ip-chat-label { display: none; } .ip-chat-launcher { padding: .8rem; } }

/* ---------- Admin chat ---------- */
.chat-list .list-group-item.unread { border-left: 3px solid var(--ip-primary); background: rgba(79, 70, 229, .05); }
.chat-thread { height: min(60vh, 560px); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: rgba(127, 127, 160, .05); }
.chat-thread .ip-msg { max-width: 75%; }
.chat-thread .ip-msg.admin { align-self: flex-end; align-items: flex-end; }
.chat-thread .ip-msg.admin .ip-bubble { background: var(--ip-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-thread .ip-msg.user { align-self: flex-start; align-items: flex-start; }
.chat-thread .ip-msg.user .ip-bubble { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-bottom-left-radius: 4px; }
.chat-thread .ip-msg.system { align-self: center; align-items: center; max-width: 90%; }
.chat-thread .ip-msg.system .ip-bubble { background: rgba(255, 193, 7, .15); font-size: .8rem; }

.min-w-0 { min-width: 0; }
.flex-none { flex: none; }

.notify-menu { width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; }

/* ---------- Getting-started guide ---------- */
.onboarding-step { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: .75rem; background: var(--bs-body-bg); }
.onboarding-step.done { opacity: .65; }
.onboarding-step .step-num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(79, 70, 229, .12); color: var(--ip-primary); font-weight: 700; font-size: .8rem; flex: none; }
.onboarding-step.done .step-num { background: #198754; color: #fff; }

/* ---------- Simple 3-step job progress ---------- */
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 767.98px) { .steps3 { grid-template-columns: 1fr; } }
.step3 { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: .85rem 1rem; position: relative; background: var(--bs-body-bg); }
.step3 .step3-head { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.step3 .step3-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(127, 127, 160, .15); color: var(--bs-secondary-color); flex: none; }
.step3.running { border-color: var(--ip-primary); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12); }
.step3.running .step3-icon { background: var(--ip-primary); color: #fff; }
.step3.done .step3-icon { background: #198754; color: #fff; }
.step3.skipped { opacity: .7; }
.step3 .progress { height: 6px; margin-top: .6rem; }
.plain-box { border-left: 4px solid var(--ip-primary); background: rgba(79, 70, 229, .05); border-radius: 8px; padding: .75rem 1rem; }
.plain-box.tone-success { border-left-color: #198754; background: rgba(25, 135, 84, .06); }
.plain-box.tone-warning { border-left-color: #ffc107; background: rgba(255, 193, 7, .08); }
.plain-box.tone-danger { border-left-color: #dc3545; background: rgba(220, 53, 69, .06); }

/* ---------- Live activity ---------- */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #dc3545; box-shadow: 0 0 0 0 rgba(220, 53, 69, .6); animation: livePulse 1.6s infinite; vertical-align: middle; }
.live-offline .live-dot { background: #adb5bd; animation: none; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .55); } 70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }
.live-list { overflow-y: auto; font-size: .85rem; }
.live-empty { padding: 1.25rem 1rem; text-align: center; }
.live-item { display: flex; align-items: flex-start; gap: .5rem; padding: .45rem 1rem; border-bottom: 1px solid var(--bs-border-color); color: inherit; text-decoration: none; transition: background-color 1.2s ease; }
a.live-item:hover { background: rgba(79, 70, 229, .05); color: inherit; }
.live-item.live-new { background: rgba(79, 70, 229, .12); }
.live-item .live-kind { color: var(--bs-secondary-color); }
.live-item .live-text { flex: 1; min-width: 0; word-break: break-word; }
.live-item .live-user { display: inline-block; font-size: .72rem; background: rgba(127, 127, 160, .15); border-radius: 4px; padding: 0 .35rem; margin-right: .35rem; }
.live-item .live-time { color: var(--bs-secondary-color); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---------- 1.4.0: site crawler steps ---------- */
.crawl-step{display:inline-flex;align-items:center;padding:.3rem .7rem;border-radius:999px;font-size:.85rem;background:var(--bs-tertiary-bg,#f1f3f5);color:var(--bs-secondary-color,#6c757d);border:1px solid var(--bs-border-color,#dee2e6)}
.crawl-step.done{background:rgba(25,135,84,.1);color:#198754;border-color:rgba(25,135,84,.35)}
.crawl-step.now{background:rgba(13,110,253,.1);color:#0d6efd;border-color:rgba(13,110,253,.45);font-weight:600}

/* ---------- 1.4.0: plan badge in the top bar ---------- */
.plan-pill{display:inline-flex;align-items:center;padding:.28rem .7rem;border-radius:999px;font-size:.8rem;font-weight:600;text-decoration:none;white-space:nowrap;border:1px solid transparent}
.plan-pill.plan-free{background:var(--bs-tertiary-bg,#f1f3f5);color:var(--bs-body-color,#212529);border-color:var(--bs-border-color,#dee2e6)}
.plan-pill.plan-paid{background:linear-gradient(135deg,#f59e0b,#f97316);color:#fff;box-shadow:0 2px 8px rgba(249,115,22,.25)}
.plan-pill.plan-admin{background:#111827;color:#fff}
.plan-pill:hover{filter:brightness(1.05)}

/* ---------- 1.4.0: upgrade & payments ---------- */
.pay-chip{display:inline-flex;align-items:center;padding:.35rem .75rem;border-radius:999px;border:1px solid var(--bs-border-color,#dee2e6);font-size:.85rem;background:var(--bs-body-bg,#fff)}
.pay-method{border:1px solid var(--bs-border-color,#dee2e6);background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#212529);border-radius:.6rem;padding:.5rem .9rem}
.pay-method.active{border-color:#0d6efd;background:rgba(13,110,253,.08);color:#0d6efd;font-weight:600;box-shadow:0 0 0 2px rgba(13,110,253,.15)}
.pay-box{background:var(--bs-tertiary-bg,#f8f9fa);border:1px dashed var(--bs-border-color,#ced4da);border-radius:.6rem;padding:1rem 1rem 1rem 1rem}
.pay-box pre{white-space:pre-wrap;font-size:.95rem;font-family:var(--bs-font-monospace);padding-right:5.5rem}
.step-num{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:50%;background:#0d6efd;color:#fff;font-size:.8rem;font-weight:700;margin-right:.5rem}

/* ---------- 1.4.0: bot page / website status ---------- */
.bot-check{border-radius:16px;max-width:820px}
.bot-verdict{border-radius:16px}
.bot-verdict .verdict-icon{font-size:2.6rem;line-height:1}
.bot-verdict.good{background:linear-gradient(135deg,rgba(25,135,84,.10),rgba(25,135,84,.02))}
.bot-verdict.good .verdict-icon{color:#198754}
.bot-verdict.warn{background:linear-gradient(135deg,rgba(255,193,7,.16),rgba(255,193,7,.03))}
.bot-verdict.warn .verdict-icon{color:#d39e00}
.bot-verdict.bad{background:linear-gradient(135deg,rgba(220,53,69,.12),rgba(220,53,69,.02))}
.bot-verdict.bad .verdict-icon{color:#dc3545}

/* ---------- 1.4.0: dashboard quick tools ---------- */
.quick-tool{transition:transform .15s ease,box-shadow .15s ease;border:1px solid var(--bs-border-color,#e5e7eb)}
.quick-tool:hover{transform:translateY(-2px);box-shadow:0 10px 24px -12px rgba(49,46,129,.35)}
.quick-icon{display:inline-flex;align-items:center;justify-content:center;width:2.6rem;height:2.6rem;border-radius:.75rem;font-size:1.25rem;flex:0 0 auto}

/* ------------------------------------------------------------------ home page (1.5.0)
   One bold moment: the crawl map in the hero. Status colours mean the same thing everywhere:
   grey ring = found, indigo = checked, green = in Google, amber = the bot itself. */
@font-face { font-family: 'Archivo Variable'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url('../vendor/archivo/archivo-latin-wdth.woff2') format('woff2-variations'), url('../vendor/archivo/archivo-latin-wdth.woff2') format('woff2'); }
.home { --h-ink: #1e1b4b; --h-band: #1e1b4b; --h-brand: #4f46e5; --h-found: #a3a9c2; --h-google: #16a34a; --h-bot: #f59e0b; --h-tint: #f5f5ff;
  --h-display: 'Archivo Variable', var(--ip-font); background: var(--ip-surface); }
[data-bs-theme="dark"] .home { --h-ink: #e9e8ff; --h-band: #25216a; --h-brand: #818cf8; --h-found: #5d6482; --h-google: #22c55e; --h-bot: #fbbf24; --h-tint: #121530; }
.public-site:has(.home) { background: var(--ip-surface); }
.home h1, .home h2, .home h3 { font-family: var(--h-display); font-stretch: 112%; color: var(--h-ink); letter-spacing: -.015em; }
.home h2 { font-size: clamp(1.65rem, 3.1vw, 2.35rem); font-weight: 720; line-height: 1.08; margin-bottom: 1rem; }
.btn-ink { --bs-btn-bg: var(--h-band); --bs-btn-border-color: var(--h-band); --bs-btn-color: #fff; --bs-btn-hover-bg: #2f2a8a; --bs-btn-hover-border-color: #2f2a8a; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #2f2a8a; --bs-btn-active-color: #fff; --bs-btn-focus-shadow-rgb: 79, 70, 229; font-weight: 600; }
[data-bs-theme="dark"] .btn-ink { --bs-btn-bg: #e9e8ff; --bs-btn-border-color: #e9e8ff; --bs-btn-color: #1e1b4b; --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; --bs-btn-hover-color: #1e1b4b; --bs-btn-active-bg: #fff; --bs-btn-active-color: #1e1b4b; }
.link-ink { color: var(--h-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--h-brand) 55%, transparent); text-underline-offset: .25em; text-decoration-thickness: 2px; }
.link-ink:hover { color: var(--h-brand); }

.home-hero { padding: 3.5rem 0 0; }
.home-hero h1 { font-size: clamp(2.15rem, 4.4vw, 3.45rem); font-weight: 780; line-height: 1.04; max-width: 23ch; margin-bottom: 1.6rem; }
.home-lead { font-size: 1.16rem; line-height: 1.6; color: var(--bs-secondary-color); max-width: 56ch; margin: 0; }
.home-check .form-control { font-size: 1.05rem; }
.home-check .form-text { margin-top: .5rem; }

.home-map { margin: 2rem 0 0; }
.home-map canvas { display: block; width: 100%; height: 320px; }
.home-map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; padding: .85rem 0 0; border-top: 1px solid var(--ip-border); font-size: .86rem; color: var(--bs-secondary-color); }
.home-map-note { margin-left: auto; }
.home-map-legend .dot { display: inline-block; width: .72rem; height: .72rem; border-radius: 50%; margin-right: .45rem; vertical-align: -.06rem; }
.dot-found { border: 2px solid var(--h-found); background: var(--ip-surface); }
.dot-checked { background: var(--h-brand); }
.dot-google { background: var(--h-google); }
.dot-bot { background: var(--h-bot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--h-bot) 28%, transparent); }

.home-flow { background: var(--h-tint); padding: 4.5rem 0 4.75rem; margin-top: 3.5rem; }
.home-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.75rem; padding: 0; margin: 2.5rem 0 0; position: relative; }
.home-steps::before { content: ""; position: absolute; top: 1.1rem; left: 1.1rem; right: 1.1rem; height: 2px; background: linear-gradient(90deg, var(--h-found), var(--h-brand) 50%, var(--h-google)); }
.home-steps li { counter-increment: step; position: relative; padding-top: 3.2rem; }
.home-steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--h-display); font-weight: 700; background: var(--ip-surface); color: var(--h-ink); border: 2px solid var(--h-brand); }
.home-steps li:first-child::before { border-color: var(--h-found); }
.home-steps li:last-child::before { border-color: var(--h-google); }
.home-steps h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.25; margin-bottom: .4rem; }
.home-steps p { font-size: .93rem; line-height: 1.55; color: var(--bs-secondary-color); margin: 0; }

.home-feature { padding: 4.75rem 0; }
.home-feature + .home-feature { padding-top: 1.5rem; }
.home-feature h2 { max-width: 17ch; }
.home-feature p { font-size: 1.05rem; line-height: 1.62; color: var(--bs-secondary-color); max-width: 50ch; }
.home-frag { position: relative; border: 1px solid var(--ip-border); border-radius: 16px; background: var(--ip-surface); padding: 1.15rem 1.25rem; box-shadow: 0 24px 48px -32px rgba(30, 27, 75, .45); }
.home-frag .frag-label { position: absolute; top: -.62rem; right: 1.1rem; padding: 0 .45rem; font-size: .74rem; color: var(--bs-secondary-color); background: var(--ip-surface); }
.home-frag .table { --bs-table-bg: transparent; }
.home-frag-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .62rem 0; font-size: .9rem; }
.home-frag-list li + li { border-top: 1px solid var(--ip-border); }
.home-frag-list .mono { min-width: 0; }
.frag-note { display: flex; gap: .85rem; padding: .7rem 0; font-size: .9rem; }
.frag-note + .frag-note { border-top: 1px solid var(--ip-border); }
.frag-note > i { font-size: 1.2rem; line-height: 1.3; }

.home-more { padding: 3.5rem 0 4rem; }
.home-also { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 3rem; }
.home-also li { display: flex; gap: .9rem; padding: .8rem 0; border-top: 1px solid var(--ip-border); }
.home-also li > i { font-size: 1.25rem; color: var(--h-brand); line-height: 1.2; }
.home-also strong { display: block; color: var(--h-ink); }
.home-also span { font-size: .93rem; color: var(--bs-secondary-color); }

.home-plans { padding: 4.5rem 0; background: var(--h-tint); }
.home-sub { color: var(--bs-secondary-color); max-width: 60ch; margin-bottom: 2.25rem; }
.home-plans .row.justify-content-center { justify-content: flex-start !important; }
.home-faq { padding: 4.5rem 0 3rem; }
.home-close { padding: 1.5rem 0 1rem; }
.home-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; background: var(--h-band); color: rgba(255, 255, 255, .82); border-radius: 18px; padding: 2.5rem 2.75rem; }
.home .home-cta h2 { color: #fff; margin-bottom: .35rem; }

@media (max-width: 991.98px) {
  .home-steps { grid-template-columns: 1fr; gap: 1.4rem; }
  .home-steps::before { top: 1.1rem; bottom: 1.1rem; left: 1.05rem; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--h-found), var(--h-brand) 50%, var(--h-google)); }
  .home-steps li { padding: .1rem 0 0 3.4rem; }
  .home-map-note { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 767.98px) {
  .home-hero { padding-top: 2.75rem; }
  .home-map canvas { height: 240px; }
  .home-also { grid-template-columns: 1fr; }
  .home-feature { padding: 3.25rem 0; }
  .home-cta { padding: 2rem 1.5rem; }
}
