/* =============================================================
   Help Articles — editorial design
   Inspired by Apple Support, Google Help, Stripe Docs.

   SCOPE — every selector is prefixed with one of these wrappers
   so nothing in this file can affect other parts of the site:
     .help-article         article shell (public article page)
     .help-article-body    article body (also used inside the admin preview)
     .help-article-toc     "On this page" sidebar nav
     .help-hero            help-home hero block
     .page-help-home       <body> on /hjelp
     .page-help-article    <body> on /hjelp/<slug>
   CSS custom properties are scoped to these wrappers as well, so
   --ha-* tokens never bleed into the global :root.
   ============================================================= */

.help-article,
.help-article-body,
.help-article-toc,
.help-hero,
.page-help-home,
.page-help-article {
    --ha-brand:        #05546c;
    --ha-brand-strong: #013f51;
    --ha-brand-soft:   #e8f1f4;
    --ha-ink:          #1d1d1f;
    --ha-ink-soft:     #3c4043;
    --ha-muted:        #6b7380;
    --ha-muted-strong: #495057;
    --ha-line:         #e5e7eb;
    --ha-line-soft:    #eef1f4;
    --ha-surface:      #ffffff;
    --ha-surface-soft: #f7f8fa;
    --ha-surface-tint: #fbfbfd;
    --ha-code-bg:      #eef1f4;
    --ha-code-fg:      #3c4043;
    --ha-accent-bg:    #f0f7fa;
    --ha-radius-sm:    8px;
    --ha-radius-md:    14px;
    --ha-radius-lg:    20px;
    --ha-shadow-sm:    0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
    --ha-shadow-md:    0 8px 24px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
    --ha-shadow-hero:  0 30px 60px -30px rgba(0,0,0,.45);
    --ha-font-sans:    "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --ha-font-display: "Roboto Flex", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --ha-font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                       "Liberation Mono", monospace;
}

/* -----------------------------------------------------------------
   Page shell (public article)
----------------------------------------------------------------- */
.help-article {
    color: var(--ha-ink);
    font-family: var(--ha-font-sans);
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(1000px 480px at 15% -10%, rgba(5,84,108,.05), transparent 70%),
        radial-gradient(900px 400px at 100% 5%,  rgba(5,84,108,.04), transparent 70%),
        var(--ha-surface);
    padding-top: 2.5rem;
    padding-bottom: 5rem;
}

/* Breadcrumb */
.help-article .breadcrumb {
    font-size: .8125rem;
    color: var(--ha-muted);
    letter-spacing: .01em;
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
}
.help-article .breadcrumb a {
    color: var(--ha-muted);
    text-decoration: none;
    transition: color .15s ease;
}
.help-article .breadcrumb a:hover { color: var(--ha-brand); }
.help-article .breadcrumb .breadcrumb-item.active { color: var(--ha-ink-soft); }
.help-article .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--ha-muted);
    opacity: .5;
}

/* Article header */
.help-article .help-article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--ha-line-soft);
}

.help-article .help-article-title {
    font-family: var(--ha-font-display) !important;
    font-size: clamp(2rem, 3.6vw, 3rem) !important;
    font-weight: 700 !important;
    letter-spacing: -0.028em !important;
    line-height: 1.08 !important;
    color: var(--ha-ink) !important;
    margin: 0 0 1rem !important;
    max-width: 26ch;
    text-transform: none !important;
}

.help-article .help-article-lead {
    font-family: var(--ha-font-display) !important;
    font-size: clamp(1.1rem, 1.4vw, 1.3125rem) !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    color: var(--ha-ink-soft) !important;
    margin: 0 0 1.5rem !important;
    max-width: 44rem;
    text-transform: none !important;
}

/* Meta stamp → chip-style row */
.help-article .help-article-meta {
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    padding: .35rem .75rem .35rem .6rem;
    background: var(--ha-surface-soft) !important;
    border: 1px solid var(--ha-line-soft);
    border-radius: 999px;
    font-size: .8125rem !important;
    color: var(--ha-muted) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    font-weight: 500;
    line-height: 1;
}
.help-article .help-article-meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
    flex-shrink: 0;
}
.help-article .help-article-meta-sep {
    opacity: .45;
    padding: 0 .1rem;
}

