/*--------------------------------------------------------------
# DotLeads - app stylesheet
# Brand tokens follow BRAND-GUIDELINES.md (DotTut family theme).
# Theming: dark is the default (brand is dark-first); the light theme
# is activated with html[data-theme="light"]. Every color used by a
# component must come from a token below so both themes stay in sync.
--------------------------------------------------------------*/

:root {
    /* Fonts */
    --default-font: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, sans-serif;
    --heading-font: "Ubuntu", sans-serif;
    --nav-font: "Inter", sans-serif;

    /* Brand constants (same in both themes) */
    --accent-color:     #40b605;
    --btn-green:        #2f8000;   /* white-text buttons (WCAG AA) */
    --btn-green-hover:  #287000;

    /* Status hues */
    --status-good: #22c55e;
    --status-warn: #f59e0b;
    --status-bad:  #ef4444;
    --status-info: #38bdf8;

    /* Layout */
    --sidebar-width: 256px;
    --topbar-height: 64px;

    scroll-behavior: smooth;
}

/* ---------- Dark theme (default) ---------- */
:root,
html[data-theme="dark"] {
    color-scheme: dark;

    --background-color: #040a01;
    --surface-color:    #0f1412;
    --surface-deep:     #0b0f0d;
    --sidebar-bg:       #060c03;
    --input-bg:         #121614;
    --input-border:     #1f2a25;

    --default-color:    #f3f6f4;
    --heading-color:    #e1eff9;
    --text-strong:      #ffffff;
    --text-soft:        rgba(255, 255, 255, .75);
    --text-muted:       rgba(255, 255, 255, .5);
    --text-faint:       rgba(255, 255, 255, .35);
    --hairline:         rgba(255, 255, 255, .06);
    --hairline-strong:  rgba(255, 255, 255, .1);
    --hover-bg:         rgba(255, 255, 255, .04);

    --emerald:          #22c55e;
    --link-color:       #22c55e;
    --link-hover:       #4ade80;

    --status-good-text: #22c55e;
    --status-warn-text: #f59e0b;
    --status-bad-text:  #ef4444;
    --status-info-text: #38bdf8;

    --chart-grid:  rgba(255, 255, 255, .06);
    --chart-label: rgba(255, 255, 255, .45);
    --glow:        0 0 40px rgba(0, 255, 120, .05);
    --overlay:     rgba(0, 0, 0, .6);
    --shadow-lg:   0 18px 50px rgba(0, 0, 0, .5);
    --placeholder: #8c9a93;
    --skeleton-a:  rgba(255, 255, 255, .05);
    --skeleton-b:  rgba(255, 255, 255, .11);
}

/* ---------- Light theme ---------- */
html[data-theme="light"] {
    color-scheme: light;

    --background-color: #f4f7f4;
    --surface-color:    #ffffff;
    --surface-deep:     #fbfdfb;
    --sidebar-bg:       #ffffff;
    --input-bg:         #f3f6f3;
    --input-border:     #d8e2d9;

    --default-color:    #1c2a21;
    --heading-color:    #0e1f14;
    --text-strong:      #0e1f14;
    --text-soft:        rgba(14, 31, 20, .8);
    --text-muted:       rgba(14, 31, 20, .58);
    --text-faint:       rgba(14, 31, 20, .42);
    --hairline:         rgba(14, 31, 20, .08);
    --hairline-strong:  rgba(14, 31, 20, .14);
    --hover-bg:         rgba(14, 31, 20, .045);

    --emerald:          #16a34a;
    --link-color:       #15803d;
    --link-hover:       #166534;

    --status-good-text: #15803d;
    --status-warn-text: #b45309;
    --status-bad-text:  #b91c1c;
    --status-info-text: #0369a1;

    --chart-grid:  rgba(14, 31, 20, .08);
    --chart-label: rgba(14, 31, 20, .45);
    --glow:        0 6px 30px rgba(20, 80, 40, .08);
    --overlay:     rgba(10, 20, 14, .45);
    --shadow-lg:   0 18px 50px rgba(20, 40, 28, .18);
    --placeholder: #7d8b81;
    --skeleton-a:  rgba(14, 31, 20, .06);
    --skeleton-b:  rgba(14, 31, 20, .12);
}

/* ---------- Base ---------- */

html { background-color: var(--background-color); }

body {
    margin: 0;
    background-color: var(--background-color);
    color: var(--default-color);
    font-family: var(--default-font);
}

/* ---------- Space ambiance (dark theme) ----------
   The starfield canvas sits behind everything; the body goes transparent in
   dark mode so stars show through page gaps while cards stay opaque. */

/* Never allow a horizontal scrollbar at the page level: data tables scroll in
   their own wrappers, and the fixed starfield must not be able to inflate the
   layout viewport (a wide element can briefly seed an overflow the fixed canvas
   then sustains). This caps the scroll width to the real viewport. */
html { overflow-x: hidden; }

#dlSpace {
    position: fixed;
    inset: 0;
    /* Constrain the DISPLAY size to the viewport; the canvas buffer is sized
       larger for DPR, and without this it paints at its full pixel size (e.g.
       780px on a 2x 390px phone) and creates a horizontal scroll. */
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* On phones/tablets, wide data tables scroll horizontally inside their card
   instead of pushing the whole page wider. */
@media (max-width: 991px) {
    .dl-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

html[data-theme="dark"] {
    background-image:
        radial-gradient(1100px 640px at 82% -12%, rgba(64, 182, 5, .055), transparent 62%),
        radial-gradient(900px 540px at -8% 78%, rgba(34, 197, 94, .035), transparent 58%);
}

html[data-theme="dark"] body { background-color: transparent; }

/* Auth pages let the sky through entirely (the glow comes from html). */
html[data-theme="dark"] .dl-auth {
    background: radial-gradient(1100px 500px at 80% -10%, rgba(64, 182, 5, .06), transparent 60%);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-family: var(--heading-font);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color .25s;
}

a:hover { color: var(--link-hover); }

::selection { background: var(--emerald); color: #06140a; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- App shell ---------- */

.dl-app { display: flex; min-height: 100vh; }

/* Onboarding gate: keep the shell hidden (but laid out) until the gate confirms
   setup, so a new user is redirected to /onboarding without a dashboard flash. */
html.dl-checking .dl-app { visibility: hidden; }

.dl-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-inline-end: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1000;
    padding: 20px 14px;
    overflow: visible; /* nav scrolls internally; keeps the website dropdown from clipping */
    transition: width .25s ease;
}

.dl-main {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-inline-start .25s ease;
}

/* The website combo must fit inside the sidebar's width (it inherits a
   min-width meant for wide toolbars). */
.dl-sidebar .dl-combo { min-width: 0; width: 100%; }
.dl-sidebar .dl-combo-panel { width: 100%; min-width: 0; }

/* ---------- Collapsed sidebar (icon rail) ---------- */

html[data-sidebar="collapsed"] { --sidebar-width: 76px; }

html[data-sidebar="collapsed"] .dl-sidebar { padding: 20px 10px; }

html[data-sidebar="collapsed"] .dl-brand { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-sidebar="collapsed"] .dl-brand .wordmark,
html[data-sidebar="collapsed"] .dl-nav .nav-label,
html[data-sidebar="collapsed"] .dl-nav a .txt,
html[data-sidebar="collapsed"] .dl-side-site .lbl,
html[data-sidebar="collapsed"] .dl-sidebar-foot,
html[data-sidebar="collapsed"] .dl-combo-btn .txt,
html[data-sidebar="collapsed"] .dl-combo-btn .bi-chevron-down { display: none; }

html[data-sidebar="collapsed"] .dl-nav a { justify-content: center; padding: 11px 0; }
html[data-sidebar="collapsed"] .dl-combo-btn { justify-content: center; padding: 9px 0; }

.dl-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    color: var(--text-faint);
    font-family: var(--nav-font);
    font-size: .8rem;
    font-weight: 600;
    padding: 9px 0;
    margin-top: 10px;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.dl-collapse-btn:hover { color: var(--emerald); border-color: var(--emerald); }
.dl-collapse-btn i { transition: transform .25s ease; }
html[data-sidebar="collapsed"] .dl-collapse-btn .txt { display: none; }
html[data-sidebar="collapsed"] .dl-collapse-btn i { transform: rotate(180deg); }

.dl-topbar {
    height: var(--topbar-height);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.dl-content { padding: 28px 24px; }

.dl-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 990;
}

.dl-backdrop.show { display: block; }

/* Sidebar brand */
.dl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 18px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 18px;
}

.dl-brand .wordmark {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-strong);
    letter-spacing: .2px;
}

.dl-brand .wordmark span { color: var(--emerald); }

/* Sidebar nav */
.dl-nav {
    list-style: none; margin: 0; padding: 0;
    flex: 1 1 auto; min-height: 0;        /* only the nav scrolls; brand/site/collapse/foot stay pinned */
    overflow-y: auto; overflow-x: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
}

.dl-nav .nav-label {
    font-family: var(--nav-font);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
    padding: 14px 12px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.dl-nav .nav-label:hover { color: var(--text-muted); }
.nav-label-chev { font-size: .62rem; opacity: .55; transition: transform .2s ease; }
.dl-nav .nav-label.collapsed .nav-label-chev { transform: rotate(-90deg); }
/* JS hides the items of a collapsed section by tagging each one. */
.dl-nav .dl-nav-hidden { display: none !important; }

/* Notification count badge on a nav item (e.g. unreviewed free checks). */
.dl-nav-badge {
    margin-left: auto;
    background: var(--status-bad-text, #ef4444);
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dl-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: var(--nav-font);
    font-size: .92rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: all .2s;
}

.dl-nav a i { font-size: 1.05rem; color: var(--text-faint); transition: color .2s; }

.dl-nav a:hover { background: var(--hover-bg); color: var(--text-strong); }
.dl-nav a:hover i { color: var(--emerald); }

.dl-nav a.active {
    background: rgba(34, 197, 94, .12);
    color: var(--text-strong);
}

.dl-nav a.active i { color: var(--emerald); }

.dl-sidebar-foot {
    padding: 14px 12px;
    border-top: 1px solid var(--hairline);
    font-size: .75rem;
    color: var(--text-faint);
}

/* Topbar bits */
.dl-page-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dl-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 220px;
}

.dl-search i { color: var(--text-faint); }

.dl-search input {
    background: none;
    border: 0;
    outline: none;
    color: var(--text-strong);
    font-family: var(--nav-font);
    font-size: .88rem;
    width: 100%;
}

.dl-search input::placeholder { color: var(--placeholder); }

.dl-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.dl-search + .dl-topbar-actions { margin-left: 0; }

.dl-icon-btn {
    background: none;
    border: 0;
    color: var(--text-soft);
    font-size: 1.15rem;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.dl-icon-btn:hover { background: var(--hover-bg); color: var(--emerald); }

.dl-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--nav-font);
    font-size: .88rem;
    color: var(--text-soft);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 10px;
}

