/* ==========================================================================
   Dial2Hire — Bootstrap 5.3 theme layer
   ========================================================================== */

:root {
    --d2h-blue: #1d5bf6;
    --d2h-blue-rgb: 29, 91, 246;
    --d2h-blue-dark: #1343c4;
    --d2h-blue-soft: #eaf0ff;
    --d2h-orange: #ff7a00;
    --d2h-orange-rgb: 255, 122, 0;
    --d2h-orange-soft: #fff3e6;
    --d2h-ink: #0f172a;
    --d2h-muted: #64748b;
    --d2h-bg: #f5f7fb;
    --d2h-border: #e5e9f2;
    --d2h-green: #12a150;
    --d2h-green-soft: #e8f8ef;
    --d2h-radius: 1rem;
    --d2h-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
    --d2h-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --d2h-shadow-lg: 0 24px 60px -20px rgba(29, 91, 246, .35);

    /* Bootstrap overrides */
    --bs-primary: var(--d2h-blue);
    --bs-primary-rgb: var(--d2h-blue-rgb);
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--d2h-ink);
    --bs-body-bg: var(--d2h-bg);
    --bs-secondary-color: var(--d2h-muted);
    --bs-border-color: var(--d2h-border);
    --bs-link-color: var(--d2h-blue);
    --bs-link-color-rgb: var(--d2h-blue-rgb);
    --bs-link-hover-color: var(--d2h-blue-dark);
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1rem;
    --bs-focus-ring-color: rgba(var(--d2h-blue-rgb), .2);
}

body { -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
a { text-decoration: none; }
h1, h2, h3, h4, h5, .fw-display { letter-spacing: -.025em; font-weight: 800; }
.text-accent { color: var(--d2h-orange) !important; }
.bg-accent { background: var(--d2h-orange) !important; color: #fff; }
.bg-blue-soft { background: var(--d2h-blue-soft) !important; }
.bg-accent-soft { background: var(--d2h-orange-soft) !important; }
.fs-7 { font-size: .8125rem; }
.fs-8 { font-size: .72rem; }
.min-w-0 { min-width: 0; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .8rem; border-radius: 999px;
    background: #fff; border: 1px solid var(--d2h-border);
    font-size: .78rem; font-weight: 700; color: var(--d2h-ink);
    box-shadow: var(--d2h-shadow-sm);
}
.eyebrow .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--d2h-orange); box-shadow: 0 0 0 3px rgba(var(--d2h-orange-rgb), .2); }

/* ---------- Buttons ---------- */
.btn { --bs-btn-font-weight: 700; --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .6rem; border-radius: .7rem; }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .35rem; border-radius: .55rem; }
.btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .85rem; border-radius: .85rem; }
.btn-primary {
    --bs-btn-bg: var(--d2h-blue); --bs-btn-border-color: var(--d2h-blue);
    --bs-btn-hover-bg: var(--d2h-blue-dark); --bs-btn-hover-border-color: var(--d2h-blue-dark);
    --bs-btn-active-bg: var(--d2h-blue-dark); --bs-btn-active-border-color: var(--d2h-blue-dark);
    --bs-btn-disabled-bg: var(--d2h-blue); --bs-btn-disabled-border-color: var(--d2h-blue);
    box-shadow: 0 6px 16px -6px rgba(var(--d2h-blue-rgb), .6);
}
.btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--d2h-orange); --bs-btn-border-color: var(--d2h-orange);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #e96f00; --bs-btn-hover-border-color: #e96f00;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #d56500; --bs-btn-active-border-color: #d56500;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--d2h-orange); --bs-btn-disabled-border-color: var(--d2h-orange);
    box-shadow: 0 6px 16px -6px rgba(var(--d2h-orange-rgb), .7);
}
.btn-white {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--d2h-border); --bs-btn-color: var(--d2h-ink);
    --bs-btn-hover-bg: #f8fafc; --bs-btn-hover-border-color: #cbd5e1; --bs-btn-hover-color: var(--d2h-ink);
    --bs-btn-active-bg: #f1f5f9; --bs-btn-active-border-color: #cbd5e1;
    --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--d2h-border);
}
.btn-soft-primary {
    --bs-btn-bg: var(--d2h-blue-soft); --bs-btn-border-color: transparent; --bs-btn-color: var(--d2h-blue);
    --bs-btn-hover-bg: #dbe6ff; --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: var(--d2h-blue-dark);
    --bs-btn-active-bg: #cddcff; --bs-btn-active-color: var(--d2h-blue-dark);
}