/* -----------------------------------------------------------------
   Body typography (used on public article AND admin preview)
----------------------------------------------------------------- */
.help-article-body {
    font-family: var(--ha-font-sans);
    color: var(--ha-ink);
    font-size: 1.125rem;            /* 18px — editorial readability */
    line-height: 1.7;
    max-width: 44rem;               /* ~704px readable measure */
    -webkit-text-size-adjust: 100%;
}

.help-article-body > * { max-width: 100%; }

.help-article-body p {
    margin: 0 0 1.35em;
    color: var(--ha-ink);
    font-size: 1.125rem;      /* 18px — editorial readability */
    line-height: 1.7;
}

.help-article-body strong,
.help-article-body b { font-weight: 600; color: var(--ha-ink); }
.help-article-body em,
.help-article-body i { color: var(--ha-ink-soft); font-style: italic; }

/* Headings */
.help-article-body h2,
.help-article-body h3,
.help-article-body h4 {
    font-family: var(--ha-font-display) !important;
    color: var(--ha-ink) !important;
    font-weight: 600 !important;
    letter-spacing: -0.018em !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    scroll-margin-top: 5rem;
}
.help-article-body h2 {
    font-size: clamp(1.5rem, 2.2vw, 1.875rem);
    margin: 3em 0 .75em;
    padding-top: 1.25em;
    border-top: 1px solid var(--ha-line-soft);
}
.help-article-body h3 {
    font-size: 1.375rem;
    margin: 2.25em 0 .5em;
}
.help-article-body h4 {
    font-size: 1rem;
    margin: 1.75em 0 .4em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ha-muted-strong);
}

/* First heading after body content should not push top border */
.help-article-body > h2:first-child,
.help-article-body > h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Links */
.help-article-body a {
    color: var(--ha-brand);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 100% 1px;
    background-position: 0 100%;
    transition: color .15s ease, background-size .15s ease;
    font-weight: 500;
}
.help-article-body a:hover {
    color: var(--ha-brand-strong);
    background-size: 100% 2px;
}

/* -----------------------------------------------------------------
   Lists — generous, with refined markers
----------------------------------------------------------------- */
.help-article-body ul,
.help-article-body ol {
    margin: 0 0 1.5em;
    padding-left: 0;                /* use custom markers */
    list-style: none;
}
.help-article-body ul > li,
.help-article-body ol > li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: .55em;
    line-height: 1.65;
}

/* Unordered list — subtle dot */
.help-article-body ul > li::before {
    content: "";
    position: absolute;
    left: .85rem;
    top: .78em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ha-brand);
    opacity: .85;
}

/* Ordered list — clean numerals in brand-tinted circle */
.help-article-body ol {
    counter-reset: ha-ol;
}
.help-article-body ol > li {
    counter-increment: ha-ol;
    padding-left: 3rem;
    margin-bottom: .85em;
}
.help-article-body ol > li::before {
    content: counter(ha-ol);
    position: absolute;
    left: 0;
    top: .1em;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--ha-brand);
    color: #fff;
    font-family: var(--ha-font-display);
    font-size: .9375rem;
    font-weight: 600;
    line-height: 2rem;
    text-align: center;
    letter-spacing: 0;
    box-shadow: 0 2px 4px -1px rgba(5,84,108,.25), inset 0 -1px 0 rgba(0,0,0,.08);
}

/* Nested lists reduce size */
.help-article-body li > ul,
.help-article-body li > ol {
    margin: .5em 0;
}
.help-article-body li > ul > li,
.help-article-body li > ol > li {
    font-size: .96em;
}

/* -----------------------------------------------------------------
   Blockquote (callout)
----------------------------------------------------------------- */
.help-article-body blockquote {
    margin: 2em 0;
    padding: 1.15rem 1.35rem;
    background: var(--ha-accent-bg);
    border-left: 3px solid var(--ha-brand);
    border-radius: 0 var(--ha-radius-md) var(--ha-radius-md) 0;
    color: var(--ha-ink-soft);
    font-style: normal;
}
.help-article-body blockquote p:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------
   Inline code + code blocks + kbd
----------------------------------------------------------------- */
.help-article-body code {
    font-family: var(--ha-font-mono);
    font-size: .86em;
    color: var(--ha-ink);
    background: var(--ha-code-bg);
    padding: .2em .5em;
    border-radius: 6px;
    border: 1px solid var(--ha-line);
    font-feature-settings: "calt" 0;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.04);
}