.dl-user:hover { background: var(--hover-bg); }

.dl-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(150deg, #4ad006, var(--btn-green));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}

.dl-user .name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdown (Bootstrap, themed) */
.dropdown-menu {
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 200px;
}

.dropdown-menu .dropdown-item {
    color: var(--text-soft);
    font-family: var(--nav-font);
    font-size: .88rem;
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.dropdown-menu .dropdown-item i { color: var(--text-faint); }
.dropdown-menu .dropdown-item:hover { background: var(--hover-bg); color: var(--text-strong); }
.dropdown-menu .dropdown-item:hover i { color: var(--emerald); }
.dropdown-menu .dropdown-header { color: var(--text-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; }
.dropdown-menu .dropdown-divider { border-color: var(--hairline); }

/* Workspace selector (lives in the topbar) */
.dl-ws-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 0 4px 0 11px;
    height: 38px;
}

.dl-ws-wrap > i { color: var(--emerald); font-size: .95rem; }

.dl-ctx-select {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    font-family: var(--nav-font);
    font-size: .85rem;
    border-radius: 8px;
    padding: 6px 4px;
    max-width: 200px;
    cursor: pointer;
}

.dl-ctx-select:focus { outline: none; }
.dl-ws-wrap:focus-within { border-color: var(--emerald); }

/* Native dropdown lists follow the theme (otherwise white-on-white in dark mode). */
.dl-ctx-select option,
.dl-select option {
    background: var(--surface-color);
    color: var(--default-color);
}

/* Website selector (lives in the sidebar, above the nav) */
.dl-side-site { margin-bottom: 16px; }

.dl-side-site .lbl,
.dl-side-ws .lbl {
    display: block;
    font-family: var(--nav-font);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
    padding: 0 12px 6px;
}

/* Workspace switcher inside the sidebar drawer - phones only (the topbar one is
   hidden at <=575). Kept in sync with the topbar select via .dl-ws-select. */
.dl-side-ws { display: none; margin-bottom: 16px; }
.dl-side-select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--hairline);
    border-radius: 9px;
    padding: 9px 11px;
    color: var(--text-strong);
    font-family: var(--nav-font);
    font-size: .85rem;
    cursor: pointer;
}
.dl-side-select:focus { outline: none; border-color: var(--emerald); }
.dl-side-select option { background: var(--surface-color); color: var(--default-color); }
@media (max-width: 575px) { .dl-side-ws { display: block; } }

/* Back button + breadcrumb + title, grouped. On desktop this is transparent
   (acts like a normal inline cluster); on phones it drops to its own row. */
.dl-titlebar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

/* Breadcrumb path: one line, ancestors muted, current page is the title
   (Vercel-style: "Site Audit / Audit Report"). */
.dl-path {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.dl-path .seg {
    font-family: var(--nav-font);
    font-size: .92rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .2s;
    flex-shrink: 0;
}

.dl-path .seg:hover { color: var(--emerald); }

.dl-path .sep {
    color: var(--text-faint);
    font-size: .95rem;
    font-weight: 300;
    flex-shrink: 0;
    user-select: none;
}

.dl-path .dl-page-title { flex-shrink: 1; min-width: 0; }

.dl-back {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-soft);
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .92rem;
    flex-shrink: 0;
    transition: border-color .2s, color .2s, transform .2s;
}

.dl-back:hover { border-color: var(--emerald); color: var(--emerald); }
.dl-back:hover i { animation: dl-nudge-left .5s ease; }

@keyframes dl-nudge-left {
    30% { transform: translateX(-3px); }
}

/* Searchable combobox */
.dl-combo { position: relative; min-width: 230px; }

.dl-combo-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-strong);
    font-family: var(--nav-font);
    font-size: .85rem;
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
}

.dl-combo-btn:hover { border-color: var(--emerald); }
.dl-combo-btn .bi-globe2 { color: var(--emerald); }
.dl-combo-btn .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-combo-btn .bi-chevron-down { font-size: .7rem; color: var(--text-faint); }

.dl-combo-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max(100%, 300px);
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    z-index: 1200;
    animation: dl-reveal .25s ease;
}

.dl-combo-panel .dl-input { padding: 9px 12px; border-radius: 9px; font-size: .85rem; }

.dl-combo-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.dl-combo-list li {
    padding: 9px 11px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--nav-font);
    font-size: .86rem;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dl-combo-list li:hover, .dl-combo-list li.hover { background: var(--hover-bg); color: var(--text-strong); }
.dl-combo-list li.selected { background: rgba(34, 197, 94, .12); color: var(--text-strong); }
.dl-combo-list li .sub { font-size: .73rem; color: var(--text-faint); }
.dl-combo-list li.none { cursor: default; color: var(--text-faint); justify-content: center; }

@media (max-width: 575px) {
    .dl-ctxbar { padding: 10px 14px; }
    .dl-ctxbar .lbl { display: none; }
    .dl-ctx-select { max-width: 130px; }
    .dl-combo { flex: 1; min-width: 0; }
}

/* ---------- Components ---------- */

/* Buttons */
.btn-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--btn-green);
    border: 2px solid var(--btn-green);
    color: #fff;
    padding: 10px 22px;
    font-family: var(--nav-font);
    font-size: .9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all .25s ease;
}

.btn-brand:hover:not(:disabled) { background: var(--btn-green-hover); border-color: var(--btn-green-hover); color: #fff; transform: translateY(-2px); }
.btn-brand:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--hairline-strong);
    color: var(--text-soft);
    padding: 10px 22px;
    font-family: var(--nav-font);
    font-size: .9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all .25s ease;
}

.btn-ghost:hover:not(:disabled) { border-color: var(--emerald); color: var(--text-strong); }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

.btn-danger-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, .35);
    color: var(--status-bad-text);
    padding: 8px 16px;
    font-family: var(--nav-font);
    font-size: .85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all .25s ease;
}

.btn-danger-ghost:hover { background: rgba(239, 68, 68, .1); border-color: var(--status-bad); }

.btn-sm { padding: 7px 14px; font-size: .82rem; }

/* Cards */
.dl-card {
    background: var(--surface-color);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    padding: 24px;
    transition: border-color .25s;
}

.dl-card:hover { border-color: rgba(34, 197, 94, .25); }

.dl-card .card-title {
    font-family: var(--nav-font);
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0 0 4px;
}

.dl-card .card-sub { font-size: .8rem; color: var(--text-muted); margin: 0; }

.dl-glow { box-shadow: var(--glow); }

/* Stat tiles */
.dl-stat .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(34, 197, 94, .12);
    color: var(--emerald);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.dl-stat .stat-value {
    font-family: var(--nav-font);
    font-variant-numeric: tabular-nums;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.1;
}

.dl-stat .stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dl-stat .stat-delta {
    font-family: var(--nav-font);
    font-size: .78rem;
    font-weight: 600;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-delta.up   { color: var(--status-good-text); }
.stat-delta.down { color: var(--status-bad-text); }

/* Badges */
.dl-badge {
    display: inline-block;
    font-family: var(--nav-font);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .4px;
    padding: 3px 11px;
    border-radius: 20px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.dl-badge.good    { color: var(--status-good-text); background: rgba(34, 197, 94, .1);  border-color: rgba(34, 197, 94, .3); }
.dl-badge.warn    { color: var(--status-warn-text); background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); }
.dl-badge.bad     { color: var(--status-bad-text);  background: rgba(239, 68, 68, .1);  border-color: rgba(239, 68, 68, .3); }
.dl-badge.info    { color: var(--status-info-text); background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .3); }
.dl-badge.neutral { color: var(--text-muted);       background: var(--hover-bg);        border-color: var(--hairline-strong); }

/* Tables */
.dl-table { width: 100%; border-collapse: collapse; }

.dl-table th {
    text-align: left;
    font-family: var(--nav-font);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline-strong);
    white-space: nowrap;
}

.dl-table td {
    padding: 13px 14px;
    font-size: .88rem;
    color: var(--text-soft);
    border-bottom: 1px solid var(--hairline);
    font-variant-numeric: tabular-nums;
}

.dl-table td.strong { color: var(--text-strong); font-weight: 500; }

.dl-table tbody tr { transition: background .15s; }
.dl-table tbody tr:hover { background: rgba(34, 197, 94, .04); }
.dl-table tbody tr:last-child td { border-bottom: 0; }
.dl-table tbody tr.clickable { cursor: pointer; }

/* Inputs */
.dl-input, .dl-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-strong);
    padding: 12px 14px;
    border-radius: 12px;
    font-family: var(--nav-font);
    font-size: .9rem;
    width: 100%;
    transition: border-color .2s, box-shadow .2s;
}

.dl-input:focus, .dl-select:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}

.dl-input::placeholder { color: var(--placeholder); }

.dl-select { appearance: auto; }

.dl-field { margin-bottom: 16px; }

.dl-field label {
    display: block;
    font-family: var(--nav-font);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.dl-field .hint { font-size: .76rem; color: var(--text-faint); margin-top: 5px; }

.dl-error {
    display: none;
    font-size: .83rem;
    color: var(--status-bad-text);
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.dl-error.show { display: block; }

/* Progress bars */
.dl-bar {
    height: 6px;
    background: var(--hover-bg);
    border-radius: 4px;
    overflow: hidden;
}

.dl-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--emerald); transition: width .4s ease; }

.dl-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--nav-font);
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* Score ring (SVG wrapper) */
.dl-ring { position: relative; display: inline-flex; }

.dl-ring .ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--nav-font);
}

