/* ============================================================
   LeanSpace Onboarding — Гайд настройки платформы v3.0
   Design: Premium SaaS — Apple / Linear / LinkedIn
   Primary: #007aff  Dark: #1d1d1f  Surface: #f5f5f7
   ============================================================ */

/* ---------- Floating Widget ---------- */
#ob-widget {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 9000;
    transition: opacity 0.2s;
}
#ob-widget .ob-widget-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 7px 16px 7px 8px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
    cursor: pointer;
    font-size: 12px;
    color: #1d1d1f;
    font-weight: 600;
    transition: box-shadow 0.2s, transform 0.15s;
    user-select: none;
    white-space: nowrap;
    font-family: inherit;
}
#ob-widget .ob-widget-btn:hover {
    box-shadow: 0 4px 20px rgba(0,122,255,0.22);
    transform: translateY(-2px);
}
#ob-widget .ob-widget-ring {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
#ob-widget .ob-widget-ring svg { transform: rotate(-90deg); }
#ob-widget .ob-widget-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #007aff;
}

/* ---------- Full-Screen Panel ---------- */
#ob-panel {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}
#ob-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.40);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: all;
    animation: ob-fade-in 0.18s ease;
}
@keyframes ob-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ob-panel-inner {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100vh;
    background: #f5f5f7;
    display: flex;
    flex-direction: column;
    pointer-events: all;
    animation: ob-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes ob-slide-in {
    from { transform: translateY(16px) scale(0.99); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- Panel Header ---------- */
.ob-panel-header {
    background: #1d1d1f;
    padding: 10px 32px 14px;
    flex-shrink: 0;
}
.ob-close-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    font-family: inherit;
}
.ob-close-btn:hover { background: rgba(255,255,255,0.16); color: white; }

/* Header top row: label + close btn */
.ob-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Header main row: text left, pills right */
.ob-header-main {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 6px;
}

.ob-hero-text { flex: 1; min-width: 0; }

/* Hero — welcome */
.ob-hero-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #007aff;
    margin: 0;
}
.ob-hero-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 3px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}
.ob-hero-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.42);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ob-hero-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    flex-shrink: 0;
    width: 210px;
}
.ob-hero-pill {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

/* Compact header (no hero) */
.ob-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px;
    letter-spacing: -0.2px;
}
.ob-panel-subtitle { font-size: 12px; color: rgba(255,255,255,0.40); margin: 0; }