.help-article-body pre {
    background: #0f172a;
    color: #e6edf3;
    border: 0;
    border-radius: var(--ha-radius-md);
    padding: 1.1rem 1.35rem;
    margin: 2em 0;
    overflow: auto;
    font-size: .9375rem;
    line-height: 1.6;
    box-shadow: var(--ha-shadow-md);
}
.help-article-body pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
    white-space: pre;
}

.help-article-body kbd {
    font-family: var(--ha-font-mono);
    font-size: .85em;
    padding: .18em .5em;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line);
    border-bottom-width: 2px;
    border-radius: 6px;
    color: var(--ha-ink);
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

/* Horizontal rule */
.help-article-body hr {
    border: 0;
    height: 1px;
    background: var(--ha-line);
    margin: 2.5em 0;
}

/* -----------------------------------------------------------------
   Images & figures
----------------------------------------------------------------- */
.help-article-body figure { margin: 2.25em 0; }
.help-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ha-radius-md);
    box-shadow: var(--ha-shadow-md);
    display: block;
    margin: 2em auto;
}
.help-article-body figure > img { margin: 0 auto; }
.help-article-body figcaption {
    font-size: .875rem;
    color: var(--ha-muted);
    text-align: center;
    margin-top: .85rem;
    line-height: 1.5;
}

/* -----------------------------------------------------------------
   Tables
----------------------------------------------------------------- */
.help-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: .9375rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line);
    border-radius: var(--ha-radius-md);
    overflow: hidden;
    box-shadow: var(--ha-shadow-sm);
}
.help-article-body thead th {
    text-align: left;
    padding: .85rem 1rem;
    background: var(--ha-surface-soft);
    color: var(--ha-ink);
    font-weight: 600;
    border-bottom: 1px solid var(--ha-line);
    font-size: .875rem;
    letter-spacing: .01em;
    text-transform: uppercase;
}
.help-article-body tbody td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--ha-line-soft);
    color: var(--ha-ink-soft);
    vertical-align: top;
}
.help-article-body tbody tr:last-child td { border-bottom: 0; }

/* -----------------------------------------------------------------
   Sidebar (public article)
----------------------------------------------------------------- */
.help-article aside {
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
}
.help-article .row { align-items: flex-start; }

.help-article aside .card {
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-lg);
    box-shadow: var(--ha-shadow-sm);
    margin-bottom: 1rem;
}

/* On-this-page TOC */
.help-article-toc {
    padding: 1.35rem 1.5rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-lg);
    box-shadow: var(--ha-shadow-sm);
    margin-bottom: 1rem;
}
.help-article-toc-heading {
    font-family: var(--ha-font-sans);
    font-size: .75rem;
    letter-spacing: .12em;
    font-weight: 600;
    color: var(--ha-muted);
    text-transform: uppercase;
    margin: 0 0 .85rem;
}
.help-article-toc ol {
    list-style: none;
    counter-reset: none;
    padding: 0;
    margin: 0;
}
.help-article-toc ol li {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--ha-line-soft);
}
.help-article-toc ol li:last-child { border-bottom: 0; }
.help-article-toc ol li::before { content: none; }
.help-article-toc ol li a {
    display: block;
    padding: .6rem 0;
    color: var(--ha-ink-soft);
    text-decoration: none;
    font-size: .925rem;
    line-height: 1.35;
    font-weight: 500;
    transition: color .15s ease, padding-left .15s ease;
}
.help-article-toc ol li a:hover {
    color: var(--ha-brand);
    padding-left: .25rem;
}
.help-article aside .card.bg-light {
    background: var(--ha-surface-tint) !important;
    border: 1px solid var(--ha-line-soft);
}
.help-article aside .card-body { padding: 1.35rem 1.5rem; }

