/* Application shell on top of the Kendo Meridian theme.

   Loaded after bootstrap.css and site.css by both layouts. Bootstrap is kept only for its grid
   and spacing utilities (row, col-*, mb-3...); every control - text boxes, buttons, check boxes,
   cards, the app bar - is a Kendo component, and this file makes the page chrome around them
   use the same theme tokens so the whole application reads as one design.

   Colours that the company can configure (menu background/text, forum background, font colour)
   are applied by Views/Shared/Components/CompanySettings/Default.cshtml and override these. */

:root {
    --forum-page-bg: #f4f6fa;
    --forum-radius: var(--kendo-border-radius-lg, 8px);
    --forum-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
    --forum-shadow-raised: 0 4px 12px rgba(16, 24, 40, .08);
    --forum-appbar-height: 60px;
}

body {
    font-family: var(--kendo-font-family);
    background-color: var(--forum-page-bg);
    color: var(--kendo-color-on-app-surface, #1e293b);
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
}

/* ---- Reading text ---------------------------------------------------------------------------
   Kendo's 1.5 line-height suits dense UI (grids, toolbars, form labels) but is tight for prose.
   Posts, answers and excerpts get looser leading, and paragraphs get a maximum line length -
   about 70 characters is comfortable to read, where a wide screen would otherwise give 150+.
   The cap is on the text blocks only, so screenshots and tables still use the full width. */

.forum-post-body,
#chat .k-message {
    line-height: 1.65;
}

    .forum-post-body > p,
    .forum-post-body > ul,
    .forum-post-body > ol {
        max-width: 72ch;
    }

.forum-result-excerpt,
.forum-chat-sub {
    line-height: 1.55;
}

/* ---- App bar (header) --------------------------------------------------------------------- */

/* offcanvas.css sets overflow-x: hidden on both html and body. With both set, body becomes its
   own scroll container - one that never scrolls - and position: sticky on the app bar sticks to
   that instead of the window, so the bar scrolled away with the page. clip hides the sideways
   overflow the same way without creating a scroll container. */
html,
body {
    overflow-x: clip;
}

/* The bar sticks to the top of the window. site.js toggles two classes on <html> as the page
   scrolls: forum-scrolled once the page has left the top, which makes the bar more compact,
   translucent and gives it a shadow; and forum-appbar-hidden on small screens while scrolling
   down, which slides it out of the way until the reader scrolls back up. */
html.forum-scrolled {
    --forum-appbar-height: 48px;
}

.forum-appbar {
    min-height: var(--forum-appbar-height);
    padding-inline: 1.25rem;
    gap: .5rem;
    z-index: 1030;
    /* Edge to edge: rounded corners on a bar pinned to the top show the page through them. */
    border-radius: 0;
    /* At the top of the page only a hairline, so the bar looks part of the page. The hairline is
       mixed from the text colour so it works whatever menu colour the company configures. */
    box-shadow: 0 1px 0 color-mix(in srgb, currentColor 12%, transparent);
    transition: min-height .2s ease, padding-block .2s ease, background-color .2s ease, box-shadow .2s ease, transform .25s ease;
}

    /* Scrolled: content passes under the bar, so it lifts off the page with a soft shadow and
       lets the content show faintly through (Kendo already gives the app bar a backdrop blur).
       --forum-appbar-bg is the company's menu colour, set by the CompanySettings component. The
       selector is more specific than the company rule, so it wins over its !important. */
    html.forum-scrolled .forum-appbar {
        padding-block: .375rem;
        box-shadow: 0 1px 0 color-mix(in srgb, currentColor 10%, transparent), 0 8px 24px -12px rgba(16, 24, 40, .35);
    }

@supports (backdrop-filter: blur(1px)) {
    html.forum-scrolled .forum-appbar {
        background-color: color-mix(in srgb, var(--forum-appbar-bg, var(--kendo-color-inverse)) 82%, transparent) !important;
        backdrop-filter: saturate(1.6) blur(14px);
    }
}

@media (max-width: 767.98px) {
    html.forum-appbar-hidden .forum-appbar {
        transform: translateY(-100%);
        box-shadow: none;
    }
}

.forum-appbar .companyLogo {
    display: inline-flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: font-size .2s ease;
}

    .forum-appbar .companyLogo img {
        max-height: 40px;
        width: auto;
        transition: max-height .2s ease;
    }

    html.forum-scrolled .forum-appbar .companyLogo {
        font-size: 1rem;
    }

        html.forum-scrolled .forum-appbar .companyLogo img {
            max-height: 32px;
        }

/* The side menu follows the bar's height as it changes. */
.forum-shell > .k-drawer-container {
    transition: top .2s ease, height .2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .forum-appbar,
    .forum-appbar .companyLogo,
    .forum-appbar .companyLogo img,
    .forum-shell > .k-drawer-container {
        transition: none;
    }
}

.forum-appbar .k-appbar-section {
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ---- App bar navigation -------------------------------------------------------------------
   The links are pills that only show a surface on hover or for the current section, so the bar
   stays quiet until it is used. Everything is mixed from currentColor, which the company menu
   text colour sets, so the same rules hold on a light or a dark bar. */

.forum-appbar .forum-nav {
    gap: .125rem;
}

    .forum-appbar .forum-nav .k-button {
        border: 0;
        border-radius: 999px;
        padding-block: .4375rem;
        padding-inline: .875rem;
        font-size: .9375rem;
        font-weight: 500;
        letter-spacing: -.005em;
        transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
    }

        /* Icons sit back a little so the labels lead; they come forward with the link. */
        .forum-appbar .forum-nav .k-button .k-button-icon {
            opacity: .7;
            transition: opacity .18s ease;
        }

        /* The Meridian theme sets the flat button's background and box-shadow with !important,
           so the pill states have to match that to take effect. */
        .forum-appbar .forum-nav .k-button.k-button-flat:hover,
        .forum-appbar .forum-nav .k-button.k-button-flat:focus-visible {
            background-color: color-mix(in srgb, currentColor 8%, transparent) !important;
        }

        .forum-appbar .forum-nav .k-button.k-button-flat:active {
            background-color: color-mix(in srgb, currentColor 14%, transparent) !important;
        }

            .forum-appbar .forum-nav .k-button:hover .k-button-icon,
            .forum-appbar .forum-nav .k-button:focus-visible .k-button-icon {
                opacity: 1;
            }

        .forum-appbar .forum-nav .k-button.k-button-flat:focus-visible {
            outline: none;
            box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent) !important;
        }

/* Avatar button in the app bar, and the user card it opens. */
/* No line-height:0 here to remove the inline-block gap - use flex instead. Kendo copies the
   anchor's font styles onto the popup, so a 0 line-height would collapse the card's text. */
.forum-user-trigger {
    display: inline-flex;
    padding: 2px;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: box-shadow .15s ease;
}

    .forum-user-trigger:hover,
    .forum-user-trigger:focus-visible {
        box-shadow: 0 0 0 2px var(--kendo-color-primary);
        outline: none;
    }

/* Until Kendo has initialised them, the user card and the avatar are plain markup in the bar: the
   card (name, e-mail, "Logga ut") would show in the bar and then vanish, and the avatar would pop
   in. The card stays hidden until it is a popup, and the avatar spot shows a skeleton circle of
   the same size, so nothing in the bar moves while the page loads. */
#userMenuPopup:not(.k-popup) {
    display: none;
}

.forum-user-trigger {
    min-width: 36px;
    min-height: 36px;
}

    .forum-user-trigger > :not(.k-avatar) {
        width: 32px;
        height: 32px;
        overflow: hidden;
        border-radius: 50%;
        color: transparent;
        background: linear-gradient(90deg, color-mix(in srgb, currentColor 10%, transparent) 25%, color-mix(in srgb, currentColor 20%, transparent) 50%, color-mix(in srgb, currentColor 10%, transparent) 75%) 0 0 / 200% 100%;
        animation: forum-skeleton 1.2s ease-in-out infinite;
    }