.dl-ring .ring-value strong {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dl-ring .ring-value small { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

.dl-ring .track { stroke: var(--hover-bg); }

/* Score text colors */
.score-good { color: var(--status-good-text) !important; }
.score-warn { color: var(--status-warn-text) !important; }
.score-bad  { color: var(--status-bad-text) !important; }

/* Section label */
.dl-label {
    font-family: var(--nav-font);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
}

/* Severity dot */
.dl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dl-dot.critical { background: var(--status-bad); }
.dl-dot.medium   { background: var(--status-warn); }
.dl-dot.low      { background: var(--status-info); }

/* Issue accordion (native <details>, CSP-safe and accessible) */
details.dl-issue {
    background: var(--surface-color);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
}

details.dl-issue summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    font-family: var(--nav-font);
    transition: background .15s;
}

details.dl-issue summary::-webkit-details-marker { display: none; }
details.dl-issue summary:hover { background: var(--hover-bg); }

details.dl-issue summary .title { font-weight: 600; color: var(--text-strong); font-size: .92rem; flex: 1; }
details.dl-issue summary .chev { color: var(--text-faint); transition: transform .3s ease; }
details.dl-issue[open] summary .chev { transform: rotate(180deg); }

/* Gentle reveal when an issue group opens */
details.dl-issue[open] .body { animation: dl-reveal .35s ease; }

@keyframes dl-reveal {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

details.dl-issue .body {
    padding: 4px 20px 18px;
    border-top: 1px solid var(--hairline);
    font-size: .88rem;
    color: var(--text-soft);
}

details.dl-issue .body h4 {
    font-family: var(--nav-font);
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
    margin: 16px 0 5px;
}

details.dl-issue .body p { margin: 0; }

.dl-affected {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}

.dl-affected li {
    padding: 7px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: .82rem;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.dl-affected li:last-child { border-bottom: 0; }
.dl-affected .detail { color: var(--text-faint); }

/* ---------- Fix module ---------- */

details.dl-fix-item.done { opacity: .6; }
details.dl-fix-item.done summary .title { text-decoration: line-through; }

.dl-fix-done {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--nav-font);
    font-size: .76rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.dl-fix-done input { accent-color: var(--emerald); cursor: pointer; }

.dl-fix-pages { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.dl-fix-page {
    border: 1px solid var(--hairline);
    border-radius: 11px;
    padding: 12px 14px;
    background: var(--surface-deep);
}

.dl-fix-page .row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dl-fix-page .row-top > a,
.dl-fix-page .row-top > span:first-child {
    font-size: .85rem;
    word-break: break-all;
    min-width: 0;
}

.dl-fix-page .cur {
    margin-top: 8px;
    font-size: .84rem;
    color: var(--text-soft);
}

.dl-fix-page .cur .lbl {
    font-family: var(--nav-font);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-faint);
    margin-right: 6px;
}

.dl-fix-page .cur .val { font-style: italic; }

.ai-out { margin-top: 12px; animation: dl-reveal .3s ease; }

.ai-out .ai-head {
    font-family: var(--nav-font);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--emerald);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .05);
    border-radius: 9px;
    margin-bottom: 8px;
}

.ai-option .txt { flex: 1; min-width: 0; font-size: .88rem; color: var(--text-strong); }
.ai-option .note { font-size: .74rem; color: var(--text-faint); white-space: nowrap; }
.ai-option button { flex-shrink: 0; }

@media (max-width: 575px) {
    .ai-option { flex-wrap: wrap; }
    .ai-option .txt { flex-basis: 100%; }
}

/* Priority list */
.dl-priority {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--hairline);
}

.dl-priority:last-child { border-bottom: 0; }

.dl-priority .rank {
    font-family: var(--nav-font);
    font-weight: 700;
    font-size: .85rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(34, 197, 94, .12);
    color: var(--emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dl-priority .title { font-weight: 600; color: var(--text-strong); font-size: .9rem; font-family: var(--nav-font); }
.dl-priority .fix { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Rank module ---------- */
.dl-spark { display: block; overflow: visible; }

/* ---------- Pulse module ---------- */
.dl-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    border-radius: 999px;
    font-family: var(--nav-font);
    font-weight: 700;
    font-size: 1.05rem;
    border: 1px solid var(--hairline-strong);
}

.dl-status-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-faint);
}

.dl-status-pill.up {
    color: var(--status-good-text);
    background: rgba(34, 197, 94, .1);
    border-color: rgba(34, 197, 94, .3);
}
.dl-status-pill.up .dot {
    background: var(--status-good-text);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: dl-pulse-dot 1.8s infinite;
}

.dl-status-pill.down {
    color: var(--status-bad-text);
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .3);
}
.dl-status-pill.down .dot { background: var(--status-bad-text); }

.dl-status-pill.unknown { color: var(--text-muted); background: var(--hover-bg); }

@keyframes dl-pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .dl-status-pill.up .dot { animation: none; }
}

.dl-pulse-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
}
.dl-pulse-event:last-child { border-bottom: 0; }
.dl-pulse-event .ico { font-size: 1.05rem; color: var(--text-muted); margin-top: 1px; }
.dl-pulse-event .ev-title { font-weight: 600; color: var(--text-strong); font-size: .88rem; }
.dl-pulse-event .ev-detail { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.dl-pulse-event .ev-time { font-size: .72rem; color: var(--text-faint); margin-top: 3px; }
.dl-pulse-event.resolved { opacity: .55; }
.dl-pulse-event.resolved .ico { color: var(--status-good-text); }

/* ---------- Agency: shared ---------- */
.dl-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .88rem; color: var(--text-soft); }
.dl-switch input { width: 18px; height: 18px; accent-color: var(--emerald); cursor: pointer; }

/* Branding preview */
.br-preview {
    border: 1px solid var(--hairline-strong);
    border-radius: 14px;
    padding: 22px;
    background: var(--surface-deep);
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}
.br-brand { display: flex; align-items: center; gap: 10px; }
.br-name { font-family: var(--nav-font); font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.br-cta { border: none; color: #fff; font-weight: 600; font-size: .82rem; padding: 8px 16px; border-radius: 9px; background: var(--emerald); }
.br-bar { width: 100%; height: 7px; border-radius: 4px; background: var(--hover-bg); overflow: hidden; }
.br-bar > span { display: block; width: 68%; height: 100%; background: var(--emerald); }
.br-foot { font-size: .76rem; color: var(--text-faint); }

/* Portal share links */
.dl-share-link {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 0; border-bottom: 1px solid var(--hairline);
}
.dl-share-link:last-child { border-bottom: 0; }

/* ---------- Agency: task board ---------- */
.dl-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.dl-col {
    background: var(--surface-deep);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 12px;
    min-height: 160px;
}
.dl-col-head {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--nav-font); font-weight: 600; font-size: .82rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
    padding: 4px 6px 12px;
}
.dl-col-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; border-radius: 10px; transition: background .15s; }
.dl-col-body.drop-over { background: rgba(34, 197, 94, .08); outline: 2px dashed rgba(34, 197, 94, .4); outline-offset: 3px; }
.dl-col-empty { text-align: center; color: var(--text-faint); font-size: .8rem; padding: 16px 0; margin: 0; }

.dl-task {
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 11px;
    padding: 12px;
    cursor: grab;
    transition: box-shadow .15s, transform .1s, border-color .15s;
}
.dl-task:hover { border-color: var(--emerald); box-shadow: var(--shadow-lg); }
.dl-task.dragging { opacity: .5; }
.dl-task-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dl-task-actions { display: flex; gap: 2px; opacity: 1; }
.dl-task-status-label { display: block; width: 100%; font-size: .72rem; color: var(--text-faint); margin-top: 8px; }
.dl-task-status { font-size: .78rem; padding: 5px 8px; min-height: auto; width: 100%; margin-top: 4px; }
@media (min-width: 801px) {
  .dl-task-actions { opacity: 0; transition: opacity .15s; }
  .dl-task:hover .dl-task-actions { opacity: 1; }
}
.dl-task-title { font-weight: 600; color: var(--text-strong); font-size: .88rem; margin: 0 0 4px; }
.dl-task-desc { font-size: .78rem; color: var(--text-muted); margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dl-task-due { font-size: .72rem; color: var(--text-faint); display: inline-flex; align-items: center; gap: 4px; }
.dl-task-who {
    margin-left: auto; width: 24px; height: 24px; border-radius: 50%;
    background: var(--emerald); color: #fff; font-size: .66rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 800px) { .dl-board { grid-template-columns: 1fr; } }

/* ---------- Agency: public share page ---------- */
.dl-share-page { max-width: 880px; margin: 0 auto; padding: 40px 20px 80px; }
.dl-share-loading, .dl-share-error { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.dl-share-error i { font-size: 2.6rem; color: var(--text-faint); }
.dl-share-error h1 { font-size: 1.4rem; color: var(--text-strong); margin: 12px 0 6px; }

.dl-share-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--hairline); }
.dl-share-brand { display: flex; align-items: center; gap: 12px; }
.dl-share-company { font-family: var(--nav-font); font-weight: 700; font-size: 1.15rem; color: var(--text-strong); margin: 0; }
.dl-share-sub { font-size: .78rem; color: var(--text-faint); margin: 0; }
.dl-share-site { text-align: right; }
.dl-share-name { font-weight: 600; color: var(--text-strong); margin: 0; }
.dl-share-domain { font-size: .82rem; color: var(--text-muted); margin: 0; }

.dl-share-hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; padding: 30px 0; }
.dl-share-stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 18px 28px; flex: 1; }
.dl-share-stat { display: flex; flex-direction: column; }
.dl-share-stat .v { font-family: var(--nav-font); font-weight: 700; font-size: 1.5rem; color: var(--text-strong); }
.dl-share-stat .l { font-size: .76rem; color: var(--text-muted); }