.help-article aside h2.h6 {
    font-family: var(--ha-font-sans);
    font-size: .75rem;
    letter-spacing: .12em;
    font-weight: 600;
    color: var(--ha-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.help-article aside ul li {
    border-bottom: 1px solid var(--ha-line-soft);
}
.help-article aside ul li:last-child { border-bottom: 0; }
.help-article aside ul li a {
    color: var(--ha-ink);
    text-decoration: none;
    display: block;
    padding: .75rem 0;
    line-height: 1.4;
    font-weight: 500;
    transition: color .15s ease, transform .15s ease;
}
.help-article aside ul li a::after {
    content: " →";
    opacity: 0;
    color: var(--ha-brand);
    transition: opacity .15s ease, transform .15s ease;
}
.help-article aside ul li a:hover {
    color: var(--ha-brand);
}
.help-article aside ul li a:hover::after {
    opacity: 1;
}

/* Sidebar search */
.help-article aside .input-group .form-control {
    border: 1px solid var(--ha-line);
    border-right: 0;
    border-radius: var(--ha-radius-sm) 0 0 var(--ha-radius-sm);
    background: var(--ha-surface);
    box-shadow: none;
    font-size: .95rem;
}
.help-article aside .input-group .form-control:focus {
    border-color: var(--ha-brand);
    box-shadow: 0 0 0 3px rgba(5,84,108,.12);
}
.help-article aside .input-group .btn {
    border-radius: 0 var(--ha-radius-sm) var(--ha-radius-sm) 0;
    background: var(--ha-ink);
    border-color: var(--ha-ink);
}
.help-article aside .input-group .btn:hover { background: #000; border-color: #000; }

/* -----------------------------------------------------------------
   Footer actions on article
----------------------------------------------------------------- */
.help-article hr.my-5 {
    border: 0;
    height: 1px;
    background: var(--ha-line-soft);
    margin: 3.5rem 0 2rem !important;
}

.help-article .btn-outline-secondary,
.help-article .btn-outline-primary {
    border-radius: 999px !important;
    padding: .6rem 1.4rem !important;
    font-weight: 500 !important;
    letter-spacing: .005em !important;
    text-transform: none !important;
    font-size: .9375rem !important;
    border-width: 1px !important;
    transition: all .15s ease;
}
.help-article .btn-outline-secondary {
    color: var(--ha-ink-soft) !important;
    border-color: var(--ha-line) !important;
    background: var(--ha-surface) !important;
}
.help-article .btn-outline-secondary:hover {
    background: var(--ha-surface-soft) !important;
    color: var(--ha-ink) !important;
    transform: translateY(-1px);
    box-shadow: var(--ha-shadow-sm);
}
.help-article .btn-outline-primary {
    color: var(--ha-brand) !important;
    border-color: var(--ha-brand) !important;
    background: var(--ha-surface) !important;
}
.help-article .btn-outline-primary:hover {
    background: var(--ha-brand) !important;
    border-color: var(--ha-brand) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(5,84,108,.5);
}

/* -----------------------------------------------------------------
   Help home — hero
----------------------------------------------------------------- */
.page-help-home .help-hero {
    padding: 5rem 0 4.5rem !important;
    background:
        radial-gradient(1000px 420px at 12% -20%, rgba(255,255,255,.22), transparent 60%),
        radial-gradient(900px 400px at 100% 120%, rgba(0,0,0,.18), transparent 60%),
        linear-gradient(135deg, var(--ha-brand) 0%, var(--ha-brand-strong) 100%);
    position: relative;
    /* No overflow:hidden — would clip the autocomplete dropdown that
       overflows the hero on long suggest lists. Radial gradients are
       clipped natively to the element's box, and the ::before dot
       pattern uses inset:0 so neither needs an overflow clip. */
}
.page-help-home .help-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: .35;
    pointer-events: none;
}
/* Don't create stacking contexts on .container or the form — they would
   trap #helpSearchSuggest's z-index inside a local context and let later
   sections (with their own opaque background) paint over the dropdown
   region that overflows below the hero. The form needs `position:
   relative` only so the absolutely-positioned dropdown anchors to it. */
.page-help-home .help-hero > .container { position: relative; }
.page-help-home .help-hero form { position: relative; }

.page-help-home .help-hero h1 {
    font-family: var(--ha-font-display);
    font-weight: 700;
    letter-spacing: -0.028em;
    font-size: clamp(2.2rem, 4.4vw, 3.5rem);
    line-height: 1.05;
}
.page-help-home .help-hero p.lead {
    font-family: var(--ha-font-display);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 400;
    opacity: .9;
}
.page-help-home .help-hero form { background: transparent; }
.page-help-home .help-hero .input-group {
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--ha-shadow-hero);
}
.page-help-home .help-hero .input-group-text,
.page-help-home .help-hero .input-group input {
    border: 0;
    background: transparent;
    font-size: 1.0625rem;
    padding: 1.1rem 1.25rem;
    box-shadow: none;
    color: var(--ha-ink);
    height: 100%;
}
.page-help-home .help-hero .input-group-text {
    padding-right: .25rem;
    padding-left: 1.5rem;
    color: var(--ha-muted);
}
.page-help-home .help-hero .input-group .btn {
    border-radius: 0 !important;
    padding-left: 1.9rem !important;
    padding-right: 1.9rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    background: var(--ha-ink) !important;
    border-color: var(--ha-ink) !important;
    color: #fff !important;
    letter-spacing: .005em !important;
}
.page-help-home .help-hero .input-group .btn:hover {
    background: #000;
    border-color: #000;
}

/* Suggest dropdown — uses Bootstrap's .dropdown-menu (position:absolute,
   anchored to the form). Without overflow:hidden anywhere up the tree
   the panel can extend below the hero, and a high z-index keeps it
   above any sibling section painted later in the document. */
#helpSearchSuggest {
    position: absolute;
    border-radius: var(--ha-radius-md);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
    background: #fff;
    padding: .4rem !important;
    margin-top: .75rem !important;
    border: 1px solid var(--ha-line-soft) !important;
    z-index: 1050;
    overflow: visible;
}
#helpSearchSuggest .dropdown-item {
    display: block !important;
    width: 100% !important;
    border: 0 !important;
    border-radius: var(--ha-radius-sm);
    color: var(--ha-ink);
    padding: .8rem 1rem !important;
    transition: background .12s ease;
    font-weight: 500;
    text-decoration: none;
    white-space: normal;
}
#helpSearchSuggest .dropdown-item:hover,
#helpSearchSuggest .dropdown-item.active {
    background: var(--ha-surface-soft);
    color: var(--ha-brand);
}
#helpSearchSuggest .dropdown-item i { color: var(--ha-muted); }