/* ---------- Navbar ---------- */
.d2h-navbar { border-bottom: 1px solid var(--d2h-border); padding-block: .7rem; }
/* Blur lives on a pseudo-element: backdrop-filter on the navbar itself would
   become the containing block for the fixed offcanvas menu and break it. */
.d2h-navbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.d2h-brand-text { white-space: nowrap; }
.d2h-brand { font-size: 1.4rem; font-weight: 800; color: var(--d2h-blue); letter-spacing: -.03em; display: inline-flex; align-items: center; gap: .55rem; }
.d2h-brand-text { color: var(--d2h-blue); }
.d2h-brand-text span { color: var(--d2h-orange); }
.d2h-footer .d2h-brand-text { color: #fff; }
.d2h-brand-mark {
    width: 2.1rem; height: 2.1rem; border-radius: .7rem; display: inline-grid; place-items: center;
    background: linear-gradient(135deg, var(--d2h-blue), #5b8cff); color: #fff !important; font-size: 1rem;
    box-shadow: 0 6px 14px -4px rgba(var(--d2h-blue-rgb), .6);
}
.d2h-navbar .nav-link { font-weight: 600; color: #334155; padding: .5rem .85rem !important; border-radius: .6rem; }
.d2h-navbar .nav-link:hover { color: var(--d2h-blue); background: var(--d2h-blue-soft); }
.d2h-navbar .nav-link.active { color: var(--d2h-blue); background: var(--d2h-blue-soft); }
.d2h-credit-pill {
    display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border-radius: 999px;
    background: var(--d2h-green-soft); color: #067a3a; font-weight: 700; font-size: .85rem; white-space: nowrap;
    border: 1px solid #c9eed8;
}
.d2h-credit-pill:hover { color: #045c2c; background: #dcf4e6; }
@media (max-width: 1199.98px) {
    .d2h-navbar .offcanvas { max-width: 300px; }
    .d2h-navbar .nav-link { padding: .75rem 1rem !important; }
}
/* Desktop: compact top links (Buy · Rent · Sell · Rent out · Search · Agents · Builders · Post …). */
@media (min-width: 1200px) {
    .d2h-navbar .nav-link { padding: .5rem .7rem !important; font-size: .95rem; white-space: nowrap; }
    .d2h-navbar .btn { white-space: nowrap; }
}
/* Between 1200 and 1499px, member header buttons show icons only so everything fits on one row. */
@media (min-width: 1200px) and (max-width: 1499.98px) {
    .d2h-navbar .d2h-nav-btn-text { display: none; }
    .d2h-navbar .nav-link { padding: .5rem .55rem !important; }
}

/* ---------- Page width ----------
   Bootstrap stops at 1320px. Widen to 1440px, the current standard desktop content width,
   on screens that have room for it (1920 / 1680 / 1536px wide laptops and monitors). */
@media (min-width: 1500px) {
    .container, .container-lg, .container-xl, .container-xxl { max-width: 1440px; }
}

/* ---------- Avatars & pills ---------- */
.d2h-avatar {
    --avatar-color: var(--d2h-blue);
    display: inline-grid; place-items: center; flex-shrink: 0; font-weight: 800;
    color: var(--avatar-color); background: color-mix(in srgb, var(--avatar-color) 13%, white);
    border: 1px solid color-mix(in srgb, var(--avatar-color) 22%, white);
}
.d2h-avatar-sm { width: 2.1rem; height: 2.1rem; font-size: .75rem; }
.d2h-avatar-md { width: 2.75rem; height: 2.75rem; font-size: .88rem; }
.d2h-avatar-lg { width: 3.25rem; height: 3.25rem; font-size: 1rem; }
.text-bg-locked { background: var(--d2h-orange-soft) !important; color: #b45309 !important; font-weight: 700; }
.text-bg-unlocked { background: var(--d2h-green-soft) !important; color: #067a3a !important; font-weight: 700; }
.badge { font-weight: 700; }
.badge-soft { background: #f1f5f9; color: #475569; }
.badge-soft-primary { background: var(--d2h-blue-soft); color: var(--d2h-blue); }

/* ---------- Cards ---------- */
.card { --bs-card-border-color: var(--d2h-border); --bs-card-border-radius: var(--d2h-radius); --bs-card-inner-border-radius: calc(var(--d2h-radius) - 1px); box-shadow: var(--d2h-shadow-sm); }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--d2h-shadow); border-color: #c7d4f5; }
.icon-tile {
    width: 3rem; height: 3rem; border-radius: .85rem; display: inline-grid; place-items: center; font-size: 1.35rem; flex-shrink: 0;
    background: var(--d2h-blue-soft); color: var(--d2h-blue);
}
.icon-tile-sm { width: 2.25rem; height: 2.25rem; border-radius: .65rem; font-size: 1rem; }
.icon-tile.tone-primary { background: var(--d2h-blue-soft); color: var(--d2h-blue); }
.icon-tile.tone-success { background: var(--d2h-green-soft); color: var(--d2h-green); }
.icon-tile.tone-warning { background: var(--d2h-orange-soft); color: var(--d2h-orange); }
.icon-tile.tone-purple { background: #f3e8ff; color: #9333ea; }

.page-header { padding: 2rem 0 1.25rem; }
.page-header h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .25rem; }

/* ---------- Hero ---------- */
.d2h-hero {
    position: relative; overflow: hidden; padding: 4.5rem 0 4rem;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(var(--d2h-blue-rgb), .13), transparent 60%),
        radial-gradient(700px 380px at 100% 20%, rgba(var(--d2h-orange-rgb), .14), transparent 60%),
        #fff;
    border-bottom: 1px solid var(--d2h-border);
}
.d2h-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(15, 23, 42, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.d2h-hero .container { position: relative; }
.d2h-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 1.1rem 0; }
.d2h-hero h1 .grad { background: linear-gradient(90deg, var(--d2h-blue), #7c3aed 55%, var(--d2h-orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d2h-hero .lead { color: var(--d2h-muted); font-size: 1.1rem; line-height: 1.7; max-width: 36rem; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-stats b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.hero-stats span { font-size: .82rem; color: var(--d2h-muted); }
.routing-card { border: 0; box-shadow: var(--d2h-shadow-lg); border-radius: 1.25rem; }
.routing-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-bottom: 1px dashed var(--d2h-border); }
.routing-row:last-child { border-bottom: 0; }
.routing-row .arrow { color: #94a3b8; }
.floating-bubble {
    position: absolute; right: -14px; bottom: -22px; max-width: 250px;
    background: #fff; border-radius: 1rem 1rem .25rem 1rem; padding: .75rem .9rem; font-size: .82rem;
    box-shadow: var(--d2h-shadow); border: 1px solid var(--d2h-border);
    animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
@media (max-width: 991.98px) { .floating-bubble { position: static; margin-top: 1rem; max-width: none; animation: none; } }

.section { padding: 4rem 0; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* Module cards on home */
.module-card { padding: 1.5rem; height: 100%; }
.module-card .action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: 1.25rem; }
.action-link {
    display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-radius: .7rem;
    border: 1px solid var(--d2h-border); background: #fff; font-weight: 700; font-size: .85rem; color: var(--d2h-ink);
    transition: all .15s ease;
}
.action-link i { color: var(--d2h-blue); }
.action-link:hover { border-color: var(--d2h-blue); color: var(--d2h-blue); background: var(--d2h-blue-soft); }
@media (max-width: 575.98px) { .module-card .action-grid { grid-template-columns: 1fr; } }

/* Flow timeline */
.flow-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; counter-reset: step; position: relative; }
.flow-steps::before { content: ""; position: absolute; top: 1.4rem; left: 10%; right: 10%; height: 2px; background: repeating-linear-gradient(90deg, #c7d4f5 0 8px, transparent 8px 14px); }
.flow-step { position: relative; text-align: center; color: inherit; }
.flow-step .num {
    width: 2.8rem; height: 2.8rem; margin: 0 auto .75rem; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 2px solid var(--d2h-blue); color: var(--d2h-blue); font-weight: 800; font-size: 1.05rem;
    position: relative; z-index: 1; box-shadow: 0 0 0 6px var(--d2h-bg);
}
.flow-step:last-child .num { background: var(--d2h-blue); color: #fff; }
.flow-step b { display: block; font-size: .95rem; }
.flow-step small { color: var(--d2h-muted); }
@media (max-width: 767.98px) {
    .flow-steps { grid-template-columns: 1fr; gap: .25rem; }
    .flow-steps::before { top: 1rem; bottom: 1rem; left: 1.4rem; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, #c7d4f5 0 8px, transparent 8px 14px); }
    .flow-step { display: flex; text-align: left; gap: 1rem; align-items: center; padding: .5rem 0; }
    .flow-step .num { margin: 0; flex-shrink: 0; }
}

.cta-band {
    border-radius: 1.5rem; padding: 2.5rem; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(120deg, #0f2a7a 0%, var(--d2h-blue) 55%, #5b8cff 100%);
}
.cta-band::after { content: ""; position: absolute; width: 340px; height: 340px; right: -80px; top: -120px; border-radius: 50%; background: rgba(var(--d2h-orange-rgb), .35); filter: blur(10px); }
.cta-band > * { position: relative; z-index: 1; }

/* ---------- Callouts ---------- */
.callout { display: flex; gap: .85rem; padding: 1rem 1.15rem; border-radius: .85rem; border: 1px solid #fed7aa; background: #fff8f0; color: #9a3412; }
.callout i { font-size: 1.15rem; line-height: 1.3; }
.callout-info { border-color: #cfdcff; background: #f4f7ff; color: #1e3a8a; }

/* ---------- Wizard (create) ---------- */
.wizard-side { position: sticky; top: 6rem; }
.stepper { list-style: none; padding: 0; margin: 0; }
.stepper li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; color: var(--d2h-muted); font-weight: 600; font-size: .92rem; position: relative; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; left: .95rem; top: 2.45rem; width: 2px; height: calc(100% - 1.9rem); background: var(--d2h-border); }
.stepper .dot { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: #fff; border: 2px solid var(--d2h-border); flex-shrink: 0; z-index: 1; }
.stepper li.active { color: var(--d2h-ink); }
.stepper li.active .dot { border-color: var(--d2h-blue); color: var(--d2h-blue); box-shadow: 0 0 0 4px var(--d2h-blue-soft); }
.stepper li.done .dot { background: var(--d2h-blue); border-color: var(--d2h-blue); color: #fff; }
.stepper li.done:not(:last-child)::after { background: var(--d2h-blue); }
@media (max-width: 991.98px) {
    .wizard-side { position: static; }
    .stepper { display: flex; justify-content: space-between; }
    .stepper li { flex-direction: column; gap: .3rem; font-size: .7rem; text-align: center; flex: 1; }
    .stepper li:not(:last-child)::after { left: calc(50% + 1.2rem); top: 1.5rem; width: calc(100% - 2.4rem); height: 2px; }
}

.wizard-section { padding: 1.5rem; border-top: 1px solid var(--d2h-border); }
.wizard-section:first-child { border-top: 0; }
.wizard-section .section-label { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.wizard-section .section-label .n { width: 1.6rem; height: 1.6rem; border-radius: .5rem; background: var(--d2h-blue-soft); color: var(--d2h-blue); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.wizard-section .section-label h2 { font-size: 1.1rem; margin: 0; }
.is-hidden { display: none !important; }
.reveal { animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

.segmented { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .3rem; border-radius: .85rem; background: #eef2f8; }
.segmented .btn { --bs-btn-padding-y: .5rem; border: 0; color: #475569; background: transparent; box-shadow: none; }
.segmented .btn:hover { color: var(--d2h-ink); }
.segmented .btn.active, .segmented .btn-check:checked + .btn { background: #fff; color: var(--d2h-blue); box-shadow: var(--d2h-shadow-sm); }

.choice-card { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; border: 1.5px solid var(--d2h-border); border-radius: .9rem; cursor: pointer; background: #fff; height: 100%; transition: all .15s ease; }
.choice-card:hover { border-color: #b8c9f7; }
.choice-card .check { position: absolute; top: .75rem; right: .75rem; color: var(--d2h-blue); opacity: 0; transition: opacity .15s; }
.btn-check:checked + .choice-card { border-color: var(--d2h-blue); background: #f7f9ff; box-shadow: 0 0 0 4px rgba(var(--d2h-blue-rgb), .1); }
.btn-check:checked + .choice-card .check { opacity: 1; }
.btn-check:focus-visible + .choice-card { outline: 2px solid var(--d2h-blue); outline-offset: 2px; }

.form-label { font-weight: 700; font-size: .85rem; margin-bottom: .4rem; }
.form-control, .form-select { border-radius: .7rem; padding: .65rem .9rem; border-color: #d5dbe7; }
.form-control:focus, .form-select:focus { border-color: var(--d2h-blue); box-shadow: 0 0 0 .25rem rgba(var(--d2h-blue-rgb), .12); }
.input-group-text { background: #f8fafc; border-color: #d5dbe7; color: var(--d2h-muted); border-radius: .7rem; }

.match-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1.5px solid var(--d2h-border); border-radius: .85rem; cursor: pointer; background: #fff; transition: all .15s; }
.match-item:hover { border-color: #b8c9f7; }
.match-item:has(input:checked) { border-color: var(--d2h-blue); background: #f7f9ff; }
.match-item .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; flex-shrink: 0; }

/* WhatsApp-style preview */
.wa-phone { background: #efe7de; border-radius: 1.25rem; padding: 1.25rem; position: relative; overflow: hidden; border: 1px solid #e3d9cd; }
.wa-phone::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 14px 14px; }
.wa-header { position: relative; display: flex; align-items: center; gap: .6rem; margin: -1.25rem -1.25rem 1rem; padding: .7rem 1rem; background: #075e54; color: #fff; }
.wa-bubble { position: relative; background: #dcf8c6; border-radius: .25rem 1rem 1rem 1rem; padding: .85rem 1rem .6rem; max-width: 26rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: .9rem; line-height: 1.55; }
.wa-bubble .wa-title { font-weight: 800; text-transform: uppercase; margin-bottom: .35rem; }
.wa-bubble .wa-time { text-align: right; font-size: .68rem; color: #5b7a5b; margin-top: .25rem; }
.wa-cta { position: relative; background: #fff; border-radius: .6rem; padding: .6rem; text-align: center; color: #128c7e; font-weight: 800; margin-top: .4rem; max-width: 26rem; font-size: .88rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); }

.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .92rem; }
.summary-row + .summary-row { border-top: 1px dashed var(--d2h-border); }

/* ---------- Search ---------- */
.search-hero { background: linear-gradient(180deg, #fff 0%, var(--d2h-bg) 100%); border-bottom: 1px solid var(--d2h-border); }
.mode-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.mode-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--d2h-border); background: #fff; font-weight: 700; color: #475569; font-size: .9rem; }
.mode-tab:hover { border-color: var(--d2h-blue); color: var(--d2h-blue); }
.mode-tab.active { background: var(--d2h-ink); color: #fff; border-color: var(--d2h-ink); }
.search-box { padding: .5rem; border-radius: 1.1rem; }
.search-box .form-control, .search-box .input-group-text { border: 0; background: transparent; }
.search-box .form-control:focus { box-shadow: none; }
.search-box .divider { width: 1px; background: var(--d2h-border); margin: .4rem 0; }
@media (max-width: 767.98px) { .search-box .divider { width: auto; height: 1px; margin: 0 .5rem; } }
.result-card { padding: 1.25rem; height: 100%; display: flex; flex-direction: column; }
.result-card .price { font-weight: 800; font-size: 1.05rem; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .icon-tile { width: 4rem; height: 4rem; font-size: 1.75rem; border-radius: 1.1rem; }

/* ---------- Chat ---------- */
.chat-app { overflow: hidden; }
.folder-card { padding: .75rem; position: sticky; top: 6rem; }
.folder { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-radius: .7rem; color: #334155; font-weight: 700; font-size: .92rem; }
.folder:hover { background: #f1f5f9; color: var(--d2h-ink); }
.folder.active { background: var(--d2h-blue-soft); color: var(--d2h-blue); }
.folder .count { margin-left: auto; font-size: .72rem; background: #eef2f7; color: #475569; border-radius: 999px; padding: .1rem .5rem; font-weight: 800; }
.folder.active .count { background: var(--d2h-blue); color: #fff; }
.subfolders { margin: .15rem 0 .5rem 1.6rem; padding-left: .75rem; border-left: 2px solid var(--d2h-border); }
.subfolder { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: .55rem; font-size: .84rem; color: #475569; font-weight: 600; }
.subfolder:hover { background: #f1f5f9; color: var(--d2h-ink); }
.subfolder.active { color: var(--d2h-blue); background: #f4f7ff; font-weight: 700; }
.subfolder .count { margin-left: auto; font-size: .7rem; color: var(--d2h-muted); font-weight: 700; }
.chip-scroller { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; }
.chip-scroller .chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; background: #fff; border: 1px solid var(--d2h-border); font-weight: 700; font-size: .82rem; color: #475569; }
.chip-scroller .chip.active { background: var(--d2h-blue); border-color: var(--d2h-blue); color: #fff; }
.chip-scroller .chip .count { font-size: .7rem; opacity: .8; }

.thread-pane { border-right: 1px solid var(--d2h-border); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.thread-pane-head { padding: 1rem 1.1rem; border-bottom: 1px solid var(--d2h-border); }
.thread-list { overflow-y: auto; max-height: 680px; }
.thread-item { display: flex; gap: .75rem; padding: .95rem 1.1rem; border-bottom: 1px solid #f0f3f8; color: inherit; position: relative; }
.thread-item:hover { background: #f8fafc; color: inherit; }
.thread-item.active { background: #f4f7ff; }
.thread-item.active::before { content: ""; position: absolute; left: 0; top: .6rem; bottom: .6rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--d2h-blue); }
.thread-item .crumb { font-size: .7rem; font-weight: 800; color: var(--d2h-blue); text-transform: uppercase; letter-spacing: .03em; }
.thread-item .post { font-size: .8rem; color: #475569; font-weight: 600; }
.thread-item .snippet { font-size: .8rem; color: var(--d2h-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .time { font-size: .7rem; color: #94a3b8; white-space: nowrap; }
.thread-item.needs-reply .snippet { color: var(--d2h-ink); font-weight: 600; }
.unread-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--d2h-orange); display: inline-block; }

.convo { display: flex; flex-direction: column; min-height: 720px; background: #fff; }
.convo-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--d2h-border); }
.post-context { display: flex; gap: .75rem; align-items: center; margin-top: .85rem; padding: .7rem .85rem; border-radius: .75rem; background: #f8fafc; border: 1px solid var(--d2h-border); font-size: .82rem; }
.unlock-strip { padding: .7rem 1.25rem; background: #fff8f0; border-bottom: 1px solid #fde3c4; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.unlock-strip.is-open { background: #f1fbf5; border-bottom-color: #cdeedb; }
.messages { flex: 1; overflow-y: auto; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; max-height: 480px; min-height: 320px;
    background: linear-gradient(180deg, #fbfcfe, #f6f8fc); }
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg .bubble { padding: .7rem .95rem; border-radius: 1.1rem; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg .meta { font-size: .68rem; color: #94a3b8; margin-top: .25rem; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.mine .bubble { background: linear-gradient(135deg, var(--d2h-blue), #3d74ff); color: #fff; border-bottom-right-radius: .3rem; }
.msg.theirs { align-self: flex-start; }
.msg.theirs .bubble { background: #fff; border: 1px solid var(--d2h-border); border-bottom-left-radius: .3rem; box-shadow: var(--d2h-shadow-sm); }
.day-sep { align-self: center; font-size: .7rem; font-weight: 700; color: #94a3b8; background: #fff; border: 1px solid var(--d2h-border); padding: .15rem .65rem; border-radius: 999px; }
.lock-note { margin: auto; text-align: center; max-width: 360px; padding: 1.25rem; border-radius: 1rem; background: #fff; border: 1px dashed #fbc98e; color: #92400e; font-size: .88rem; }
.lock-note i { font-size: 1.6rem; display: block; margin-bottom: .35rem; }
.composer { padding: .85rem 1.25rem; border-top: 1px solid var(--d2h-border); background: #fff; }
.composer textarea { resize: none; border-radius: .85rem; }
.viewer-toggle .btn { --bs-btn-font-size: .8rem; }
@media (max-width: 991.98px) {
    .folder-card { position: static; }
    .thread-pane { border-right: 0; border-bottom: 1px solid var(--d2h-border); }
    .thread-list { max-height: 330px; }
    .convo { min-height: 600px; }
    .msg { max-width: 90%; }
}

/* ---------- Dashboard ---------- */
.stat-card { padding: 1.25rem; display: flex; flex-direction: row; gap: 1rem; align-items: center; height: 100%; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .label { font-size: .8rem; color: var(--d2h-muted); font-weight: 600; }
.category-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; background: #f1f5f9; color: #475569; }
.category-chip:hover { background: var(--d2h-blue-soft); color: var(--d2h-blue); }
.category-chip b { color: var(--d2h-ink); }
.list-row { display: flex; gap: .85rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid #f0f3f8; color: inherit; }
.list-row:hover { background: #f8fafc; color: inherit; }
.logic-steps { list-style: none; padding: 0; margin: 0; counter-reset: logic; }
.logic-steps li { counter-increment: logic; display: flex; gap: .85rem; padding: .7rem 0; font-size: .9rem; }
.logic-steps li::before { content: counter(logic); width: 1.7rem; height: 1.7rem; border-radius: .55rem; background: var(--d2h-orange-soft); color: var(--d2h-orange); font-weight: 800; font-size: .8rem; display: grid; place-items: center; flex-shrink: 0; }
.table-d2h { --bs-table-bg: transparent; margin: 0; }
.table-d2h thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--d2h-muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--d2h-border); padding: .75rem 1.25rem; white-space: nowrap; }
.table-d2h td { padding: .9rem 1.25rem; vertical-align: middle; font-size: .9rem; border-color: #f0f3f8; }
.txn { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid #f0f3f8; }
.txn:first-child { border-top: 0; }
.txn .amt { font-weight: 800; white-space: nowrap; }

/* ---------- Plans ---------- */
.plan-card { padding: 2rem; height: 100%; display: flex; flex-direction: column; position: relative; }
.plan-card .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; }
.plan-card .price small { font-size: .95rem; color: var(--d2h-muted); font-weight: 600; letter-spacing: 0; }
.plan-card.featured { border: 2px solid var(--d2h-blue); box-shadow: var(--d2h-shadow-lg); }
@media (min-width: 992px) { .plan-card.featured { transform: scale(1.03); } }
.plan-card .ribbon { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--d2h-blue); color: #fff; font-size: .75rem; font-weight: 800; padding: .3rem .85rem; border-radius: 999px; white-space: nowrap; }
.perk { display: flex; gap: .6rem; padding: .4rem 0; font-size: .92rem; }
.perk i { color: var(--d2h-green); }

/* ---------- Toasts ---------- */
.d2h-toast { background: #0f172a; color: #fff; border-radius: .9rem; box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .45); min-width: 300px; }
.d2h-toast-success .d2h-toast-icon { color: #4ade80; }
.d2h-toast-warning .d2h-toast-icon { color: #fbbf24; }
.d2h-toast-danger .d2h-toast-icon { color: #f87171; }
.d2h-toast-info .d2h-toast-icon { color: #93c5fd; }
.d2h-toast-body { font-size: .9rem; line-height: 1.45; }

/* ---------- Footer ---------- */
.d2h-footer { background: #0b1224; color: #cbd5e1; padding: 2.5rem 0; margin-top: 4rem; }
.d2h-footer a { color: #cbd5e1; }
.d2h-footer a:hover { color: #fff; }
.d2h-footer .d2h-brand { font-size: 1.25rem; }

/* Modals */
.modal-content { border: 0; border-radius: 1.25rem; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .4); }
