:root {
    --ink: #16212b;
    --muted: #607284;
    --line: rgba(22, 33, 43, 0.12);
    --panel:
        radial-gradient(ellipse 60% 50% at 15% -5%, rgba(190, 220, 242, 0.35), transparent 60%),
        radial-gradient(ellipse 55% 45% at 90% 108%, rgba(203, 232, 226, 0.3), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 248, 251, 0.92) 100%);
    --navy: #15324a;
    --blue: #2f6c8f;
    --line-blue: rgba(47, 108, 143, 0.35);
    --onb-heading: #1d5c94;
    --onb-navn: #4a86b8;
    --mist: #d9e9f2;
    --apricot: #d98b52;
    --shadow: 0 24px 60px rgba(17, 31, 41, 0.16);
    --radius-xl: 28px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Aptos, "Segoe UI Variable", Bahnschrift, "Trebuchet MS", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(ellipse 60% 50% at 15% -5%, rgba(190, 220, 242, 0.45), transparent 60%),
        radial-gradient(ellipse 55% 45% at 90% 108%, rgba(203, 232, 226, 0.4), transparent 60%),
        linear-gradient(180deg, #f5f8fb 0%, #e9eef4 100%);
}

body {
    /* Kurts præcisering (20/7): kanvasset beholder sin 14 px-ramme —
       det er BAGGRUNDS-gradienten (body), der når helt ud til kanten. */
    --shell-padding: 14px;
    padding: 0 !important;
    overflow: hidden;
}

.page {
    width: 100%;
    max-width: calc((100vh - (var(--shell-padding) * 2)) * 5 / 3);
    margin: 0 auto;
    height: 100%;
    position: relative;
}

.canvas {
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    min-height: calc(100vh - (var(--shell-padding) * 2));
    display: flex;
    flex-direction: column;
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    padding: 9px 14px;
    background: linear-gradient(135deg, var(--navy), #244e70);
    color: white;
    align-items: center;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-icon-btn,
.topbar-logout-btn {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #f6fbff;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
}

.topbar-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.topbar-logout-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 0.86rem;
}

.tour-onboarding-card,
.tour-hint-card {
    position: fixed;
    top: 78px;
    right: 22px;
    width: min(420px, calc(100vw - 32px));
    border-radius: 16px;
    border: 1px solid rgba(47, 108, 143, 0.22);
    background: linear-gradient(180deg, rgba(249, 253, 255, 0.98), rgba(237, 244, 251, 0.98));
    box-shadow: 0 16px 44px rgba(17, 31, 41, 0.2);
    z-index: 92;
    padding: 14px 16px 14px;
}

.tour-hint-card {
    z-index: 91;
}

/* 24/7: "Ellers tak"-dæmpningen — mørkt slør under hint-boblen; kun boblen
   og topbarens rundtur-knap (tour-hint-fremhaevet) står klart frem.
   Overgangen er animeret (Mortens ønske): sløret toner ind, boblen fader
   op med et blidt løft, og ℹ-knappen giver to rolige glød-pulser. */
.tour-hint-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(17, 31, 41, 0.45);
    animation: tour-hint-daemp 300ms ease-out;
}

@keyframes tour-hint-daemp {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tour-hint-card {
    animation: tour-hint-op 340ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes tour-hint-op {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tour-hint-fremhaevet {
    position: relative;
    z-index: 91;
    animation: tour-hint-gloed 1.1s ease-out 350ms 2;
}

@keyframes tour-hint-gloed {
    0%, 100% { box-shadow: none; }
    50%      { box-shadow: 0 0 0 7px rgba(246, 251, 255, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
    .tour-hint-backdrop,
    .tour-hint-card,
    .tour-hint-fremhaevet {
        animation: none;
    }
}

/* F2: "Kom godt i gang"-panelets dok — fast øverst til højre under top-
   bjælken (samme hjørne som tour-kortene, men bag dem i lag, så de
   flygtige kort altid vinder). Selve panelet styles i RCL'en. */
.kgig-dock {
    position: fixed;
    top: 78px;
    right: 22px;
    z-index: 80;
}

.tour-onboarding-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    color: #2e5778;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.tour-onboarding-title {
    color: #173b59;
    font-weight: 700;
    font-size: 0.98rem;
    padding-right: 34px;
}

.tour-onboarding-text {
    margin-top: 8px;
    color: #355670;
    font-size: 0.85rem;
    line-height: 1.42;
}

.tour-onboarding-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.tour-onboarding-btn {
    border: 1px solid rgba(47, 108, 143, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #2f5877;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
}

.tour-onboarding-btn-primary {
    background: linear-gradient(180deg, #3b7fcb, #2f6aad);
    border-color: rgba(36, 87, 140, 0.54);
    color: #fff;
}

.tour-hint-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #173b59;
    padding-right: 34px;
}

.tour-hint-tour-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
}

.settings-modal-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(8, 19, 30, 0.28);
    z-index: 90;
}

.settings-modal {
    position: fixed;
    top: 74px;
    right: 22px;
    width: min(560px, calc(100vw - 32px));
    border-radius: 20px;
    border: 1px solid rgba(47, 108, 143, 0.24);
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(236, 244, 252, 0.98));
    box-shadow: 0 24px 60px rgba(17, 31, 41, 0.22);
    z-index: 91;
    overflow: hidden;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(47, 108, 143, 0.12);
    color: #203c56;
}

.settings-modal-close {
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    color: #365879;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.settings-modal-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 18px 0;
}

.settings-tab {
    border: 1px solid rgba(47, 108, 143, 0.18);
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.84rem;
    color: #48627f;
    background: rgba(255, 255, 255, 0.76);
    cursor: pointer;
}

.settings-tab.is-active {
    background: rgba(208, 228, 248, 0.96);
    border-color: rgba(47, 108, 143, 0.4);
    color: #21425f;
    font-weight: 700;
}

.settings-modal-body {
    padding: 16px 18px 18px;
}

.settings-db-panel {
    border: 1px solid rgba(47, 108, 143, 0.16);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.66);
    padding: 28px 34px 24px;
}

.settings-db-form {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 138px;
    align-items: center;
    gap: 18px 22px;
}

.settings-db-label {
    color: #203c56;
    font-size: 0.88rem;
}

.settings-db-check-label {
    align-self: center;
}

.settings-db-input {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(21, 50, 74, 0.18);
    background: #fff;
    border-radius: 4px;
    padding: 0 12px;
    font: inherit;
    color: #233b50;
}

.settings-db-check {
    justify-self: start;
    width: 22px;
    height: 22px;
    accent-color: #1e73be;
}

.settings-db-btn {
    height: 36px;
    border: 1px solid rgba(21, 50, 74, 0.18);
    border-radius: 8px;
    background: #fff;
    color: #23415c;
    font: inherit;
    cursor: pointer;
}

.settings-db-status {
    margin-top: 16px;
    color: #45627f;
    font-size: 0.82rem;
    white-space: pre-line;
}

.settings-mic-panel {
    padding: 22px 30px 20px;
}

/* 24/7: mikrofon-fanen som ren formular — label-kolonne + felter i fuld
   bredde; knapperne bor i settings-mic-knapper nederst til højre. */
.settings-mic-layout {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    max-width: 560px;
}

.settings-mic-knapper {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    max-width: 560px;
}

.settings-mic-action-btn--primaer {
    background: var(--navy, #1d4363);
    color: #fff;
    border-color: var(--navy, #1d4363);
}

.settings-mic-field-label {
    padding-top: 8px;
}

.settings-mic-select {
    appearance: auto;
}

.settings-mic-action-btn {
    min-width: 120px;
}

.settings-mic-volume-block {
    display: grid;
    gap: 8px;
    align-items: center;
    padding-top: 2px;
}

.settings-mic-test-wrap {
    display: grid;
    gap: 5px;
}

.settings-mic-test-label {
    color: #27435e;
    font-size: 0.8rem;
}

.settings-mic-test-track {
    height: 10px;
    border-radius: 999px;
    background: #d9e8f5;
    overflow: hidden;
    border: 1px solid rgba(23, 74, 120, 0.18);
}

.settings-mic-test-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #44b26f 0%, #5bcf83 45%, #d4d63f 75%, #f39e45 100%);
    transition: width 90ms linear;
}

.settings-mic-summary {
    color: #27435e;
    font-size: 0.85rem;
}

.settings-mic-slider {
    width: 100%;
    accent-color: #1980d8;
}

.settings-mic-status {
    margin-top: 14px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand strong {
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.brand span {
    font-size: 0.72rem;
    opacity: 0.86;
}

.layout {
    padding: 18px;
    display: grid;
    gap: 18px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 18px 50px rgba(80, 105, 130, 0.13);
}

.panel-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    height: 100%;
}

.agent-panel {
    min-height: 0;
    gap: 12px;
    position: relative;
}

/* MCP-lås: kun journalsøgningen låses (CPR, journal-svar, Spørg journalen) —
   resten af kolonnen (Dagens notater m.m.) er fri. Forklaring = 🔒-linjen,
   som bor ØVERST i .agent-bottom og derfor altid står lige over Spørg
   journalen-feltet — og undtages fra dæmpningen. */
.agent-panel.is-mcp-locked :is(.cpr-row, .agent-answer-buttons),
.agent-panel.is-mcp-locked .agent-bottom > *:not(.mcp-lock-line) {
    opacity: 0.38;
    pointer-events: none;
    user-select: none;
}

.mcp-lock-line {
    font-size: 0.68rem;
    color: #8fa0b1;
    text-align: center;
    padding: 2px 0;
}

.mcp-conn-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    width: fit-content;
    border: 1px solid transparent;
}

.mcp-conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mcp-conn-error {
    background: rgba(200, 50, 50, 0.08);
    color: #9b2c2c;
    border-color: rgba(200,50,50,0.18);
}
.mcp-conn-error .mcp-conn-dot { background: #c83232; }


.agent-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    font: inherit;
    color: var(--ink);
    background: white;
    border: 1px solid rgba(21, 50, 74, 0.08);
}

/* Critical prompt/auth/editor rules duplicated early to keep the core UI styled
   even if a later CSS section is skipped by cache or parse drift. */
.auth-login-overlay {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}

.auth-login-box {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(21, 50, 74, 0.12);
    box-shadow: 0 12px 40px rgba(21, 50, 74, 0.14);
    padding: 40px 44px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-login-box strong {
    display: block;
    font-size: 1.1rem;
    color: #15324a;
}

.auth-login-box span {
    display: block;
    font-size: 0.875rem;
    color: #33495d;
    line-height: 1.5;
}

.auth-login-mitid-btn {
    margin-top: 12px;
    background: #15324a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 32px;
    cursor: pointer;
}

.editor-controls-inline {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    z-index: 120;
}

.editor-controls-inline.note-controls {
    width: 60%;
    max-width: 60%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    transition: width 180ms ease, max-width 180ms ease;
}

.editor-controls-inline.note-controls.is-expanded,
.editor-controls-inline.note-controls.is-scrollable {
    width: 90%;
    max-width: 90%;
}

.note-edit-shell {
    position: relative; /* anker for seddel-menuen, der svæver til højre for feltet */
    width: 100%;
    display: grid;
    gap: 6px;
}

.note-edit-disclaimer {
    margin-top: 18px;
    font-size: 0.74rem;
    line-height: 1.3;
    color: rgba(56, 76, 99, 0.78);
    text-align: center;
    user-select: none;
}

.editor-search-inline {
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(21, 50, 74, 0.12);
    background: #fbfdff;
    box-shadow: 0 10px 24px rgba(25, 49, 73, 0.08), 0 2px 6px rgba(25, 49, 73, 0.05);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
    padding: 4px;
    justify-self: center;
    width: 100%;
}

.editor-search-inline-with-generate {
    position: relative;
    padding-right: 52px;
}

.editor-search-inline.note-edit-bar {
    overflow: visible;
}

.editor-search-inline input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 0;
    outline: none;
    background: transparent;
    color: #67798f;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 0 10px 0 14px;
}

.patient-id {
    width: auto;
    align-self: flex-start;
    text-align: left;
    font-size: 0.82rem;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    font-weight: 600;
}

.patient-id-input {
    width: 100%;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    padding: 0 46px 0 14px;
    font: inherit;
    font-size: 0.92rem;
    color: #24384d;
    font-weight: 600;
    transition: transform 0.2s ease, height 0.2s ease, font-size 0.2s ease, box-shadow 0.2s ease;
}

.patient-active-display {
    width: 100%;
    min-height: 42px;
    border: none;
    background: transparent;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    color: #1a3347;
    cursor: pointer;
    text-align: left;
}

.patient-active-name {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.patient-active-cpr {
    font-size: 0.82rem;
    color: #4d657e;
    font-weight: 600;
    white-space: nowrap;
}

.patient-active-display:hover .patient-active-name,
.patient-active-display:focus-visible .patient-active-name {
    text-decoration: underline;
}

.patient-active-display:focus-visible {
    outline: 2px solid rgba(47, 108, 143, 0.32);
    outline-offset: 3px;
    border-radius: 10px;
}

.cpr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.patient-id-shell {
    position: relative;
    flex: 1;
    min-width: 0;
    transition: width 0.24s ease;
}

.cpr-activate-btn,
.journal-ask-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #1a2f45;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
}

.cpr-inside-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
}

.cpr-row.is-compact {
    width: auto;
}

.cpr-row.is-compact .patient-id-shell {
    flex: 0 0 auto;
    width: 172px;
}

.cpr-row.is-compact .patient-id-input {
    height: 36px;
    font-size: 0.82rem;
    padding-left: 12px;
}

.cpr-row.is-compact.is-expanded .patient-id-shell {
    width: 236px;
}

.cpr-row.is-compact.is-expanded .patient-id-input {
    height: 40px;
    font-size: 0.9rem;
}

.cpr-activate-btn:disabled,
.journal-ask-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.upload-icon {
    display: block;
    width: 16px;
    height: 16px;
    background-color: white;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m-7 7 7-7 7 7'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m-7 7 7-7 7 7'/%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-position: center;
    -webkit-mask-position: center;
}

.patient-id-input:focus,
.search-line input:focus {
    outline: none;
    border-color: rgba(47, 108, 143, 0.45);
    box-shadow: 0 0 0 3px rgba(47, 108, 143, 0.12);
}

.patient-id-input:focus {
    transform: scale(1.03);
}

.search-line input {
    width: 100%;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(21, 50, 74, 0.14);
    background: #f9fcff;
    padding: 0 44px 0 14px;
    color: #66778d;
    font-size: 0.96rem;
}

.search-line {
    position: relative;
}

.agent-search-line {
    position: relative;
    width: 100%;
    /* Flex fjerner inline-descender under input'et, så linjens højde = feltets
       højde (46px). Ellers strækker .ask-edge (inset af linjen) sig under feltet. */
    display: flex;
    align-items: center;
}

/* Loading: luminous blå markering (L1) der glider langs feltets kant mens MCP svarer.
   SVG med procent-geometri (ingen viewBox-skalering) → korrekte pill-hjørner ved
   variabel bredde og konstant hastighed rundt. Tændes via .is-asking (IsJournalAgentBusy). */
.ask-edge {
    position: absolute;
    inset: 2px;
    /* <svg> er et replaced element med default-størrelse 300×150; inset alene
       kan ikke strække det. Eksplicit width/height binder det til feltets boks,
       så rect'ens 100%-geometri følger feltets kant. */
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    overflow: visible;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 2;
}
.agent-search-line.is-asking .ask-edge { opacity: 1; }
.ask-edge rect { fill: none; }
.ask-edge .ask-base { stroke: #dfeaf6; stroke-width: 1.5; }
.ask-edge .ask-hi {
    stroke: #3a9dff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 11 89;
    animation: ask-edge-travel 1.9s linear infinite;
}
@keyframes ask-edge-travel { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
    .ask-edge .ask-hi { animation: none; }
    .agent-search-line.is-asking .ask-edge { opacity: 0.6; }
}

.agent-search-line.is-hold-capture {
    isolation: isolate;
}

.journal-hold-indicator {
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 22% 45%, rgba(66, 199, 109, 0.22), rgba(66, 199, 109, 0) 45%),
        radial-gradient(circle at 78% 55%, rgba(46, 212, 136, 0.2), rgba(46, 212, 136, 0) 42%),
        linear-gradient(90deg, rgba(24, 151, 84, 0.05), rgba(56, 212, 133, 0.22), rgba(24, 151, 84, 0.05));
    filter: blur(0.3px) saturate(1.18);
    animation: journal-hold-pulse 1.45s ease-in-out infinite, journal-hold-sweep 2.3s linear infinite;
}

.agent-search-line.is-hold-capture .agent-search-input {
    border-color: rgba(38, 169, 96, 0.64);
    box-shadow: 0 0 0 3px rgba(62, 201, 122, 0.16), 0 0 24px rgba(56, 209, 123, 0.2);
}

@keyframes journal-hold-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.012);
    }
}