/* -----------------------------------------------------------------
   Help home — sections, headings, cards
   Single source of truth: every article tile uses .help-card.
----------------------------------------------------------------- */
.page-help-home .help-results-section { padding: 3rem 0 1.5rem; }
.page-help-home .help-lists-section   { padding: 3.5rem 0 4rem; background: var(--ha-surface-tint); }

/* Section heading (search results, populære, nyeste) */
.page-help-home .help-section-heading {
    font-family: var(--ha-font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ha-ink);
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    line-height: 1.3;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    text-transform: none;
}
.page-help-home .help-section-heading em {
    font-style: italic;
    font-weight: 600;
    color: var(--ha-ink);
}
.page-help-home .help-section-count {
    color: var(--ha-muted);
    font-weight: 400;
    font-size: .8em;
    letter-spacing: 0;
}
.page-help-home .help-icon-fire  { color: #ef4444; opacity: .9; }
.page-help-home .help-icon-spark { color: var(--ha-brand); opacity: .9; }

/* Two-column layout for popular + recent */
.page-help-home .help-lists-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .page-help-home .help-lists-grid { grid-template-columns: 1fr 1fr; }
}

/* Search results: responsive 2-up grid */
.page-help-home .help-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* Vertical stack used inside popular/recent */
.page-help-home .help-card-stack {
    display: grid;
    gap: .65rem;
}

/* Card — every article tile on /hjelp uses this exact recipe */
.page-help-home .help-card {
    display: block;
    padding: 1.15rem 1.35rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-md);
    box-shadow: var(--ha-shadow-sm);
    text-decoration: none;
    color: var(--ha-ink);
    height: 100%;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.page-help-home .help-card:hover,
.page-help-home .help-card:focus-visible {
    box-shadow: var(--ha-shadow-md);
    transform: translateY(-2px);
    border-color: var(--ha-line);
    color: var(--ha-ink);
    outline: none;
}

.page-help-home .help-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .85rem;
    margin-bottom: .4rem;
}
.page-help-home .help-card-header .help-card-title { margin: 0; flex: 1 1 auto; }

.page-help-home .help-card-title {
    font-family: var(--ha-font-display);
    font-size: 1.0625rem;     /* unified across search, populære and nyeste */
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.35;
    color: var(--ha-ink);
    margin: 0 0 .35rem;
    text-transform: none;
}