@keyframes forum-skeleton {
    to {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .forum-user-trigger > :not(.k-avatar) {
        animation: none;
    }
}

.forum-user-card {
    min-width: 260px;
    max-width: 320px;
    padding: 1rem;
}

.forum-user-card-head {
    display: flex;
    align-items: center;
    gap: .875rem;
}

.forum-user-card-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.forum-user-card-name {
    font-weight: 600;
}

.forum-user-card-email {
    font-size: .875rem;
    color: var(--kendo-color-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-user-card .k-hr {
    margin-block: .875rem;
}

.forum-user-card-logout {
    width: 100%;
    justify-content: flex-start;
}

.forum-appbar form {
    margin: 0;
}

@media (max-width: 575.98px) {
    .forum-appbar .forum-nav .k-button-text {
        display: none;
    }
}

/* ---- Side menu (Kendo Drawer, admin layout) ----------------------------------------------- */

/* The drawer and the page sit side by side; the drawer pushes the page as it expands. */
.forum-shell {
    display: flex;
    align-items: flex-start;
}

    .forum-shell > main {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* The menu stays in view while the page scrolls. */
    .forum-shell > .k-drawer-container {
        position: sticky;
        top: var(--forum-appbar-height);
        height: calc(100vh - var(--forum-appbar-height));
        flex: 0 0 auto;
        z-index: 1020;
    }

        .forum-shell > .k-drawer-container > .k-drawer {
            height: 100%;
            background-color: var(--kendo-color-app-surface, #fff);
            box-shadow: 1px 0 0 var(--kendo-color-border);
        }

.forum-shell .k-drawer-items {
    gap: 2px;
    padding: .75rem .5rem;
}

    /* Drawer.show()/hide() re-insert the template inside .k-drawer-items, nesting a second <ul>
       that would otherwise get Bootstrap's list indent. */
    .forum-shell .k-drawer-items ul {
        display: flex;
        flex-direction: column;
        gap: 2px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

.forum-shell .k-drawer-item {
    padding: 0;
    border-radius: var(--forum-radius);
}

    .forum-shell .k-drawer-item > .k-drawer-link {
        margin: 0;
        padding: .625rem .875rem;
        align-items: center;
        gap: .875rem;
        text-decoration: none;
        white-space: nowrap;
    }

    .forum-shell .k-drawer-item .k-icon {
        font-size: 18px;
    }

.forum-shell .k-drawer-separator {
    margin: .5rem .5rem;
    padding: 0;
}

/* Section heading in the expanded menu ("AI-assistent"); the icon rail shows a separator instead. */
.forum-shell .forum-drawer-heading {
    margin: .875rem .875rem .25rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--kendo-color-subtle);
    white-space: nowrap;
}

/* Collapsed (icon rail): centre the icons. */
.forum-shell .k-drawer-mini .k-drawer-item > .k-drawer-link {
    justify-content: center;
    padding-inline: 0;
}

/* Collapse / expand button (RenderMenu in _AdminLayout.cshtml), pinned to the bottom of the menu.
   The item lists are stretched to the drawer's height so margin-top: auto can push it down; on
   a short screen it sticks to the bottom while the entries scroll under it. */
.forum-shell .k-drawer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.forum-shell .k-drawer-items,
.forum-shell .k-drawer-items ul {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.forum-shell .forum-drawer-toggle {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding-top: .5rem;
    background-color: var(--kendo-color-app-surface, #fff);
    box-shadow: 0 -1px 0 var(--kendo-color-border);
}

.forum-drawer-toggle-btn {
    display: flex;
    align-items: center;
    gap: .875rem;
    width: 100%;
    padding: .625rem .875rem;
    border: 0;
    border-radius: var(--forum-radius);
    background: transparent;
    color: var(--kendo-color-subtle);
    font: inherit;
    font-size: .875rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

    .forum-drawer-toggle-btn svg {
        flex: 0 0 auto;
        transition: transform .2s ease;
    }

    .forum-drawer-toggle-btn:hover,
    .forum-drawer-toggle-btn:focus-visible {
        background-color: color-mix(in srgb, currentColor 9%, transparent);
        color: var(--kendo-color-on-app-surface, inherit);
    }

    /* The arrows nudge the way the menu will move. */
    .forum-drawer-toggle-btn:hover svg {
        transform: translateX(-2px);
    }

    .forum-drawer-toggle-btn:focus-visible {
        outline: 2px solid var(--kendo-color-primary);
        outline-offset: -2px;
    }

.forum-shell .k-drawer-mini .forum-drawer-toggle-btn {
    justify-content: center;
    padding-inline: 0;
}

    .forum-shell .k-drawer-mini .forum-drawer-toggle-btn:hover svg {
        transform: translateX(2px);
    }

@media (prefers-reduced-motion: reduce) {
    .forum-drawer-toggle-btn,
    .forum-drawer-toggle-btn svg {
        transition: none;
    }
}

/* ---- Page container ----------------------------------------------------------------------- */

.forum-page {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* ---- Cards and panels --------------------------------------------------------------------- */

.k-card {
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
}

.k-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
}

    .k-card-header h2,
    .k-card-header .k-card-title {
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
    }

.k-card-body {
    padding: 1.25rem;
}

/* Buttons in a card or page header: always on the right, secondary before primary. */
.forum-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-left: auto;
}

/* The white "panel" blocks used across the public and admin pages get the same card surface. */
.bg-white.shadow-sm,
.bg-white.shadow-lg {
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow) !important;
}

/* ---- Forms -------------------------------------------------------------------------------- */

.forum-page label:not(.k-checkbox-label):not(.k-radio-label) {
    font-weight: 500;
    margin-bottom: .25rem;
}

.forum-field > label {
    display: block;
}

/* Direct children only: a descendant selector would also stretch the pickers inside an
   Editor's toolbar (font, size, colour) to the full field width. */
.forum-field > .k-input,
.forum-field > .k-picker,
.forum-field > .k-colorpicker,
.forum-field > .k-editor,
.forum-field > .k-upload {
    width: 100%;
}

.field-validation-error,
.validation-summary-errors {
    color: var(--kendo-color-error);
    font-size: .875em;
}

    .validation-summary-errors ul {
        margin-bottom: .5rem;
        padding-left: 1.25rem;
    }

/* Check boxes that belong together sit on one line and wrap as a group. */
.forum-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem 1.5rem;
    min-height: calc(var(--kendo-spacing-2, .5rem) * 2 + 1.5rem);
}

    /* Each item is a box plus its label, kept together. */
    .forum-checkbox-group > span {
        display: inline-flex;
        align-items: center;
        gap: .375rem;
    }

    .forum-checkbox-group .k-checkbox-label {
        margin: 0;
        font-weight: 400;
    }

.forum-field-hint {
    display: block;
    margin-top: .375rem;
    font-size: .8125rem;
    color: var(--kendo-color-subtle);
}

/* Text boxes written as the Kendo TextBox's markup (no widget) get their invalid state from the
   inner input, where the validator puts it when there is no widget wrapper to decorate. */
.k-input:has(> .k-input-inner.k-invalid),
.k-input:has(> .k-input-inner.input-validation-error) {
    border-color: var(--kendo-color-error-on-surface);
}

/* ---- Widgets not yet initialised ------------------------------------------------------------
   Html.Kendo() helpers render a bare <input>/<textarea> and build the widget from script when
   the DOM is ready, so the browser paints the raw element first and the widget then replaces it
   at a different size. Until then the raw element is drawn as a placeholder of the widget's final
   size and shape. Kendo sets data-role on the element when it creates the widget - and moves it
   inside the widget's wrapper - so these rules stop matching at that exact moment: no timer. */

:root {
    --forum-control-height: calc(var(--kendo-font-size, 1rem) * var(--kendo-line-height, 1.5) + var(--kendo-spacing-1\.5, .375rem) * 2 + 2px);
    --forum-skeleton-fill: color-mix(in srgb, var(--kendo-color-subtle, #64748b) 18%, transparent);
}

/* :where() keeps this at the specificity of the per-widget rules below, so they can override it. */
.forum-field > :is(input, textarea):not([data-role]):where(:not([type=hidden], [type=checkbox])) {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: var(--forum-control-height);
    margin: 0;
    padding: 0;
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md);
    background: var(--kendo-color-surface-alt, #fff);
    color: transparent;
    resize: none;
    overflow: hidden;
    pointer-events: none;
    animation: k-skeleton-pulse 1.5s ease-in-out infinite;
}

/* A picker: a value bar and the arrow button. */
.forum-field > input[type=text]:not([data-role]) {
    background:
        linear-gradient(var(--forum-skeleton-fill) 0 0) .75rem 50% / 40% .75rem no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) right .75rem top 50% / .75rem .75rem no-repeat,
        var(--kendo-color-surface-alt, #fff);
}

/* Upload: the drop zone around its "Välj filer" button. */
.forum-field > input[type=file]:not([data-role]) {
    height: calc(var(--forum-control-height) + var(--kendo-spacing-2\.5, .625rem) * 2 + 2px);
    border-radius: var(--kendo-border-radius-xxl);
    background:
        linear-gradient(var(--forum-skeleton-fill) 0 0) var(--kendo-spacing-2\.5, .625rem) 50% / 7rem var(--forum-control-height) no-repeat,
        var(--kendo-color-surface-alt, #fff);
}

    .forum-field > input[type=file]:not([data-role])::file-selector-button {
        visibility: hidden;
    }

/* Editor: toolbar, its bottom rule, and the first lines of text. */
.forum-field > textarea:not([data-role]) {
    height: var(--forum-editor-height, 320px);
    border-radius: var(--kendo-border-radius-xxl);
    background:
        linear-gradient(var(--forum-skeleton-fill) 0 0) .625rem .625rem / 9.5rem var(--forum-control-height) no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) 10.625rem .625rem / 2.5rem var(--forum-control-height) no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) 13.625rem .625rem / 7rem var(--forum-control-height) no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) 21.125rem .625rem / 10rem var(--forum-control-height) no-repeat,
        linear-gradient(var(--kendo-color-border) 0 0) 0 calc(var(--forum-control-height) + 1.25rem) / 100% 1px no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) 1rem calc(var(--forum-control-height) + 2.5rem) / 55% .75rem no-repeat,
        linear-gradient(var(--forum-skeleton-fill) 0 0) 1rem calc(var(--forum-control-height) + 4rem) / 40% .75rem no-repeat,
        var(--kendo-color-surface-alt, #fff);
}

@media (prefers-reduced-motion: reduce) {
    .forum-field > :is(input, textarea):not([data-role]) {
        animation: none;
    }
}

/* ---- Compose form (Ställ en fråga / Nytt ärende) -------------------------------------------- */

.forum-compose .k-card-header {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: .875rem;
    padding: 1.25rem 1.5rem;
}

.forum-compose-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    color: var(--kendo-color-primary);
    background-color: color-mix(in srgb, var(--kendo-color-primary) 10%, transparent);
    font-size: 1.125rem;
}

.forum-compose-heading p {
    margin: .125rem 0 0;
    font-size: .875rem;
    color: var(--kendo-color-subtle);
}

.forum-compose .k-card-body {
    padding: 1.5rem;
}

/* Footer: consent on the left, send on the right. */
.forum-compose .forum-form-footer {
    padding: 1.125rem 1.5rem;
    flex-wrap: nowrap;
    background-color: color-mix(in srgb, var(--kendo-color-base-subtle, #f8fafc) 60%, var(--kendo-color-surface-alt, #fff));
}

.forum-compose .forum-consent {
    align-items: flex-start;
    gap: .75rem;
    /* Takes whatever width the send button leaves, so the sentence has room to run on one or
       two lines instead of being squeezed to its shortest wrap. */
    flex: 1 1 auto;
    min-width: 0;
}

    .forum-compose .forum-consent .k-checkbox {
        flex: none;
        margin-top: .125rem;
        cursor: pointer;
    }

.forum-consent-text {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.forum-compose .forum-consent .k-checkbox-label {
    /* The theme lays checkbox labels out as inline-flex, which turns the sentence and the
       "personuppgifter" link into two columns: on a phone the text wrapped down one narrow column
       with the link floating beside it. Plain inline text lets the link wrap with the sentence. */
    display: inline;
    font-size: .9375rem;
    line-height: 1.45;
    cursor: pointer;
}

    .forum-compose .forum-consent .k-checkbox-label a {
        color: var(--kendo-color-primary);
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 2px;
        white-space: nowrap;
    }

        .forum-compose .forum-consent .k-checkbox-label a .k-icon {
            font-size: .8125rem;
            margin-inline-start: .125rem;
            vertical-align: -1px;
        }

.forum-consent-hint {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    color: var(--kendo-color-subtle);
}

    .forum-consent-hint .k-icon {
        font-size: .875rem;
    }

/* Once the box is ticked the hint has done its job. */
.forum-consent:has(#IsAccept:checked) .forum-consent-hint {
    display: none;
}

.forum-compose .forum-submit {
    flex: none;
    min-width: 8.5rem;
    border-radius: 999px;
    transition: box-shadow .18s ease, transform .18s ease;
}

    .forum-compose .forum-submit:not(.k-disabled):hover {
        box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--kendo-color-primary) 60%, transparent);
        transform: translateY(-1px);
    }

@media (max-width: 575.98px) {
    .forum-compose .forum-form-footer {
        flex-wrap: wrap;
    }

    /* Consent on its own full-width row above the button. */
    .forum-compose .forum-consent {
        flex-basis: 100%;
    }

    .forum-compose .forum-submit {
        width: 100%;
    }
}

.forum-compose .forum-field > label {
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .375rem;
}

/* Replaces the old window-resize handler: sizing in CSS applies from the first paint. */
.forum-field-editor {
    --forum-editor-height: max(320px, 100vh - 600px);
}

    .forum-field-editor > .k-editor {
        height: var(--forum-editor-height);
        transition: border-color .15s ease, box-shadow .15s ease;
    }

        .forum-field-editor > .k-editor:focus-within {
            border-color: var(--kendo-color-primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--kendo-color-primary) 18%, transparent);
        }

        .forum-field-editor > .k-editor.k-invalid,
        .forum-field-editor > .k-editor:has(textarea.k-invalid) {
            border-color: var(--kendo-color-error-on-surface);
        }

        .forum-field-editor > .k-editor .k-editor-toolbar {
            background-color: var(--kendo-color-base-subtle, #f8fafc);
            border-radius: var(--kendo-border-radius-xxl) var(--kendo-border-radius-xxl) 0 0;
        }

/* The upload reads as a drop zone. */
.forum-compose .forum-field > .k-upload {
    border-style: dashed;
    transition: border-color .15s ease, background-color .15s ease;
}

    .forum-compose .forum-field > .k-upload:hover,
    .forum-compose .forum-field > .k-upload .k-dropzone-hovered {
        border-color: var(--kendo-color-primary);
        background-color: color-mix(in srgb, var(--kendo-color-primary) 4%, transparent);
    }

    .forum-compose .forum-field > .k-upload .k-dropzone-hint {
        text-align: start;
        margin-inline-start: .75rem;
        color: var(--kendo-color-subtle);
    }

/* ---- Ärende (post) cards and the reply thread ---------------------------------------------- */

.forum-post .k-card-header {
    gap: .5rem;
}

/* The thread title with its in-place editor (Admin/ViewPost): the heading and a small pencil,
   swapped for a text box with Spara / Avbryt while editing. */
.forum-title-edit {
    flex: 1 1 auto;
    min-width: 0;
}

    /* Kendo gives its buttons and inputs a display of their own, which would beat the hidden
       attribute the script toggles. */
    .forum-title-edit [hidden] {
        display: none !important;
    }

.forum-title-view {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
}

    .forum-title-view h2 {
        overflow-wrap: anywhere;
    }

.forum-title-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

    .forum-title-form .k-textbox {
        flex: 1 1 16rem;
    }

.forum-post-body {
    overflow-wrap: anywhere;
}

    /* !important because the Kendo editor writes the size into the image's own style when it is
       resized (style="width:600px;height:400px"). The inline height beats a normal rule, so on
       a narrow screen max-width made the image narrower but not shorter, and it was squashed. */
    .forum-post-body img {
        max-width: 100%;
        height: auto !important;
    }

    /* The editor puts images inside a <p>, which the 72ch cap above made as narrow as the text. */
    .forum-post-body > p:has(img) {
        max-width: none;
    }

    /* Tables from the editor carry pixel widths as well. */
    .forum-post-body table {
        max-width: 100%;
    }

/* A post built in the Unlayer page builder (Views/Shared/_PostBody.cshtml). post-design.js sets
   the height to the content, so the frame itself has no border or scrollbar. */
.forum-post-design {
    display: block;
    width: 100%;
    min-height: 3rem;
    border: 0;
}

/* The reply editor's label row, with the switch to the page builder on the right. */
.forum-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

    /* unlayer-editor.js swaps the two buttons with the hidden attribute, which Kendo's
       display:inline-flex on .k-button would otherwise override. */
    .forum-editor-head [hidden] {
        display: none !important;
    }

.forum-unlayer {
    height: 80vh;
    min-height: 600px;
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--forum-radius);
    overflow: hidden;
}

    .forum-post-body > *:last-child {
        margin-bottom: 0;
    }

.forum-post-contact {
    margin-top: .5rem;
    color: var(--kendo-color-subtle);
}

/* Author line / timestamps under a message. */
.forum-post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border-top: 1px solid var(--kendo-color-border);
    color: var(--kendo-color-subtle);
    font-size: .875rem;
}

.forum-post-author {
    display: flex;
    align-items: baseline;
    gap: .625rem;
    min-width: 0;
}

.forum-post-date {
    color: var(--kendo-color-subtle);
    font-size: .875rem;
    font-weight: 400;
}

/* ---- Public question and answers ------------------------------------------------------------ */

.forum-answers {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* An accent down the side marks a card as an answer without indenting it. */
.forum-answer {
    border-inline-start: 3px solid var(--kendo-color-primary);
}

.forum-answer-head {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.forum-answer-who {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

/* Author line under a question: avatar and name together on the left, date on the right. */
.forum-post-meta.forum-byline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
}

    .forum-byline .forum-post-date {
        margin-inline-start: auto;
    }

    /* The "base" avatar is near-white, which disappears on the card. */
    .forum-byline .k-avatar {
        background-color: var(--kendo-color-base-subtle, #e2e8f0);
        color: var(--kendo-color-subtle);
        font-weight: 600;
    }

.forum-badge-answer {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-inline-start: auto;
    padding: .125rem .5rem;
    border-radius: 999px;
    background-color: rgba(16, 122, 87, .12);
    background-color: color-mix(in srgb, var(--kendo-color-success) 14%, transparent);
    color: var(--kendo-color-success);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

    .forum-badge-answer .k-icon {
        font-size: 12px;
    }

/* The admin thread adds an edit button after the badge. The badge already claims the free space,
   so the button sits next to it rather than splitting the gap with it. */
.forum-answer-head .forum-actions {
    margin-inline-start: 0;
}

/* The bar on a preview (Admin/PreviewPost): everything under it is the real public thread, so
   this tab has to read as a draft at a glance and not as the live ärende. */
.forum-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-block-end: 1rem;
    padding: .625rem 1rem;
    border: 1px solid var(--kendo-color-warning, #f0ad4e);
    border-radius: var(--forum-radius);
    background-color: rgba(240, 173, 78, .14);
    background-color: color-mix(in srgb, var(--kendo-color-warning) 16%, transparent);
    font-size: .875rem;
}

    .forum-preview-bar .k-button {
        margin-inline-start: auto;
    }

/* A case opened from the personal link in the answer e-mail (Views/Post/ViewPost.cshtml). */
.forum-caselink-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    margin-block: 1rem;
    padding: .875rem 1.125rem;
    border: 1px solid color-mix(in srgb, var(--kendo-color-primary) 22%, transparent);
    border-radius: var(--forum-radius);
    background-color: color-mix(in srgb, var(--kendo-color-primary) 6%, var(--kendo-color-surface-alt, #fff));
    font-size: .9375rem;
}

.forum-caselink-bar-icon {
    color: var(--kendo-color-primary);
    font-size: 1.125rem;
}

.forum-caselink-bar-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 18rem;
}

    .forum-caselink-bar-text span {
        color: var(--kendo-color-subtle);
        font-size: .875rem;
    }

/* The answer the e-mail link points at is picked out briefly when the page opens on it. */
.forum-answer:target {
    scroll-margin-top: calc(var(--forum-appbar-height) + 1rem);
    animation: forum-answer-target 2.4s ease-out;
}

@keyframes forum-answer-target {
    0%, 35% {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--kendo-color-success, #16a34a) 45%, transparent);
    }

    100% {
        box-shadow: var(--forum-shadow);
    }
}

@media (prefers-reduced-motion: reduce) {
    .forum-answer:target {
        animation: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--kendo-color-success, #16a34a) 45%, transparent);
    }
}

/* File lists on a message. */
.forum-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem 1.25rem;
    margin: .875rem 0 0;
    padding: 0;
    list-style: none;
}

    .forum-attachments li {
        display: flex;
        align-items: center;
        gap: .375rem;
    }

/* Action bar at the bottom of a form card: supporting content left, primary button right. */
.forum-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--kendo-color-border);
    background-color: var(--kendo-color-base-subtle, #f8fafc);
    border-radius: 0 0 var(--forum-radius) var(--forum-radius);
}

.forum-consent {
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .forum-consent .k-checkbox-label {
        margin: 0;
        font-weight: 400;
    }

/* ---- Confirmation page (Post/Tack) ----------------------------------------------------------- */

.forum-confirm {
    max-width: 38rem;
    margin: 1.5rem auto 0;
}

.forum-confirm-card {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

    .forum-confirm-card h1 {
        font-size: 1.625rem;
        margin: 1.25rem 0 .5rem;
        letter-spacing: -.01em;
    }

.forum-confirm-lead {
    font-size: 1.0625rem;
    color: var(--kendo-color-subtle);
    margin: 0 auto 1.75rem;
    max-width: 30rem;
}

/* The check mark: a ring in the success colour that scales in once. */
.forum-confirm-mark {
    --forum-confirm-color: var(--kendo-color-success, #16a34a);
    --forum-confirm-ink: var(--kendo-color-success-on-surface, #15803d);
    /* The card is a flex column that stretches its items; the mark sits in the middle. */
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    color: var(--forum-confirm-ink);
    background-color: color-mix(in srgb, var(--forum-confirm-color) 12%, transparent);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--forum-confirm-color) 6%, transparent);
    animation: forum-confirm-pop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}

    .forum-confirm-mark .k-icon {
        font-size: 2rem;
    }

/* Meridian's warning is a light yellow; the icon uses its darker on-surface shade to be seen. */
.forum-confirm-mark-warning {
    --forum-confirm-color: var(--kendo-color-warning, #facc15);
    --forum-confirm-ink: var(--kendo-color-warning-on-surface, #a16207);
}

@keyframes forum-confirm-pop {
    from {
        transform: scale(.6);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ticket number: the one thing to keep, so it reads like a receipt stub. */
.forum-confirm-ticket {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1rem .875rem 1.25rem;
    border: 1px dashed var(--kendo-color-border);
    border-radius: var(--forum-radius);
    background-color: var(--kendo-color-base-subtle, #f8fafc);
    text-align: start;
}

.forum-confirm-ticket-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kendo-color-subtle);
}

.forum-confirm-ticket-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

    .forum-confirm-ticket-number::before {
        content: "#";
        color: var(--kendo-color-subtle);
        font-weight: 500;
        margin-inline-end: .125rem;
    }

.forum-confirm-hint {
    margin: .5rem 0 2rem;
    font-size: .8125rem;
    color: var(--kendo-color-subtle);
    text-align: start;
}

.forum-confirm-subhead {
    font-size: 1rem;
    margin: 0 0 .75rem;
    text-align: start;
}

/* What happens next: a short vertical timeline. */
.forum-confirm-steps {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    text-align: start;
}

    .forum-confirm-steps li {
        position: relative;
        display: flex;
        gap: .875rem;
        padding-bottom: 1rem;
        font-size: .9375rem;
        color: var(--kendo-color-subtle);
        line-height: 1.5;
    }

        .forum-confirm-steps li:last-child {
            padding-bottom: 0;
        }

        /* The line joining the steps. */
        .forum-confirm-steps li:not(:last-child)::before {
            content: "";
            position: absolute;
            left: 1rem;
            top: 2.25rem;
            bottom: .25rem;
            width: 2px;
            transform: translateX(-50%);
            background-color: var(--kendo-color-border);
        }

        .forum-confirm-steps li b {
            color: var(--kendo-color-on-app-surface);
            font-weight: 600;
        }

.forum-confirm-step-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--kendo-color-border);
    background-color: var(--kendo-color-surface-alt, #fff);
    color: var(--kendo-color-subtle);
}

.forum-confirm-steps li.is-done .forum-confirm-step-icon {
    border-color: transparent;
    background-color: var(--kendo-color-success, #16a34a);
    color: #fff;
}

.forum-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--kendo-color-border);
}

@media (max-width: 575.98px) {
    .forum-confirm-card {
        padding: 2rem 1.25rem 1.5rem;
    }

    .forum-confirm-actions .k-button {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .forum-confirm-mark {
        animation: none;
    }
}

/* Access denied (Account/AccessDenied): the signed-in account, in the ticket stub's frame. */
.forum-denied-account {
    margin-bottom: 1.75rem;
    min-width: 0;
}

    .forum-denied-account > div {
        min-width: 0;
    }

.forum-denied-account-name {
    display: block;
    font-weight: 600;
}

.forum-denied-account-email {
    display: block;
    color: var(--kendo-color-subtle);
    overflow-wrap: anywhere;
}

/* ---- Landing page: the ask field ------------------------------------------------------------

   The first thing anyone sees, and the page's one designed object. Everything around it is kept
   deliberately quiet - the headline is smaller than a hero headline usually is - so the field is
   what the eye lands on.

   The accent is #1AB7EA, the cyan of the arcMember figure in the logo, and it is used as light:
   the spark, the caret, the edge of the field when it has focus. It never fills a shape. */

:root {
    --forum-ask-accent: #1ab7ea;
    --forum-ask-accent-ink: #0b7fa8; /* the same cyan, dark enough to read as text on white */
    --forum-ask-ink: #1d2436;
}

.forum-hero {
    text-align: center;
    padding-block: 2rem 1.75rem;
}

    .forum-hero h1 {
        max-width: 22ch;
        margin-inline: auto;
        margin-bottom: .5rem;
        color: var(--forum-ask-ink);
        font-size: clamp(1.625rem, 1.15rem + 1.9vw, 2.375rem);
        font-weight: 700;
        letter-spacing: -.021em;
        line-height: 1.15;
    }

    .forum-hero p {
        max-width: 54ch;
        margin-inline: auto;
        margin-bottom: 1.5rem;
        color: var(--kendo-color-subtle);
        line-height: 1.55;
    }

.forum-ask {
    max-width: 720px;
    margin-inline: auto;
    text-align: start;
}

/* ---- The field ------------------------------------------------------------------------------ */

.forum-ask-field {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .375rem .375rem .375rem .875rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 14px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.forum-ask-lead .forum-ask-field {
    gap: .75rem;
    padding: .5rem .5rem .5rem 1.125rem;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -18px rgba(29, 36, 54, .45);
}

/* Focus is the moment the field becomes the assistant's, so it takes the brand cyan and a ring
   of the same colour at low opacity rather than the browser's default outline. */
.forum-ask-field:focus-within {
    border-color: var(--forum-ask-accent);
    box-shadow: 0 0 0 4px rgba(26, 183, 234, .16);
}

.forum-ask-spark {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--forum-ask-accent);
    font-size: 1.125rem;
}

/* Twinkles only while the placeholder is typing itself; once anyone touches the field, the class
   comes off and the page is still. */
.forum-ask-field.is-typing .forum-ask-spark {
    animation: forum-ask-twinkle 2.4s ease-in-out infinite;
}

@keyframes forum-ask-twinkle {
    0%, 70%, 100% { opacity: 1; transform: scale(1); }
    82% { opacity: .55; transform: scale(.88) rotate(-12deg); }
}

.forum-ask-input {
    flex: 1 1 auto;
    min-width: 0;
    padding-block: .625rem;
    border: 0;
    background: none;
    color: var(--forum-ask-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    caret-color: var(--forum-ask-accent);
}

.forum-ask-lead .forum-ask-input {
    padding-block: .75rem;
    font-size: 1.0625rem;
}

    .forum-ask-input::placeholder {
        color: #8a94a6;
        font-weight: 400;
    }

    .forum-ask-input:focus {
        outline: none;
    }

/* ---- The two ways out of the field ---------------------------------------------------------- */

/* Quiet until there is a question to ask: the button fills in on the first character typed. */
.forum-ask-go {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .4375rem;
    padding: .625rem 1.125rem;
    border: 0;
    border-radius: 10px;
    background-color: #eef1f6;
    color: #6b7488;
    font: inherit;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

    .forum-ask-go.is-ready {
        background-color: var(--forum-ask-ink);
        color: #fff;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .2), 0 8px 18px -10px rgba(29, 36, 54, .6);
    }

        .forum-ask-go.is-ready .k-icon {
            color: var(--forum-ask-accent);
        }

    .forum-ask-go:hover.is-ready {
        background-color: #121833;
    }

    .forum-ask-go:focus-visible {
        outline: 2px solid var(--forum-ask-accent);
        outline-offset: 2px;
    }

.forum-ask-lead .forum-ask-go {
    padding: .75rem 1.25rem;
    border-radius: 12px;
}

/* The row under the field: examples on the left, the keyword search on the right. */
.forum-ask-under {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
}

    /* Without the examples this row is one quiet link, so it keeps close to the field rather
       than floating between it and whatever the page puts underneath. */
    .forum-ask:not(.forum-ask-lead) .forum-ask-under {
        margin-top: .375rem;
    }

.forum-ask-try {
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
}

.forum-ask-example {
    padding: .3125rem .75rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 999px;
    background-color: #fff;
    color: var(--forum-ask-ink);
    font-size: .8125rem;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

    .forum-ask-example:hover,
    .forum-ask-example:focus-visible {
        border-color: var(--forum-ask-accent);
        color: var(--forum-ask-accent-ink);
        background-color: rgba(26, 183, 234, .06);
    }

    /* Colour alone is not enough to show where the keyboard is. */
    .forum-ask-example:focus-visible {
        outline: 2px solid var(--forum-ask-accent);
        outline-offset: 2px;
    }

/* The keyword search: available, never competing. */
.forum-ask-plain {
    margin-inline-start: auto;
    padding: .3125rem 0;
    border: 0;
    background: none;
    color: var(--kendo-color-subtle);
    font: inherit;
    font-size: .8125rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(107, 116, 136, .4);
    cursor: pointer;
}

    .forum-ask-plain:hover,
    .forum-ask-plain:focus-visible {
        color: var(--forum-ask-ink);
        text-decoration-color: currentColor;
    }

    .forum-ask-plain:focus-visible {
        outline: 2px solid var(--forum-ask-accent);
        outline-offset: 3px;
        border-radius: 4px;
    }

/* On a narrow screen the button drops below the question it sends. The spark stays beside the
   text where it belongs - given a row of its own it reads as a stray graphic. */
@media (max-width: 576px) {
    .forum-ask-field {
        flex-wrap: wrap;
    }

    .forum-ask-spark {
        order: 1;
    }

    .forum-ask-input {
        order: 2;
    }

    .forum-ask-go {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
    }

    .forum-ask-plain {
        margin-inline-start: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .forum-ask-field.is-typing .forum-ask-spark {
        animation: none;
    }
}


/* The CTA in the app bar keeps its solid colour, so it should not pick up the menu text colour. */
.forum-appbar .forum-nav-cta {
    color: var(--kendo-color-on-primary, #fff) !important;
}

/* The one filled control in the bar, so it carries the weight: a pill with a faint top highlight
   and a shadow tinted with its own colour, which lifts on hover. background-image rather than
   background-color, so it wins over the Kendo solid-button fill without !important. */
.forum-appbar .forum-nav .forum-nav-cta {
    border: 0;
    padding-inline: 1.125rem;
    font-weight: 600;
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--kendo-color-primary, #2b3467) 88%, #fff) 0%, var(--kendo-color-primary, #2b3467) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(16, 24, 40, .16), 0 6px 14px -6px color-mix(in srgb, var(--kendo-color-primary, #2b3467) 55%, transparent);
}

    .forum-appbar .forum-nav .forum-nav-cta .k-button-icon {
        opacity: .9;
    }

    .forum-appbar .forum-nav .forum-nav-cta:hover,
    .forum-appbar .forum-nav .forum-nav-cta:focus-visible {
        transform: translateY(-1px);
        background-image: linear-gradient(180deg, color-mix(in srgb, var(--kendo-color-primary, #2b3467) 80%, #fff) 0%, color-mix(in srgb, var(--kendo-color-primary, #2b3467) 94%, #fff) 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 4px rgba(16, 24, 40, .16), 0 10px 20px -8px color-mix(in srgb, var(--kendo-color-primary, #2b3467) 65%, transparent);
    }

    .forum-appbar .forum-nav .forum-nav-cta:active {
        transform: translateY(0);
        box-shadow: inset 0 1px 2px rgba(16, 24, 40, .25);
    }

    .forum-appbar .forum-nav .forum-nav-cta:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--kendo-color-primary, #2b3467) 30%, transparent), 0 6px 14px -6px color-mix(in srgb, var(--kendo-color-primary, #2b3467) 55%, transparent);
    }

/* Marks the section being viewed with a tinted pill. */
.forum-appbar .forum-nav .k-button.forum-nav-current {
    /* Beats the theme's "background: none !important" on flat buttons. */
    background-color: color-mix(in srgb, currentColor 9%, transparent) !important;
    font-weight: 600;
}

    .forum-appbar .forum-nav .forum-nav-current .k-button-icon {
        opacity: 1;
    }

/* Hairline between the navigation links and the call to action. */
.forum-nav-divider {
    width: 1px;
    height: 20px;
    margin-inline: .625rem;
    border-radius: 1px;
    background-color: color-mix(in srgb, currentColor 20%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .forum-appbar .forum-nav .k-button {
        transition: none;
    }

        .forum-appbar .forum-nav .forum-nav-cta:hover,
        .forum-appbar .forum-nav .forum-nav-cta:focus-visible {
            transform: none;
        }
}

@media (max-width: 767.98px) {
    .forum-appbar .forum-nav-cta .k-button-text {
        display: none;
    }
}

/* ---- Tab strip ------------------------------------------------------------------------------ */

/* Flat tabs: the cards inside provide the surfaces, so the strip itself stays transparent. */
.forum-tabs.k-tabstrip {
    background: none;
    border: 0;
}

    .forum-tabs.k-tabstrip > .k-tabstrip-content {
        padding: 0;
        border: 0;
        background: none;
    }

/* A one-tab strip is only a label - hide the tab row. */
.forum-tabs-single > .k-tabstrip-items-wrapper {
    display: none;
}

/* ---- Category cards on the landing page ------------------------------------------------------ */

/* driveway's panel clips its content, which cut off the card's hover shadow. */
.dw-panel__content:has(> .forum-category) {
    overflow: visible;
}

/* No transform on hover: the cards sit in CSS columns, and a transformed box there gets clipped at
   the column edge. Border and shadow alone carry the hover state. */
.forum-category {
    position: relative;
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}

    /* Accent strip along the top edge, drawn in on hover. */
    .forum-category::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 3px;
        background-color: var(--kendo-color-primary);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .25s ease;
    }

    .forum-category:hover {
        border-color: color-mix(in srgb, var(--kendo-color-primary) 35%, var(--kendo-color-border));
        box-shadow: var(--forum-shadow-raised);
    }

        .forum-category:hover::before {
            transform: scaleX(1);
        }

.forum-category-head {
    padding-bottom: .25rem;
}

.forum-category-title {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.35;
    margin: 0;
}

/* Rows of links with a chevron: category cards, category listings and search results. */
.forum-category-list,
.forum-linklist {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
}

.forum-linklist {
    margin-top: 0;
}

    .forum-category-list a,
    .forum-linklist a {
        display: flex;
        align-items: center;
        gap: .625rem;
        padding: .5rem;
        margin-inline: -.5rem;
        border-radius: var(--forum-radius);
        color: inherit;
        text-decoration: none;
        transition: background-color .15s ease;
    }

        .forum-category-list a:hover,
        .forum-category-list a:focus-visible,
        .forum-linklist a:hover,
        .forum-linklist a:focus-visible {
            background-color: var(--kendo-color-base-subtle, #f1f5f9);
        }

.forum-category-question {
    flex: 1 1 auto;
    min-width: 0;
}

/* Rows read as plain text until hovered, then the title takes the link colour. */
.forum-category-list a:hover .forum-category-question,
.forum-category-list a:focus-visible .forum-category-question,
.forum-linklist a:hover .forum-linklist-title,
.forum-linklist a:focus-visible .forum-linklist-title {
    color: var(--kendo-color-primary);
}

.forum-linklist-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}

.forum-linklist li + li {
    border-top: 1px solid var(--kendo-color-border);
}

/* ---- Search results ------------------------------------------------------------------------

   These sit directly under the AI answer and are the posts it reads from, so they are built to
   be scanned rather than read: where the post lives, when it was written, the question, and two
   lines of the answer. Several posts share near-identical titles ("Hur registrerar jag en ny
   gåva?"), which is exactly why the category and date lead each row.

   Rows separate by space rather than by rules. Hairlines between every row made the list read as
   a table of records; a support answer is a thing you pick, so each one is its own target. */

.forum-results {
    list-style: none;
    display: grid;
    gap: .125rem;
    margin: 0;
    padding: 0;
}

.forum-result-link {
    position: relative;
    display: grid;
    gap: .1875rem;
    padding: .75rem 1rem .75rem 1.125rem;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background-color .15s ease;
}

/* The row's one moving part: a rail in the brand cyan, which grows out of the left edge under
   the pointer. It is also what marks a post the answer above actually used, resting at half
   strength so those rows can be picked out of the list at a glance. */
.forum-result-link::before {
    content: "";
    position: absolute;
    inset-block: .75rem;
    inset-inline-start: 0;
    width: 2px;
    border-radius: 2px;
    background-color: var(--forum-ask-accent, #1ab7ea);
    opacity: 0;
    transform: scaleY(.35);
    transition: opacity .15s ease, transform .15s ease;
}

.forum-result.is-cited .forum-result-link::before {
    opacity: .55;
    transform: scaleY(1);
}

.forum-result-link:hover,
.forum-result-link:focus-visible {
    background-color: rgba(26, 183, 234, .06);
    outline: none;
}

    .forum-result-link:hover::before,
    .forum-result-link:focus-visible::before {
        opacity: 1;
        transform: scaleY(1);
    }

    .forum-result-link:focus-visible {
        box-shadow: 0 0 0 2px var(--forum-ask-accent, #1ab7ea);
    }

/* Where it lives, when it was written, and whether the answer used it. */
.forum-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    line-height: 1.4;
}

.forum-result-category {
    padding: .0625rem .5rem;
    border-radius: 999px;
    background-color: #eef2f7;
    color: #55607a;
    font-weight: 500;
}

.forum-result-date {
    color: var(--kendo-color-subtle);
    font-variant-numeric: tabular-nums;
}

.forum-result-cited {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .0625rem .5rem;
    border-radius: 999px;
    background-color: rgba(26, 183, 234, .12);
    color: var(--forum-ask-accent-ink, #0b7fa8);
    font-weight: 600;
}

    .forum-result-cited .k-icon {
        font-size: 12px;
    }

.forum-result-title {
    color: var(--forum-ask-ink, #1d2436);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.forum-result-link:hover .forum-result-title,
.forum-result-link:focus-visible .forum-result-title {
    color: var(--forum-ask-accent-ink, #0b7fa8);
}

/* Two lines of the answer: enough to tell whether this is the right post, never enough to
   turn the list into a wall of text. */
.forum-result-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90ch;
    color: var(--kendo-color-subtle);
    font-size: .875rem;
    line-height: 1.5;
}

/* The searched term, in the accent rather than the highlighter yellow it used to be.

   The breathing room around the word is drawn with a shadow rather than padding: padding is
   layout, so it pushed the following character away and left "en gåva ?" with a gap before the
   question mark. A shadow paints outside the box and moves nothing. */
.forum-results mark {
    padding: 0;
    border-radius: 2px;
    background-color: rgba(26, 183, 234, .18);
    box-shadow: 0 0 0 .13em rgba(26, 183, 234, .18);
    color: inherit;
}

/* Count beside a card title. */
.forum-result-count {
    padding: .125rem .5rem;
    border-radius: 999px;
    background-color: #eef2f7;
    color: #55607a;
    font-size: .75rem;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .forum-result-link,
    .forum-result-link::before {
        transition: none;
    }
}

.forum-empty {
    color: var(--kendo-color-subtle);
    margin: 0;
}

.forum-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2rem 1rem;
    text-align: center;
}

    .forum-empty-state .k-icon {
        font-size: 32px;
        opacity: .6;
    }

    .forum-empty-state p {
        margin: 0;
    }

/* The chevron appears on hover so the resting card stays calm. */
.forum-category-chevron {
    flex: 0 0 auto;
    color: var(--kendo-color-subtle);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

.forum-category-list a:hover .forum-category-chevron,
.forum-category-list a:focus-visible .forum-category-chevron {
    opacity: 1;
    transform: translateX(0);
}

.forum-category-more {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-top: .5rem;
    padding-top: .75rem;
    border-top: 1px solid var(--kendo-color-border);
    width: 100%;
    color: var(--kendo-color-primary);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: gap .15s ease;
}

    .forum-category-more:hover {
        gap: .625rem;
    }

/* The arrow and chevron glyphs are drawn high inside their em box, so centring the boxes still
   leaves them looking raised next to the text. One pixel down lines the ink up. */
.forum-category-more .k-icon,
.forum-category-chevron {
    position: relative;
    top: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .forum-category,
    .forum-category::before,
    .forum-category-chevron,
    .forum-category-more {
        transition: none;
    }
}

/* ---- Grids -------------------------------------------------------------------------------- */

.k-grid {
    border-radius: var(--forum-radius);
    overflow: hidden;
}

.k-card > .k-grid,
.k-card-body > .k-grid {
    border-radius: 0 0 var(--forum-radius) var(--forum-radius);
}

/* ---- AI assistant launcher ----------------------------------------------------------------- */

/* A pill that rests as a circle in the bottom corner and widens to reveal its label on hover
   or keyboard focus. */
.forum-assistant {
    position: fixed;
    inset-block-end: 1.5rem;
    inset-inline-end: 1.5rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    /* No gap: collapsed, the button must be exactly as wide as it is tall (12 + 32 + 12 = 56)
       so it reads as a circle. The label supplies its own spacing when it expands. */
    height: 56px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background-color: var(--kendo-color-primary);
    color: var(--kendo-color-on-primary, #fff);
    box-shadow: 0 6px 16px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .12);
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

    .forum-assistant:hover {
        background-color: var(--kendo-color-primary-hover, var(--kendo-color-primary));
        box-shadow: 0 10px 24px rgba(16, 24, 40, .22), 0 3px 8px rgba(16, 24, 40, .14);
        transform: translateY(-2px);
    }

    .forum-assistant:active {
        transform: translateY(0);
    }

    .forum-assistant:focus-visible {
        outline: 2px solid var(--kendo-color-on-primary, #fff);
        outline-offset: -5px;
    }

.forum-assistant-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

    .forum-assistant-icon img {
        width: 30px;
        height: 30px;
    }

/* Small sparkle marking this as the AI assistant. */
/* Stays within the circle: the sparkle is white, so any part that overhangs the edge
   disappears against the page. */
.forum-assistant-spark {
    position: absolute;
    top: -3px;
    inset-inline-end: -3px;
    font-size: 12px;
    color: var(--kendo-color-on-primary, #fff);
}

/* The label is collapsed until the button is hovered or focused. */
.forum-assistant-text {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 500;
    opacity: 0;
    transition: max-width .25s ease, opacity .2s ease;
}

.forum-assistant:hover .forum-assistant-text,
.forum-assistant:focus-visible .forum-assistant-text {
    max-width: 200px;
    opacity: 1;
    padding-inline: .625rem .25rem;
}

@media (prefers-reduced-motion: reduce) {
    .forum-assistant,
    .forum-assistant-text {
        transition: none;
    }

    .forum-assistant:hover {
        transform: none;
    }
}

@media print {
    .forum-assistant {
        display: none;
    }
}

/* ---- AI assistant page ---------------------------------------------------------------------- */

/* The card fills the viewport and only the transcript scrolls inside it, so the header (with the
   thinking indicator) and the message box stay put however long the conversation gets. The page
   used to grow instead, pushing both out of view - exactly when an answer was being waited for. */
.forum-chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--forum-appbar-height) - 4.5rem);
    min-height: 460px;
}

.forum-chat-body {
    flex: 1 1 auto;
    min-height: 0;
}

#chatBox {
    flex: 1 1 auto;
    min-height: 0;
}

.forum-chat-head {
    gap: .875rem;
}

.forum-chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--kendo-color-primary);
}

    .forum-chat-avatar img {
        width: 26px;
        height: 26px;
    }

.forum-chat-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .forum-chat-titles h2 {
        font-size: 1.125rem;
        margin: 0;
    }

.forum-chat-sub {
    color: var(--kendo-color-subtle);
    font-size: .875rem;
}

/* "Thinking" pill in the header - the one place the wait is reported, so it takes the accent
   the rest of the assistant is drawn in. */
.forum-chat-status {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-inline-start: auto;
    padding: .25rem .625rem;
    border-radius: 999px;
    background-color: rgba(26, 183, 234, .12);
    color: var(--forum-ask-accent-ink, #0b7fa8);
    font-size: .8125rem;
    font-weight: 500;
}

.forum-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: forum-pulse 1.2s ease-in-out infinite;
}

@keyframes forum-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.75); }
}

.forum-chat-body {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .75rem;
}

/* Starter questions. */
.forum-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.forum-chat-suggestions-label {
    color: var(--kendo-color-subtle);
    font-size: .875rem;
}

.forum-chip {
    padding: .375rem .75rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 999px;
    background-color: var(--kendo-color-app-surface, #fff);
    color: inherit;
    font-size: .875rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

    .forum-chip:hover,
    .forum-chip:focus-visible {
        background-color: var(--kendo-color-base-subtle, #f1f5f9);
        border-color: var(--kendo-color-primary);
    }

/* ---- The transcript --------------------------------------------------------------------------

   Only one side of the conversation is a bubble.

   The visitor's messages are short and belong to them, so they keep a bubble: filled, on the
   right, with the corner nearest them squared off. The assistant's replies are not remarks - they
   are numbered steps, lists and sources, often twenty lines of them - so they are set on the
   surface itself with no border, no fill and no shadow, the full width of the panel. Boxing that
   in a card gave the answer a second frame inside a page that is already a card, and pushed the
   text into a column narrow enough to break the steps over three lines each. */

#chat .k-message-group {
    max-width: 100%;
}

#chat .k-message-group-sender {
    max-width: 72%;
}

/* The assistant: no bubble at all. Both boxes have to be cleared - Kendo paints the fill on
   .k-chat-bubble and this file used to put a border and a shadow on .k-message. */
#chat .k-message-group-receiver .k-message,
#chat .k-message-group-receiver .k-chat-bubble {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

    /* Kendo puts the bubble's padding on .k-chat-bubble, not on .k-bubble-content. With no bubble
       left to sit inside, all of it goes: the inline padding indented the answer from its own
       column, and the block padding pushed the first line 12px below the avatar beside it. */
    #chat .k-message-group-receiver .k-chat-bubble,
    #chat .k-message-group-receiver .k-bubble-content {
        padding: 0;
    }

    /* An answer is a block of the page, not a shrink-to-fit bubble, so its column is the full
       width left over beside the avatar however short the reply happens to be. */
    #chat .k-message-group-receiver {
        width: 100%;
        /* Kendo's 8px left the mark almost touching the first word once the bubble padding
           that used to separate them was gone. */
        gap: .75rem;
    }

        #chat .k-message-group-receiver .k-message-group-content {
            flex: 1 1 auto;
            min-width: 0;
        }

    /* The bubble used to cap the line length by being narrow. Without it the text would run the
       full width of the panel - 150-odd characters on a wide screen - so the cap is set here
       instead, on the prose itself. */
    #chat .k-message-group-receiver .ai-answer > p,
    #chat .k-message-group-receiver .ai-answer > ul,
    #chat .k-message-group-receiver .ai-answer > ol {
        max-width: 72ch;
    }

/* The visitor: a filled bubble, squared at the corner it is spoken from. */
#chat .k-message-group-sender .k-chat-bubble {
    border: 0;
    border-radius: 16px 16px 4px 16px;
    background-color: var(--forum-ask-ink, #1d2436);
    color: #fff;
}

    #chat .k-message-group-sender .k-chat-bubble-text {
        color: inherit;
    }

/* No name labels over either side. The visitor's own name is never set, so that span was an
   empty line of leading above every message of theirs; and "AI" over every answer only repeated
   what the avatar beside it and the panel header already say. Dropping it also lets the avatar
   line up with the first line of the answer instead of floating in the gap above it. */
#chat .k-message-author {
    display: none;
}

/* On a phone the avatar column and its gap cost 40 of about 350 usable pixels, which a six-step
   answer needs more than the conversation needs a repeated mark. The "AI" label stays. */
@media (max-width: 575.98px) {
    #chat .k-message-group-receiver .k-avatar {
        display: none;
    }

    #chat .k-message-group-sender {
        max-width: 85%;
    }
}

/* The assistant's mark in the transcript, on a disc of its own colour so it reads as an identity
   rather than a loose graphic.

   The size is pinned on every axis. Width alone left Kendo's own sizing to win on the flex axis,
   which drew the disc 32 wide by 30 tall - an oval with the mark sitting off-centre in it. */
#chat .k-avatar {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 30px;
    /* Kendo drops the avatar 18px to clear the author label that used to sit above the bubble.
       With no label there, that offset just left it hanging below the line it belongs to. */
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(26, 183, 234, .12);
    overflow: hidden;
}

    #chat .k-avatar .k-avatar-image {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        line-height: 0;
    }

    #chat .k-avatar img {
        width: 18px;
        height: 18px;
    }

/* The answer wrapper. A block of its own, so paragraphs and lists stack normally no matter what
   Kendo renders around it (.k-message-group is a row flex container). */
.ai-answer {
    display: block;
    width: 100%;
}

/* Typography inside an answer: clear separation between paragraphs and list items, so a long
   reply is easy to skim and a short one does not look sparse. */
.ai-answer p {
    margin-block: .625rem;
}

    .ai-answer p:first-child {
        margin-top: 0;
    }

    .ai-answer p:last-child {
        margin-bottom: 0;
    }

.ai-answer ol,
.ai-answer ul {
    margin-block: .625rem;
    padding-inline-start: 1.5rem;
}

.ai-answer li {
    margin-block: .375rem;
}

    .ai-answer li::marker {
        color: var(--kendo-color-subtle);
    }

.ai-answer strong {
    font-weight: 600;
}

/* Source references, lifted out of the closing sentence into chips. */
.ai-sources {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    margin-top: .75rem;
    padding-top: .625rem;
    border-top: 1px solid var(--kendo-color-border);
}

.ai-sources-label {
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
}

/* #chat raises the specificity over the Chat's own link styling, which underlines links. */
#chat .ai-source,
.ai-source {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .125rem .625rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 999px;
    color: var(--kendo-color-primary);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

    .ai-source:hover,
    .ai-source:focus-visible {
        border-color: var(--kendo-color-primary);
        background-color: var(--kendo-color-base-subtle, #f1f5f9);
    }

/* Under a finished answer: "Osäkert svar" and the thumbs. Quiet, so the answer stays the focus. */
.ai-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-top: .625rem;
    font-size: .8125rem;
    color: var(--kendo-color-subtle);
}

.ai-uncertain {
    padding: .0625rem .5rem;
    border-radius: 999px;
    background-color: var(--kendo-color-warning-subtle, #fff4e0);
    color: var(--kendo-color-warning-on-subtle, #8a5a00);
    font-weight: 500;
}

.ai-feedback {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.ai-feedback-label {
    margin-inline-end: .25rem;
}

.ai-feedback-btn {
    min-width: 2rem;
    padding: .125rem .375rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: 999px;
    background: transparent;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

    .ai-feedback-btn:hover:not(:disabled),
    .ai-feedback-btn:focus-visible {
        border-color: var(--kendo-color-primary);
    }

    .ai-feedback-btn:disabled {
        cursor: default;
        opacity: .45;
    }

    .ai-feedback-btn[aria-pressed="true"] {
        opacity: 1;
        border-color: var(--kendo-color-primary);
        background-color: var(--kendo-color-base-subtle, #f1f5f9);
    }

.ai-feedback-followup {
    margin-top: .5rem;
    font-size: .875rem;
}

    .ai-feedback-followup p {
        margin-block: .25rem;
    }

.ai-feedback-comment {
    display: flex;
    gap: .5rem;
    max-width: 32rem;
}

    .ai-feedback-comment .k-textbox {
        flex: 1;
    }

/* The way forward when the assistant cannot answer, or after a thumbs-down. */
#chat .ai-escalate-button,
.ai-escalate-button {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: var(--kendo-border-radius-md, 4px);
    background-color: var(--kendo-color-primary);
    color: var(--kendo-color-on-primary, #fff);
    font-weight: 500;
    text-decoration: none;
}

    .ai-escalate-button:hover,
    .ai-escalate-button:focus-visible {
        filter: brightness(.95);
        color: var(--kendo-color-on-primary, #fff);
    }

.ai-escalate ul {
    margin-block: .375rem .625rem;
}

/* "Liknande frågor" under the AddPost title and "Relaterade trådar" under a public thread:
   existing answers, found without the chat model. */
.forum-similar {
    margin-top: .5rem;
    padding: .5rem .75rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md, 4px);
    background-color: var(--kendo-color-base-subtle, #f8fafc);
    font-size: .875rem;
}

.forum-similar-label {
    margin: 0 0 .25rem;
    font-weight: 500;
}

.forum-similar ul,
.forum-related-list {
    margin: 0;
    padding-inline-start: 1.25rem;
}

    .forum-similar li,
    .forum-related-list li {
        margin-block: .25rem;
    }

.forum-similar a,
.forum-related-list a {
    color: var(--kendo-color-primary);
}

.forum-similar-category {
    margin-inline-start: .5rem;
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
}

.forum-related-title {
    margin: 0;
    font-size: 1.0625rem;
}

/* A clarifying question's options: the same chips as the chat's starter questions. */
.ai-clarify-options {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-top: .5rem;
}

    .ai-followup .ai-clarify-options {
        margin-bottom: .5rem;
    }

/* After a first miss the visitor is invited to rephrase; the way to a person is there, but quiet. */
.ai-ask-us-soft {
    color: var(--kendo-color-subtle);
    font-size: .875rem;
}

    .ai-ask-us-soft a {
        color: var(--kendo-color-primary);
    }

/* Three dots where the answer is about to appear. In the assistant's own cyan rather than the
   surrounding text colour: it is the only thing on screen at that moment, and grey dots on a
   grey line read as something failing to load rather than an answer being written. */
.ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-block: 6px;
}

    .ai-typing > span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background-color: var(--forum-ask-accent, #1ab7ea);
        opacity: .5;
        animation: forum-typing 1.1s ease-in-out infinite;
    }

        .ai-typing > span:nth-child(2) {
            animation-delay: .18s;
        }

        .ai-typing > span:nth-child(3) {
            animation-delay: .36s;
        }

@keyframes forum-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .forum-chat-status-dot,
    .ai-typing > span {
        animation: none;
    }
}

/* ---- AI answer card (above the search results) ---------------------------------------------- */

/* Sits between the search box and the keyword hits, so it has to read as an answer rather than as
   one more result: its own faintly tinted surface and a hairline of the primary colour along the
   top. Both are mixed from the theme token, so the card follows whatever colour the company has
   configured instead of introducing a second accent. */
.forum-ai-card {
    position: relative;
    margin-block: 1rem;
    padding: 1rem 1.125rem;
    border: 1px solid color-mix(in srgb, var(--kendo-color-primary, #2b3467) 20%, var(--kendo-color-border, #e2e8f0));
    border-radius: var(--forum-radius);
    background-color: var(--kendo-color-app-surface, #fff);
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--kendo-color-primary, #2b3467) 5%, #fff) 0%, var(--kendo-color-app-surface, #fff) 64%);
    box-shadow: var(--forum-shadow);
    overflow: hidden;
}

    .forum-ai-card::before {
        content: "";
        position: absolute;
        inset-block-start: 0;
        inset-inline: 0;
        height: 2px;
        background-image: linear-gradient(90deg, var(--kendo-color-primary, #2b3467) 0%, color-mix(in srgb, var(--kendo-color-primary, #2b3467) 20%, transparent) 100%);
    }

.forum-ai-head {
    display: flex;
    align-items: center;
    gap: .625rem;
}

.forum-ai-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--kendo-color-primary, #2b3467) 12%, transparent);
    color: var(--kendo-color-primary, #2b3467);
}

.forum-ai-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .forum-ai-titles h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.3;
    }

.forum-ai-sub {
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
}

/* Pushed to the end of the header row, where the chat page also puts its "Tänker…" pill. */
.forum-ai-status {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-inline-start: auto;
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
    white-space: nowrap;
}

/* The ask: the question read back, and the button that spends an OpenAI call on it. */
.forum-ai-ask {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: .75rem;
}

.forum-ai-ask-text {
    flex: 1 1 18rem;
    margin: 0;
    color: var(--kendo-color-on-app-surface, #1e293b);
}

.forum-ai-run {
    flex: 0 0 auto;
}

/* The answer itself reuses .ai-answer from the chat bubbles, so a reply looks the same in both
   places; only the line length is capped here, the card being far wider than a bubble. */
.forum-ai-body {
    margin-top: .875rem;
}

    .forum-ai-body .ai-answer {
        line-height: 1.65;
    }

        .forum-ai-body .ai-answer > p,
        .forum-ai-body .ai-answer > ul,
        .forum-ai-body .ai-answer > ol {
            max-width: 72ch;
        }

.forum-ai-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-top: .875rem;
    padding-top: .75rem;
    border-top: 1px solid var(--kendo-color-border);
}

/* Follow-up questions from related forum threads, above the field that asks your own. */
.forum-ai-suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    width: 100%;
}

.forum-ai-suggest-label {
    color: var(--kendo-color-subtle);
    font-size: .8125rem;
}

.forum-ai-suggest-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

    .forum-ai-suggest-chips .forum-chip {
        text-align: start;
    }

/* The follow-up field takes the full width of the card, so it reads as the next step and not as
   footer small print. */
.forum-ai-followup {
    display: flex;
    gap: .5rem;
    width: 100%;
    margin: 0;
}

.forum-ai-followup-input {
    flex: 1 1 auto;
    min-width: 0;
}

.forum-ai-followup .k-button {
    flex: 0 0 auto;
}

/* An AI answer needs to say so, quietly: it is generated from the forum's posts and the sources
   are right above it. */
.forum-ai-note {
    margin-inline-start: auto;
    color: var(--kendo-color-subtle);
    font-size: .75rem;
}

@media (max-width: 576px) {
    /* No room for the status pill beside the title, and it is not needed: the answer body shows
       the same typing dots while the reply is on its way. Wrapping the pill onto its own line put
       two sets of dots one above the other. */
    .forum-ai-status {
        display: none;
    }

    .forum-ai-run {
        width: 100%;
    }

    .forum-ai-note {
        margin-inline-start: 0;
    }
}

/* Confirmation popups (Ja / Nej). */
.forum-dialog-actions {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
}

/* ---- Bot protection ------------------------------------------------------------------------- */

/* Honeypot field from Views/Shared/_ReCaptcha.cshtml. Moved off-screen rather than display:none,
   which some bots detect and skip. */
.forum-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* reCAPTCHA v3 badge: hidden, which Google allows as long as the page states that reCAPTCHA
   is used - the partial prints that notice. */
.grecaptcha-badge {
    visibility: hidden;
}

.forum-recaptcha-notice {
    font-size: .75rem;
    color: var(--kendo-color-subtle);
}

    .forum-recaptcha-notice a {
        color: inherit;
        text-decoration: underline;
    }

/* AI-ordlista, AI-faktablad and AI-testfrågor (Views/Admin/Assistant*.cshtml). */
.forum-content-sub,
.forum-content-hint,
.forum-content-status {
    color: var(--kendo-color-subtle);
    font-size: .875rem;
}

.forum-content-sub {
    margin: .25rem 0 0;
}

.forum-content-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

    .forum-content-status-row .forum-content-status {
        margin: 0;
    }

.forum-content-description {
    max-width: 60rem;
}

.forum-content-message,
.forum-content-error {
    padding: .5rem .75rem;
    border-radius: var(--kendo-border-radius-md, 4px);
}

.forum-content-message {
    background-color: var(--kendo-color-success-subtle, #e6f4ea);
    color: var(--kendo-color-success-on-subtle, #1e5b2f);
}

.forum-content-error {
    background-color: var(--kendo-color-error-subtle, #fdecea);
    color: var(--kendo-color-error-on-subtle, #8a1c12);
}

.forum-glossary {
    width: 100%;
    border-collapse: collapse;
}

    .forum-glossary th {
        text-align: start;
        font-weight: 500;
        padding: 0 .25rem .375rem;
    }

    .forum-glossary td {
        padding: .1875rem .25rem;
        vertical-align: top;
    }

        .forum-glossary td:first-child {
            width: 30%;
        }

        .forum-glossary td:last-child {
            width: 2.5rem;
        }

    .forum-glossary .k-textbox {
        width: 100%;
    }

/* The editor card must not clip, or the save bar below cannot stick (.k-card has overflow: hidden). */
.forum-content-editor,
.forum-content-editor > .k-card-body {
    overflow: visible;
}

/* Add row, counter, unsaved marker and Save: pinned to the bottom of the window while the form
   is longer than the screen, so Save never has to be scrolled to. */
.forum-content-savebar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: .75rem -1.25rem -1.25rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--kendo-color-border);
    border-radius: 0 0 var(--forum-radius) var(--forum-radius);
    background-color: var(--kendo-color-surface-alt, #fff);
}

    /* The counter and everything after it sit on the right, next to Save. */
    .forum-content-savebar .forum-content-counter {
        margin-inline-start: auto;
    }

.forum-content-counter {
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

.forum-content-dirty {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .875rem;
    color: var(--kendo-color-warning-on-subtle, #7a4f01);
}

    .forum-content-dirty::before {
        content: "";
        width: .5rem;
        height: .5rem;
        border-radius: 50%;
        background-color: var(--kendo-color-warning, #f59e0b);
    }

    .forum-content-dirty[hidden] {
        display: none;
    }

/* Text boxes in the row tables that grow with their text (see _AssistantContentScript). */
.forum-glossary .k-textarea {
    width: 100%;
}

    .forum-glossary .k-textarea textarea.forum-autogrow {
        resize: none;
        overflow: hidden;
        min-height: 0;
        line-height: 1.5;
    }

.forum-content-over {
    color: var(--kendo-color-error);
    font-weight: 600;
}

.forum-content-textarea {
    width: 100%;
}

    .forum-content-textarea textarea {
        font-family: inherit;
        line-height: 1.5;
        overflow-y: auto;
    }

    /* Sized to its text by _AssistantContentScript; the page scrolls, not the box. */
    .forum-content-textarea textarea.forum-content-grow {
        resize: none;
        overflow-y: hidden;
    }

.forum-content-test {
    display: flex;
    gap: .5rem;
    max-width: 48rem;
}

    .forum-content-test .k-textbox {
        flex: 1;
    }

.forum-content-test-result {
    display: grid;
    gap: .25rem;
    margin: 1rem 0;
}

    .forum-content-test-result > div {
        display: grid;
        grid-template-columns: 9rem 1fr;
        gap: .75rem;
    }

    .forum-content-test-result dt {
        font-weight: 500;
    }

    .forum-content-test-result dd {
        margin: 0;
    }

.forum-content-answer {
    max-width: 48rem;
    padding: .75rem 1rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md, 4px);
    background-color: var(--kendo-color-base-subtle, #f8fafc);
}

.forum-content-answer-label {
    margin: 0 0 .5rem;
    font-size: .8125rem;
    color: var(--kendo-color-subtle);
}

/* AI-testfrågor: the question rows, the chat-log suggestions and the test report. */
.forum-glossary td.forum-evalcase-decline {
    width: 7rem;
    text-align: center;
    vertical-align: middle;
}

.forum-content-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.forum-evalcase-candidates,
.forum-evalcase-report {
    width: 100%;
    border-collapse: collapse;
}

    .forum-evalcase-candidates th,
    .forum-evalcase-candidates td,
    .forum-evalcase-report th,
    .forum-evalcase-report td {
        text-align: start;
        padding: .375rem .5rem;
        border-bottom: 1px solid var(--kendo-color-border);
        vertical-align: top;
    }

.forum-evalcase-pass,
.forum-evalcase-fail {
    display: inline-block;
    padding: .125rem .5rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.forum-evalcase-pass {
    background-color: var(--kendo-color-success-subtle, #e6f4ea);
    color: var(--kendo-color-success-on-subtle, #1e5b2f);
}

.forum-evalcase-fail {
    background-color: var(--kendo-color-error-subtle, #fdecea);
    color: var(--kendo-color-error-on-subtle, #8a1c12);
}

.forum-evalcase-summary {
    margin-bottom: 1rem;
}

    .forum-evalcase-summary p {
        margin-bottom: .25rem;
    }

.forum-evalcase-score {
    font-size: 1.25rem;
    font-weight: 600;
}

.forum-evalcase-onlyfailed {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    font-size: .875rem;
    cursor: pointer;
}

.forum-evalcase-onlyfailed-on .forum-evalcase-passed {
    display: none;
}

/* Title above tabbed pages (AI-testfrågor). */
.forum-content-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

    .forum-content-pagehead h1 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

/* "Så fungerar det" panel (Views/Admin/_AssistantEvalHelp.cshtml), opened by the Hjälp button. */
.forum-help {
    margin-bottom: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--kendo-color-primary) 22%, transparent);
    border-radius: var(--forum-radius);
    background-color: color-mix(in srgb, var(--kendo-color-primary) 5%, var(--kendo-color-surface-alt, #fff));
}

    .forum-help[hidden] {
        display: none;
    }

.forum-help-head {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .75rem .625rem 1.25rem;
    color: var(--kendo-color-primary);
}

    .forum-help-head .forum-help-title {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
    }

    .forum-help-head .forum-help-close {
        margin-inline-start: auto;
    }

.forum-help-body {
    padding: 0 1.25rem 1.25rem;
}

.forum-help-lead {
    max-width: 60rem;
    margin-bottom: 1rem;
}

.forum-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.forum-help-card {
    padding: 1rem 1.125rem;
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--forum-radius);
    background-color: var(--kendo-color-surface-alt, #fff);
    font-size: .9375rem;
}

    .forum-help-card h3 {
        margin: 0 0 .75rem;
        font-size: 1rem;
        font-weight: 600;
    }

    .forum-help-card p {
        margin-bottom: .5rem;
    }

        .forum-help-card p:last-child {
            margin-bottom: 0;
        }

.forum-help-example + .forum-help-example {
    margin-top: .875rem;
    padding-top: .875rem;
    border-top: 1px dashed var(--kendo-color-border);
}

.forum-help-q {
    font-weight: 500;
}

/* Field name in an example row ("Begrepp", "Betydelse"). */
.forum-help-label {
    display: inline-block;
    min-width: 5.5rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--kendo-color-subtle);
}

.forum-help-list {
    display: grid;
    gap: .375rem;
    margin: 0 0 .75rem;
    padding-inline-start: 1.125rem;
}

/* Term and explanation pairs (what a number or a column means). */
.forum-help-terms {
    display: grid;
    gap: .5rem;
    margin: 0 0 .5rem;
}

    .forum-help-terms dt {
        font-weight: 600;
    }

    .forum-help-terms dd {
        margin: 0;
        font-size: .875rem;
        color: var(--kendo-color-subtle);
    }

.forum-help-tag {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-bottom: .375rem;
    padding: .125rem .625rem .125rem .5rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
}

.forum-help-tag-answer {
    background-color: var(--kendo-color-success-subtle, #e6f4ea);
    color: var(--kendo-color-success-on-subtle, #1e5b2f);
}

.forum-help-tag-decline {
    background-color: var(--kendo-color-base-subtle, #eef2f6);
    color: var(--kendo-color-on-app-surface);
}

.forum-help-links {
    display: grid;
    gap: .5rem;
    margin: 0 0 .75rem;
    padding: 0;
    list-style: none;
}

    .forum-help-links li {
        display: grid;
        gap: 0;
    }

    .forum-help-links a {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        font-weight: 600;
        text-decoration: none;
    }

        .forum-help-links a:hover {
            text-decoration: underline;
        }

    .forum-help-links li > span {
        padding-inline-start: 1.5rem;
        font-size: .8125rem;
        color: var(--kendo-color-subtle);
    }

/* Numbered steps with the number in a circle. */
.forum-help-steps {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: forum-step;
}

    .forum-help-steps li {
        position: relative;
        padding-inline-start: 2.25rem;
        counter-increment: forum-step;
    }

        .forum-help-steps li::before {
            content: counter(forum-step);
            position: absolute;
            inset-inline-start: 0;
            top: 0;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 50%;
            background-color: var(--kendo-color-primary);
            color: var(--kendo-color-on-primary, #fff);
            font-size: .8125rem;
            font-weight: 600;
            line-height: 1.5rem;
            text-align: center;
        }


/* Tabs: only show and hide panels on the same page, so nothing typed is lost by switching. */
.forum-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--kendo-color-border);
}

.forum-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: -1px;
    padding: .625rem 1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--kendo-color-subtle);
    font-weight: 500;
    cursor: pointer;
}

    .forum-tab:hover {
        color: var(--kendo-color-on-app-surface);
    }

    .forum-tab[aria-selected="true"] {
        color: var(--kendo-color-primary);
        border-bottom-color: var(--kendo-color-primary);
    }

    .forum-tab:focus-visible {
        outline: 2px solid var(--kendo-color-primary);
        outline-offset: -2px;
        border-radius: var(--kendo-border-radius-md, 4px);
    }

.forum-tab-count {
    min-width: 1.5rem;
    padding: 0 .4375rem;
    border-radius: 999px;
    background-color: var(--kendo-color-base-subtle, #eef2f6);
    color: var(--kendo-color-on-app-surface);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.375rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.forum-tab-count-pass {
    background-color: var(--kendo-color-success-subtle, #e6f4ea);
    color: var(--kendo-color-success-on-subtle, #1e5b2f);
}

.forum-tab-count-fail {
    background-color: var(--kendo-color-error-subtle, #fdecea);
    color: var(--kendo-color-error-on-subtle, #8a1c12);
}

/* Search box above the row tables on AI-ordlista and AI-testfrågor. */
.forum-content-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

    .forum-content-filter .k-textbox {
        width: 20rem;
        max-width: 100%;
    }

.forum-evalcases td:first-child {
    width: 34%;
}

.forum-evalcases td:nth-child(2) {
    width: 24%;
}