@keyframes journal-hold-sweep {
    0% {
        filter: hue-rotate(0deg) blur(0.3px) saturate(1.15);
    }
    50% {
        filter: hue-rotate(8deg) blur(0.6px) saturate(1.35);
    }
    100% {
        filter: hue-rotate(0deg) blur(0.3px) saturate(1.15);
    }
}

.agent-search-input {
    width: 100%;
    min-width: 100%;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(21, 50, 74, 0.14);
    background: #f9fcff;
    padding: 0 42px;
    font: inherit;
    color: #66778d;
    font-size: 0.96rem;
}

.journal-mic {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 50%;
    background: linear-gradient(180deg, #f8fcff, #eef5ff);
    color: #4f6689;
    display: grid;
    place-items: center;
    padding: 0;
    flex-shrink: 0;
}

.journal-mic:disabled {
    opacity: 0.55;
    cursor: default;
}

.journal-mic.is-recording {
    border-color: rgba(51, 138, 79, 0.45);
    color: #2a7a48;
    animation: fp-recording-ring 1.6s ease-out infinite;
}

.journal-field-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.journal-field-btn-left {
    left: 6px;
}

.journal-field-btn-right {
    right: 6px;
}

.agent-answer-buttons {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.agent-answer-button {
    border: 1px solid rgba(47, 108, 143, 0.2);
    border-radius: 12px;
    padding: 9px 11px;
    text-align: left;
    font: inherit;
    font-size: 0.84rem;
    color: #2a4d6c;
    background: rgba(236, 245, 255, 0.78);
    cursor: pointer;
}

.agent-answer-button:hover {
    background: rgba(222, 237, 252, 0.88);
}

.agent-answer-button.is-active {
    background: rgba(204, 227, 252, 0.94);
    border-color: rgba(47, 108, 143, 0.35);
    color: #1f405d;
}

.journal-answer-modal-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(8, 19, 30, 0.28);
    z-index: 80;
}

.journal-answer-modal {
    position: fixed;
    z-index: 81;
    top: 50%;
    left: 0;
    right: 0;
    margin-inline: auto;
    transform: translateY(-50%);
    width: min(760px, calc(100% - 32px));
    max-height: min(82vh, 860px);
    border-radius: 18px;
    border: 1px solid rgba(47, 108, 143, 0.22);
    background: linear-gradient(180deg, rgba(246, 251, 255, 0.98), rgba(235, 245, 255, 0.98));
    box-shadow: 0 22px 46px rgba(21, 50, 74, 0.24);
    display: grid;
    grid-template-rows: auto 1fr;
}

.journal-answer-modal-close {
    border: 0;
    border-radius: 10px;
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.7);
    color: #355879;
    cursor: pointer;
}

.note-detail-text {
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.6;
    color: #1e3a52;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
}

.journal-result-empty {
    border: 1px dashed rgba(47, 108, 143, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    color: #5c6f84;
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.58);
}

.journal-debug-grid {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #3f5d79;
}

.journal-debug-diagnostics {
    margin: 8px 0 0;
    padding-left: 16px;
    color: #5e6f82;
    font-size: 0.79rem;
}

.journal-debug-json {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(47, 108, 143, 0.14);
    background: rgba(241, 248, 255, 0.76);
    color: #2b4d6d;
    font-size: 0.73rem;
    line-height: 1.35;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
}

.journal-commit-status {
    font-size: 0.78rem;
    color: #2e6188;
    border: 1px dashed rgba(47, 108, 143, 0.3);
    border-radius: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.66);
}

.mcp-commit-block {
    border: 1px solid rgba(47, 108, 143, 0.2);
    border-radius: 12px;
    background: rgba(245, 250, 255, 0.82);
    padding: 10px 12px;
    margin: 8px 0;
}

.mcp-commit-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: #2c5678;
    margin-bottom: 6px;
}

.mcp-commit-body {
    font-size: 0.85rem;
    color: #173650;
    line-height: 1.55;
}

.mcp-commit-entry {
    border-top: 1px solid rgba(47, 108, 143, 0.14);
    margin-top: 8px;
    padding-top: 8px;
}

.mcp-commit-entry:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.mcp-commit-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: #355f84;
    margin-bottom: 4px;
}

.mcp-commit-entry-body {
    font-size: 0.82rem;
    color: #1f4463;
    line-height: 1.5;
}

.mcp-transfer-target {
    animation: mcpTransferPulse 0.7s ease;
}

@keyframes mcpTransferPulse {
    0% { box-shadow: 0 0 0 0 rgba(66, 151, 213, 0.42); }
    100% { box-shadow: 0 0 0 16px rgba(66, 151, 213, 0); }
}

.mcp-transfer-ghost {
    position: fixed;
    z-index: 9999;
    border-radius: 10px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(110, 190, 244, 0.9), rgba(64, 150, 210, 0.82));
    box-shadow: 0 6px 16px rgba(21, 63, 93, 0.24);
    transform-origin: top left;
    transition: transform 560ms cubic-bezier(.2,.8,.2,1), opacity 560ms ease;
}

.agent-answer-text {
    color: #203448;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.agent-tool-chip {
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(47, 108, 143, 0.12);
    color: #315b7c;
    font-size: 0.76rem;
    font-weight: 600;
}

.left-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, rgba(21, 50, 74, 0.08), rgba(21, 50, 74, 0.24), rgba(21, 50, 74, 0.08));
    margin-top: 0;
    margin-bottom: 10px;
}