.page-help-home .help-card-excerpt {
    font-size: .875rem;
    line-height: 1.55;
    color: var(--ha-muted);
    margin: 0;
}

.page-help-home .help-card-meta {
    font-size: .8125rem;
    color: var(--ha-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Empty-state placeholder (no results, no published articles) */
.page-help-home .help-empty {
    padding: 1.25rem 1.5rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-md);
    color: var(--ha-muted);
    text-align: center;
    margin: 0;
}

/* -----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .help-article { padding-top: 1.75rem; padding-bottom: 3.5rem; }
}
@media (max-width: 767.98px) {
    .help-article .help-article-title { font-size: 1.85rem !important; }
    .help-article .help-article-lead  { font-size: 1.05rem !important; }
    .help-article-body p { font-size: 1.05rem; line-height: 1.65; }
    .help-article-body { font-size: 1.05rem; line-height: 1.65; }
    .help-article-body h2 {
        font-size: 1.45rem;
        margin-top: 2.25em;
        padding-top: 1em;
    }
    .help-article-body h3 { font-size: 1.15rem; margin-top: 1.75em; }
    .help-article-body ol > li { padding-left: 2.5rem; }
    .help-article-body ol > li::before {
        width: 1.6rem; height: 1.6rem; line-height: 1.6rem; font-size: .8rem;
    }
    .help-hero { padding: 3rem 0 3rem !important; }
    .help-hero .input-group .btn { padding-left: 1.1rem; padding-right: 1.1rem; }
    .help-hero .input-group-text,
    .help-hero .input-group input { padding: .9rem 1rem; }
}

/* Admin editor preview — inherits help-article-body but sits inside card */
.help-article-body { background: transparent; }

/* =================================================================
   SMART SUGGESTIONS — contact-form panel
   Scoped on the panel's own class so styles never leak.
   ================================================================= */

.help-suggest,
.help-suggest-return-banner,
.help-article-feedback {
    --ha-brand:        #05546c;
    --ha-brand-strong: #013f51;
    --ha-brand-soft:   #e8f1f4;
    --ha-ink:          #1d1d1f;
    --ha-ink-soft:     #3c4043;
    --ha-muted:        #6b7380;
    --ha-line:         #e5e7eb;
    --ha-line-soft:    #eef1f4;
    --ha-surface:      #ffffff;
    --ha-radius-sm:    8px;
    --ha-radius-md:    14px;
    --ha-radius-lg:    18px;
    --ha-shadow-sm:    0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
    --ha-shadow-md:    0 8px 24px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
    --ha-font-sans:    "Noto Sans", Helvetica, Arial, sans-serif;
    --ha-font-display: Roboto, Helvetica, Arial, sans-serif;
}

.help-suggest {
    margin-top: 1.25rem;
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-lg);
    box-shadow: var(--ha-shadow-md);
    font-family: var(--ha-font-sans);
    color: var(--ha-ink);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease, border-color .25s ease;
}
.help-suggest.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.help-suggest[data-tier="high"] {
    border-color: rgba(5, 84, 108, .25);
    box-shadow: 0 0 0 4px rgba(5, 84, 108, .08), var(--ha-shadow-md);
}
.help-suggest[data-tier="medium"] {
    border-color: var(--ha-line);
}