.dl-share-block { padding: 18px 0; border-top: 1px solid var(--hairline); }
.dl-share-block h2 { font-size: 1.05rem; color: var(--text-strong); margin: 0 0 14px; }
.dl-share-empty { color: var(--text-muted); font-size: .9rem; }
.dl-share-issue { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.dl-share-issue:last-child { border-bottom: 0; }
.dl-share-issue .rank { width: 26px; height: 26px; border-radius: 8px; background: rgba(34,197,94,.12); color: var(--emerald); font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dl-share-issue .t { font-weight: 600; color: var(--text-strong); font-size: .9rem; margin: 0; }
.dl-share-issue .f { font-size: .82rem; color: var(--text-muted); margin: 2px 0 0; }

.dl-share-report { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--hairline-strong); border-radius: 10px; margin-bottom: 8px; color: var(--text-strong); text-decoration: none; transition: border-color .15s; }
.dl-share-report:hover { border-color: var(--emerald); }
.dl-share-report .dl-share-report-date { font-size: .76rem; color: var(--text-faint); }
.dl-share-foot { text-align: center; padding-top: 28px; color: var(--text-faint); font-size: .8rem; }

/* ---------- DotLeads AI ---------- */
.dl-ai-thinking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; color: var(--text-muted); }
.dl-ai-copy { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 9px; margin-bottom: 8px; }
.dl-ai-copy > span { flex: 1; min-width: 0; font-size: .88rem; color: var(--text-strong); }
.dl-ai-copy button { flex-shrink: 0; }
.dl-ai-old { font-size: .72rem; color: var(--text-faint); margin-top: 4px; }
.dl-ai-faq { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.dl-ai-faq:last-child { border-bottom: 0; }
.dl-ai-faq .q { font-weight: 600; color: var(--text-strong); font-size: .9rem; margin: 0 0 3px; }
.dl-ai-faq .a { font-size: .85rem; color: var(--text-muted); margin: 0; }
.dl-ai-outline { padding-left: 18px; margin: 0; }
.dl-ai-outline > li { margin-bottom: 8px; color: var(--text-strong); font-size: .9rem; }
.dl-ai-outline ul { margin: 4px 0 0; padding-left: 18px; }
.dl-ai-outline ul li { color: var(--text-muted); font-size: .84rem; font-weight: 400; }
.dl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-chip { font-size: .76rem; padding: 4px 10px; border-radius: 999px; background: var(--hover-bg); color: var(--text-soft); border: 1px solid var(--hairline-strong); }
.dl-code {
    background: var(--surface-deep); border: 1px solid var(--hairline);
    border-radius: 9px; padding: 12px; font-size: .76rem; line-height: 1.5;
    color: var(--text-soft); overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 0;
}
.dl-ai-hist { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 9px; cursor: pointer; transition: background .15s; }
.dl-ai-hist:hover { background: var(--hover-bg); }
.dl-ai-hist > i { color: var(--emerald); }
.dl-ai-hist .t { font-size: .84rem; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-ai-hist .d { font-size: .72rem; color: var(--text-faint); }

/* ---------- DotLeads Local ---------- */
.dl-heat { display: grid; gap: 6px; max-width: 380px; }
.dl-heat-cell {
    aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-family: var(--nav-font); font-weight: 700; font-size: .82rem; color: #fff;
}
.dl-heat-cell.good { background: #22c55e; }
.dl-heat-cell.warn { background: #f59e0b; }
.dl-heat-cell.bad  { background: #ef4444; }
.dl-heat-cell.none { background: var(--hover-bg); color: var(--text-faint); }

.dl-check { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.dl-check:last-child { border-bottom: 0; }
.dl-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--emerald); cursor: pointer; flex-shrink: 0; }
.dl-check .t { display: block; font-weight: 600; color: var(--text-strong); font-size: .88rem; }
.dl-check .d { display: block; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.dl-check.done .t { text-decoration: line-through; color: var(--text-muted); }

.dl-stars { white-space: nowrap; }
.dl-stars .bi { font-size: .82rem; }
.dl-review-resp { font-size: .82rem; color: var(--text-muted); background: var(--hover-bg); border-radius: 8px; padding: 7px 10px; }
.dl-review-resp .bi { color: var(--emerald); }

/* ---------- Client-side router: top progress bar + brand logo ---------- */
#dl-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--emerald); box-shadow: 0 0 10px var(--emerald);
    z-index: 9999; opacity: 0; pointer-events: none;
}
#dl-progress.show { opacity: 1; width: 80%; transition: width 10s cubic-bezier(0, .6, .2, 1); }
#dl-progress.done { width: 100%; opacity: 0; transition: width .2s ease, opacity .3s ease .15s; }
.dl-brand-logo { height: 30px; width: auto; border-radius: 7px; }
@media (prefers-reduced-motion: reduce) {
    #dl-progress.show { transition: none; }
}

/* ---------- DotLeads Ascent ---------- */
.dl-ascent-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border-radius: 999px; border: 1px solid var(--hairline-strong); background: var(--hover-bg);
    color: var(--text-strong); font-weight: 700; font-size: .82rem; text-decoration: none;
    transition: border-color .15s, transform .1s;
}
.dl-ascent-chip:hover { border-color: var(--emerald); transform: translateY(-1px); }
.dl-ascent-chip .bi { color: var(--emerald); }

.dl-jy-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.dl-zeo svg { display: block; filter: drop-shadow(0 4px 14px rgba(34,197,94,.25)); }
.dl-jy-level { flex: 1; min-width: 220px; }
.dl-jy-level .lv-name { font-family: var(--nav-font); font-weight: 700; font-size: 1.3rem; color: var(--text-strong); margin: 0 0 8px; }
.dl-jy-level .lv-xp { font-size: .8rem; color: var(--text-muted); margin: 6px 0 0; }
.dl-jy-xpbar { height: 12px; border-radius: 8px; background: var(--hover-bg); overflow: hidden; }
.dl-jy-xpbar > span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--emerald), #38bdf8); transition: width .6s ease; }

.dl-jy-path { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin-top: 22px; }
.dl-jy-node { flex: 1; text-align: center; position: relative; }
.dl-jy-node::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--hairline-strong); z-index: 0; }
.dl-jy-node:first-child::before { display: none; }
.dl-jy-node.done::before, .dl-jy-node.current::before { background: var(--emerald); }
.dl-jy-node .dot {
    position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; margin: 0 auto;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem;
    background: var(--surface-color); border: 2px solid var(--hairline-strong); color: var(--text-faint);
}
.dl-jy-node.done .dot { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.dl-jy-node.current .dot { border-color: var(--emerald); color: var(--emerald); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.dl-jy-node .nm { display: block; font-size: .68rem; color: var(--text-muted); margin-top: 6px; }
.dl-jy-node.current .nm { color: var(--text-strong); font-weight: 600; }
@media (max-width: 640px) { .dl-jy-node .nm { display: none; } }

.dl-streak-flame { font-size: 2rem; color: #f59e0b; }
.dl-streak-weeks { font-family: var(--nav-font); font-weight: 700; font-size: 2.4rem; color: var(--text-strong); margin: 2px 0 0; line-height: 1; }

.dl-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.dl-badge-tile { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 8px; text-align: center; transition: transform .12s; }
.dl-badge-tile:hover { transform: translateY(-2px); }
.dl-badge-tile .ic { font-size: 1.7rem; }
.dl-badge-tile .nm { font-size: .76rem; font-weight: 600; color: var(--text-strong); margin-top: 6px; }
.dl-badge-tile .tr { font-size: .66rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.dl-badge-tile.locked { opacity: .45; filter: grayscale(1); }
.dl-badge-tile.tier-bronze .ic { color: #cd7f32; }
.dl-badge-tile.tier-silver .ic { color: #b8c2cc; }
.dl-badge-tile.tier-gold .ic { color: #f5b301; }
.dl-badge-tile.tier-gold { border-color: rgba(245,179,1,.4); box-shadow: 0 0 0 1px rgba(245,179,1,.15) inset; }

.dl-credit-balance { font-family: var(--nav-font); font-weight: 700; font-size: 1.9rem; color: var(--text-strong); }
.dl-credit-balance .bi { color: #f5b301; }

.dl-reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dl-reward { display: flex; align-items: center; gap: 12px; border: 1px solid var(--hairline-strong); border-radius: 12px; padding: 12px; }
.dl-reward.dim { opacity: .6; }
.dl-reward .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--hover-bg); display: flex; align-items: center; justify-content: center; color: var(--emerald); font-size: 1.2rem; flex-shrink: 0; }
.dl-reward .bd { flex: 1; min-width: 0; }
.dl-reward .nm { font-weight: 600; color: var(--text-strong); font-size: .86rem; margin: 0; }
.dl-reward .ds { font-size: .76rem; color: var(--text-muted); margin: 2px 0 0; }

.dl-refer-link { display: flex; align-items: center; gap: 10px; background: var(--surface-deep); border: 1px solid var(--hairline-strong); border-radius: 10px; padding: 10px 12px; }
.dl-refer-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--emerald); font-size: .84rem; }

/* Celebration */
.dl-celebrate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: var(--overlay, rgba(0,0,0,.5)); opacity: 0; transition: opacity .25s; }
.dl-celebrate.in { opacity: 1; }
.dl-celebrate.out { opacity: 0; }
.dl-celebrate-card { background: var(--surface-color); border: 1px solid var(--hairline-strong); border-radius: 18px; padding: 32px 36px; text-align: center; max-width: 380px; transform: scale(.9); transition: transform .25s cubic-bezier(.2,1.3,.4,1); box-shadow: var(--shadow-lg); }
.dl-celebrate.in .dl-celebrate-card { transform: scale(1); }
.dl-celebrate-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; background: linear-gradient(135deg, var(--emerald), #38bdf8); display: flex; align-items: center; justify-content: center; font-size: 2.1rem; color: #fff; }
.dl-celebrate-title { font-family: var(--nav-font); font-weight: 700; font-size: 1.25rem; color: var(--text-strong); margin: 0 0 4px; }
.dl-celebrate-sub { color: var(--text-muted); font-size: .9rem; margin: 0 0 8px; }
.dl-celebrate-credits { color: #f5b301; font-weight: 700; margin: 0 0 14px; }
.dl-celebrate-ok { margin-top: 6px; }
.dl-confetti { position: fixed; inset: 0; z-index: 10001; pointer-events: none; }

.dl-share-ascent { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid rgba(34,197,94,.3); border-radius: 12px; margin: 8px 0 4px; color: var(--text-strong); font-size: .9rem; }
.dl-share-ascent .bi { color: var(--emerald); font-size: 1.2rem; }

/* ---------- Command palette (⌘K) ---------- */
.dl-cmd { position: fixed; inset: 0; z-index: 9500; background: var(--overlay, rgba(0,0,0,.45)); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; backdrop-filter: blur(2px); }
.dl-cmd-box { width: 100%; max-width: 600px; background: var(--surface-color); border: 1px solid var(--hairline-strong); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.dl-cmd-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.dl-cmd-search .bi { color: var(--text-faint); font-size: 1.1rem; }
.dl-cmd-search input { flex: 1; background: none; border: 0; outline: none; color: var(--text-strong); font-size: 1rem; font-family: inherit; }
.dl-cmd-search kbd { font-size: .68rem; color: var(--text-faint); border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 2px 6px; }
.dl-cmd-list { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow-y: auto; }
.dl-cmd-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.dl-cmd-list li.active { background: var(--hover-bg); }
.dl-cmd-list li > .bi { color: var(--emerald); width: 18px; text-align: center; }
.dl-cmd-list .lbl { flex: 1; min-width: 0; color: var(--text-strong); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-cmd-list .lbl .sub { color: var(--text-faint); font-size: .8rem; }
.dl-cmd-list .grp { font-size: .68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.dl-cmd-empty { padding: 20px; text-align: center; color: var(--text-faint); }

/* ---------- Notification bell ---------- */
.dl-notify { position: relative; }
.dl-notify-btn { position: relative; }
.dl-notify-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--status-bad-text); box-shadow: 0 0 0 2px var(--sidebar-bg); }
.dl-notify-panel {
    position: absolute; top: calc(100% + 10px); right: 0; width: 340px; max-width: 86vw;
    background: var(--surface-color); border: 1px solid var(--hairline-strong); border-radius: 14px;
    box-shadow: var(--shadow-lg); z-index: 1200; overflow: hidden;
}
.dl-notify-head { padding: 12px 16px; font-weight: 600; color: var(--text-strong); border-bottom: 1px solid var(--hairline); font-size: .9rem; }
.dl-notify-list { max-height: 60vh; overflow-y: auto; }
.dl-notify-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); text-decoration: none; transition: background .15s; }
.dl-notify-item:last-child { border-bottom: 0; }
.dl-notify-item:hover { background: var(--hover-bg); }
.dl-notify-item > .bi { color: var(--emerald); margin-top: 2px; }
.dl-notify-item.unread { background: rgba(34,197,94,.05); }
.dl-notify-item.unread > .bi { color: var(--status-info-text); }
.dl-notify-item .t { font-weight: 500; color: var(--text-strong); font-size: .85rem; margin: 0; }
.dl-notify-item .d { font-size: .78rem; color: var(--text-muted); margin: 2px 0 0; }
.dl-notify-item .tm { font-size: .72rem; color: var(--text-faint); margin: 3px 0 0; }
.dl-notify-empty { padding: 32px 16px; text-align: center; color: var(--text-faint); }
.dl-notify-empty .bi { font-size: 1.6rem; color: var(--emerald); }
.dl-notify-empty p { margin: 8px 0 0; }

/* ---------- AI assistant panel ---------- */
.dl-ask-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 1600;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px 11px 15px; border: 0; border-radius: 999px; cursor: pointer;
    color: #fff; font: inherit; font-weight: 600; font-size: .92rem; letter-spacing: .01em;
    background: linear-gradient(120deg, var(--emerald), #38bdf8);
    box-shadow: 0 10px 26px rgba(16, 185, 129, .38), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
}
.dl-ask-fab .bi { font-size: 1.05rem; }
.dl-ask-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(16, 185, 129, .5); }
.dl-ask-fab.hidden { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; }

.dl-ask { position: fixed; inset: 0; z-index: 9600; }
.dl-ask[hidden] { display: none; }
.dl-ask-overlay {
    position: absolute; inset: 0; background: var(--overlay);
    opacity: 0; transition: opacity .25s ease; backdrop-filter: blur(2px);
}
.dl-ask.show .dl-ask-overlay { opacity: 1; }

.dl-ask-panel {
    position: absolute; top: 0; right: 0; height: 100%;
    width: min(420px, 100%); display: flex; flex-direction: column;
    background: var(--surface-color); border-left: 1px solid var(--hairline-strong);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.dl-ask.show .dl-ask-panel { transform: none; }

.dl-ask-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid var(--hairline);
}
.dl-ask-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dl-ask-avatar {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center; color: #fff; font-size: 1.1rem;
    background: linear-gradient(135deg, var(--emerald), #38bdf8);
    box-shadow: 0 4px 14px rgba(16, 185, 129, .4);
}
.dl-ask-title { margin: 0; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.dl-ask-scope { margin: 2px 0 0; font-size: .78rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.dl-ask-x {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; border: 0; cursor: pointer;
    background: var(--hover-bg); color: var(--text-muted); display: grid; place-items: center;
    transition: background .15s ease, color .15s ease;
}
.dl-ask-x:hover { background: var(--hairline-strong); color: var(--text-strong); }

.dl-ask-body {
    flex: 1 1 auto; overflow-y: auto; padding: 18px;
    display: flex; flex-direction: column; gap: 14px;
}
.dl-ask-msg { display: flex; gap: 9px; align-items: flex-end; max-width: 100%; }
.dl-ask-msg.me { justify-content: flex-end; }
.dl-ask-mini {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
    color: #fff; font-size: .8rem; background: linear-gradient(135deg, var(--emerald), #38bdf8);
}
.dl-ask-bubble {
    max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.5;
    color: var(--text-soft); background: var(--surface-deep); border: 1px solid var(--hairline);
    word-wrap: break-word; overflow-wrap: anywhere;
}
.dl-ask-msg.me .dl-ask-bubble {
    color: #06281a; border: 0; background: linear-gradient(135deg, #6ee7b7, #38bdf8);
    border-bottom-right-radius: 5px;
}
.dl-ask-msg.zeo .dl-ask-bubble { border-bottom-left-radius: 5px; }
.dl-ask-bubble p { margin: 0 0 7px; }
.dl-ask-bubble p:last-child { margin-bottom: 0; }
.dl-ask-bubble ul { margin: 6px 0; padding-left: 18px; }
.dl-ask-bubble li { margin: 3px 0; }
.dl-ask-bubble strong { color: var(--text-strong); font-weight: 700; }
.dl-ask-bubble code {
    font-size: .82em; padding: 1px 5px; border-radius: 5px;
    background: var(--hover-bg); border: 1px solid var(--hairline);
}

.dl-ask-dots { display: inline-flex; gap: 4px; padding: 2px 0; }
.dl-ask-dots i {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint);
    animation: dl-ask-blink 1.2s infinite ease-in-out;
}
.dl-ask-dots i:nth-child(2) { animation-delay: .18s; }
.dl-ask-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dl-ask-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.dl-ask-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 4px; }
.dl-ask-chip {
    border: 1px solid var(--hairline-strong); background: var(--surface-deep); cursor: pointer;
    color: var(--text-soft); font: inherit; font-size: .8rem; padding: 6px 11px; border-radius: 999px;
    transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.dl-ask-chip:hover { border-color: var(--emerald); color: var(--text-strong); transform: translateY(-1px); }

.dl-ask-composer {
    display: flex; align-items: flex-end; gap: 9px; padding: 14px 16px;
    border-top: 1px solid var(--hairline); background: var(--surface-color);
}
.dl-ask-composer textarea {
    flex: 1 1 auto; resize: none; max-height: 120px; min-height: 40px;
    padding: 10px 13px; border-radius: 12px; font: inherit; font-size: .9rem; line-height: 1.4;
    color: var(--text-strong); background: var(--input-bg); border: 1px solid var(--input-border);
    outline: none; transition: border-color .15s ease;
}
.dl-ask-composer textarea:focus { border-color: var(--emerald); }
.dl-ask-composer textarea:disabled { opacity: .6; }
.dl-ask-send {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: 0; cursor: pointer;
    color: #fff; display: grid; place-items: center; font-size: 1rem;
    background: linear-gradient(135deg, var(--emerald), #38bdf8);
    transition: transform .15s ease, opacity .15s ease;
}
.dl-ask-send:hover:not(:disabled) { transform: translateY(-1px); }
.dl-ask-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 575.98px) {
    .dl-ask-fab span { display: none; }
    .dl-ask-fab { padding: 13px; }
}

/* ---------- Competitors (benchmark) ---------- */
.dl-spin { display: inline-block; animation: dl-spin .8s linear infinite; }

.dl-cmp-bars { display: flex; flex-direction: column; gap: 12px; }
.dl-cmp-bar { display: grid; grid-template-columns: 160px 1fr 44px; align-items: center; gap: 12px; }
.dl-cmp-bar .nm {
    font-size: .88rem; color: var(--text-soft); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.dl-cmp-bar.you .nm { color: var(--text-strong); font-weight: 600; }
.dl-cmp-bar .track { height: 12px; border-radius: 999px; background: var(--hover-bg); overflow: hidden; }
.dl-cmp-bar .fill {
    display: block; height: 100%; border-radius: 999px;
    background: var(--text-faint); transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.dl-cmp-bar .fill.good { background: linear-gradient(90deg, var(--emerald), #38bdf8); }
.dl-cmp-bar .fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dl-cmp-bar .fill.bad  { background: linear-gradient(90deg, #ef4444, #f97316); }
.dl-cmp-bar .val { text-align: right; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.dl-cmp-bar.you .track { box-shadow: 0 0 0 2px rgba(34, 197, 94, .25); }

.dl-cmp-table th[scope="row"] { color: var(--text-soft); font-weight: 500; }
.dl-cmp-table td { font-variant-numeric: tabular-nums; }
.dl-cmp-table th.you, .dl-cmp-table td.you {
    background: rgba(34, 197, 94, .06);
    border-left: 1px solid rgba(34, 197, 94, .2);
    border-right: 1px solid rgba(34, 197, 94, .2);
}
.dl-cmp-table td.lead { color: var(--status-good-text); font-weight: 700; }
.dl-cmp-table td.lead .bi { color: #fbbf24; }
.dl-cmp-lead-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--status-good-text); vertical-align: middle; margin-right: 4px;
}

.dl-cmp-row {
    display: flex; align-items: center; gap: 14px; padding: 12px 4px;
    border-top: 1px solid var(--hairline);
}
.dl-cmp-row:first-child { border-top: 0; }
.dl-cmp-row .id { display: flex; align-items: center; gap: 11px; flex: 1 1 auto; min-width: 0; }
.dl-cmp-row .id > .bi { font-size: 1.1rem; color: var(--text-faint); }
.dl-cmp-row .nm { margin: 0; font-weight: 600; color: var(--text-strong); }
.dl-cmp-row .dm { margin: 0; font-size: .8rem; color: var(--text-muted); }
.dl-cmp-row .st { flex: 0 0 auto; }
.dl-cmp-row .ac { flex: 0 0 auto; display: flex; gap: 6px; }

@media (max-width: 575.98px) {
    .dl-cmp-bar { grid-template-columns: 110px 1fr 36px; gap: 8px; }
    .dl-cmp-row { flex-wrap: wrap; }
}

/* ---------- Web Vitals ---------- */
.dl-seg {
    display: inline-flex; padding: 3px; border-radius: 10px;
    background: var(--hover-bg); border: 1px solid var(--hairline);
}
.dl-seg button {
    border: 0; background: none; cursor: pointer; font: inherit; font-size: .85rem;
    color: var(--text-muted); padding: 6px 12px; border-radius: 7px;
    display: inline-flex; align-items: center; gap: 6px; transition: background .15s ease, color .15s ease;
}
.dl-seg button.active { background: var(--surface-color); color: var(--text-strong); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.2)); }

.vit-metric {
    border: 1px solid var(--hairline-strong); border-radius: 14px; padding: 14px 16px; height: 100%;
    border-left-width: 4px;
}
.vit-metric.is-good { border-left-color: var(--status-good-text); }
.vit-metric.is-avg  { border-left-color: var(--status-warn-text); }
.vit-metric.is-poor { border-left-color: var(--status-bad-text); }
.vit-metric .k { margin: 0; font-size: .8rem; color: var(--text-muted); }
.vit-metric .v { margin: 4px 0 6px; font-size: 1.5rem; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.vit-metric .r { font-size: .76rem; font-weight: 600; }
.vit-metric.is-good .r { color: var(--status-good-text); }
.vit-metric.is-avg  .r { color: var(--status-warn-text); }
.vit-metric.is-poor .r { color: var(--status-bad-text); }

.vit-cat { text-align: center; }
.vit-cat .ring {
    position: relative; width: 92px; height: 92px; border-radius: 50%; margin: 0 auto;
    display: grid; place-items: center;
}
.vit-cat .ring::before {
    content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; background: var(--surface-color);
}
.vit-cat .ring span { position: relative; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vit-cat .lbl { margin: 10px 0 0; font-size: .85rem; color: var(--text-soft); }

/* ---------- Internal Links ---------- */
.stat-value.good { color: var(--status-good-text); }
.stat-value.warn { color: var(--status-warn-text); }
.stat-value.bad  { color: var(--status-bad-text); }

.dl-depth { display: flex; flex-direction: column; gap: 9px; }
.dl-depth-row { display: grid; grid-template-columns: 84px 1fr 44px; align-items: center; gap: 12px; }
.dl-depth-row .d { font-size: .85rem; color: var(--text-soft); }
.dl-depth-row .track { height: 14px; border-radius: 999px; background: var(--hover-bg); overflow: hidden; }
.dl-depth-row .fill {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--emerald), #38bdf8); transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.dl-depth-row .fill.deep { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.dl-depth-row .c { text-align: right; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }

.dl-tips { margin: 0; padding-left: 18px; color: var(--text-soft); }
.dl-tips li { margin: 6px 0; line-height: 1.5; }

.dl-linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-strong); font: inherit; font-weight: 600; text-align: left; }
.dl-linkbtn:hover { color: var(--emerald); text-decoration: underline; }

/* keyword difficulty bar */
.dl-kd { display: inline-flex; align-items: center; gap: 8px; }
.dl-kd .bar { width: 70px; height: 7px; border-radius: 999px; background: var(--hover-bg); overflow: hidden; }
.dl-kd .bar > span { display: block; height: 100%; border-radius: 999px; }

/* GEO answer excerpts */
.geo-excerpt { padding: 10px 0; border-top: 1px solid var(--hairline); }
.geo-excerpt:first-child { border-top: 0; }

/* GEO content signals */
.geo-signal { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hairline); }
.geo-signal:first-child { border-top: 0; }
.geo-signal > .bi { font-size: 1.15rem; margin-top: 1px; flex: 0 0 auto; }
.geo-signal.pass > .bi { color: var(--status-good-text); }
.geo-signal.fail > .bi { color: var(--status-bad-text); }
.geo-signal .l { margin: 0; font-weight: 600; color: var(--text-strong); }
.geo-signal .d { margin: 2px 0 0; font-size: .85rem; color: var(--text-muted); }

/* GEO prompt ideas */
.geo-idea { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.geo-idea:first-child { border-top: 0; }
.geo-idea > span { color: var(--text-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* API key reveal box */
.dl-newkey { padding: 14px 16px; border-radius: 12px; background: rgba(34, 197, 94, .08); border: 1px solid rgba(34, 197, 94, .3); }
.dl-newkey code { font-size: .85rem; }

/* Usage / quota meters */
.dl-usage-row + .dl-usage-row { margin-top: 16px; }
.dl-usage-row .dl-bar > span.over { background: var(--status-bad-text); }
.dl-usage-row .lim.over { color: var(--status-bad-text); font-weight: 600; }

/* Workspace activity feed */
.dl-actfeed { list-style: none; margin: 0; padding: 0; }
.dl-actfeed li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.dl-actfeed li:first-child { border-top: 0; }
.dl-actfeed .when { flex: 0 0 auto; font-size: .78rem; color: var(--text-faint); min-width: 120px; }
.dl-actfeed .what { flex: 1 1 auto; color: var(--text-soft); }
.dl-actfeed .who { flex: 0 0 auto; font-size: .78rem; color: var(--text-faint); }

/* Webhook endpoints */
.dl-wh { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.dl-wh:last-child { margin-bottom: 0; }
.dl-wh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-wh-url { min-width: 0; overflow: hidden; }
.dl-wh-url code { word-break: break-all; }
.dl-wh-desc { color: var(--text-faint); font-size: .82rem; margin-left: 8px; }
.dl-wh-badges { flex: 0 0 auto; white-space: nowrap; }
.dl-wh-events { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dl-wh-secret { margin-top: 8px; font-size: .82rem; color: var(--text-muted); }
.dl-wh-secret code { font-size: .8rem; }
.dl-wh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dl-wh-deliveries { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.dl-wh-del { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .82rem; color: var(--text-soft); }
.dl-wh-del .dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.dl-wh-del .dot.good { background: var(--status-good-text); }
.dl-wh-del .dot.bad { background: var(--status-bad-text); }
.dl-wh-del .ev { flex: 1 1 auto; font-weight: 600; color: var(--text-strong); }
.dl-wh-del .st, .dl-wh-del .ms { font-variant-numeric: tabular-nums; }
.dl-wh-del .tm { color: var(--text-faint); min-width: 120px; text-align: right; }

/* ---------- Scrollbars (modern, theme-aware) ---------- */
html[data-theme="dark"]  { --scroll-thumb: rgba(255, 255, 255, .16); --scroll-thumb-hover: rgba(255, 255, 255, .32); }
html[data-theme="light"] { --scroll-thumb: rgba(14, 31, 20, .20);    --scroll-thumb-hover: rgba(14, 31, 20, .36); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }

/* Chromium / Safari - slim, rounded, floating thumb on a transparent track */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--emerald), #38bdf8);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--emerald), #38bdf8);
    background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

/* slimmer rails inside compact panels */
.dl-sidebar::-webkit-scrollbar,
.dl-combo-list::-webkit-scrollbar,
.dl-code::-webkit-scrollbar { width: 8px; height: 8px; }
.dl-sidebar::-webkit-scrollbar-thumb,
.dl-combo-list::-webkit-scrollbar-thumb,
.dl-code::-webkit-scrollbar-thumb { border-width: 2px; }

/* ---------- Scroll-reveal (cards rise + fade as they enter view) ---------- */
/* Pure CSS scroll-driven animation: no flash, no JS, router-safe. It animates
   the `translate` property (not `transform`) so card hover-lifts still work, and
   only runs where supported and motion is allowed. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .dl-content .dl-card {
            animation: dl-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
            will-change: opacity, translate;
        }
        @keyframes dl-rise {
            from { opacity: 0; translate: 0 26px; }
            to   { opacity: 1; translate: 0 0; }
        }
    }
}

/* Tabs */
.dl-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--hairline-strong);
    margin-bottom: 18px;
    overflow-x: auto;
}

.dl-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--nav-font);
    font-size: .9rem;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}

.dl-tab:hover { color: var(--text-strong); }
.dl-tab.active { color: var(--emerald); border-bottom-color: var(--emerald); }

/* Skeleton loaders */
.dl-skeleton {
    display: inline-block;
    border-radius: 8px;
    background: linear-gradient(100deg, var(--skeleton-a) 40%, var(--skeleton-b) 50%, var(--skeleton-a) 60%);
    background-size: 200% 100%;
    animation: dl-shimmer 1.4s infinite linear;
    min-height: 1em;
}

@keyframes dl-shimmer {
    to { background-position: -200% 0; }
}

/* Spinner */
.dl-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--hover-bg);
    border-top-color: var(--emerald);
    border-radius: 50%;
    animation: dl-spin .8s linear infinite;
    display: inline-block;
}

@keyframes dl-spin { to { transform: rotate(360deg); } }

/* Empty states */
.dl-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.dl-empty i { font-size: 2.4rem; color: var(--text-faint); display: block; margin-bottom: 12px; }
.dl-empty .head { font-family: var(--nav-font); font-weight: 600; color: var(--text-strong); font-size: 1rem; margin-bottom: 4px; }
.dl-empty p { font-size: .87rem; margin: 0 0 18px; }

/* Toasts */
.dl-toasts {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
}

.dl-toast {
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-left: 3px solid var(--emerald);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 13px 16px;
    font-family: var(--nav-font);
    font-size: .87rem;
    color: var(--text-soft);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: dl-toast-in .25s ease;
}

.dl-toast.error { border-left-color: var(--status-bad); }
.dl-toast.success { border-left-color: var(--status-good); }
.dl-toast i { color: var(--emerald); }
.dl-toast.error i { color: var(--status-bad-text); }

@keyframes dl-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

/* Modals (Bootstrap, themed) */
.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 16px;
    color: var(--default-color);
}

.modal-header { border-bottom: 1px solid var(--hairline); }
.modal-footer { border-top: 1px solid var(--hairline); }
.modal-title { font-family: var(--nav-font); font-size: 1.02rem; font-weight: 600; color: var(--text-strong); }
.modal-backdrop { --bs-backdrop-bg: var(--overlay); }

.modal .btn-close {
    filter: none;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23999'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

/* ---------- Auth pages ---------- */

.dl-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1100px 500px at 80% -10%, rgba(64, 182, 5, .07), transparent 60%),
        var(--background-color);
}

.dl-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: var(--glow);
}

.dl-auth-card .brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.dl-auth-card h1 {
    font-size: 1.3rem;
    text-align: center;
    margin: 14px 0 4px;
}

.dl-auth-card .sub { text-align: center; font-size: .87rem; color: var(--text-muted); margin: 0 0 24px; }
.dl-auth-card .alt { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 20px; }

.dl-auth-theme { position: fixed; top: 16px; right: 16px; }

/* Password wrapper */
.dl-pass { position: relative; }
.dl-pass .dl-input { padding-right: 44px; }
.dl-pass .toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--text-faint);
    font-size: 1rem;
    padding: 8px;
    cursor: pointer;
}
.dl-pass .toggle:hover { color: var(--emerald); }

/* ---------- Coming soon ---------- */

.dl-soon {
    max-width: 520px;
    margin: 8vh auto 0;
    text-align: center;
}

.dl-soon .tile {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    margin: 0 auto 22px;
    background: rgba(34, 197, 94, .12);
    color: var(--emerald);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-soon h2 { font-size: 1.45rem; margin-bottom: 10px; }
.dl-soon p { color: var(--text-muted); font-size: .92rem; }

/* ---------- Back to top (rocket + scroll progress ring) ---------- */

.dl-totop {
    position: fixed;
    right: 24px;
    bottom: 84px; /* stacked above the AI assistant launcher */
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 0;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}

.dl-totop.show { opacity: 1; transform: none; pointer-events: auto; }

.dl-totop svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dl-totop svg circle {
    fill: none;
    stroke-width: 3;
}

.dl-totop svg .track { stroke: var(--hover-bg); }

.dl-totop svg .bar {
    stroke: var(--emerald);
    stroke-linecap: round;
    stroke-dasharray: 150.8; /* 2 * pi * r(24) */
    stroke-dashoffset: 150.8;
    transition: stroke-dashoffset .15s linear;
}

.dl-totop i {
    color: var(--emerald);
    font-size: 1.25rem;
    transition: transform .25s ease;
}

.dl-totop:hover i { transform: translateY(-3px); }

/* SEO joke included: rankings only go up from here. */
.dl-totop.launch i { animation: dl-launch .65s ease-in forwards; }

@keyframes dl-launch {
    0%   { transform: none; opacity: 1; }
    55%  { transform: translateY(-30px) scale(.85); opacity: 0; }
    56%  { transform: translateY(26px) scale(.85); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

/* ---------- Micro-interactions ---------- */

/* Content blocks rise in as a page opens (staggered) */
.dl-content > * { animation: dl-rise .38s ease backwards; }
.dl-content > *:nth-child(2) { animation-delay: .05s; }
.dl-content > *:nth-child(3) { animation-delay: .1s; }
.dl-content > *:nth-child(4) { animation-delay: .15s; }
.dl-content > *:nth-child(5) { animation-delay: .2s; }
.dl-content > *:nth-child(n+6) { animation-delay: .25s; }

@keyframes dl-rise {
    from { opacity: 0; transform: translateY(10px); }
}

/* Score rings sweep to their value instead of snapping */
.dl-ring svg circle + circle {
    transition: stroke-dashoffset .9s cubic-bezier(.22, .8, .35, 1), stroke .4s;
}

/* Buttons press down satisfyingly */
.btn-brand:active:not(:disabled),
.btn-ghost:active:not(:disabled),
.btn-danger-ghost:active,
.dl-icon-btn:active,
.dl-back:active,
.dl-totop:active { transform: scale(.94) !important; }

/* Sidebar icons lean into a hover */
.dl-nav a i { transition: color .2s, transform .2s; }
.dl-nav a:hover i { transform: translateX(2px) scale(1.06); }

/* Stat tiles lift slightly */
.dl-stat { transition: transform .25s ease, border-color .25s; }
.dl-stat:hover { transform: translateY(-3px); }

/* ---------- Responsive ---------- */

.dl-menu-toggle {
    display: none;
    background: none;
    border: 0;
    color: var(--text-strong);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 991px) {
    /* The sidebar is an overlay drawer on mobile; collapsing does not apply. */
    html[data-sidebar="collapsed"] { --sidebar-width: 256px; }
    html[data-sidebar="collapsed"] .dl-brand .wordmark,
    html[data-sidebar="collapsed"] .dl-nav .nav-label,
    html[data-sidebar="collapsed"] .dl-nav a .txt,
    html[data-sidebar="collapsed"] .dl-side-site .lbl,
    html[data-sidebar="collapsed"] .dl-sidebar-foot,
    html[data-sidebar="collapsed"] .dl-combo-btn .txt,
    html[data-sidebar="collapsed"] .dl-combo-btn .bi-chevron-down { display: revert; }
    html[data-sidebar="collapsed"] .dl-nav a { justify-content: flex-start; padding: 10px 12px; }
    html[data-sidebar="collapsed"] .dl-combo-btn { justify-content: flex-start; padding: 8px 12px; }
    html[data-sidebar="collapsed"] .dl-brand { justify-content: flex-start; padding: 4px 10px 18px; }
    .dl-collapse-btn { display: none; }

    .dl-sidebar { transform: translateX(-100%); transition: transform .3s ease; }
    .dl-sidebar.open { transform: translateX(0); }
    /* Drawer slides in from the inline-start edge (right in Arabic). */
    html[dir="rtl"] .dl-sidebar { transform: translateX(100%); }
    html[dir="rtl"] .dl-sidebar.open { transform: translateX(0); }
    .dl-main { margin-inline-start: 0; }
    .dl-menu-toggle { display: block; }
    .dl-search { display: none; }
    .dl-content { padding: 20px 14px; }
    .dl-topbar { padding: 0 14px; gap: 10px; }
    .dl-user .name { display: none; }
    .dl-ctx-select { max-width: 110px; }
}

@media (max-width: 575px) {
    /* Phones: a two-row topbar. Row 1 = menu toggle + the action icons; row 2 =
       back button + page title on their own line, so the title has full width
       and is never squeezed. No breadcrumb trail (it needs more room than we
       have). */
    .dl-topbar {
        flex-wrap: wrap;
        height: auto;
        row-gap: 8px;
        padding: 10px 14px;
        align-items: center;
    }
    .dl-menu-toggle { order: 1; }
    .dl-topbar-actions { order: 2; }      /* margin-left:auto keeps it right */
    .dl-titlebar {
        order: 3;
        flex: 1 1 100%;                   /* full width -> drops to its own row */
        gap: 12px;
    }

    .dl-path .seg, .dl-path .sep { display: none; }   /* no breadcrumb trail */
    .dl-path { flex: 1 1 auto; min-width: 0; }
    .dl-page-title { overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 575px) {
    .dl-card { padding: 18px; }
    .dl-page-title { font-size: 1rem; }
    .btn-brand, .btn-ghost { padding: 9px 16px; font-size: .85rem; }
    .dl-auth-card { padding: 28px 20px; }
    /* The workspace switcher pill is too wide for a phone topbar; it stays on
       tablet/desktop and is surfaced instead inside the sidebar drawer
       (.dl-side-ws), which shows on phones. */
    .dl-topbar-actions .dl-ws-wrap { display: none; }
    .dl-topbar-actions { gap: 4px; }

    /* The notification panel anchors to the bell with right:0, which pushes it
       off the left edge on a narrow phone. Pin it to the viewport instead. We
       size with 100vw (the real viewport width) rather than left+right, because
       any residual horizontal overflow inflates the fixed-position containing
       block (window.innerWidth) and would otherwise stretch the panel wider
       than the screen. */
    .dl-notify-panel {
        position: fixed;
        top: 108px;   /* clears the two-row mobile topbar (~103px) */
        left: 10px;
        right: auto;
        width: calc(100vw - 20px);
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ============================ First-run onboarding ============================ */
.dl-ob {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: var(--background-color);
}
.dl-ob-card {
    width: 100%;
    max-width: 600px;
    background: var(--surface-color);
    border: 1px solid var(--hairline-strong);
    border-radius: 20px;
    padding: 30px 34px;
    box-shadow: var(--shadow-lg);
}
.dl-ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dl-ob-brand { font-weight: 700; font-size: 20px; color: var(--text-strong); letter-spacing: -.3px; }
.dl-ob-brand span { color: var(--emerald); }
.dl-ob-help { font-size: .82rem; color: var(--text-faint); }
.dl-ob-headright { display: flex; align-items: center; gap: 10px; }
.dl-ob-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--input-border); background: transparent; color: var(--text-soft);
    border-radius: 9px; cursor: pointer; font-size: .95rem; transition: all .15s ease;
}
.dl-ob-icon:hover { color: var(--text-strong); border-color: var(--emerald); }
@media (max-width: 575px) { .dl-ob-headright .dl-ob-help { display: none; } }
.dl-ob-progress { height: 5px; background: var(--hairline); border-radius: 3px; overflow: hidden; margin-bottom: 26px; }
.dl-ob-progress span { display: block; height: 100%; background: var(--emerald); border-radius: 3px; transition: width .3s ease; }
.dl-ob-body { min-height: 290px; }
.dl-ob-step h1 { font-size: 1.5rem; margin: 0 0 8px; color: var(--text-strong); }
.dl-ob-sub { color: var(--text-muted); margin: 0 0 22px; font-size: .95rem; line-height: 1.55; }
.dl-ob-hint { font-size: .8rem; color: var(--status-bad-text); margin: 6px 0 0; }
.dl-ob-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; color: var(--default-color); }
.dl-ob-done { width: 64px; height: 64px; border-radius: 50%; background: rgba(34,197,94,.14); color: var(--emerald); display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 16px; }
.dl-ob-step[data-step="4"] { text-align: center; }
.dl-ob-foot { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.dl-ob-stepno { font-size: .82rem; color: var(--text-faint); }
.dl-ob-foot .btn-brand { margin-left: auto; }

.dl-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 10px; padding: 8px 10px; min-height: 46px; }
.dl-tags input { flex: 1; min-width: 150px; background: transparent; border: 0; outline: none; color: var(--default-color); font-size: .9rem; padding: 4px; }
.dl-tag { display: inline-flex; align-items: center; gap: 6px; background: rgba(34,197,94,.12); color: var(--emerald); border-radius: 7px; padding: 4px 4px 4px 9px; font-size: .82rem; }
.dl-tag button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 4px; }

/* Segmented domain input: https:// | www | host */
.dl-domain {
    display: flex; align-items: stretch;
    background: var(--input-bg); border: 1px solid var(--input-border);
    border-radius: 12px; overflow: hidden;
}
.dl-domain:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }
.dl-domain-scheme {
    display: flex; align-items: center; padding: 0 12px;
    font-family: var(--nav-font); font-size: .88rem; color: var(--text-faint);
    background: var(--input-border); white-space: nowrap; user-select: none;
}
.dl-domain input { border: 0; outline: none; background: transparent; color: var(--text-strong); font-family: var(--nav-font); padding: 12px 0; }
.dl-domain .dl-domain-www { width: 60px; text-align: center; padding: 12px 6px; color: var(--text-soft); }
.dl-domain .dl-domain-sep { display: flex; align-items: center; color: var(--text-faint); padding: 0 1px; }
.dl-domain .dl-domain-host { flex: 1; min-width: 0; padding-left: 6px; padding-right: 12px; }
.dl-domain input::placeholder { color: var(--placeholder); }
/* "No subdomain" hides the editable www segment and uses the apex domain. */
.dl-domain.no-sub .dl-domain-www, .dl-domain.no-sub .dl-domain-sep { display: none; }
.dl-domain.no-sub .dl-domain-host { padding-left: 12px; }
.dl-domain-opt { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .82rem; color: var(--text-soft); cursor: pointer; }
.dl-domain-opt input { accent-color: var(--emerald); }

/* AI suggestion chips (competitors / keywords) */
.dl-suggest { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--text-faint); }
.dl-suggest-lbl { color: var(--text-faint); margin-right: 2px; }
.dl-suggest-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .8rem; font-family: var(--nav-font);
    border: 1px dashed var(--input-border); background: transparent; color: var(--text-soft);
    border-radius: 999px; padding: 3px 11px; cursor: pointer; transition: all .15s ease;
}
.dl-suggest-chip:hover { border-color: var(--emerald); color: var(--emerald); border-style: solid; }
.dl-suggest-chip.added { opacity: .45; cursor: default; }
.dl-suggest-chip i { font-size: .72rem; }
.dl-suggest-note { color: var(--emerald); }

@media (max-width: 575px) {
    .dl-ob-card { padding: 22px 18px; }
    .dl-ob-step h1 { font-size: 1.25rem; }
}

/* ============================ Verify-email banner ============================ */
.dl-verify-banner {
    position: relative;
    z-index: 940;
    background: #f59e0b;            /* solid amber - pops on both light and dark backgrounds */
    color: #3a2600;                /* dark brown - high contrast on amber, readable in both themes */
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    padding: 9px 16px;
    font-size: .85rem;
    font-weight: 500;
    text-align: center;
}
.dl-verify-banner a { color: #1f1400; font-weight: 700; text-decoration: underline; cursor: pointer; }
.dl-verify-banner .x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }

/* ============================ Product tour (coachmarks) ============================ */
.dl-tour-backdrop { position: fixed; inset: 0; background: transparent; z-index: 4000; }
.dl-tour-spot { position: fixed; z-index: 4001; border-radius: 12px; box-shadow: 0 0 0 4px rgba(34,197,94,.6), 0 0 0 9999px rgba(2,6,12,.62); transition: all .25s ease; pointer-events: none; }
.dl-tour-pop { position: fixed; z-index: 4002; width: 300px; max-width: calc(100vw - 32px); background: var(--surface-color); border: 1px solid var(--hairline-strong); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-lg); }
.dl-tour-pop h4 { margin: 0 0 6px; font-size: 1rem; color: var(--text-strong); }
.dl-tour-pop p { margin: 0 0 14px; font-size: .87rem; line-height: 1.5; color: var(--text-muted); }
.dl-tour-pop .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dl-tour-step { font-size: .78rem; color: var(--text-faint); }
.dl-tour-actions { display: flex; gap: 8px; }
.dl-tour-skip { background: none; border: 0; color: var(--text-faint); font-size: .82rem; cursor: pointer; }
.dl-tour-skip:hover { color: var(--text-muted); text-decoration: underline; }