.divider-left {
    position: relative;
}

.divider-left::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(21, 50, 74, 0.06), rgba(47, 108, 143, 0.45), rgba(21, 50, 74, 0.06));
}

.focus-main-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

.editor {
    min-height: 320px;
    border-radius: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.focus-editor {
    min-height: 0;
    height: 100%;
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 16px;
    padding-bottom: 84px;
}

.focus-main-panel {
    position: relative;
    padding-top: 0;
}

.focus-main-panel.is-prompt-adjusting {
    padding-top: 0;
}

.mainframe-flip {
    position: relative;
    flex: 1;
    min-height: 0;
    perspective: 1300px;
    transform-style: preserve-3d;
}

.mainframe-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    transition: transform 380ms ease, opacity 260ms ease;
}

.mainframe-face-front {
    transform: rotateY(0deg);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mainframe-face-back {
    transform: rotateY(180deg);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
}

.mainframe-flip.is-flipped .mainframe-face-front {
    transform: rotateY(-180deg);
    opacity: 0;
    pointer-events: none;
}

.mainframe-flip:not(.is-flipped) .mainframe-face-back {
    pointer-events: none;
}

.mainframe-flip.is-flipped .mainframe-face-back {
    transform: rotateY(0deg);
}

.prompt-adjustment-shell {
    display: block;
    height: 100%;
    min-height: 0;
}

.prompt-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.prompt-mode-cpr-label {
    flex: 1;
    min-width: 0;
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    border: 1px solid rgba(88, 110, 138, 0.28);
    font-size: 0.92rem;
    color: #24384d;
    font-weight: 600;
}

.prompt-sidebar-helper {
    margin-top: 18px;
    color: #5a6f88;
    font-size: 0.83rem;
    line-height: 1.45;
    padding: 0 4px;
}

.prompt-adjustment-nav-btn {
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #4e637d;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.prompt-adjustment-nav-btn.is-active {
    border-color: rgba(47, 108, 143, 0.34);
    background: linear-gradient(180deg, #e8f3ff, #dfedff);
    color: #264d6e;
    font-weight: 600;
}

.prompt-adjustment-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 4px 10px 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(95, 116, 143, 0.3) transparent;
}

.prompt-adjustment-right::-webkit-scrollbar {
    width: 6px;
}

.prompt-adjustment-right::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-adjustment-right::-webkit-scrollbar-thumb {
    background: rgba(95, 116, 143, 0.3);
    border-radius: 999px;
}

/* Sticky topbar centreret over papiret — titel, bruger-chip og handlinger
   følger med ved scroll og ligger aldrig klistret ud mod panelkanten. */
.prompt-adjustment-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: min(880px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 10px;
    border-bottom: 1px solid rgba(21, 50, 74, 0.14);
    background: rgba(236, 243, 250, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.prompt-adjustment-header strong {
    font-size: 1.02rem;
    color: #1f374f;
}

.prompt-adjustment-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.prompt-adjustment-close {
    border: 1px solid var(--line-blue);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--blue);
    font: inherit;
    font-size: 0.8rem;
    padding: 5px 12px;
    cursor: pointer;
}

.prompt-doc-header-gem {
    border: none;
    border-radius: 9px;
    background: linear-gradient(180deg, #3b7fcb, #2f6aad);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 18px;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.prompt-doc-header-gem:disabled {
    opacity: 0.45;
    cursor: default;
}

.prompt-adjustment-sliders {
    display: grid;
    gap: 14px;
    max-width: 520px;
}

.prompt-adjustment-slider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4a6079;
    font-size: 0.86rem;
    font-weight: 600;
}

.prompt-adjustment-sliders input[type="range"] {
    width: 100%;
    accent-color: #2f6c8f;
}

.prompt-adjustment-example {
    margin-top: -6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(21, 50, 74, 0.12);
    background: rgba(239, 246, 255, 0.65);
    color: #4d6179;
    font-size: 0.82rem;
    line-height: 1.45;
}

.prompt-adjustment-save-status {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #4d6179;
}

.prompt-adjustment-save-status.is-saving {
    color: #2f6c8f;
}

.prompt-record-value {
    font-size: 0.81rem;
    color: #51667e;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-adjustment-placeholder {
    border: 1px dashed rgba(21, 50, 74, 0.2);
    border-radius: 12px;
    padding: 16px;
    color: #62758d;
    font-size: 0.86rem;
}

/* ── Prompt-editor som dokument ──────────────────────────────────────────────
   Bud 2 fra docs/design/prompt-redigering-mockups.html: prompten redigeres på
   ét hvidt "papir"-kort med sektionsnavne i venstre margen og formaterings-
   pillen svævende over papirets overkant. Genbruger .html-editor-toolbar og
   .prompt-record-html-editor — kun placering/flade ændres herinde. */

.prompt-doc-scene {
    display: flex;
    justify-content: center;
    padding: 10px 0 28px;
}

.prompt-doc-paper {
    width: min(820px, 100%);
    background: #fff;
    border: 1px solid rgba(47, 108, 143, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(17, 31, 41, 0.12);
    padding: 22px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Pillen trækkes op over papirets kant og docker under den sticky topbar.
   Dobbelt klasse-selektor: basisklassen .html-editor-toolbar sætter selv
   top: 0 senere i filen — denne skal vinde kaskaden. */
.html-editor-toolbar.prompt-doc-toolbar {
    position: sticky;
    top: 68px;
    z-index: 20;
    align-self: center;
    width: max-content;
    margin: -38px 0 -4px;
}

.prompt-doc-field {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.prompt-doc-gutter {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--blue);
    text-align: right;
    line-height: 1.35;
    padding: 10px 10px 0 0;
    border-right: 2px solid rgba(47, 108, 143, 0.25);
    word-break: break-word;
}

/* Papiret ER skrivefladen — felterne mister deres egen kort-ramme */
.prompt-doc-paper .prompt-record-html-editor {
    border: 0;
    background: transparent;
    padding: 8px 4px;
    border-radius: 8px;
}

.prompt-doc-paper .prompt-record-html-editor:focus {
    outline: none;
    background: rgba(239, 246, 255, 0.55);
}

.prompt-doc-skabelon {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-doc-actions .prompt-new-save-btn {
    width: auto;
    padding: 7px 22px;
}

.prompt-doc-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(21, 50, 74, 0.1);
}

.prompt-doc-bruger-chip {
    font-size: 0.72rem;
    color: var(--blue);
    background: rgba(47, 108, 143, 0.09);
    border: 1px solid rgba(47, 108, 143, 0.2);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .prompt-doc-field {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .prompt-doc-gutter {
        text-align: left;
        border-right: 0;
        border-bottom: 1px solid rgba(47, 108, 143, 0.2);
        padding: 0 0 4px;
    }
}

.mainframe-top-divider {
    height: 1px;
    width: auto;
    background: linear-gradient(90deg, rgba(21, 50, 74, 0.08), rgba(21, 50, 74, 0.24), rgba(21, 50, 74, 0.08));
    margin: 0 14px 10px;
}

.mainframe-top-controls {
    position: relative;
    margin: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 3;
}

.mainframe-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.samtykke-btn {
    position: static;
    z-index: 2;
    border: 1px solid rgba(46, 110, 70, 0.30);
    background: linear-gradient(180deg, #eaf7ef, #ddeee3);
    color: #235c3a;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 7px 14px;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.samtykke-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(17, 40, 68, 0.10);
}

.samtykke-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.samtykke-btn.is-saved {
    border-color: rgba(46, 110, 70, 0.45);
    background: linear-gradient(180deg, #d8efe0, #cbe7d5);
    color: #1c4d30;
}

.samtykke-error {
    margin: 8px 0 0;
    color: #b3261e;
    font-size: 0.8rem;
}

.samtykke-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    border: 0;
    padding: 0;
    background: rgba(17, 31, 41, 0.35);
}

.samtykke-modal {
    position: fixed;
    z-index: 310;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 14px;
    background: rgba(255, 252, 247, 0.98);
    box-shadow: 0 20px 46px rgba(17, 31, 41, 0.22);
    padding: 18px;
}

.samtykke-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.samtykke-modal-logo {
    width: 42px;
    height: 42px;
}

.samtykke-modal-titel {
    font-size: 1rem;
    font-weight: 600;
    color: #2f4b65;
}

.samtykke-modal-tekst {
    font-size: 0.85rem;
    color: #5f7088;
    line-height: 1.4;
    margin-bottom: 12px;
}

.samtykke-modal-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8096b0;
    margin-bottom: 4px;
}

.samtykke-modal-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(21, 50, 74, 0.2);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
    padding: 8px 10px;
}

.samtykke-modal-input:focus {
    outline: none;
    border-color: rgba(46, 110, 70, 0.5);
}

.samtykke-modal-knapper {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

/* OK og Annuller skal være lige store */
.samtykke-modal-knapper .button {
    min-width: 110px;
    text-align: center;
}

.samtykke-modal-annuller {
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    color: #2f4b65;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 7px 14px;
}

.ny-session-inside {
    position: static;
    z-index: 2;
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    color: #2f4b65;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 7px 12px;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.ny-session-inside:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(17, 40, 68, 0.10);
}

.ny-session-inside:active {
    transform: translateY(0);
    box-shadow: none;
}

/* -- KOPIER NOTAT FEATURE: samme udtryk som Ny session; grøn kvittering -- */
.kopier-notat-btn {
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    color: #2f4b65;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 7px 12px;
}

.kopier-notat-btn.is-copied {
    background: rgba(40, 167, 100, 0.12);
    border-color: rgba(40, 167, 100, 0.30);
    color: #1e7a4a;
}

.consultation-mic {
    position: absolute;
    overflow: hidden;
    z-index: 3;
    border: 1px solid rgba(88, 110, 138, 0.28);
    background: linear-gradient(180deg, #edf3fb, #e3edf9);
    color: #2f4b65;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 0.82rem;
    padding: 7px 12px;
    transition: top 260ms ease, left 260ms ease, transform 260ms ease, box-shadow 260ms ease;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.consultation-mic::before {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--mic-fill, 0%);
    background: linear-gradient(90deg, rgba(67, 170, 98, 0.8), rgba(67, 170, 98, 0.55));
    transition: width 80ms linear;
}

.consultation-mic.is-recording {
    border-color: rgba(51, 138, 79, 0.45);
}

.consultation-mic,
.consultation-mic::before {
    border-radius: 999px;
}

.consultation-mic {
    isolation: isolate;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.consultation-mic span {
    position: relative;
    z-index: 1;
}


.editor-output {
    margin-top: 8px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    position: relative;
    z-index: 1;
}

.note-output-loading {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 4;
    pointer-events: none;
    display: flex;
    justify-content: center;
    padding: 0 10px;
}

.note-output-loading-line {
    max-width: min(680px, 92%);
    color: #3f5772;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(21, 50, 74, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 6px 18px rgba(15, 37, 58, 0.08);
}

.note-output-loading-caret {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-left: 3px;
    vertical-align: -2px;
    background: #2f6c8f;
    animation: fp-type-caret 850ms steps(1, end) infinite;
}

.editor-output textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    border: 0;
    resize: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    line-height: 1.55;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 0 6px 84px 0;
}

.editor-output textarea:focus {
    outline: none;
}

.note-output-editor {
    display: block;
    /* Luft mellem tekst og feltkant — scrollbaren bliver ved kanten,
       fordi paddingen ligger på editoren og ikke på scroll-containeren. */
    padding: 4px 24px 0 22px;
}

.editor-controls-inline {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    z-index: 120;
}

.editor-controls-inline.note-controls {
    width: 60%;
    max-width: 60%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    transition: width 180ms ease, max-width 180ms ease;
}

.editor-controls-inline.note-controls.is-expanded,
.editor-controls-inline.note-controls.is-scrollable {
    width: 90%;
    max-width: 90%;
}

.note-edit-shell {
    position: relative; /* anker for seddel-menuen, der svæver til højre for feltet */
    width: 100%;
    display: grid;
    gap: 6px;
}

.note-edit-disclaimer {
    margin-top: 18px;
    font-size: 0.74rem;
    line-height: 1.3;
    color: rgba(56, 76, 99, 0.78);
    text-align: center;
    user-select: none;
}

.editor-search-inline {
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(21, 50, 74, 0.12);
    background: #fbfdff;
    box-shadow: 0 10px 24px rgba(25, 49, 73, 0.08), 0 2px 6px rgba(25, 49, 73, 0.05);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
    padding: 4px;
    justify-self: center;
    width: 100%;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.editor-search-inline:hover,
.editor-search-inline:focus-within {
    box-shadow: 0 14px 32px rgba(25, 49, 73, 0.11), 0 4px 10px rgba(25, 49, 73, 0.07);
    transform: translateY(-1px);
}

.editor-search-inline-with-generate {
    position: relative;
    padding-right: 52px;
}

.editor-search-inline.note-edit-bar {
    overflow: visible;
}

.mic-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-color: currentColor;
    /* M2 "solid kapsel" — samme mic-ikon som kontrolpanelets knapper (13/7) */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='9' y='2.5' width='6' height='11' rx='3' fill='black' stroke='none'/%3E%3Cpath d='M5.5 11.5a6.5 6.5 0 0 0 13 0'/%3E%3Cpath d='M12 18v3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='9' y='2.5' width='6' height='11' rx='3' fill='black' stroke='none'/%3E%3Cpath d='M5.5 11.5a6.5 6.5 0 0 0 13 0'/%3E%3Cpath d='M12 18v3'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.mic-icon::before {
    content: none;
}

.mic-icon::after {
    content: none;
}

.mic-icon-sm {
    width: 15px;
    height: 15px;
}

.editor-search-inline input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 0;
    outline: none;
    background: transparent;
    color: #67798f;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 0 10px 0 14px;
}

.editor-search-inline.note-edit-bar.is-scrollable .note-edit-input {
    overflow-x: auto;
    text-overflow: clip;
    white-space: nowrap;
}

/* Ved udvidet felt (lang instruks, 90 % bredde) er der ikke plads til sedlerne til højre */
.editor-controls-inline.note-controls.is-expanded .seddel-menu,
.editor-controls-inline.note-controls.is-scrollable .seddel-menu {
    display: none;
}

/* Den runde ↑-knap i omnifeltet — sender teksten til LLM (Enter-flowet). */
.omni-send {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #1a2f45;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 140;
    transition: box-shadow 140ms ease, background 140ms ease;
}

.omni-send:hover:not(:disabled) {
    background: #244566;
    box-shadow: 0 4px 12px rgba(25, 49, 73, 0.28);
}

.omni-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.popup-backdrop {
    position: absolute;
    inset: 0;
    z-index: 25;
    border: 0;
    background: transparent;
    padding: 0;
    pointer-events: auto;
}

.popup-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8096b0;
    margin-bottom: 4px;
    padding: 2px 4px 6px;
    border-bottom: 1px solid rgba(21, 50, 74, 0.1);
}

@keyframes fp-type-caret {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.dict-admin-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dict-admin-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dict-admin-search,
.dict-admin-input {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(79, 115, 151, 0.22);
    background: rgba(255, 255, 255, 0.96);
    color: #28445d;
    padding: 10px 14px;
    font: inherit;
}

.dict-admin-search {
    flex: 1 1 auto;
}

.dict-admin-summary,
.dict-admin-state,
.dict-admin-status {
    border-radius: 14px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.74);
    color: #47627c;
    border: 1px solid rgba(79, 115, 151, 0.14);
}

.dict-admin-state-error,
.dict-admin-status-error {
    color: #8d2f36;
    border-color: rgba(170, 66, 76, 0.24);
    background: rgba(255, 241, 242, 0.95);
}

.dict-admin-status-ok {
    color: #245f47;
    border-color: rgba(55, 133, 96, 0.24);
    background: rgba(241, 251, 245, 0.95);
}

.dict-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: min(62vh, 760px);
    overflow: auto;
    padding-right: 4px;
}

.dict-admin-card {
    border-radius: 18px;
    border: 1px solid rgba(79, 115, 151, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(26, 49, 66, 0.08);
    padding: 16px;
}

.dict-admin-card-header,
.dict-admin-card-actions,
.dict-admin-edit-actions,
.dict-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dict-admin-row {
    align-items: flex-start;
    padding-top: 10px;
}

.dict-admin-label {
    width: 140px;
    flex: 0 0 140px;
    color: #70859b;
    font-size: 0.82rem;
}

.dict-admin-value {
    flex: 1 1 auto;
    color: #1f3f5b;
    font-weight: 600;
    white-space: pre-wrap;
    word-break: break-word;
}

.dict-admin-edit-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px 14px;
    margin-top: 14px;
}

.dict-admin-field {
    display: contents;
}

.dict-admin-field > span {
    align-self: center;
    color: #70859b;
    font-size: 0.82rem;
}

.dict-admin-textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.45;
}

.dict-admin-edit-actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.dict-admin-btn {
    min-height: 38px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0 14px;
    font: inherit;
    cursor: pointer;
}

.dict-admin-btn-primary {
    background: #243851;
    color: #fff;
}

.dict-admin-btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: #365879;
    border-color: rgba(79, 115, 151, 0.2);
}

.dict-admin-btn-danger {
    background: rgba(255, 244, 245, 0.95);
    color: #963e46;
    border-color: rgba(170, 66, 76, 0.18);
}

.dict-admin-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

@media (max-width: 860px) {
    .dict-admin-toolbar,
    .dict-admin-card-header,
    .dict-admin-card-actions,
    .dict-admin-edit-actions,
    .dict-admin-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dict-admin-edit-grid {
        grid-template-columns: 1fr;
    }

    .dict-admin-label {
        width: auto;
        flex: 0 0 auto;
    }
}

/* Editable name input in editor header */
.prompt-adjustment-name-input {
    flex: 1;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a2e44;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(47, 108, 143, 0.3);
    border-radius: 8px;
    padding: 4px 10px;
    outline: none;
    min-width: 0;
}

.prompt-adjustment-name-input:focus {
    border-color: rgba(47, 108, 143, 0.65);
    background: #fff;
}

    /* ── HTML editor toolbar ─────────────────────────────────────────────────── */
    .html-editor-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 7px 10px;
        flex-wrap: wrap;
        background: rgba(236, 243, 250, 0.88);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(47,108,143,0.18);
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(21,50,74,0.08), 0 0 0 0.5px rgba(255,255,255,0.6) inset;
        margin-bottom: 2px;
    }

    .html-editor-size-group {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 28px;
        padding-left: 2px;
        color: #49627d;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .html-editor-size-label {
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .html-editor-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 28px;
        padding: 0 8px;
        background: rgba(255,255,255,0.7);
        border: 1px solid rgba(47,108,143,0.22);
        border-radius: 6px;
        font: inherit;
        font-size: 0.82rem;
        color: #1a2e44;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
        box-shadow: 0 1px 3px rgba(21,50,74,0.06);
    }

    .html-editor-btn:hover {
        background: rgba(47,108,143,0.13);
        border-color: rgba(47,108,143,0.5);
        box-shadow: 0 2px 6px rgba(47,108,143,0.15);
    }

    .html-editor-btn:active {
        background: rgba(47,108,143,0.22);
        box-shadow: none;
    }

    .html-editor-separator {
        display: inline-block;
        width: 1px;
        height: 20px;
        background: rgba(47,108,143,0.22);
        margin: 0 4px;
    }

    .html-editor-size-select {
        height: 28px;
        padding: 0 22px 0 8px;
        background: rgba(255,255,255,0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(47,108,143,0.6)'/%3E%3C/svg%3E") no-repeat right 7px center;
        border: 1px solid rgba(47,108,143,0.22);
        border-radius: 6px;
        font: inherit;
        font-size: 0.82rem;
        color: #1a2e44;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        box-shadow: 0 1px 3px rgba(21,50,74,0.06);
        transition: border-color 0.15s, box-shadow 0.15s;
        min-width: 64px;
    }

    .html-editor-size-select option {
        color: #1a2e44;
    }

    .html-editor-size-select:focus {
        outline: none;
        border-color: rgba(47,108,143,0.5);
        box-shadow: 0 0 0 2px rgba(47,108,143,0.12);
    }

    .html-editor-size-select:hover {
        border-color: rgba(47,108,143,0.5);
        box-shadow: 0 2px 6px rgba(47,108,143,0.15);
    }

    /* ── Contenteditable field in prompt editor ──────────────────────────────── */
    .prompt-record-html-editor {
        width: 100%;
        font: inherit;
        font-size: 0.82rem;
        color: #1a2e44;
        background: rgba(255,255,255,0.7);
        border: 1px solid rgba(47,108,143,0.2);
        border-radius: 8px;
        padding: 6px 8px;
        box-sizing: border-box;
        min-height: 140px;
        overflow-y: auto;
        white-space: pre-wrap;
        word-break: break-word;
        cursor: text;
    }

    .prompt-record-html-editor:focus {
        outline: none;
        border-color: rgba(47,108,143,0.5);
        background: #fff;
    }

    .prompt-record-html-editor:empty::before {
        content: attr(data-placeholder);
        color: rgba(26,46,68,0.4);
        pointer-events: none;
    }

    .prompt-record-html-editor strong,
    .prompt-record-html-editor b {
        font-size: inherit;
        font-weight: 600;
    }

    .prompt-record-html-editor span:not([style*="font-size"]) {
        font-size: inherit;
    }

    .prompt-record-html-editor div,
    .prompt-record-html-editor p {
        font-size: inherit;
        margin: 0;
    }

    /* ── HTML output div (note output, contenteditable after LLM) ────────────── */
    .html-output {
        width: 100%;
        min-height: 100px;
        background: transparent;
        white-space: normal;
        word-break: break-word;
    }

    .html-output p,
    .html-output h1,
    .html-output h2,
    .html-output h3,
    .html-output h4,
    .html-output h5,
    .html-output h6,
    .html-output ul,
    .html-output ol,
    .html-output li,
    .html-output div {
        margin-top: 0;
        margin-bottom: 0.35em;
    }

    .html-output p:last-child,
    .html-output h1:last-child,
    .html-output h2:last-child,
    .html-output h3:last-child,
    .html-output h4:last-child,
    .html-output h5:last-child,
    .html-output h6:last-child,
    .html-output ul:last-child,
    .html-output ol:last-child,
    .html-output li:last-child,
    .html-output div:last-child {
        margin-bottom: 0;
    }

    .html-output[contenteditable="true"] {
        outline: none;
        cursor: text;
    }

    .html-output strong { font-weight: bold; }
    .html-output em { font-style: italic; }
    .html-output u { text-decoration: underline; }

.prompt-new-save-btn {
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(180deg, #3b7fcb, #2f6aad);
    color: #fff;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.prompt-new-save-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 1000px) {
    body {
        --shell-padding: 12px;
        padding: 0 !important;
        overflow: auto;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .divider-left::before {
        display: none;
    }

    .focus-main-panel {
        min-height: 0;
    }

    .prompt-adjustment-shell {
        display: block;
    }

    .prompt-record-grid {
        grid-template-columns: 1fr;
    }

    .prompt-sidebar-menu {
        flex-direction: row;
    }
    .editor-controls-inline.note-controls {
        width: 100%;
        max-width: 100%;
    }

    .settings-modal {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .tour-onboarding-card,
    .tour-hint-card {
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .settings-db-form {
        grid-template-columns: 1fr;
    }

    .settings-mic-layout {
        grid-template-columns: 1fr;
    }
}

/* 24/7 (Mortens beslutning): pillen sidder mellem ▦ og Log ud, følger den
   AKTUELLE teksts bredde (ingen max-width/ellipsis — bredden glider med
   ved hvert tekstskifte) og har fået glas-look med blid glød. */
.topbar-user-pill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    color: #f6fbff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 8px rgba(9, 20, 30, 0.25);
    transition: background 140ms ease, border-color 140ms ease,
                transform 120ms ease, box-shadow 140ms ease;
}

.topbar-user-pill:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12));
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(9, 20, 30, 0.35);
}

.topbar-user-pill:active {
    transform: translateY(0);
}

.topbar-user-pill-text {
    display: inline-block;
    animation: portal-pill-swap 200ms ease;
}

@keyframes portal-pill-swap {
    from {
        opacity: 0.45;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Login overlay (unauthenticated state) ─────────────────────────────── */
.auth-login-overlay {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 28, 48, 0.55);
    backdrop-filter: blur(6px);
}

.auth-login-box {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(21, 50, 74, 0.12);
    box-shadow: 0 12px 40px rgba(21, 50, 74, 0.14);
    padding: 40px 44px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-login-box strong {
    display: block;
    font-size: 1.1rem;
    color: #15324a;
}

.auth-login-box span {
    display: block;
    font-size: 0.875rem;
    color: #33495d;
    line-height: 1.5;
}

.auth-login-mitid-btn {
    margin-top: 12px;
    background: #15324a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 32px;
    cursor: pointer;
    transition: background 160ms ease, transform 120ms ease;
}

.auth-login-mitid-btn:hover {
    background: #1e4668;
    transform: translateY(-1px);
}

.auth-login-mitid-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────────────── */

@keyframes fp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}


@keyframes fp-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


@keyframes fp-slide-in-left {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fp-recording-ring {
    0%   { box-shadow: 0 0 0 0 rgba(51, 138, 79, 0.45); }
    60%  { box-shadow: 0 0 0 8px rgba(51, 138, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(51, 138, 79, 0); }
}


/* ── Agent answer buttons: slide-in stagger ────────────────────────────── */
.agent-answer-button {
    animation: fp-slide-in-left 220ms ease both;
    transition: background 130ms ease, border-color 130ms ease,
                transform 120ms ease, box-shadow 120ms ease;
}
.agent-answer-button:nth-child(1)  { animation-delay:  20ms; }
.agent-answer-button:nth-child(2)  { animation-delay:  55ms; }
.agent-answer-button:nth-child(3)  { animation-delay:  90ms; }
.agent-answer-button:nth-child(4)  { animation-delay: 125ms; }
.agent-answer-button:nth-child(5)  { animation-delay: 160ms; }
.agent-answer-button:nth-child(n+6){ animation-delay: 190ms; }

.agent-answer-button:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 7px rgba(17, 50, 80, 0.10);
}

/* ── Consultation mic — pulse ring while recording ─────────────────────── */
.consultation-mic.is-recording {
    animation: fp-recording-ring 1.6s ease-out infinite;
}

/* ── Topbar buttons ────────────────────────────────────────────────────── */
.topbar-icon-btn,
.topbar-logout-btn {
    transition: background 140ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.topbar-icon-btn.topbar-pip-active {
    background: rgba(67, 170, 98, 0.22);
    border-color: rgba(67, 170, 98, 0.55);
    color: #5bc47a;
}
.topbar-icon-btn:hover,
.topbar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}
.topbar-icon-btn:active,
.topbar-logout-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Tour button pulse ─────────────────────────────────────────────────── */
.topbar-tour-btn {
    animation: fp-tour-pulse 2.6s ease-in-out infinite;
}

@keyframes fp-tour-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
    50%       { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

/* ── CPR activate / journal-ask buttons ────────────────────────────────── */
.cpr-activate-btn,
.journal-ask-btn {
    transition: background 140ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.cpr-activate-btn:hover:not(:disabled),
.journal-ask-btn:hover:not(:disabled) {
    background: #243f5a;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 5px rgba(10, 25, 45, 0.11);
}
.cpr-activate-btn:active:not(:disabled),
.journal-ask-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.97);
    box-shadow: none;
}

/* ── Settings modal entry ──────────────────────────────────────────────── */
.settings-modal {
    animation: fp-slide-up 200ms cubic-bezier(.22,.68,0,1.1) both;
}

.settings-modal-backdrop {
    animation: fp-fade-in 160ms ease both;
}

/* ── Settings tab hover ────────────────────────────────────────────────── */
.settings-tab {
    transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}
.settings-tab:hover:not(.is-active) {
    background: rgba(208, 228, 248, 0.6);
    border-color: rgba(47, 108, 143, 0.28);
    color: #21425f;
}

/* ── Settings DB/mic buttons ────────────────────────────────────────────── */
.settings-db-btn {
    transition: background 130ms ease, transform 110ms ease;
}
.settings-db-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f0f6ff, #e5f0ff);
    transform: translateY(-1px);
}

/* ── Journal answer modal entry ─────────────────────────────────────────── */
.journal-answer-modal {
    animation: fp-fade-in 180ms ease both;
}
.journal-answer-modal-backdrop {
    animation: fp-fade-in 180ms ease both;
}

/* ── Subscription access toast ─────────────────────────────────────────── */
.subscription-access-toast {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 1300;
    max-width: min(460px, calc(100vw - 32px));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(158, 48, 24, 0.25);
    background: linear-gradient(180deg, #fff3ef, #ffe8e0);
    color: #6b1f0d;
    box-shadow: 0 10px 28px rgba(53, 22, 8, 0.18);
    font-size: 13px;
    line-height: 1.4;
    animation: fp-toast-in 220ms cubic-bezier(.2,.8,.2,1) both;
}

.subscription-access-toast-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(158, 48, 24, 0.35);
    background: rgba(158, 48, 24, 0.14);
    font-weight: 700;
    font-size: 12px;
    flex: 0 0 auto;
}

@keyframes fp-toast-in {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .subscription-access-toast {
        top: 14px;
        right: 14px;
        left: 14px;
        max-width: none;
    }
}

/* ── MCP connection badge pop when status changes ───────────────────────── */
.mcp-conn-badge {
    transition: background 300ms ease, color 300ms ease, border-color 300ms ease;
}

/* ── Prompt adjustment nav buttons hover ────────────────────────────────── */
.prompt-adjustment-nav-btn {
    transition: background 130ms ease, border-color 130ms ease, color 130ms ease,
                transform 110ms ease;
}
.prompt-adjustment-nav-btn:hover:not(.is-active) {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.9);
}

/* ── Prompt adjustment close button ────────────────────────────────────── */
.prompt-adjustment-close {
    transition: background 130ms ease, transform 110ms ease;
}
.prompt-adjustment-close:hover {
    background: rgba(47, 108, 143, 0.1);
    transform: translateY(-1px);
}

/* ── Guided tour ───────────────────────────────────────────────────────────
   Rundtur v2 (25/7): filmens overlays OG spotlight-motorens kort/highlight
   bor nu i css/rundtur.css — kun /minklinik-knappen er tilbage her. */

/* 24/7: rundturs-triggeren på /minklinik — pakken har ingen topbar, så
   ℹ bor fast øverst til højre; over hint-backdroppen (90), under turens
   overlay (9800). */
.mk-tour-btn {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 95;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(29, 67, 99, 0.35);
    background: #fff;
    color: var(--navy, #1d4363);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(17, 31, 41, 0.18);
    transition: transform 120ms ease, box-shadow 140ms ease;
}

.mk-tour-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(17, 31, 41, 0.26);
}

/* Vejen tilbage til appen (26/7): Min klinik har ingen topbjælke, og uden
   ejer-adgang er siden ellers en blindgyde. Samme udtryk som ℹ-knappen —
   modsatte hjørne, pilleform fordi den bærer tekst. */
.mk-tilbage-btn {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 95;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(29, 67, 99, 0.35);
    background: #fff;
    color: var(--navy, #1d4363);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(17, 31, 41, 0.18);
    transition: transform 120ms ease, box-shadow 140ms ease;
}

.mk-tilbage-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(17, 31, 41, 0.26);
}

.mk-tilbage-pil {
    font-size: 1.05rem;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    .mk-tilbage-btn:hover {
        transform: none;
    }
}


/* ── TRANSCRIPT FIND PANEL ──────────────────────────────────────────────────── */

.transcript-find-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 340px;
    max-height: 60vh;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transcript-find-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.transcript-find-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.transcript-find-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.transcript-find-badge--exact {
    background: #d1fae5;
    color: #065f46;
}

.transcript-find-badge--fuzzy {
    background: #fef3c7;
    color: #92400e;
}

.transcript-find-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #64748b;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}

.transcript-find-panel-close:hover {
    color: #1e293b;
}

.transcript-find-panel-query {
    padding: 8px 16px 4px;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.transcript-find-panel-query em {
    font-style: italic;
    word-break: break-word;
}

.transcript-find-panel-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.transcript-find-context {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.65;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.transcript-find-no-result {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

/* ── MCP svar-popup: to-kolonne redesign ───────────────────────────────────── */
.journal-answer-modal--split {
    width: min(1280px, calc(100% - 32px));
    /* Fast højde — popup'en skal altid have den store størrelse, uanset hvor mange
       notater der vises i venstre kolonne. Kolonnerne scroller internt. */
    height: min(90vh, 1020px);
    grid-template-rows: 1fr;
    grid-template-columns: 270px minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
}

/* Venstre kolonne */
.journal-split-menu {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid rgba(47, 108, 143, 0.16);
    background: rgba(255, 255, 255, 0.55);
}

.journal-menu-search {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px;
    border-bottom: 1px solid rgba(47, 108, 143, 0.12);
}

.journal-menu-search-icon { color: #5a7290; font-size: 0.95rem; }

.journal-menu-search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(47, 108, 143, 0.22);
    border-radius: 8px;
    padding: 7px 9px;
    font: inherit;
    font-size: 0.82rem;
    color: #1e3c58;
    background: #fff;
    outline: none;
}
.journal-menu-search-input:focus { border-color: #2f6c8f; box-shadow: 0 0 0 3px rgba(47, 108, 143, 0.14); }

.journal-menu-pin {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 8px 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #1e3c58;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.journal-menu-pin:hover { background: rgba(47, 108, 143, 0.08); }
.journal-menu-pin.is-active { background: rgba(47, 108, 143, 0.14); color: #15405e; }
.journal-menu-pin-icon { color: #2f6c8f; }

/* Højre kolonne */
.journal-split-main { display: flex; flex-direction: column; min-height: 0; }

.journal-split-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(47, 108, 143, 0.14);
    flex-shrink: 0;
}
.journal-split-stamp { font-size: 0.74rem; color: #6a82a0; }
.journal-split-export { margin-left: auto; position: relative; }

.journal-export-btn {
    border: 1px solid rgba(47, 108, 143, 0.24);
    border-radius: 9px;
    background: #fff;
    color: #2a4d6c;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
}
.journal-export-btn:hover:not(:disabled) { background: rgba(47, 108, 143, 0.07); }
.journal-export-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.journal-export-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 5;
    width: 210px;
    background: #fff;
    border: 1px solid rgba(47, 108, 143, 0.2);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(21, 50, 74, 0.18);
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.journal-export-item {
    border: 0;
    background: transparent;
    color: #2a4d6c;
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.journal-export-item:hover:not(:disabled) { background: rgba(47, 108, 143, 0.08); }
.journal-export-item:disabled { opacity: 0.45; cursor: not-allowed; }

.journal-split-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 16px 20px;
}

/* Resumé-panel i to kolonner: indhold + lodret forløbs-skinne til højre. */
.journal-summary-layout { display: block; }
.journal-summary-layout.has-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 26px;
    align-items: start;
}
.journal-summary-main { min-width: 0; }
.journal-summary-rail {
    position: sticky;
    top: 0;
    align-self: start;
    padding-left: 20px;
    border-left: 1px solid rgba(47, 108, 143, 0.14);
}
@media (max-width: 900px) {
    .journal-summary-layout.has-rail { grid-template-columns: 1fr; }
    .journal-summary-rail { position: static; padding-left: 0; border-left: 0;
        border-top: 1px solid rgba(47, 108, 143, 0.14); padding-top: 12px; margin-top: 8px; }
}

.journal-summary-label { font-size: 0.72rem; color: #6a82a0; display: flex; align-items: center; gap: 5px; }
.journal-summary-theme { margin: 4px 0 14px; font-size: 1.1rem; font-weight: 600; color: #15405e; }
.journal-summary-text { line-height: 1.65; color: #243f59; }

.journal-citation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    margin: 0 1px;
    padding: 0 4px;
    border: 1px solid rgba(47, 108, 143, 0.3);
    border-radius: 5px;
    background: rgba(47, 108, 143, 0.1);
    color: #1f5f86;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: super;
    cursor: pointer;
}
.journal-citation:hover { background: #2f6c8f; color: #fff; }
.journal-citation + .journal-citation { margin-left: 3px; }

/* Kildelink som selve teksten: linjen er klikbar og åbner kildenotatet. */
.resume-srcline {
    display: inline;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.resume-srcline:hover,
.resume-srcline:focus-visible {
    color: #1f5f86;
    border-bottom-color: rgba(47, 108, 143, 0.5);
    outline: none;
}

/* ── Patientresumé (struktureret journal_resume-visning, se PatientResume.razor) ── */
.resume-cave {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 6px;
    padding: 10px 14px;
    border-radius: 9px;
    background: rgba(226, 75, 74, 0.08);
    border: 1px solid rgba(226, 75, 74, 0.35);
    color: #9c2827;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
}
.resume-cave-icon { flex-shrink: 0; }

/* Struktureret resumé må ikke arve pre-wrap: Razor-skabelonens linjeskift ville
   ellers blive til synligt mellemrum mellem overskrift og første punkt. */
.resume-root { white-space: normal; }

.resume-sec { margin-top: 22px; }
.resume-sec:first-child { margin-top: 4px; }
.resume-sec h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #15405e;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(47, 108, 143, 0.28);
}
.resume-sec ul { margin: 0; padding: 0; list-style: none; }
.resume-sec li {
    position: relative;
    padding: 4px 0 4px 16px;
    line-height: 1.55;
    color: #243f59;
    font-size: 0.9rem;
}
.resume-sec li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.85em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(47, 108, 143, 0.55);
}
.resume-note {
    font-weight: 400;
    font-size: 0.68rem;
    text-transform: none;
    letter-spacing: normal;
    color: #a07a1f;
}

.journal-notfound {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fef3c7;
    border: 1px solid #fcd96b;
    color: #7a5600;
    font-size: 0.82rem;
    line-height: 1.5;
}
.journal-notfound-icon { margin-top: 1px; }
.journal-notfound strong { font-weight: 700; }

.journal-detail-title { font-size: 0.95rem; font-weight: 600; color: #15405e; }
.journal-detail-meta { font-size: 0.74rem; color: #6a82a0; margin: 2px 0 14px; }
.journal-detail-text { line-height: 1.65; color: #243f59; }
/* Notatkrop opdelt i afsnit ved kliniske sektions-headere (RenderStructuredNoteBody). */
.note-para { margin: 0 0 11px; line-height: 1.62; }
.note-para:last-child { margin-bottom: 0; }
.note-para-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #55708c;
    margin-bottom: 2px;
}
.journal-hl { background: #fde68a; color: #5b4500; border-radius: 3px; padding: 0 2px; }

/* Opdelt notat: sammenfoldelig formalia, diagnose-pills, klinisk krop, signatur */
.journal-detail-formalia { margin: 0 0 12px; }
.journal-detail-formalia > summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.76rem;
    color: #6a82a0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.journal-detail-formalia > summary::-webkit-details-marker { display: none; }
.journal-detail-formalia > summary::before {
    content: "";
    width: 0; height: 0;
    border-left: 4px solid #9db2c9;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.12s ease;
}
.journal-detail-formalia[open] > summary::before { transform: rotate(90deg); }
.journal-detail-formalia-body { margin: 8px 0 0 14px; font-size: 0.78rem; color: #55708c; line-height: 1.65; }
.journal-detail-formalia-body > div { margin: 1px 0; }
.journal-detail-formalia-body span { color: #93a6bd; margin-right: 6px; }

.journal-detail-diagnoser { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.journal-diag-pill {
    font-size: 0.72rem;
    color: #15405e;
    background: #eaf1f8;
    border-radius: 999px;
    padding: 3px 10px;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.journal-diag-pill code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    color: #1d6ea5;
}
.journal-detail-signatur { margin: 14px 0 0; font-size: 0.78rem; color: #93a6bd; font-style: italic; }

.journal-split-kbd {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 14px;
    border-top: 1px solid rgba(47, 108, 143, 0.14);
    background: rgba(47, 108, 143, 0.04);
    font-size: 0.7rem;
    color: #6a82a0;
}
.journal-split-kbd-label { color: #8499b0; }
.journal-split-kbd kbd {
    font-family: var(--font-mono, monospace);
    font-size: 0.66rem;
    background: #fff;
    border: 1px solid rgba(47, 108, 143, 0.22);
    border-radius: 4px;
    padding: 1px 5px;
    color: #355879;
}

@media (max-width: 640px) {
    .journal-answer-modal--split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 40%) minmax(0, 60%);
    }
    .journal-split-menu { border-right: 0; border-bottom: 1px solid rgba(47, 108, 143, 0.16); }
}

/* ── MCP tool-output: collapsible drawer i højre skærmside ──────────────────── */
.mcp-debug-drawer {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 82;
    display: flex;
    align-items: stretch;
    max-height: 84vh;
}

.mcp-debug-tab {
    writing-mode: vertical-rl;
    border: 1px solid rgba(47, 108, 143, 0.24);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: rgba(246, 251, 255, 0.98);
    color: #2a4d6c;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 12px 7px;
    cursor: pointer;
    box-shadow: -4px 0 14px rgba(21, 50, 74, 0.12);
    align-self: center;
}
.mcp-debug-tab:hover { background: #fff; color: #15405e; }
.mcp-debug-tab-text { transform: rotate(180deg); }

.mcp-debug-content {
    width: min(360px, calc(100vw - 48px));
    max-height: 84vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(180deg, rgba(246, 251, 255, 0.99), rgba(235, 245, 255, 0.99));
    border: 1px solid rgba(47, 108, 143, 0.22);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    box-shadow: -16px 0 36px rgba(21, 50, 74, 0.2);
    padding: 14px 16px;
    display: grid;
    gap: 10px;
    align-content: start;
}

.mcp-debug-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #1e3c58;
    font-size: 0.9rem;
}
.mcp-debug-close {
    border: 0;
    border-radius: 8px;
    width: 26px;
    height: 26px;
    font-size: 1rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.7);
    color: #355879;
    cursor: pointer;
}
.mcp-debug-close:hover { background: #fff; }

@media (max-width: 640px) {
    .mcp-debug-drawer { top: auto; bottom: 8px; transform: none; }
    .mcp-debug-tab { writing-mode: horizontal-tb; border-radius: 10px 0 0 10px; }
    .mcp-debug-tab-text { transform: none; }
}

/* Note-detalje: header med "medtag i eksport"-knap */
.journal-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.journal-detail-pick {
    flex-shrink: 0;
    border: 1px solid rgba(47, 108, 143, 0.28);
    border-radius: 999px;
    background: #fff;
    color: #2a4d6c;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.journal-detail-pick:hover { background: rgba(47, 108, 143, 0.08); }
.journal-detail-pick.is-selected {
    background: #2f6c8f;
    border-color: #2f6c8f;
    color: #fff;
}


/* ── Login-side (/login) ──────────────────────────────────────────────────── */

/* 24/7: registreringskortet er højere end viewporten — SIDEN (ikke kortet)
   scroller, og kortet lægger ud fra toppen, så bunden altid kan nås.
   Login-kortet (uden fp-onb-forloeb) centreres fortsat som før. */
.fp-login-page:has(.fp-onb-forloeb) {
    /* kolonne-flex: align-items = VANDRET (forbliver centreret fra basen);
       justify-content flex-start = lægger ud fra toppen, så scrollen kan nå
       både top og bund af det høje kort. */
    justify-content: flex-start;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Loginflowet kører kant-til-kant som på main — app-hostens shell-padding
   (Kurts 14 px-kanvas-ramme, 20/7) gælder kun hovedskærmen. */
div.app-host:has(.fp-login-page),
div.app-host:has(.fp-invitation),
div.app-host:has(.fp-aftale) {
    padding: 0;
}

.fp-login-page {
    /* relative + hidden: den animerede baggrund (LoginBackdrop) ligger absolut
       med inset:-20px og må ikke give scrollbars */
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    /* K1 (godkendt 16/7): blålig øverst venstre, grønlig øverst højre,
       diskret varmt skær i bunden mod højre. */
    background:
        radial-gradient(ellipse 60% 55% at 0% 0%, #d4e5f4 0%, rgba(212, 229, 244, 0) 70%),
        radial-gradient(ellipse 55% 50% at 100% 0%, #d9efe4 0%, rgba(217, 239, 228, 0) 70%),
        radial-gradient(ellipse 65% 55% at 95% 100%, #f6e3da 0%, rgba(246, 227, 218, 0) 72%),
        radial-gradient(ellipse 45% 40% at 40% 100%, #f3ece2 0%, rgba(243, 236, 226, 0) 65%),
        linear-gradient(180deg, #eef3f7 0%, #edf2f5 100%);
}

/* K5: login-kortets tekstlinjer — ens mellemrum (22 px). */
.fp-login-linje {
    margin: 22px 0 0;
    font-size: 0.9rem;
    color: #33506a;
    line-height: 1.55;
}

/* Kendt MitID-afvisning (fx erhvervs-login uden virksomhedstilknytning) —
   gul forklaring øverst på login-kortet, K40-farvesproget. */
.fp-login-advarsel {
    margin-top: 18px;
    background: #fdf3e0;
    border: 1px solid #f0d9ad;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 0.84rem;
    color: #7a4b12;
    line-height: 1.55;
}

.fp-login-linje--foerste {
    font-size: 0.95rem;
    color: #15324a;
}

.fp-login-linje--dæmpet {
    color: #607284;
}

.fp-login-linje--trial {
    color: #0f6e56;
    font-weight: 500;
}

.fp-login-trial {
    margin-top: 16px;
    font-size: 0.85rem !important;
    opacity: 0.75;
}

.fp-login-btn-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* MitID-knapper: lys blå gradient som main. */
.fp-login-btn {
    flex: 1;
    background: linear-gradient(180deg, #3b7fcb, #2f6aad);
    color: #fff;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.fp-login-btn--mitid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.fp-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 40, 68, 0.18);
}

.fp-login-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.fp-login-btn-split {
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, #3b7fcb, #2f6aad);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.fp-login-btn-split:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 40, 68, 0.18);
}

.fp-login-btn-split:active {
    transform: translateY(0);
    box-shadow: none;
}

.fp-login-btn-split-main {
    flex: 1;
    background: transparent;
    color: #fff;
    border: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
}

.fp-login-btn-split-toggle {
    flex-shrink: 0;
    background: transparent;
    color: #fff;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 1.1rem;
    padding: 12px 16px;
    cursor: pointer;
    line-height: 1;
    transition: transform 120ms ease;
}

.fp-login-btn-split-toggle:hover {
    transform: rotate(180deg);
}

.fp-login-spinner {
    font-size: 0.88rem;
    color: var(--muted);
}

/* ── End login-side ───────────────────────────────────────────────────────── */

/* ── Advarselstekst i onboarding-formularer ────────────────────────────────── */

.fp-oplysninger-warning {
    font-size: 0.85rem !important;
    color: #b45309;
}

/* ── Onboarding v2 — enkel midterboks (jf. docs/design/onboarding_boks_design.html) ──
   Én centreret boks på den varme gradient: FlowPilot-navnetræk øverst til venstre
   på siden, overskrift + én kort linje i boksen, fuldbredde navy-knapper. ──────── */

/* FlowPilot-navnetræk (FlowPilotBrand.razor) med intermitterende B3-animation:
   teksten viger hvert ~9. sekund for logomærket, der tegner sig selv. */

.fp-brand {
    position: fixed;
    top: 20px;
    left: 24px;
    height: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.fp-brand-tekst {
    display: inline-block;
    animation: fp-brand-tekst 9s ease infinite;
}

.fp-brand-maerke {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    animation: fp-brand-maerke 9s ease infinite;
}

.fp-brand-maerke rect {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: fp-brand-ramme 9s ease infinite;
}

.fp-brand-maerke path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: fp-brand-boelge 9s ease infinite;
}

.fp-brand-maerke path:nth-of-type(2) { animation-delay: 0.18s; }
.fp-brand-maerke path:nth-of-type(3) { animation-delay: 0.36s; }

@keyframes fp-brand-tekst {
    0%, 17%  { opacity: 1; transform: translateY(0); }
    21%, 39% { opacity: 0; transform: translateY(-5px); }
    44%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes fp-brand-maerke {
    0%, 19%  { opacity: 0; }
    23%, 37% { opacity: 1; }
    41%, 100% { opacity: 0; }
}

@keyframes fp-brand-ramme {
    0%, 20%  { stroke-dashoffset: 100; }
    27%, 38% { stroke-dashoffset: 0; }
    42%, 100% { stroke-dashoffset: 100; }
}

@keyframes fp-brand-boelge {
    0%, 24%  { stroke-dashoffset: 30; }
    31%, 38% { stroke-dashoffset: 0; }
    42%, 100% { stroke-dashoffset: 30; }
}

.fp-onb2-card {
    /* over den slørede login-baggrund (LoginBackdrop) */
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 38px 40px;
    width: 100%;
    max-width: 480px;
}

/* Variant til PIN-feltet — smalt med spredte cifre */
.fp-onb2-input--pin {
    max-width: 160px;
    letter-spacing: 0.25em;
}

.fp-onb2-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 8px;
    line-height: 1.25;
}

.fp-onb2-sub {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 22px;
}

/* Login-siden: dobbelt luft mellem overskrift og undertekst */
.fp-onb2-heading--luft {
    margin-bottom: 16px;
}

/* Mikroanimation C2 (valgt 2026-07-07): en teal-blå farvebølge glider gennem
   ordet "FlowPilot" i overskriften hvert 9. sekund og forsvinder igen.
   Gradientens yderkanter er navy, så ordet står i normal farve mellem løbene. */
.fp-ord-skimmer {
    background: linear-gradient(100deg,
        var(--navy) 0%, var(--navy) 38%,
        #3f97a6 46%, #4a86b8 50%, #86bdb5 54%,
        var(--navy) 62%, var(--navy) 100%);
    background-size: 320% 100%;
    background-position: 110% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fp-ord-skim 9s ease-in-out infinite;
}

@keyframes fp-ord-skim {
    0%, 80%   { background-position: 110% 0; }
    97%, 100% { background-position: -110% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fp-ord-skimmer {
        animation: none;
        background: none;
        color: var(--navy);
    }
}

/* Login-siden: dobbelt luft mellem underteksten og MitID-knappen */
.fp-onb2-sub--luft {
    margin-bottom: 44px;
}

.fp-onb2-btn {
    width: 100%;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.fp-onb2-btn:hover {
    background: #1d4363;
}

.fp-onb2-annuller {
    display: block;
    margin: 18px auto 0;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}

.fp-onb2-annuller:hover {
    color: var(--navy);
}

/* Formularfelter i onboarding v2-boksen (Registrering, DPA-gate) */

.fp-onb2-label {
    display: block;
    font-size: 0.82rem;
    color: var(--navy);
    font-weight: 600;
    margin-bottom: 5px;
}

.fp-onb2-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c3ccd4;
    border-radius: 6px;
    font: inherit;
    font-size: 0.92rem;
    margin-bottom: 16px;
    background: #fff;
    color: var(--ink);
    box-sizing: border-box;
}

.fp-onb2-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 108, 143, 0.15);
}

/* Navn fra MitID — låst felt med mærkat */
.fp-onb2-navn {
    position: relative;
    margin-bottom: 16px;
}

.fp-onb2-navn .fp-onb2-input {
    background: #f1efe8;
    color: #5f5e5a;
    border-color: #d5dbe0;
    margin-bottom: 0;
}

.fp-onb2-navn-tag {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888780;
}

/* Klinik-søgning med autocomplete-liste */
.fp-onb2-soeg {
    position: relative;
    margin-bottom: 16px;
}

.fp-onb2-soeg .fp-onb2-input {
    padding-left: 34px;
    margin-bottom: 0;
}

.fp-onb2-soeg--aaben .fp-onb2-input {
    border-color: var(--blue);
    border-radius: 6px 6px 0 0;
}

.fp-onb2-soeg-ikon {
    position: absolute;
    left: 11px;
    top: 12px;
    color: #888780;
    pointer-events: none;
}

.fp-onb2-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--blue);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #fff;
    max-height: 150px;
    overflow: auto;
}

.fp-onb2-liste li {
    padding: 8px 12px 8px 34px;
    font-size: 0.9rem;
    color: var(--ink);
    cursor: pointer;
    border-bottom: 1px solid #f1efe8;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.fp-onb2-liste li:last-child { border-bottom: none; }

.fp-onb2-liste li:hover { background: #eef4f7; }

.fp-onb2-liste-cvr {
    color: #888780;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Checkbokse (klinikejer, vilkår) */
.fp-onb2-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--ink);
    line-height: 1.5;
    margin-bottom: 14px;
    cursor: pointer;
}

.fp-onb2-check input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--navy);
}

.fp-onb2-check a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
}

/* (?)-hjælpeikon med hover-forklaring */
.fp-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border: 1px solid var(--blue);
    border-radius: 50%;
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
}

.fp-help-tip {
    display: none;
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 290px;
    background: var(--navy);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    z-index: 10;
}

.fp-help:hover .fp-help-tip { display: block; }

/* Settings-fanen "Klinik": nuværende klinik m. DPA-badge + skift via CVR-søgning */

.settings-klinik-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-klinik-nuvaerende {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-klinik-navn {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.settings-klinik-cvr {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
}

.fp-dpa-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
}

.fp-dpa-badge--ok {
    background: #e1f5ee;
    color: #085041;
}

.fp-dpa-badge--mangler {
    background: #faeeda;
    color: #633806;
}

.settings-klinik-skift {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.settings-klinik-skift .settings-db-btn {
    align-self: flex-start;
}

.settings-klinik-status--ok {
    color: #0f6e56;
}

.settings-klinik-status--advarsel {
    color: #b45309;
}

/* ── End Onboarding v2 ─────────────────────────────────────────────────────── */

/* ── AUTOLÆRING: sektionsmenu, status-bjælke, fortryd og ✦ Lært ─────────────────
   Se docs/design/redigering-laering-spec.md. ▾-triggeren ved hver sektions-
   overskrift åbner en menu (kortere/længere/punktform/…); valget udføres straks. */

/* Diskret ▾-trigger efter hver sektionsoverskrift i notatet.
   Nedtonet i hvile, træder først frem ved hover på sektionen eller fokus. */
.fp-sek-rediger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #9aa8b8;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: 1px;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

/* Vis triggeren, når musen er over sektionen, ved tastatur-fokus, eller når dens menu er åben */
[data-fp-seg]:hover .fp-sek-rediger,
.fp-sek-rediger:focus-visible,
.fp-sek-rediger.is-aaben {
    opacity: 1;
}

.fp-sek-rediger:hover,
.fp-sek-rediger.is-aaben {
    background: rgba(47, 108, 143, 0.1);
    color: #3f6b96;
}

/* Popover-menuen (bor i document.body) */
.fp-sek-menu {
    position: fixed;
    z-index: 4000;
    min-width: 190px;
    padding: 5px;
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(25, 49, 73, 0.16);
    font-size: 0.85rem;
    color: #24384d;
    animation: fp-sek-menu-ind 0.12s ease-out;
}

@keyframes fp-sek-menu-ind {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fp-sek-menu-punkt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background 0.12s ease;
}

.fp-sek-menu-punkt:hover,
.fp-sek-menu-punkt:focus-visible {
    background: rgba(47, 108, 143, 0.1);
    outline: none;
}

.fp-sek-menu-hint {
    padding: 7px 12px 4px;
    margin-top: 3px;
    border-top: 1px solid rgba(21, 50, 74, 0.08);
    font-size: 0.72rem;
    line-height: 1.35;
    color: #8595a7;
}

/* Spinner i status-bjælken mens en sektionsordre udføres */
.fp-ordre-spinner {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(47, 108, 143, 0.25);
    border-top-color: #2f6c8f;
    border-radius: 50%;
    animation: fp-ordre-spin 0.7s linear infinite;
}

@keyframes fp-ordre-spin {
    to { transform: rotate(360deg); }
}

/* Blød highlight der toner væk, når en sektions-ordre er applikeret (ingen diff) */
.fp-sek-flash {
    animation: fp-sek-flash-anim 2.4s ease-out both;
    border-radius: 6px;
}

@keyframes fp-sek-flash-anim {
    0%   { background: rgba(122, 197, 154, 0.38); box-shadow: 0 0 0 4px rgba(122, 197, 154, 0.22); }
    60%  { background: rgba(122, 197, 154, 0.16); box-shadow: 0 0 0 4px rgba(122, 197, 154, 0.08); }
    100% { background: transparent; box-shadow: none; }
}

/* Fælles bjælke-look (matcher editor-search-inline-familien) */
.fp-ordre-bar,
.fp-fortryd-bar,
.fp-laer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 999px;
    background: #fbfdff;
    box-shadow: 0 8px 22px rgba(25, 49, 73, 0.09);
    padding: 6px 8px 6px 14px;
    margin-bottom: 8px;
    font-size: 0.84rem;
    color: #2a4d6c;
}

/* Fejl-varianten af status-bjælken (efter basereglen, så farverne vinder) */
.fp-ordre-bar-fejl {
    border-color: rgba(196, 110, 90, 0.45);
    background: rgba(251, 236, 232, 0.6);
    color: #7a3b28;
}

.fp-laer-bar {
    border-color: rgba(217, 139, 82, 0.45);
    background: rgba(251, 238, 226, 0.55);
    color: #5a3a1c;
}

/* Effektmålingen har fjernet en regel — dæmpet, informativ */
.fp-laer-bar-fjernet {
    border-color: rgba(120, 134, 150, 0.35);
    background: rgba(236, 240, 245, 0.6);
    color: #4a5b6d;
}

/* Genforslag — et spørgsmål, ikke en konstatering */
.fp-laer-bar-forslag {
    border-color: rgba(88, 132, 176, 0.45);
    background: rgba(230, 240, 250, 0.6);
    color: #2a4d6c;
}

.fp-bar-ja {
    flex-shrink: 0;
    border: 1px solid rgba(63, 118, 92, 0.4);
    border-radius: 999px;
    background: linear-gradient(180deg, #eaf6ef, #dcefe4);
    color: #2c5c44;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
}

.fp-bar-ja:hover { background: #d3ecdd; transform: translateY(-1px); }

.fp-bar-tekst {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-bar-fortryd,
.fp-bar-ok {
    flex-shrink: 0;
    border: 1px solid rgba(21, 50, 74, 0.2);
    border-radius: 999px;
    background: #fff;
    color: #2a4d6c;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
}

.fp-bar-fortryd:hover { background: rgba(226, 90, 90, 0.08); border-color: rgba(150, 60, 60, 0.35); }
.fp-bar-ok:hover      { background: rgba(47, 108, 143, 0.08); }

/* ✦ Lært-chip + popover */
.fp-laert-wrap {
    position: relative;
    display: inline-flex;
}

.fp-laert-chip {
    border: 1px solid rgba(217, 139, 82, 0.4) !important;
    background: rgba(251, 238, 226, 0.75) !important;
    color: #8a5a2b !important;
    font-size: 0.8rem;
    font-weight: 600;
}

.fp-laert-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    border: 0;
    background: transparent;
    cursor: default;
}

.fp-laert-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    width: 380px;
    background: #fff;
    border: 1px solid rgba(21, 50, 74, 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(17, 31, 41, 0.22);
    padding: 12px 14px;
}

.fp-laert-pop-titel {
    font-size: 0.8rem;
    font-weight: 700;
    color: #15324a;
    margin-bottom: 8px;
}

.fp-laert-regel {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: #33526f;
    background: rgba(251, 238, 226, 0.6);
    border-radius: 9px;
    padding: 7px 10px;
    margin-bottom: 6px;
}

.fp-laert-regel span { flex: 1; min-width: 0; }

.fp-laert-fjern {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #c9d4de;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.fp-laert-fjern:hover { color: #b94f4f; }

.fp-laert-hint {
    font-size: 0.7rem;
    color: #607284;
}

.fp-laert-tom {
    font-size: 0.76rem;
    color: #8595a7;
    font-style: italic;
    margin-bottom: 8px;
}

/* Fortrudt-sektionen — den manuelle vej ud af karantænen */
.fp-laert-sektion {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8595a7;
    margin: 10px 0 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(21, 50, 74, 0.08);
}

.fp-laert-regel-fortrudt {
    background: rgba(236, 240, 245, 0.55);
    color: #74879a;
}

.fp-laert-genaktiver {
    flex-shrink: 0;
    border: 1px solid rgba(63, 118, 92, 0.35);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #2c5c44;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.fp-laert-genaktiver:hover { background: #eaf6ef; }

/* ── Prompt-seddelmenu: nudge — feltet "ånder", mens placeholderen skriver sig selv.
   Klassen fp-nudge sættes/fjernes af js/promptMenuNudge.js; selve menuen er
   Components/PromptMenu/PromptSeddelMenu.razor (scoped css). ─────────────────── */

.note-edit-bar.fp-nudge {
    animation: fp-nudge-breathe 3.2s ease-in-out infinite;
}

@keyframes fp-nudge-breathe {
    0%, 100% { box-shadow: 0 10px 24px rgba(25, 49, 73, 0.08), 0 2px 6px rgba(25, 49, 73, 0.05); }
    50% { box-shadow: 0 10px 28px rgba(25, 49, 73, 0.13), 0 0 0 6px rgba(217, 139, 82, 0.09); }
}

/* ── Adskilte moduler (design valgt 2026-07-11; is & glas 2026-07-13) ───────
   Pill-formet topbar og fritsvævende paneler direkte på den kølige baggrund;
   panelerne deler is & glas-gradienten med himlen (via --panel), felterne er
   hvide og knapperne fyldigere blå. Facit: docs/design/chat-transkription-
   B-retninger.html (V2 · Is & glas) + docs/design/hvide-felter-mockup.html
   (tilstand 9 · Svævende). Sektionen overstyrer bevidst basereglerne ovenfor,
   så designet kan fjernes igen ved at slette blokken. */

.canvas {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border: 0;
    /* Skygger fra topbar og paneler skal kunne tegne ud over canvas-kanten */
    overflow: visible;
}

.topbar {
    border-radius: 999px;
    padding: 9px 20px;
    /* Flugter med panelernes kanter (.layout har 18px padding) */
    margin: 0 18px;
    /* Svæve-skygge i samme kølige familie som panelerne */
    box-shadow: 0 10px 34px rgba(80, 105, 130, 0.22);
}

/* Venstre panel har kun klassen .panel-left (ikke .panel) — begge moduler
   skal stå som selvstændige kort. Skyggen er blød og "rund": næsten intet
   offset og lav opacitet, så den ligger tæt om kortet i stedet for at kaste
   langt nedad — de store offset-skygger flød sammen til en synlig flade. */
.panel,
.panel-left {
    background: var(--panel);
    /* Helt tynd blålig kant om de to paneler (topbaren er kantfri) */
    border: 1px solid rgba(47, 108, 143, 0.16);
    border-radius: 26px;
    box-shadow: 0 5px 24px rgba(80, 105, 130, 0.16);
}

/* Den lodrette skillelinje mellem panelerne udgår — adskillelsen kommer nu
   fra kortene selv og gabet imellem dem. */
.divider-left::before {
    display: none;
}

/* Hvide felter — indhold står på hvidt, kortet leverer farven */
.patient-id-input {
    background: #fff;
    border-color: rgba(21, 50, 74, 0.18);
}

.agent-search-input {
    background: #fff;
}

.agent-answer-button {
    background: #fff;
}

.agent-answer-button:hover {
    background: #f4f9ff;
}

.agent-answer-button.is-active {
    background: #eaf3fd;
}

.editor-search-inline {
    background: #fff;
}

/* Fyldigere, mørkere blå knapper — tydelig kontrast til de hvide felter.
   Mikrofonens grønne fyld (::before, --mic-fill) ligger ovenpå og er urørt. */
.consultation-mic,
.ny-session-inside {
    background: linear-gradient(180deg, #a9ccec, #7fadd8);
    border-color: rgba(38, 80, 120, 0.42);
    color: #16344f;
    text-shadow: none;
}

/* Instruks-bjælken er absolut forankret i editorens bund (bottom: 14px), og
   disclaimer-linjen hænger under den — på den gamle glas-flade var det usynligt,
   men på det fritsvævende kort ragede teksten 13px ud under kortets kant.
   34px løfter bjælke + disclaimer ind på kortet med luft til notatfeltet. */
.editor-controls-inline {
    bottom: 34px;
}

/* ── End Adskilte moduler ──────────────────────────────────────────────────── */


/* Indstillinger-renoveringen (22/7): lodret fanemenu + bredere modal. */
.settings-modal { width: 660px; max-width: calc(100vw - 48px); }

.settings-modal-flex {
    display: flex;
    align-items: stretch;
    min-height: 380px;
}

.settings-modal-menu {
    width: 185px;
    flex: none;
    border-right: 1px solid #e3edf2;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-menu-btn {
    background: none;
    border: none;
    border-left: 3px solid transparent;
    text-align: left;
    padding: 9px 16px;
    font: inherit;
    font-size: 0.85rem;
    color: #46586b;
    cursor: pointer;
}

.settings-menu-btn:hover { color: #15324a; background: #f5f9fb; }

.settings-menu-btn.is-active {
    background: #eef5f8;
    border-left-color: #3f97a6;
    color: #173a52;
    font-weight: 600;
}

.settings-modal-flex .settings-modal-body {
    flex: 1;
    min-width: 0;
    padding: 14px 20px 18px;
    overflow-y: auto;
}
/* Indstillinger-afsnit (23/7): overskrift + tynd blaa linje + luft. */
.settings-afsnit-titel {
    font-size: 0.9rem;
    font-weight: 600;
    color: #15324a;
    margin: 0;
    line-height: 1.3;
}

.settings-afsnit-streg {
    border-top: 1px solid #9fc0d4;
    margin: 2px 0 12px;
}
/* Panelets flex-gap (14px) skubbede stregen vaek fra overskriften -
   stregen traekkes op, saa den ligger taet under titlen (23/7). */
.settings-klinik-panel .settings-afsnit-streg {
    margin: -11px 0 0;
}