/* ===== cht_portal_stats_html (HTML form, scoped) =====
   Loaded eagerly from anvil.yaml native_deps.head_html, which is also the only route
   that styles the designer canvas.

   .cht-portal-wrap is the root Anvil adopts, so its rule stays a BARE class: it must
   outrank the scoped rules beneath it. It keeps overflow: hidden, which it declared
   itself — the migration guide's ban on overflow is about the SCREEN root, the flex
   item inside the layout's scroll port, and that is the shell's .cht-shell, not this
   card. No flex, no position and no min-height is added: a dashboard child root is a
   plain block inside the shell's .px-section-reveal section, which owns the margin
   and the fade-in.

   [data-theme="dark"] sits on <html>, an ancestor of every form root, so that prefix
   stays OUTSIDE the :where() scope. Written the naive way round,
   :where(.cht-portal-wrap) [data-theme="dark"] .cht-never-section, it would need a
   data-theme element inside this card and could never match, and dark mode would die
   here with no error.

   .cht-never-hidden is the starting display:none of .cht-never-section, because a
   template may carry no style attribute. The module writes neverSection.style.display
   on every render, and that inline write beats this class permanently.

   This section declares no .px-* class, so nothing here can tie with the theme the
   dependency injects into the head at runtime. Do not create one. */

.cht-portal-wrap {
    background: var(--px-bg-card);
    border: 1px solid var(--px-border);
    border-radius: var(--px-radius);
    box-shadow: var(--px-shadow);
    overflow: hidden;
}

:where(.cht-portal-wrap) .cht-portal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--px-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

:where(.cht-portal-wrap) .cht-portal-title {
    font-family: var(--px-font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--px-text-primary);
    margin: 0;
}

:where(.cht-portal-wrap) .cht-portal-updated {
    font-family: var(--px-mono);
    font-size: 0.7rem;
    color: var(--px-text-muted);
}

:where(.cht-portal-wrap) .cht-portal-body {
    padding: 1.25rem;
}

:where(.cht-portal-wrap) .cht-bars {
    display: grid;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

:where(.cht-portal-wrap) .cht-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--px-font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--px-text-primary);
    margin-bottom: 0.375rem;
}

:where(.cht-portal-wrap) .cht-bar-count {
    font-family: var(--px-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--px-text-muted);
}

:where(.cht-portal-wrap) .cht-bar-track {
    height: 10px;
    border-radius: var(--px-radius-pill);
    background: var(--px-bg-elevated);
    overflow: hidden;
}

:where(.cht-portal-wrap) .cht-bar-fill {
    height: 100%;
    border-radius: var(--px-radius-pill);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.cht-portal-wrap) .cht-never-section {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: var(--px-radius-sm);
    background: rgba(225, 29, 72, 0.06);
    border: 1px solid rgba(225, 29, 72, 0.15);
}

/* The lifted style="display:none;". */
:where(.cht-portal-wrap) .cht-never-hidden {
    display: none;
}

[data-theme="dark"] :where(.cht-portal-wrap) .cht-never-section {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
}

:where(.cht-portal-wrap) .cht-never-title {
    font-family: var(--px-font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent, #e11d48);
    margin: 0 0 0.5rem 0;
}

[data-theme="dark"] :where(.cht-portal-wrap) .cht-never-title {
    color: color-mix(in srgb, var(--accent, var(--px-accent)) 40%, var(--px-text-primary));
}

:where(.cht-portal-wrap) .cht-never-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

:where(.cht-portal-wrap) .cht-never-list li {
    font-family: var(--px-font);
    font-size: 0.8rem;
    color: var(--px-text-secondary);
    padding: 0.25rem 0.625rem;
    background: var(--px-bg-elevated);
    border-radius: var(--px-radius-pill);
}