/* ============================ i18n / RTL ============================ */
/* Sidebar docking uses logical inset-inline-start (see .dl-sidebar).
   Mobile drawer slide transforms live inside the max-width:991px block. */
html[dir="rtl"] .bi-chevron-double-left,
html[dir="rtl"] .bi-arrow-left { transform: scaleX(-1); }
.dl-lang-select { max-width: 4.5rem; font-size: .8rem; }
.lang-select { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 4px 8px; font-size: .8rem; }

/* ==================== topbar notifications + quick search ==================== */
/* Drives the bell dropdown and quick-search markup in Views/Shared/_Layout.cshtml.
   Kept here (not injected from JS) so both themes and the design tokens apply. */
[data-notif-toggle] { position: relative; }
.dl-notif-dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--status-bad-text); color: #fff; font-size: .62rem; font-weight: 700;
  line-height: 17px; text-align: center; pointer-events: none; }
.dl-notif-menu { width: min(360px, calc(100vw - 28px)); padding: 0; overflow: hidden; }
.dl-notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; font-weight: 600; font-size: .9rem; color: var(--text-strong);
  border-bottom: 1px solid var(--hairline); }
.dl-notif-list { max-height: 60vh; overflow-y: auto; }
.dl-notif-item { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none;
  border-bottom: 1px solid var(--hairline); transition: background .15s; }