.help-suggest-header {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: .9rem;
}
.help-suggest-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ha-brand-soft);
    color: var(--ha-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.help-suggest-header > div {
    flex: 1 1 auto;
    line-height: 1.35;
}
.help-suggest-title {
    display: block;
    font-family: var(--ha-font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--ha-ink);
}
.help-suggest-subtitle {
    display: block;
    font-size: .8125rem;
    color: var(--ha-muted);
    margin-top: .15rem;
}
.help-suggest-dismiss {
    appearance: none;
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--ha-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s ease, color .12s ease;
}
.help-suggest-dismiss:hover { background: var(--ha-line-soft); color: var(--ha-ink); }

.help-suggest-list {
    display: grid;
    gap: .55rem;
}
.help-suggest-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    background: var(--ha-surface);
    border: 1px solid var(--ha-line-soft);
    border-radius: var(--ha-radius-md);
    text-decoration: none;
    color: var(--ha-ink);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.help-suggest-card:hover,
.help-suggest-card:focus-visible {
    border-color: var(--ha-brand);
    box-shadow: 0 4px 12px rgba(5, 84, 108, .08);
    transform: translateY(-1px);
    color: var(--ha-ink);
    text-decoration: none;
    outline: none;
}
.help-suggest-card-body {
    flex: 1 1 auto;
    min-width: 0;
}
.help-suggest-card-title {
    font-family: var(--ha-font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--ha-ink);
    margin: 0 0 .15rem;
    line-height: 1.35;
    text-transform: none;
}
.help-suggest-card-why {
    font-size: .85rem;
    color: var(--ha-muted);
    line-height: 1.5;
    margin: 0;
}
.help-suggest-card-arrow {
    font-size: 1.5rem;
    color: var(--ha-brand);
    line-height: 1;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .15s ease, transform .15s ease;
}
.help-suggest-card:hover .help-suggest-card-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* Soft-friction state on the Send button after a suggestion was shown */
.btn.help-suggest-armed {
    background: #f5b500 !important;
    border-color: #f5b500 !important;
    color: #1d1d1f !important;
    box-shadow: 0 0 0 4px rgba(245, 181, 0, .18);
    animation: help-suggest-pulse 1.2s ease-in-out;
}
@keyframes help-suggest-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

/* Loading state during the final pre-submit check */
.btn.help-suggest-loading { opacity: .85; cursor: wait; }
.help-suggest-spin {
    display: inline-block;
    animation: help-suggest-rotate 1s linear infinite;
}
@keyframes help-suggest-rotate { to { transform: rotate(360deg); } }

/* =================================================================
   "Did this help?" banner on the article page
   ================================================================= */

.help-article-feedback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1rem 1.35rem;
    background: var(--ha-brand-soft);
    border: 1px solid rgba(5, 84, 108, .18);
    border-radius: var(--ha-radius-lg);
    color: var(--ha-ink);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
}
.help-article-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.help-article-feedback-text {
    flex: 1 1 320px;
    line-height: 1.45;
}
.help-article-feedback-text strong {
    display: block;
    color: var(--ha-brand-strong);
    font-weight: 600;
    margin-bottom: .15rem;
}
.help-article-feedback-text span {
    color: var(--ha-ink-soft);
    font-size: .9375rem;
}
.help-article-feedback-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.help-article-feedback-actions button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .5rem 1.1rem;
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.help-article-feedback-yes {
    background: var(--ha-brand);
    color: #fff;
}
.help-article-feedback-yes:hover {
    background: var(--ha-brand-strong);
    transform: translateY(-1px);
}
.help-article-feedback-no {
    background: var(--ha-surface);
    color: var(--ha-ink-soft);
    border-color: var(--ha-line);
}
.help-article-feedback-no:hover {
    background: #fff;
    border-color: var(--ha-brand);
    color: var(--ha-brand);
    transform: translateY(-1px);
}

/* =================================================================
   "You're back from an article" banner above the contact form
   ================================================================= */

.help-suggest-return-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 auto 1rem;
    max-width: 700px;
    padding: .75rem 1rem;
    background: var(--ha-brand-soft);
    color: var(--ha-brand-strong);
    border: 1px solid rgba(5, 84, 108, .15);
    border-radius: var(--ha-radius-md);
    font-size: .9375rem;
    font-family: var(--ha-font-sans);
}
.help-suggest-return-icon {
    color: var(--ha-brand);
    flex-shrink: 0;
}
.help-suggest-return-banner span { flex: 1 1 auto; }
.help-suggest-return-dismiss {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--ha-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background .12s ease;
}
.help-suggest-return-dismiss:hover { background: rgba(5, 84, 108, .12); }

/* Mobile polish */
@media (max-width: 575.98px) {
    .help-suggest { padding: .9rem 1rem 1rem; }
    .help-suggest-header { gap: .65rem; }
    .help-suggest-icon { width: 30px; height: 30px; font-size: .9rem; }
    .help-suggest-card { padding: .75rem .9rem; gap: .65rem; }
    .help-article-feedback { padding: .85rem 1rem; }
    .help-article-feedback-actions { width: 100%; }
    .help-article-feedback-actions button { flex: 1 1 auto; }
}