/* Progress bar — inline row */
.ob-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.ob-overall-progress {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    height: 3px;
    overflow: hidden;
    margin: 0;
}
.ob-overall-fill {
    height: 100%;
    background: #007aff;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.ob-overall-label { font-size: 11px; color: rgba(255,255,255,0.38); font-weight: 500; white-space: nowrap; }

/* ---------- Scrollable Body ---------- */
.ob-body {
    flex: 1;
    overflow-y: auto;
}
.ob-body-inner {
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 40px 36px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ob-body::-webkit-scrollbar { width: 5px; }
.ob-body::-webkit-scrollbar-track { background: transparent; }
.ob-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ---------- Domain Block ---------- */
.ob-block {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.ob-block-header {
    padding: 14px 16px 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
}
.ob-block-header:hover { background: #fafafa; }

/* Numbered circle — replaces emoji icon */
.ob-block-num {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #f0f4ff;
    color: #007aff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
}
.ob-block.ob-all-done-block .ob-block-num {
    background: #f0fdf4;
    color: #16a34a;
}

.ob-block-title-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #1d1d1f;
    flex: 1;
    letter-spacing: -0.1px;
}
.ob-block-count {
    font-size: 11px;
    font-weight: 600;
    color: #007aff;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 8px;
    flex-shrink: 0;
}
.ob-block-count.ob-all-done { color: #16a34a; background: #f0fdf4; }

.ob-block-minibar { height: 2px; background: #f5f5f7; }
.ob-block-minibar-fill {
    height: 100%;
    background: #007aff;
    transition: width 0.3s ease;
}
.ob-block-minibar-fill.ob-all-done { background: #16a34a; }

.ob-block-toggle {
    color: #9ca3af;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: transform 0.18s;
}
.ob-block.ob-collapsed .ob-block-toggle { transform: rotate(-90deg); }
.ob-block.ob-collapsed .ob-steps { display: none; }
.ob-block.ob-collapsed .ob-block-minibar { display: none; }

/* ---------- Steps ---------- */
.ob-steps { padding: 2px 0 4px; border-top: 1px solid #f5f5f7; }
.ob-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    transition: background 0.1s;
    border-bottom: 1px solid #f9fafb;
}
.ob-step:last-child { border-bottom: none; }
.ob-step:hover { background: #fafafa; }
.ob-step.ob-done { opacity: 0.45; }

/* CSS checkbox — replaces ☐ / ✅ emoji */
.ob-step-chk {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #d1d5db;
    background: white;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.ob-step-chk.ob-step-chk-done {
    background: #16a34a;
    border-color: #16a34a;
}
.ob-step-chk.ob-step-chk-done::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-left: none;
    border-top: none;
    transform: rotate(45deg);
}
.ob-step-body { flex: 1; min-width: 0; }
.ob-step-title {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.12s;
}
.ob-step-title:hover { color: #007aff; }
.ob-step.ob-done .ob-step-title { text-decoration: line-through; color: #9ca3af; cursor: default; }
.ob-step.ob-done .ob-step-title:hover { color: #9ca3af; }
.ob-step-desc { font-size: 11px; color: #9ca3af; margin-top: 2px; line-height: 1.4; }

/* "Пример" button */
.ob-mk-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
    font-family: inherit;
}
.ob-mk-btn:hover { border-color: #007aff; color: #007aff; background: #f0f6ff; }

/* ---------- Footer ---------- */
.ob-footer {
    padding: 12px 40px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.ob-dismiss-btn {
    background: none; border: none; font-size: 12px;
    color: #9ca3af; cursor: pointer; padding: 0; transition: color 0.12s;
    font-family: inherit;
}
.ob-dismiss-btn:hover { color: #6b7280; }
.ob-refresh-btn {
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 12px; color: #374151; cursor: pointer; padding: 7px 14px;
    transition: background 0.12s; font-family: inherit;
}
.ob-refresh-btn:hover { background: #e5e7eb; }

/* ---------- Example ("МастерКухни") Modal ---------- */
#ob-mk-modal {
    position: fixed; inset: 0; z-index: 10100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ob-mk-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ob-mk-panel {
    position: relative; width: 100%; max-width: 560px; max-height: 88vh;
    background: white; border-radius: 18px; display: flex; flex-direction: column;
    box-shadow: 0 32px 72px rgba(0,0,0,0.24);
    animation: ob-slide-in 0.2s cubic-bezier(0.16,1,0.3,1); overflow: hidden;
}
.ob-mk-header {
    background: #1d1d1f; padding: 18px 20px 14px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; flex-shrink: 0;
}
.ob-mk-title { font-size: 15px; font-weight: 700; color: white; margin: 0 0 3px; }
.ob-mk-company { font-size: 11px; color: rgba(255,255,255,0.38); margin: 0; }
.ob-mk-close {
    background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.7);
    width: 28px; height: 28px; border-radius: 50%; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.12s; line-height: 1; font-family: inherit;
}
.ob-mk-close:hover { background: rgba(255,255,255,0.2); color: white; }
.ob-mk-body {
    flex: 1; overflow-y: auto; padding: 20px;
    font-size: 13px; color: #374151; line-height: 1.7;
}
.ob-mk-body p { margin: 0 0 10px; }
.ob-mk-body b { color: #1d1d1f; }
.ob-mk-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ob-mk-body th, .ob-mk-body td { padding: 6px 8px; }
.ob-mk-body th { background: #f5f5f7; font-weight: 600; text-align: left; }
.ob-mk-go-btn {
    margin: 10px 20px 16px; padding: 13px;
    background: #007aff; color: white;
    border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; width: calc(100% - 40px); transition: opacity 0.15s;
    flex-shrink: 0; font-family: inherit;
}
.ob-mk-go-btn:hover { opacity: 0.88; }

/* Completion banner */
.ob-complete-banner {
    padding: 16px 20px; background: #f0fdf4;
    border: 1px solid #bbf7d0; border-radius: 12px; text-align: center;
    font-size: 14px; color: #15803d; font-weight: 600; margin-bottom: 8px;
}

/* ============================================================
   Full-Screen Modals (Company Profile, Integrations, 14-day plan)
   ============================================================ */
.ob-fs-modal {
    position: fixed; inset: 0; z-index: 10200;
    display: flex; flex-direction: column; background: #f5f5f7;
    animation: ob-slide-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.ob-fs-modal-header {
    background: #1d1d1f; padding: 16px 24px;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0; gap: 12px;
}
.ob-fs-modal-header-text { flex: 1; min-width: 0; }
.ob-fs-modal-title { font-size: 16px; font-weight: 700; color: white; margin: 0 0 2px; letter-spacing: -0.2px; }
.ob-fs-modal-subtitle { font-size: 12px; color: rgba(255,255,255,0.38); margin: 0; }
.ob-fs-modal-close {
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.7);
    width: 30px; height: 30px; border-radius: 50%; font-size: 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.15s; line-height: 1; font-family: inherit;
}
.ob-fs-modal-close:hover { background: rgba(255,255,255,0.18); color: white; }
.ob-fs-modal-body { flex: 1; overflow-y: auto; }
.ob-fs-modal-body::-webkit-scrollbar { width: 5px; }
.ob-fs-modal-body::-webkit-scrollbar-track { background: transparent; }
.ob-fs-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.ob-fs-modal-inner {
    max-width: 700px; margin: 0 auto;
    padding: 24px 24px 32px; width: 100%; box-sizing: border-box;
}
.ob-fs-modal-footer {
    background: white; border-top: 1px solid #e5e7eb;
    padding: 14px 24px; flex-shrink: 0;
}
.ob-fs-modal-footer-inner { max-width: 700px; margin: 0 auto; }
.ob-fs-save-btn {
    width: 100%; padding: 13px;
    background: #007aff;
    color: white; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s; font-family: inherit;
}
.ob-fs-save-btn:hover { opacity: 0.88; }
.ob-fs-save-btn.ob-secondary {
    background: white; color: #007aff;
    border: 1.5px solid #bfdbfe; margin-top: 8px;
}
.ob-fs-save-btn.ob-secondary:hover { background: #f0f6ff; }
.ob-fs-section-title {
    font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 18px 0 10px; border-bottom: 1px solid #e5e7eb; margin-bottom: 16px;
}
.ob-fs-field { margin-bottom: 14px; }
.ob-fs-field label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 5px; }
.ob-fs-field select,
.ob-fs-field input[type="text"],
.ob-fs-field textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 14px; box-sizing: border-box; font-family: inherit;
    color: #1d1d1f; background: white; transition: border-color 0.15s;
    -webkit-appearance: none;
}
.ob-fs-field select:focus, .ob-fs-field input:focus, .ob-fs-field textarea:focus {
    border-color: #007aff; outline: none; box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}
.ob-fs-field textarea { resize: vertical; min-height: 80px; }
.ob-fs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .ob-fs-grid { grid-template-columns: 1fr; } }
.ob-fs-ai-note {
    background: #f0f6ff; border: 1px solid #bfdbfe; border-radius: 10px;
    padding: 12px 14px; font-size: 12px; color: #1d4ed8; line-height: 1.6; margin-top: 6px;
}
.ob-fs-ai-btn {
    width: 100%; padding: 12px;
    background: #007aff;
    color: white; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    margin-top: 16px; transition: opacity 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit;
}
.ob-fs-ai-btn:hover { opacity: 0.88; }
.ob-info-card {
    background: white; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 16px; margin-bottom: 10px;
}
.ob-info-card-title { font-size: 14px; font-weight: 700; color: #1d1d1f; margin: 0 0 5px; }
.ob-info-card-body { font-size: 13px; color: #6b7280; line-height: 1.6; margin: 0; }
.ob-info-card-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 7px; }
.ob-plan-week { border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ob-plan-week-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ob-plan-week-day { color: white; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 8px; }
.ob-plan-week-title { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.ob-plan-item { font-size: 13px; color: #374151; padding: 2px 0 2px 14px; line-height: 1.5; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .ob-panel-header { padding: 0 16px 14px; }
    .ob-body-inner { padding: 16px 16px 28px; }
    .ob-footer { padding: 10px 16px; }
    #ob-widget { bottom: 88px; right: 16px; }
    #ob-widget .ob-widget-btn { font-size: 11px; }
    .ob-hero-title { font-size: 22px; }
    .ob-hero-sub { font-size: 13px; }
    .ob-mk-panel { max-height: 92vh; }
    .ob-fs-modal-inner { padding: 16px 16px 28px; }
}

/* ---------- Financial Scan CTA in panel footer ---------- */
.ob-scan-cta {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-top: 1px solid #a7f3d0;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
    color: #065f46;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0 0 16px 16px;
    transition: background 0.15s;
}
.ob-scan-cta:hover { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.ob-scan-result {
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
    padding: 10px 20px;
    text-align: center;
    font-size: 13px;
    color: #15803d;
    border-radius: 0 0 16px 16px;
}

/* ── Structured AI Context Q&A ────────────────────────────────── */
.ob-context-qa { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.ob-qa-item { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.ob-qa-q {
    padding: 10px 14px; font-size: 13px; color: #374151; cursor: pointer;
    background: #f9fafb; transition: background 0.15s; line-height: 1.5;
    display: flex; align-items: center; gap: 8px;
}
.ob-qa-q::before { content: '▶'; font-size: 9px; color: #9ca3af; flex-shrink: 0; }
.ob-qa-q:hover { background: #f0f4ff; color: #4f46e5; }
.ob-qa-ans {
    width: 100%; border: none; border-top: 1px solid #e5e7eb;
    padding: 10px 14px; font-size: 13px; resize: vertical; outline: none;
    font-family: inherit; color: #111827; background: white; box-sizing: border-box;
}