.dl-notif-item:last-child { border-bottom: 0; }
.dl-notif-item:hover { background: var(--hover-bg); }
.dl-notif-item > .bi { color: var(--emerald); margin-top: 2px; }
.dl-notif-item.unread { background: rgba(34, 197, 94, .06); }
.dl-notif-item.unread > .bi { color: var(--status-info-text); }
.dl-notif-item .body { display: block; min-width: 0; }
.dl-notif-item .t { display: block; font-weight: 500; color: var(--text-strong); font-size: .85rem; }
.dl-notif-item .d { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.dl-notif-item .tm { display: block; font-size: .72rem; color: var(--text-faint); margin-top: 3px; }
.dl-notif-empty, .dl-notif-loading { padding: 28px 16px; text-align: center; color: var(--text-faint);
  font-size: .85rem; }
.dl-notif-empty .bi { display: block; font-size: 1.5rem; color: var(--emerald); margin-bottom: 8px; }
.dl-notif-empty p { margin: 0; }
.dl-link-btn { background: none; border: 0; padding: 0; color: var(--link-color); font-size: .8rem;
  font-weight: 600; cursor: pointer; }
.dl-link-btn:hover { color: var(--link-hover); text-decoration: underline; }

.dl-quicksearch { position: relative; display: flex; align-items: center; }
.dl-quicksearch > .bi-search { position: absolute; left: 10px; font-size: .85rem; color: var(--text-faint);
  pointer-events: none; }
.dl-quicksearch .dl-input { padding-left: 30px; width: min(260px, 34vw); height: 34px; font-size: .84rem; }

/* The results panel shares the combobox visual language (see the section below):
   same surface, radius, shadow, row treatment and open transition. quick-search.js
   only fills it with .dl-qs-group / .dl-qs-item / .dl-qs-note markup. */
.dl-quicksearch-results { position: absolute; top: calc(100% + 6px); right: 0; z-index: 1050;
  width: min(380px, calc(100vw - 28px)); max-height: 60vh; overflow-y: auto; padding: 6px;
  background: var(--surface-color); border: 1px solid var(--hairline-strong); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25); animation: dl-cbx-in .12s ease; }
.dl-quicksearch-results[hidden] { display: none; }
.dl-qs-group { padding: 8px 10px 4px; font-family: var(--nav-font); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.dl-qs-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--text-soft); text-decoration: none; }
.dl-qs-item:hover { background: var(--hover-bg); color: var(--text-strong); }
.dl-qs-item.active { background: var(--hover-bg); color: var(--text-strong);
  box-shadow: inset 2px 0 0 var(--emerald); }
.dl-qs-item > i { color: var(--emerald); font-size: .95rem; flex-shrink: 0; }
.dl-qs-item .bd { display: flex; flex-direction: column; min-width: 0; }
.dl-qs-item .nm { font-size: .87rem; font-weight: 600; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-qs-item .sb { font-size: .78rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-qs-note { padding: 14px 12px; font-size: .84rem; color: var(--text-muted); }
@media (max-width: 767px) { .dl-quicksearch { display: none; } }

/* ============================ Searchable combobox (DL.combobox) ============================ */
/* wwwroot/js/dl-combobox.js wraps a .dl-input in .dl-cbx and renders the panel below.
   Tokens only, so both themes work; the topbar quick-search panel above reuses the same
   language (and the dl-cbx-in keyframes defined here). */

.dl-cbx { position: relative; display: block; }
.dl-cbx > .dl-input { width: 100%; padding-right: 40px; }
.dl-cbx.has-value > .dl-input { padding-right: 68px; }

/* Chevron affordance + inline clear button, both inside the input's right edge. */
.dl-cbx-toggle, .dl-cbx-clear {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: none; color: var(--text-faint); cursor: pointer; font-size: .72rem;
  transition: color .15s, background .15s;
}
.dl-cbx-toggle { right: 8px; }
.dl-cbx-clear { right: 36px; }
.dl-cbx-toggle:hover, .dl-cbx-clear:hover { color: var(--text-strong); background: var(--hover-bg); }
.dl-cbx-toggle .bi { transition: transform .15s ease; }
.dl-cbx[aria-expanded="true"] .dl-cbx-toggle .bi { transform: rotate(180deg); }
.dl-cbx > .dl-input:disabled ~ .dl-cbx-toggle,
.dl-cbx > .dl-input:disabled ~ .dl-cbx-clear { opacity: .4; pointer-events: none; }

/* While an async lookup runs, a small spinner replaces the chevron. */
.dl-cbx-spin { display: none; position: absolute; right: 13px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; border-width: 2px; }
.dl-cbx.loading .dl-cbx-spin { display: block; }
.dl-cbx.loading .dl-cbx-toggle { visibility: hidden; }

.dl-cbx-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200;
  min-width: 100%; max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--surface-color);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  animation: dl-cbx-in .12s ease;
}
.dl-cbx-panel[hidden] { display: none; }
.dl-cbx-panel.up { top: auto; bottom: calc(100% + 6px); animation-name: dl-cbx-in-up; }

@keyframes dl-cbx-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes dl-cbx-in-up { from { opacity: 0; transform: translateY(-4px); } }

.dl-cbx-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 8px; background: none;
  text-align: left; cursor: pointer; color: var(--text-soft);
  font-family: var(--nav-font); font-size: .87rem;
}
.dl-cbx-item:hover { background: var(--hover-bg); }
.dl-cbx-item.active { background: var(--hover-bg); box-shadow: inset 2px 0 0 var(--emerald); }
.dl-cbx-item > .bi { color: var(--emerald); font-size: .95rem; flex-shrink: 0; }
.dl-cbx-item .bd { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dl-cbx-item .lb { font-weight: 600; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-cbx-item .sb { font-size: .78rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-cbx-check { color: var(--emerald); font-size: .9rem; flex-shrink: 0; }

.dl-cbx-note, .dl-cbx-error { padding: 14px 12px; font-size: .84rem;
  color: var(--text-muted); text-align: center; }
.dl-cbx-error { color: var(--status-bad-text); }
.dl-cbx-error .bi { margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
  .dl-cbx-panel, .dl-quicksearch-results { animation: none; }
  .dl-cbx-toggle .bi { transition: none; }
}
