/* ============================================================
   Lungespesialist — Main Stylesheet
   Compact, clinical. No framework dependencies.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --blue-dark:   #1b3a5c;
    --blue-mid:    #2563a8;
    --blue-light:  #dbeafe;
    --green:       #16a34a;
    --red:         #dc2626;
    --yellow:      #ca8a04;
    --gray-50:     #f8fafc;
    --gray-100:    #f1f5f9;
    --gray-200:    #e2e8f0;
    --gray-400:    #94a3b8;
    --gray-600:    #475569;
    --gray-700:    #334155;
    --gray-900:    #0f172a;
    --white:       #ffffff;
    --radius:      5px;
    --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.5;
}

a { color: var(--blue-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Dev bar (hidden in production via SHOW_DEV) ---- */
.dev-bar {
    background: #1a1a2e;
    color: #a0a0c0;
    font-size: .72rem;
    padding: .25rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.dev-bar-label {
    background: #e63946;
    color: #fff;
    font-weight: 700;
    font-size: .65rem;
    padding: .1rem .35rem;
    border-radius: 3px;
    letter-spacing: .5px;
    flex-shrink: 0;
}
.dev-bar-sep {
    color: #555580;
    margin-left: .25rem;
}
.dev-bar a {
    color: #90e0ef;
    text-decoration: none;
    padding: .1rem .35rem;
    border-radius: 3px;
    transition: background .1s;
}
.dev-bar a:hover {
    background: rgba(144,224,239,.15);
    text-decoration: none;
    color: #caf0f8;
}

/* ---- Site nav ---- */
.site-header {
    background: var(--blue-dark);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-bar {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 48px;
    gap: 1rem;
}

.nav-brand {
    font-weight: 700;
    font-size: .9375rem;
    color: var(--white);
    letter-spacing: .2px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.nav-brand:hover { text-decoration: none; color: var(--white); }
.nav-logo { display: block; flex-shrink: 0; }

/* Public (non-account) nav links — always on the left, next to the logo */
.nav-public {
    display: flex;
    align-items: center;
    gap: .1rem;
}
.nav-public a {
    color: rgba(255,255,255,.72);
    font-size: .8125rem;
    padding: .3rem .55rem;
    border-radius: var(--radius);
    transition: background .12s;
    white-space: nowrap;
}
.nav-public a:hover {
    background: rgba(255,255,255,.13);
    text-decoration: none;
    color: var(--white);
}
/* Mobile-only copies inside the hamburger dropdown */
.nav-mobile-only { display: none; }

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem .3rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    height: 2px;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.nav-bar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-bar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
.nav-bar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

.nav-links a {
    color: rgba(255,255,255,.82);
    font-size: .8125rem;
    padding: .3rem .6rem;
    border-radius: var(--radius);
    transition: background .12s;
}
.nav-links a:hover {
    background: rgba(255,255,255,.13);
    text-decoration: none;
    color: var(--white);
}
.nav-links a.nav-logout { color: rgba(255,200,200,.85); }
.nav-links a.nav-doctor-login { opacity: .5; font-size: .8rem; }

/* ---- Language switcher ---- */
/* Language switcher — globe trigger + hover dropdown on desktop */
.nav-lang-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: .25rem;
}
.nav-lang-trigger {
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 4px;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
    line-height: 1;
}
.nav-lang-trigger:hover { background: rgba(255,255,255,.2); color: #fff; }
.nav-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1b3a5c;
    border-radius: 6px;
    padding: .35rem .3rem;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    z-index: 200;
    min-width: 52px;
}
.nav-lang-dropdown::before {
    content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.nav-lang-switch:hover .nav-lang-dropdown,
.nav-lang-switch:focus-within .nav-lang-dropdown { display: flex; }
.nav-lang {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 8px;
    border-radius: 3px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-lang:hover { color: #fff; background: rgba(255,255,255,.15); }
.nav-lang.nav-lang--active { color: #fff; background: rgba(255,255,255,.22); }

.nav-user {
    color: rgba(255,255,255,.6);
    font-size: .8125rem;
    padding: 0 .6rem 0 .25rem;
    border-right: 1px solid rgba(255,255,255,.18);
    margin-right: .25rem;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Role indicator badge in nav bar ---- */
.nav-role {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .3px;
    padding: .15rem .55rem;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-role--doctor  { color: #fff;    background: rgba(255,255,255,.18); }
.nav-role--patient { color: #bbf7d0; background: rgba(22,163,74,.35);   }

/* ---- Mobile nav ---- */
@media (max-width: 680px) {
    .nav-hamburger { display: flex; align-self: center; }
    .nav-public { display: none; }
    .nav-mobile-only { display: block; }
    .nav-bar { flex-wrap: wrap; height: auto; min-height: 48px; padding: 0 .75rem; align-items: center; }
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        width: 100%;
        padding: .4rem 0 .75rem;
        border-top: 1px solid rgba(255,255,255,.12);
    }
    .nav-bar.nav-open .nav-links { display: flex; }
    .nav-links a, .nav-links span.nav-user {
        padding: .65rem .5rem;
        font-size: .95rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.06);
        white-space: normal;
        max-width: none;
    }
    .nav-links a:last-child { border-bottom: none; }
    .nav-brand { padding: 0; line-height: 48px; }
    .nav-page-label { font-size: .65rem; }
    /* Lang switcher inside burger — show links flat, no dropdown chrome */
    .nav-lang-trigger { display: none; }
    .nav-lang-switch {
        padding: .55rem .5rem;
        border-bottom: 1px solid rgba(255,255,255,.06);
        margin-left: 0;
        width: 100%;
    }
    .nav-lang-dropdown {
        display: flex !important;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        background: transparent;
        box-shadow: none;
        padding: 0;
        min-width: 0;
    }
    .nav-links .nav-lang-dropdown .nav-lang {
        padding: 4px 9px;
        font-size: .78rem;
        border-bottom: none;
    }
}

/* ---- Page label badge (test/feedback — yellow, next to role indicator) ---- */
.nav-page-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .4px;
    padding: .15rem .45rem;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
    background: #fde047;
    color: #1e1e1e;
    font-family: monospace;
}

/* ---- Main layout ---- */
.main-content {
    max-width: 1540px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3rem;
}

/* ---- Flash / alert ---- */
.flash:not(:empty) {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: .6rem .9rem;
    margin-bottom: 1rem;
    font-size: .875rem;
    color: #78350f;
}
.flash.error:not(:empty) {
    background: #fee2e2;
    border-color: #f87171;
    color: #7f1d1d;
}

/* ---- Page heading ---- */
.page-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin: 0 0 1.1rem;
}

/* ---- Hero (home) ---- */
.hero {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin: 0 0 .6rem;
}
.hero p {
    font-size: .9375rem;
    color: var(--gray-700);
    margin: 0 0 1.25rem;
    max-width: 640px;
    line-height: 1.65;
}

/* ---- Card grid (home) ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.card-grid--single {
    grid-template-columns: 1fr;
    max-width: 480px;
}
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--blue-dark);
    margin: 0 0 .5rem;
}
.card-body {
    font-size: .8125rem;
    color: var(--gray-700);
    margin: 0 0 .9rem;
    line-height: 1.6;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: .4rem .85rem;
    border-radius: var(--radius);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: filter .12s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn-primary  { background: var(--blue-mid); color: var(--white); border-color: var(--blue-mid); }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-200); }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: .2rem .5rem; font-size: .75rem; }

/* ---- Login form ---- */
.login-wrap {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.login-wrap h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin: 0 0 1.25rem;
}
.form-group { margin-bottom: .85rem; }
.form-group label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .25rem;
}
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .4rem .6rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--gray-900);
    background: var(--white);
    font-family: var(--font);
}
.form-group textarea { resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 2px rgba(37,99,168,.18);
}

/* ---- Logg Hendelse: datetime row + quick-pick buttons ---- */
.event-time-row {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-top: .4rem;
}
.event-time-row input[type="datetime-local"] {
    flex: 1;
    width: auto;
    font-size: .8rem;
    padding: .3rem .45rem;
}
.btn-time-quick {
    flex-shrink: 0;
    padding: .25rem .45rem;
    font-size: .72rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1.3;
    white-space: nowrap;
}
.btn-time-quick:hover { background: var(--gray-100); border-color: var(--gray-300); }
.form-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
    border-radius: var(--radius);
    padding: .5rem .75rem;
    font-size: .8125rem;
    margin-bottom: .85rem;
}
.dev-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: .4rem .65rem;
    font-size: .75rem;
    color: #92400e;
    margin-bottom: .85rem;
}
.dev-logins {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}
.dev-logins p {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gray-400);
    margin: 0 0 .4rem;
}
.dev-btn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

/* ---- Section panels ---- */
.section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.section-header {
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.section-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--blue-dark);
    margin: 0;
}
.section-body { padding: .75rem 1rem; }
.section-body-flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- Data table ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
    min-width: 480px;
}
.data-table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: .75rem;
    text-align: left;
    padding: .45rem .75rem;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: .45rem .75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table a { color: var(--blue-mid); }

/* ---- Status badges ---- */
.badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 9999px;
    letter-spacing: .2px;
}
.badge-active    { background: #dcfce7; color: #15803d; }
.badge-inactive  { background: #f1f5f9; color: #64748b; }
.badge-paused    { background: #fef9c3; color: #854d0e; }
.badge-completed { background: #dbeafe; color: #1d4ed8; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-600); }
.badge-progress  { background: #e0f2fe; color: #0369a1; }
.badge-not-started { background: var(--gray-100); color: var(--gray-600); }
.badge-skipped   { background: #fce7f3; color: #9d174d; }
.badge-master    { background: #fef3c7; color: #92400e; }

/* ---- Search bar ---- */
.search-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.search-row input {
    flex: 1;
    padding: .38rem .6rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .8125rem;
    font-family: var(--font);
}
.search-row input:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 2px rgba(37,99,168,.15);
}

/* ---- Workflow step list ---- */
.step-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.step-item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--gray-100);
}
.step-item:last-child { border-bottom: none; }
.step-num {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue-mid);
    font-size: .6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: .1rem;
}
.step-num.done  { background: #dcfce7; color: var(--green); }
.step-num.skip  { background: var(--gray-100); color: var(--gray-400); }
.step-info { flex: 1; min-width: 0; }
.step-title { font-weight: 500; font-size: .8125rem; }
.step-note  { font-size: .75rem; color: var(--gray-600); margin-top: .1rem; }

/* ---- Step detail (forlop page) ---- */
.step-item--detail {
    align-items: flex-start;
    padding: .7rem .75rem;
    gap: .75rem;
}
.step-item--detail .step-info {
    flex: 1;
    min-width: 0;
}
.step-item--detail[data-status="in_progress"] {
    background: #f0f9ff;
    border-left: 3px solid var(--blue-mid);
}
.step-item--detail[data-status="completed"] {
    opacity: .75;
}
.step-desc {
    font-size: .75rem;
    color: var(--gray-700);
    margin-top: .2rem;
    line-height: 1.55;
}
.doc-note {
    color: var(--blue-dark);
    font-style: italic;
}
.pat-note {
    color: var(--green);
}
/* Badge + buttons sit below the step text, left-aligned, in a row */
.step-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
}
.step-marked-by {
    font-size: .7rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* ---- Progress bar ---- */
.progress-track {
    height: 8px;
    background: var(--gray-100);
    border-radius: 9999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--blue-mid);
    border-radius: 9999px;
    transition: width .4s ease;
    min-width: 0;
}

/* ---- Flash messages ---- */
.flash { padding: .6rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: .9rem; }
.flash-ok  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---- Settings page grid ---- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 720px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* ---- Page description (shown below heading on every page) ---- */
.page-desc {
    color: var(--gray-600);
    font-size: .875rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
    max-width: 640px;
}

/* ---- Forlop header ---- */
.forlop-back { margin-bottom: .75rem; }
.back-link {
    font-size: .8125rem;
    color: var(--gray-600);
}
.back-link:hover { color: var(--blue-mid); }
.forlop-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.forlop-header-main { flex: 1; }
.forlop-meta {
    font-size: .8125rem;
    color: var(--gray-600);
    margin: 0;
}
.forlop-count {
    font-size: .8125rem;
    color: var(--gray-600);
}

/* ---- Previous answer display ---- */
.prev-answer {
    font-size: .75rem;
    color: var(--gray-600);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .3rem .5rem;
    margin-top: .3rem;
    line-height: 1.5;
}
.answer-textarea {
    width: 100%;
    padding: .4rem .6rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .8125rem;
    resize: vertical;
}
.answer-textarea:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 2px rgba(37,99,168,.18);
}

/* ---- Empty state ---- */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--gray-400);
    font-size: .8125rem;
}

/* ---- Toolbar (section header actions) ---- */
.toolbar { display: flex; gap: .35rem; align-items: center; }

/* ---- 404 ---- */
.not-found {
    text-align: center;
    padding: 4rem 1rem;
}
.not-found .big-num {
    font-size: 5rem;
    font-weight: 900;
    color: var(--gray-200);
    line-height: 1;
    margin-bottom: .25rem;
}
.not-found h2 {
    font-size: 1.125rem;
    color: var(--blue-dark);
    margin: 0 0 .75rem;
}
.not-found p {
    font-size: .875rem;
    color: var(--gray-600);
    margin: 0 0 1.25rem;
}

/* ---- Patient profile grid ---- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .5rem .75rem;
}
.profile-field { display: flex; flex-direction: column; }
.profile-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-400);
    font-weight: 600;
}
.profile-value {
    font-size: .875rem;
    color: var(--gray-900);
    font-weight: 500;
}

/* ---- Patient general notes (D2 profile card) ---- */
.patient-note-section {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--gray-200);
}
.patient-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .35rem;
}
.patient-note-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.patient-note-edit-btn {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .45rem;
    cursor: pointer;
    color: var(--gray-500);
}
.patient-note-edit-btn:hover { border-color: var(--blue); color: var(--blue); }
.patient-note-hist-link {
    font-size: .7rem;
    color: var(--gray-400);
    text-decoration: none;
}
.patient-note-hist-link:hover { color: var(--blue); text-decoration: underline; }
.patient-note-text {
    font-size: .875rem;
    line-height: 1.55;
    color: var(--gray-900);
    margin: 0 0 .25rem;
    white-space: pre-wrap;
}
.patient-note-empty {
    font-size: .8rem;
    color: var(--gray-400);
    font-style: italic;
    margin: 0 0 .25rem;
}
.patient-note-meta {
    font-size: .7rem;
    color: var(--gray-900);
}
.patient-note-textarea {
    width: 100%;
    margin-top: .35rem;
    font-size: .875rem;
    line-height: 1.5;
    resize: vertical;
}
.patient-note-edit-btns {
    display: flex;
    gap: .5rem;
    margin-top: .4rem;
}

/* ---- Note history popup ---- */
.note-hist-entry {
    padding: .75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: .6rem;
    font-size: .875rem;
}
.note-hist-current { border-color: var(--blue); background: #eff6ff; }
.note-hist-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .7rem;
    color: var(--gray-900);
    margin-bottom: .4rem;
}
.note-hist-tag {
    background: var(--blue);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .35rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.note-hist-body { color: var(--gray-900); line-height: 1.5; white-space: pre-wrap; }
.note-hist-tag--old { background: #f1f5f9; color: #64748b; }
.note-diff-ins { background: #dcfce7; color: #166534; text-decoration: none; border-radius: 2px; padding: 0 1px; }
.note-diff-del { background: #fee2e2; color: #991b1b; text-decoration: line-through; border-radius: 2px; padding: 0 1px; }
.note-diff-toggle { font-size: .75rem; color: #6b7280; cursor: pointer; margin-left: auto; background: none; border: none; padding: 0; font-family: inherit; }
.note-diff-toggle:hover { color: #374151; text-decoration: underline; }

/* ---- Template picker ---- */
.template-group { margin-bottom: 1.5rem; }
.template-group-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--gray-400);
    margin: 0 0 .6rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--gray-200);
}
.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .75rem;
}
.template-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    box-shadow: var(--shadow);
}
.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}
.template-card-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--blue-dark);
}
.template-step-count {
    font-size: .75rem;
    color: var(--gray-400);
    white-space: nowrap;
}
.template-card-desc {
    font-size: .78rem;
    color: var(--gray-700);
    margin: 0 0 .5rem;
    line-height: 1.55;
}
.template-steps-preview {
    margin-bottom: .5rem;
    font-size: .78rem;
}
.template-steps-preview summary {
    cursor: pointer;
    color: var(--blue-mid);
    font-size: .78rem;
    padding: .15rem 0;
}
.template-step-list {
    margin: .4rem 0 0 0;
    padding-left: 0;
    list-style: none;
}
.template-step-list li {
    padding: .2rem 0;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: .4rem;
    border-bottom: 1px solid var(--gray-100);
}
.template-step-list li:last-child { border-bottom: none; }
.step-num-sm {
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue-mid);
    font-size: .625rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Action type tag ---- */
.type-tag {
    font-size: .68rem;
    color: var(--gray-400);
    font-style: normal;
    background: var(--gray-100);
    padding: .05rem .35rem;
    border-radius: 9999px;
    white-space: nowrap;
}

/* ---- Doctor workflow step controls ---- */
.step-item--dr {
    align-items: flex-start;
    padding: .7rem .75rem;
    gap: .75rem;
}
.step-item--dr[data-status="in_progress"] {
    background: #f0f9ff;
    border-left: 3px solid var(--blue-mid);
}
.step-item--dr[data-status="completed"] { opacity: .8; }
.step-item--dr[data-status="skipped"]   { opacity: .55; }

.step-dr-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
    flex-shrink: 0;
    min-width: 160px;
}
.status-select {
    padding: .25rem .4rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .75rem;
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--white);
    cursor: pointer;
    width: 100%;
}
.status-select:focus {
    outline: none;
    border-color: var(--blue-mid);
}
.inline-form {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.step-notes-detail { width: 100%; }
.step-notes-detail summary {
    cursor: pointer;
    font-size: .72rem;
    color: var(--blue-mid);
    padding: .1rem 0;
}
.notes-form { margin-top: .35rem; display: flex; flex-direction: column; gap: .3rem; }
.notes-textarea {
    width: 100%;
    padding: .3rem .5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .78rem;
    resize: vertical;
    min-height: 52px;
}
.notes-textarea:focus {
    outline: none;
    border-color: var(--blue-mid);
}
.toolbar-hint {
    font-size: .72rem;
    color: var(--gray-400);
    font-style: italic;
}

/* ---- Forlop header actions ---- */
.forlop-header-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---- Step number cell in table ---- */
.step-num-cell {
    width: 32px;
    text-align: center;
    font-weight: 700;
    color: var(--blue-mid);
    font-size: .8125rem;
}

/* ---- Add step form ---- */
.add-step-form { }
.forlop-rediger-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.forlop-delete-form { margin: 0; }
.forlop-delete-disabled {
    font-size: .8rem;
    color: var(--gray-400);
    cursor: not-allowed;
}
.add-step-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.add-step-row .btn { flex-shrink: 0; }
@media (max-width: 480px) {
    .add-step-row { flex-direction: column; align-items: stretch; }
    .add-step-row .action-select,
    .add-step-row .btn { width: 100%; }
}
.action-select {
    flex: 1;
    padding: .38rem .5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .8125rem;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--white);
}
.action-select:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 2px rgba(37,99,168,.15);
}

/* ---- Answer list (doctor view) ---- */
.answer-list { margin: 0; }
.answer-list dt {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: .6rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.answer-list dt:first-child { margin-top: 0; }
.answer-list dd {
    margin: .2rem 0 0 0;
    font-size: .8125rem;
    color: var(--gray-900);
    background: var(--gray-50);
    border-left: 2px solid var(--blue-light);
    padding: .3rem .6rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    line-height: 1.5;
}
.answer-date {
    font-size: .7rem;
    color: var(--gray-900);
    font-weight: 400;
}
.answer-date-ok   { color: var(--gray-900); }
.answer-date-warn { color: var(--gray-900); }
.answer-date-old  { color: var(--gray-900); font-weight: 600; }

/* ---- Video cards ---- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .75rem;
}
.video-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .75rem;
    box-shadow: var(--shadow);
}
.video-card-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--blue-dark);
    margin-bottom: .25rem;
}
.video-meta {
    font-size: .72rem;
    color: var(--gray-900);
    margin: 0 0 .5rem;
}
.video-edit-details { margin-top: .6rem; border-top: 1px solid #e2e8f0; padding-top: .5rem; }
.video-edit-details summary { font-size: .78rem; color: #64748b; cursor: pointer; user-select: none; }
.video-edit-form { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.video-notes {
    font-size: .78rem;
    color: var(--gray-700);
    margin: .4rem 0 0;
    line-height: 1.5;
}
.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    margin: .4rem 0;
}
.video-embed-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.video-player {
    width: 100%;
    border-radius: var(--radius);
    margin: .4rem 0;
}

/* Specialist intro video card */
.specialist-video-section { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.specialist-video-card { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.specialist-video-label { display: flex; align-items: center; gap: .45rem; padding: .55rem 1.25rem; background: #1b3a5c; color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.specialist-video-label::before { content: '▶'; font-size: .65rem; opacity: .75; }
.specialist-video-body { padding: 1rem 1.25rem 1.25rem; }
.specialist-video-title { font-size: 1rem; font-weight: 600; color: #1b3a5c; margin: 0 0 .75rem; }
.specialist-video-player { width: 100%; border-radius: .4rem; max-height: 400px; background: #000; display: block; }
.specialist-video-meta { font-size: .82rem; color: #64748b; margin: .6rem 0 0; }

/* ================================================================
   CAT SCORE — widget, form, history
   ================================================================ */

/* Widget on KOLS page */
.cat-widget { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.cat-widget-done { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.cat-widget-prompt { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cat-score-badge { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; flex-shrink: 0; padding: .2rem .65rem; }
.cat-score-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.cat-score-denom { font-size: 1rem; font-weight: 600; opacity: .6; }
.cat-score-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.cat-sparkline { display: block; flex-shrink: 0; }
.cat-next { font-size: .82rem; color: #64748b; margin: 0; }
.cat-prompt { font-weight: 700; color: #1b3a5c; margin: 0; font-size: .95rem; }
.cat-prompt-lead { font-size: .82rem; color: #64748b; margin: 0; flex: 1; }

/* Full CAT form page */
.cat-page { max-width: 680px; margin: 0 auto; }
.cat-page-header { margin-bottom: 1.75rem; }
.cat-back { font-size: .85rem; color: #64748b; text-decoration: none; display: inline-block; margin-bottom: .75rem; }
.cat-back:hover { color: #1b3a5c; }
.cat-page-title { font-size: 1.4rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .4rem; }
.cat-page-lead { color: #64748b; font-size: .92rem; margin: 0; line-height: 1.6; }
.cat-form { display: flex; flex-direction: column; gap: .75rem; }
.cat-question { background: #fff; border: 1px solid #e2e8f0; border-radius: .6rem; padding: 1rem 1.25rem; }
.cat-q-row { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .5rem; }
.cat-anchor { font-size: .78rem; color: #64748b; line-height: 1.4; align-self: end; }
.cat-anchor--left  { grid-column: 1; grid-row: 1; }
.cat-anchor--right { grid-column: 2; grid-row: 1; text-align: right; }
.cat-btn-group { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; gap: .35rem; }
@media (min-width: 560px) {
    .cat-q-row { grid-template-columns: 1fr auto 1fr; grid-template-rows: auto; align-items: center; gap: .75rem; }
    .cat-anchor--left  { grid-column: 1; grid-row: 1; align-self: center; }
    .cat-anchor--right { grid-column: 3; grid-row: 1; align-self: center; }
    .cat-btn-group     { grid-column: 2; grid-row: 1; }
}
.cat-btn-opt { display: block; cursor: pointer; }
.cat-btn-opt input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.cat-btn-opt span { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; font-size: .9rem; font-weight: 700; color: #64748b; transition: background .12s, border-color .12s, color .12s; }
.cat-btn-opt:has(input:checked) span { background: #2563a8; border-color: #2563a8; color: #fff; }
@media (hover: hover) { .cat-btn-opt:hover span { border-color: #2563a8; color: #2563a8; } }
.cat-live-score { font-size: 1rem; font-weight: 700; color: #2563a8; min-height: 1.4em; }
.cat-scale-guide { font-size: .82rem; color: #64748b; background: #f8fafc; border-radius: .5rem; padding: .9rem 1.1rem; margin-top: .5rem; }
.cat-scale-guide ul { margin: .4rem 0 0; padding-left: 1.2rem; line-height: 1.9; }

/* History table + chart (doctor + patient views) */
.cat-history { display: flex; flex-direction: column; gap: 1rem; }
.cat-history--empty p { color: #94a3b8; font-size: .88rem; }
.cat-line-chart { width: 100%; max-width: 480px; overflow: visible; }
.cat-history-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.cat-history-table th { text-align: left; padding: .4rem .6rem; color: #94a3b8; font-weight: 600; font-size: .78rem; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; }
.cat-history-table td { padding: .45rem .6rem; border-bottom: 1px solid #f1f5f9; }
.cat-band-pill { display: inline-block; padding: .1rem .55rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; color: #fff; }
.cat-band--low   { background: #16a34a; }
.cat-band--med   { background: #d97706; }
.cat-band--high  { background: #ea580c; }
.cat-band--vhigh { background: #dc2626; }

/* ---- Form layout helpers ---- */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

.field-hint {
    display: block;
    font-size: .72rem;
    color: var(--gray-400);
    margin-top: .2rem;
}
.required { color: var(--red); }

/* ---- Date status badges (step scheduling) ---- */
.date-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 3px;
    margin: .15rem 0 .25rem;
    letter-spacing: .01em;
    color: var(--gray-900);
}
.date-upcoming {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.date-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.date-warn {
    background: #fefce8;
    border: 1px solid #fde68a;
}
.date-overdue {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* ---- Patient step button group (non-sequential) ---- */
.step-btn-group {
    display: contents; /* children participate directly in .step-foot row */
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    border-radius: var(--radius);
    font-size: .75rem;
    padding: .2rem .55rem;
}
.btn-ghost:hover { background: var(--gray-100); }

/* ---- Date picker in doctor step controls ---- */
.form-control-sm {
    width: 100%;
    padding: .25rem .4rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .78rem;
    color: var(--gray-900);
    background: var(--white);
    margin-top: .1rem;
}

/* ---- Patient portal two-column layout (50/50) ---- */
.patient-portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .patient-portal-grid { grid-template-columns: 1fr; }
    .portal-inbox { order: -1; } /* inbox above treatment on mobile */
}

/* ---- Inbox panel (right column) ---- */
.inbox-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.inbox-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .85rem;
    background: var(--blue-dark);
    color: var(--white);
}
.inbox-panel-title {
    font-size: .85rem;
    font-weight: 600;
    margin: 0;
    color: var(--white);
}
.inbox-unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 10px;
    white-space: nowrap;
}
.inbox-scroll {
    max-height: 480px;
    overflow-y: auto;
}
.inbox-empty {
    padding: 1.2rem .85rem;
    color: var(--gray-400);
    font-size: .82rem;
    text-align: center;
}
.inbox-item {
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: .82rem;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item--unread {
    background: #f0f9ff;
    border-left: 3px solid var(--blue-mid);
    padding-left: calc(.85rem - 3px);
}
.inbox-meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .25rem;
}
.inbox-dot {
    width: 7px;
    height: 7px;
    background: var(--blue-mid);
    border-radius: 50%;
    flex-shrink: 0;
}
.inbox-from {
    font-weight: 600;
    color: var(--blue-dark);
}
.inbox-date {
    color: var(--gray-900);
    font-size: .72rem;
    margin-left: auto;
}
.inbox-subject {
    font-weight: 600;
    margin-bottom: .2rem;
    color: var(--gray-900);
}
.inbox-body {
    color: var(--gray-700);
    line-height: 1.55;
    white-space: pre-wrap;
}
.inbox-see-all {
    display: block;
    text-align: center;
    padding: .55rem;
    font-size: .78rem;
    color: var(--blue-mid);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.inbox-see-all:hover { background: var(--gray-100); text-decoration: none; }

/* Full messages page */
.messages-full-list {
    max-width: 760px;
}
.messages-full-list .inbox-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    padding: .9rem 1rem;
}
.messages-full-list .inbox-item--unread {
    border-left: 4px solid var(--blue-mid);
    padding-left: calc(1rem - 1px);
}
.messages-full-list .inbox-body {
    font-size: .875rem;
    margin-top: .35rem;
}

/* ---- Doctor sent messages list ---- */
.sent-msg-list { display: flex; flex-direction: column; }
.sent-msg {
    padding: .3rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.sent-msg--inbound .sent-msg-body { color: var(--gray-500); }
.sent-msg-meta {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    margin-bottom: .1rem;
}
.sent-msg-dir  { color: var(--gray-400); }
.sent-msg-date { color: var(--gray-900); font-variant-numeric: tabular-nums; margin-left: auto; }
.sent-msg-unread { color: var(--blue); font-size: .85rem; line-height: 1; }
.sent-msg-del-form { display: inline; margin-left: .4rem; }
.sent-msg-del {
    background: none; border: none; cursor: pointer;
    color: var(--gray-400); font-size: 1rem; line-height: 1;
    padding: 0 2px; border-radius: 3px;
}
.sent-msg-del:hover { color: #dc2626; background: #fee2e2; }
.sent-msg-subject { font-weight: 600; }
.sent-msg-body {
    font-size: .78rem;
    color: var(--gray-700);
    line-height: 1.45;
    white-space: pre-wrap;
}

/* ---- Message compose form ---- */
.message-compose .form-control {
    width: 100%;
}

/* ---- Sequential / freeflow badges ---- */
.badge-seq {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
    font-size: .7rem;
}
.badge-freeflow {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-size: .7rem;
}

/* ---- Locked step (sequential workflows) ---- */
.step-locked {
    font-size: .72rem;
    color: var(--gray-400);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .2rem .5rem;
    cursor: not-allowed;
}
.step-item--detail[data-status="not_started"].is-locked {
    opacity: .6;
}

/* ---- Template library page ---- */
.section-subtitle {
    font-size: .78rem;
    color: var(--gray-400);
    align-self: center;
}
.form-hint {
    display: block;
    margin-top: .3rem;
    font-size: .82rem;
    color: #64748b;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .88rem;
    line-height: 1.45;
}
.checkbox-label input[type="checkbox"] { flex-shrink: 0; }

/* ---- Two-column doctor patient page ---- */
.dr-patient-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1200px) {
    .dr-patient-grid { grid-template-columns: 1fr 1fr; }
    .dr-patient-left { order: 3; grid-column: 1 / -1; }
}
@media (max-width: 800px) {
    .dr-patient-grid { grid-template-columns: 1fr; }
}
.dr-patient-left  { min-width: 0; }
.dr-patient-main  { min-width: 0; }
.dr-patient-aside { min-width: 0; }

/* Timeline in left column: no hard scroll cap, flows naturally */
.all-answers-scroll { max-height: 420px; overflow-y: auto; }

/* Chat-style Q&A log */
.chat-log  { display: flex; flex-direction: column; gap: 0; }
.chat-pair {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.chat-pair:last-child { border-bottom: none; }
.chat-q {
    font-size: .75rem;
    color: var(--gray-500);
    max-width: 72%;
    line-height: 1.4;
}
.chat-a-wrap {
    align-self: flex-end;
    max-width: 72%;
    text-align: right;
}
.chat-a {
    font-size: .82rem;
    color: var(--gray-900);
    line-height: 1.5;
    text-align: left;
}
.chat-dt {
    font-size: .68rem;
    color: var(--gray-900);
    margin-top: .1rem;
    font-variant-numeric: tabular-nums;
}

/* Timeline */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: .9rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--gray-200);
}
.tl-item {
    display: flex;
    gap: .75rem;
    padding: .45rem 0 .45rem .15rem;
    position: relative;
}
.tl-dot {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    z-index: 1;
}
.tl-body   { flex: 1; min-width: 0; }
.tl-head   { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.tl-title  { font-size: .82rem; font-weight: 600; color: var(--gray-900); }
.tl-actor  { font-size: .72rem; color: var(--gray-400); }
.tl-time   { font-size: .72rem; color: var(--gray-900); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-detail { font-size: .78rem; color: var(--gray-600); margin: .15rem 0 0; line-height: 1.4; }

/* Timeline event type colours */
.tl-workflow   .tl-dot { background:#dbeafe; border-color:#2563a8; color:#2563a8; }
.tl-step-start .tl-dot { background:#fef3c7; border-color:#ca8a04; color:#ca8a04; }
.tl-step-done  .tl-dot { background:#dcfce7; border-color:#16a34a; color:#16a34a; }
.tl-step-skip  .tl-dot { background:#f1f5f9; border-color:#94a3b8; color:#94a3b8; }
.tl-answer     .tl-dot { background:#ede9fe; border-color:#7c3aed; color:#7c3aed; }
.tl-message    .tl-dot { background:#fce7f3; border-color:#db2777; color:#db2777; }
.tl-video      .tl-dot { background:#fff7ed; border-color:#ea580c; color:#ea580c; }
.tl-event      .tl-dot { background:#f0fdf4; border-color:#16a34a; color:#16a34a; }
.tl-callback   .tl-dot { background:#eff6ff; border-color:#2563eb; color:#2563eb; }

/* ---- Notification disabled banner ---- */
.notif-disabled-banner {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-left: 4px solid #ca8a04;
    color: #713f12;
    padding: .6rem .9rem;
    border-radius: var(--radius);
    font-size: .85rem;
    margin-bottom: 1rem;
}
.notif-disabled-banner a { color: #92400e; font-weight:600; }
.notif-prefs-section { margin-top: 1.5rem; }

/* ---- Message channel tabs (web / WhatsApp) ---- */
.msg-channel-tabs { display:flex; gap:.25rem; border-bottom:2px solid var(--gray-200); margin-bottom:.25rem; }
.msg-tab {
    background: none; border: none; padding: .35rem .75rem;
    font-size: .82rem; cursor: pointer; color: var(--gray-600);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.msg-tab--active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); font-weight:600; }

/* ---- WhatsApp send button ---- */
.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
    padding: .35rem .8rem;
    border-radius: var(--radius);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-whatsapp:hover { background: #1da851; text-decoration:none; color:#fff; }

/* ---- Message direction indicators (inbound vs outbound) ---- */
.inbox-item--inbound {
    border-left-color: #7c3aed;   /* purple for patient replies */
    background: #faf5ff;
}
.inbox-channel-badge {
    font-size: .68rem;
    padding: .1rem .35rem;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: .2px;
}
.inbox-channel-badge--web      { background:#dbeafe; color:#1e40af; }
.inbox-channel-badge--whatsapp { background:#dcfce7; color:#166534; }
.inbox-channel-badge--sms      { background:#fef3c7; color:#92400e; }
.inbox-channel-badge--call     { background:#f3e8ff; color:#6b21a8; }

/* ---- Master nav link ---- */
.nav-master {
    font-weight: 700;
    color: #fbbf24 !important;  /* amber — visually distinct from regular nav */
}

/* ---- Master badge (in doctor activity table) ---- */
.badge-master {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ---- Master stats grid ---- */
.master-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
}
.stat-card.stat-ok   { border-color: #86efac; background: #f0fdf4; }
.stat-card.stat-warn { border-color: #fca5a5; background: #fef2f2; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: .7rem; color: var(--gray-500); text-align: center; }

.master-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.master-tools-arrow { color: var(--gray-400); font-size: .9rem; padding: 0 .1rem; }
.master-tools-sep   { color: var(--gray-300); font-size: 1.1rem; padding: 0 .25rem; }

/* ---- Diagnosis tree (M3) ---- */
.diag-tree-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: .6rem;
    background: var(--white);
    box-shadow: var(--shadow);
}
.diag-tree-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .9rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.diag-tree-summary::-webkit-details-marker { display: none; }
.diag-tree-summary::before {
    content: '▸';
    font-size: .75rem;
    color: var(--gray-400);
    flex-shrink: 0;
    transition: transform .15s;
}
.diag-tree-item[open] > .diag-tree-summary::before { content: '▾'; }
.diag-tree-name {
    font-weight: 700;
    font-size: .9375rem;
    color: var(--gray-900);
    flex: 1;
}
.diag-tree-meta {
    font-size: .78rem;
    color: var(--gray-900);
}
.diag-tree-vid {
    font-size: .78rem;
    color: var(--blue);
    text-decoration: none;
}
.diag-tree-body {
    border-top: 1px solid var(--gray-200);
    padding: .5rem .9rem .75rem 2rem;
}
.diag-tree-table {
    margin-bottom: .5rem;
}
.diag-tree-empty {
    font-size: .82rem;
    color: var(--gray-400);
    margin: .5rem 0;
}
.diag-tree-actions {
    margin-top: .4rem;
}

/* ---- Inline table links ---- */
.table-link {
    color: var(--blue);
    text-decoration: none;
    font-size: inherit;
}
.table-link:hover { text-decoration: underline; }

/* ---- Breadcrumb separator and meta link ---- */
.breadcrumb-sep {
    color: var(--gray-400);
    margin: 0 .25rem;
    font-size: .8rem;
}
.forlop-meta-link {
    color: var(--blue);
    text-decoration: none;
}
.forlop-meta-link:hover { text-decoration: underline; }

/* ---- Two-column master catalogue pages ---- */
.master-catalogue-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .master-catalogue-grid { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */
.site-footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: .7rem 1rem;
    font-size: .75rem;
}
.site-footer a { color: rgba(255,255,255,.65); }
.site-footer a:hover { color: var(--white); text-decoration: none; }

/* ======================================================
   Mobile QR widget — D2 Video tab
   ====================================================== */
.mobile-qr-widget {
    display: inline-block;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .6rem;
    text-align: center;
    margin-top: .75rem;
}
.mobile-qr-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 .4rem;
}
.mobile-qr-img-wrap { display: flex; justify-content: center; margin-bottom: .4rem; }
.mobile-qr-img {
    display: block;
    width: 140px;
    height: 140px;
    aspect-ratio: 1;
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    image-rendering: pixelated;
}
.mobile-qr-copy-row {
    display: flex;
    gap: .3rem;
    align-items: center;
    margin: 0 0 .3rem;
    width: 140px;
}
.mobile-qr-url-input {
    flex: 1;
    min-width: 0;
    font-size: .72rem;
    padding: .25rem .4rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-qr-hint {
    font-size: .68rem;
    color: var(--gray-400);
    font-style: italic;
    margin: 0;
}
.mobile-qr-divider {
    text-align: center;
    font-size: .72rem;
    color: var(--gray-400);
    margin: .85rem 0 0;
}

/* ======================================================
   Mobile upload page  /lege-mobil/video/{id}
   ====================================================== */
.mobile-upload-body {
    background: var(--gray-50);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}
.mobile-upload-header {
    background: var(--blue-dark);
    color: var(--white);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.mobile-upload-brand { font-weight: 700; font-size: .9rem; }
.mobile-upload-badge {
    font-size: .72rem;
    background: rgba(255,255,255,.18);
    padding: .15rem .5rem;
    border-radius: 10px;
}
.mobile-upload-main {
    max-width: 540px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}
.mobile-upload-form {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1rem 1.25rem;
    box-shadow: var(--shadow);
}
.mobile-form-group { margin-bottom: 1rem; }
.mobile-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .3rem;
}
/* font-size 1rem = 16px prevents iOS auto-zoom on input focus */
.mobile-input {
    width: 100%;
    padding: .55rem .65rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-900);
    background: var(--white);
    font-family: var(--font);
    box-sizing: border-box;
}
.mobile-input:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 2px rgba(37,99,168,.15);
}
textarea.mobile-input { resize: vertical; }
.mobile-file-input { width: 100%; font-size: .875rem; padding: .4rem 0; }
.mobile-file-hint {
    display: block;
    font-size: .72rem;
    color: var(--gray-400);
    margin-top: .2rem;
}
.mobile-submit-btn {
    width: 100%;
    background: var(--blue-mid);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    padding: .8rem;
    cursor: pointer;
    margin-top: .5rem;
    font-family: var(--font);
    letter-spacing: .15px;
    transition: background .15s;
}
.mobile-submit-btn:hover  { background: var(--blue-dark); }
.mobile-submit-btn:active { transform: scale(.98); }
.mobile-upload-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.mobile-success-icon { font-size: 3.5rem; color: #16a34a; line-height: 1; margin-bottom: .5rem; }
.mobile-success-title { color: #15803d; font-size: 1.3rem; margin: 0 0 .5rem; }
.mobile-success-text { font-size: .875rem; color: var(--gray-700); margin: 0; }
.mobile-upload-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .875rem;
    color: #b91c1c;
    margin-bottom: .75rem;
}

/* ================================================================
   Catalogue edit pages — action & diagnosis full edit view
   ================================================================ */

.catalogue-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.catalogue-edit-grid--3col {
    grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 1100px) {
    .catalogue-edit-grid--3col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .catalogue-edit-grid,
    .catalogue-edit-grid--3col { grid-template-columns: 1fr; }
}

.question-bank-group-heading {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1.25rem 0 .35rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--gray-200);
}
.question-bank-group-heading:first-child { margin-top: 0; }
.question-bank-group-hint {
    font-weight: 400;
    color: var(--gray-400);
    font-size: .75rem;
}

.form-hint {
    font-size: .78rem;
    color: var(--gray-500);
    margin: .2rem 0 0;
}

/* Video list */
.catalogue-video-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.catalogue-video-item {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .4rem .6rem;
    background: var(--gray-50);
    border-radius: .3rem;
    font-size: .85rem;
}
.catalogue-video-link {
    flex: 1;
    color: var(--blue-600);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.catalogue-video-link:hover { text-decoration: underline; }
.catalogue-video-meta {
    font-size: .72rem;
    color: var(--gray-500);
    white-space: nowrap;
}
.btn-inline-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1rem;
    line-height: 1;
    padding: 0 .1rem;
    flex-shrink: 0;
}
.btn-inline-delete:hover { color: #b91c1c; }

/* Add-video form inside edit page */
.catalogue-video-add {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    margin-top: .5rem;
}
.catalogue-video-add-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.catalogue-video-or {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.catalogue-video-or-sep {
    padding-top: 2rem;
    font-size: .78rem;
    color: var(--gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 700px) {
    .catalogue-video-or { flex-direction: column; }
    .catalogue-video-or-sep { padding-top: 0; }
}


/* =================================================================
   KOLS SELF-CARE PAGE  (page_pasient_kols.tpl)
   ================================================================= */

/* Hero header */
.kols-hero {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    color: #fff;
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
}
.kols-hero-content { /* left column */ }
.kols-hero-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .2rem;
}
.kols-hero-plan-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .85rem;
}
.kols-hero-tasks {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.kols-hero-task { display: block; }
.kols-hero-task-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: .45rem;
    padding: .5rem .7rem;
    color: #fff;
    text-decoration: none;
    font-size: .92rem;
    transition: background .15s;
}
.kols-hero-task-link:hover { background: rgba(255,255,255,.22); }
.kols-hero-task--done .kols-hero-task-link {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    opacity: .65;
}
.kols-hero-task--done .kols-task-text { text-decoration: line-through; }
.kols-task-check {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: .25rem;
    border: 1.5px solid rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
}
.kols-task-check--done { background: #4ade80; border-color: #4ade80; color: #14532d; }
.kols-task-check--open { background: transparent; }
.kols-task-text { flex: 1; }
.kols-task-arrow { margin-left: auto; opacity: .55; font-size: .85rem; }
.kols-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}
.kols-btn-warning {
    font-size: 1rem;
    font-weight: 700;
    padding: .85rem 1.2rem;
}
.kols-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    color: #1a56a0;
    font-size: 1rem;
    font-weight: 700;
    padding: .85rem 1.2rem;
    border-radius: .5rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.kols-chat-btn:hover { background: #e8f0fb; color: #1a56a0; }
.kols-hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
.kols-cta-stack { display: flex; flex-direction: column; gap: .5rem; }
.kols-btn-outline {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
}
.kols-btn-outline:hover { background: rgba(255,255,255,.25); }
.kols-btn-chat { display: flex; flex-direction: column; align-items: center; justify-content: center;
                 gap: .35rem; min-height: 4.5rem; padding: .7rem 1.4rem;
                 background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.6); }
.kols-btn-chat:hover { background: rgba(255,255,255,.35); }
.kols-btn-chat svg { width: 1.8rem; height: 1.8rem; opacity: .95; }
.kols-btn-chat span { font-size: .92rem; font-weight: 700; letter-spacing: .01em; }

/* Right column: video stacked above B2 */
.kols-right-col { display: flex; flex-direction: column; gap: 1.25rem; }
.kols-right-col .specialist-video-section { margin-bottom: 0; }
.kols-right-col .specialist-video-player { max-height: 220px; }

/* Two-column grid */
.kols-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 780px) { .kols-grid { grid-template-columns: 1fr; } }

/* Right column wrapper — stacks kols-card + nearby events vertically */
.kols-grid-right-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
}

/* Cards */
.kols-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1.5rem;
}
.kols-card--emergency {
    background: #fff1f2;
    border-color: #fecdd3;
}
.kols-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 .4rem;
}
.kols-card-lead {
    font-size: .88rem;
    color: var(--gray-600);
    margin: 0 0 1rem;
}
.kols-card-footnote {
    font-size: .8rem;
    color: var(--gray-500);
    margin: 1rem 0 0;
}

/* Task checkboxes */
.kols-tasks { display: flex; flex-direction: column; gap: .5rem; }
.kols-task {
    border: 1px solid var(--gray-200);
    border-radius: .6rem;
    overflow: hidden;
    transition: border-color .15s, background .15s;
}
.kols-task--done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.kols-task-form { margin: 0; }
.kols-task-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .93rem;
    text-align: left;
    color: var(--gray-800);
    font-family: inherit;
}
.kols-task-btn:hover { background: var(--gray-50); }
.kols-task--done .kols-task-btn { color: var(--gray-600); text-decoration: line-through; }
.kols-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    flex-shrink: 0;
    font-size: .85rem;
    color: transparent;
}
.kols-check-icon--done {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}
.kols-task-note {
    font-size: .8rem;
    color: var(--gray-500);
    margin: 0;
    padding: 0 1rem .6rem 3.05rem;
}

/* Motivation stats */
.kols-motivation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .5rem; }
.kols-motivation-stat {
    border-radius: .75rem;
    padding: 1rem;
}
.kols-stat-cyan { background: #ecfeff; border: 1px solid #a5f3fc; }
.kols-stat-sky  { background: #f0f9ff; border: 1px solid #bae6fd; }
.kols-stat-num  { font-size: 1.8rem; font-weight: 700; color: var(--gray-900); }
.kols-stat-label { font-size: .82rem; color: var(--gray-600); margin: .25rem 0 0; }
.kols-motivation-tip {
    grid-column: 1 / -1;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: .75rem;
    padding: .85rem 1rem;
    font-size: .88rem;
    color: var(--gray-700);
}

/* Resource links */
.kols-resources { display: flex; flex-direction: column; gap: .6rem; }
.kols-resources--mt { margin-top: 1rem; }
.kols-resource-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border: 1px solid #bfdbfe;
    border-radius: .6rem;
    text-decoration: none;
    color: #1e40af;
    font-size: .9rem;
    background: #eff6ff;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.kols-resource-link:hover { background: #dbeafe; border-color: #93c5fd; box-shadow: 0 1px 4px rgba(37,99,235,.12); }
.kols-resource-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: .75rem;
    flex-shrink: 0;
    padding-left: 2px; /* optical centering of play triangle */
}
.kols-resource-title { flex: 1; font-weight: 500; }
.kols-resource-arrow { font-size: 1rem; flex-shrink: 0; color: #6b7280; }

/* Numbered instruction list */
.kols-numbered-list {
    padding-left: 1.4rem;
    margin: .5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    font-size: .92rem;
    color: var(--gray-800);
    line-height: 1.5;
}

/* Vaccines */
.kols-vaccine-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .25rem; }
.kols-vaccine-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: .6rem;
    padding: .7rem 1rem;
}
.kols-vaccine-name { font-weight: 600; font-size: .93rem; color: var(--gray-900); }
.kols-vaccine-desc { font-size: .82rem; color: var(--gray-600); margin: .2rem 0 0; }

/* Warning signs */
.kols-grid--warning { align-items: start; }
.kols-warn-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.kols-warn-item { display: flex; align-items: flex-start; gap: .6rem; font-size: .92rem; color: var(--gray-800); line-height: 1.4; }
.kols-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: .3rem;
}
.kols-dot--amber { background: #f59e0b; }
.kols-dot--red   { background: #ef4444; }

/* Closing advice */
.kols-advice {
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}
.kols-advice-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .6rem; color: #fff; }
.kols-advice p { font-size: .93rem; color: #cbd5e1; margin: 0; max-width: 44rem; line-height: 1.6; }

/* Collapsible sections (messages, questions) */
.kols-details {
    border: 1px solid var(--gray-200);
    border-radius: .75rem;
    margin-bottom: .75rem;
    background: #fff;
}
.kols-details-summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--gray-800);
    list-style: none;
    user-select: none;
}
.kols-details-summary::-webkit-details-marker { display: none; }
.kols-details-summary::before {
    content: '▸ ';
    font-size: .75rem;
    color: var(--gray-400);
}
.kols-details[open] .kols-details-summary::before { content: '▾ '; }
.kols-details-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--gray-100); }
.kols-link { color: var(--primary-color); font-size: .88rem; }

.kols-settings-link { font-size: .85rem; color: var(--gray-500); margin-top: 1rem; }

/* ── Om oss ─────────────────────────────────────────────────────── */
.om-oss-wrap { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 3rem; }

.om-hero { text-align: center; padding: 2.5rem 1rem 2rem; border-bottom: 2px solid var(--primary-color); margin-bottom: 2rem; }
.om-hero h1 { font-size: 2.2rem; font-weight: 700; color: var(--primary-color); margin: 0 0 .5rem; }
.om-tagline { font-size: 1.1rem; color: var(--gray-500); font-style: italic; margin: 0; }

.om-section { margin-bottom: 2rem; }
.om-section h2 { font-size: 1.15rem; font-weight: 700; color: var(--primary-color); margin: 0 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--gray-100); }
.om-section p { color: var(--gray-700); line-height: 1.7; margin: 0; }

.om-list { margin: 0; padding: 0 0 0 1.2rem; color: var(--gray-700); line-height: 1.8; }
.om-list li { margin-bottom: .25rem; }

/* ── KOLS — Viktige helsesjekker ───────────────────────────────── */
.kols-section-heading { text-align: center; margin: 2.5rem 0 1.25rem; }
.kols-section-heading h2 { font-size: 1.35rem; font-weight: 700; color: var(--primary-color); margin: 0 0 .4rem; }
.kols-section-heading p { color: var(--gray-500); font-size: .95rem; margin: 0; }

.kols-grid--health { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.kols-card--health { border-top: 3px solid var(--primary-color); }

.kols-health-icon { font-size: 1.6rem; margin-bottom: .5rem; line-height: 1; }
.kols-health-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); margin: 0 0 .6rem; }

.kols-health-lead { font-size: .9rem; color: var(--gray-700); margin: .75rem 0 .4rem; font-weight: 600; }

.kols-health-list { margin: 0 0 .75rem 1.1rem; padding: 0; color: var(--gray-700); font-size: .88rem; line-height: 1.75; }
.kols-health-list li { margin-bottom: .15rem; }

.kols-health-urgent { font-size: .85rem; color: #92400e; background: #fffbeb; border-left: 3px solid #f59e0b; padding: .5rem .75rem; border-radius: 0 .25rem .25rem 0; margin: .5rem 0 0; }

.kols-health-cta { font-size: .88rem; font-weight: 600; color: var(--primary-color); margin: .75rem 0 0; }

/* ── Health-check read button ──────────────────────────────────── */
.health-check-read-wrap { display: flex; justify-content: flex-end; margin: .75rem 0 1.5rem; }
.health-check-form { margin: 0; }
.health-check-btn {
    display: inline-block;
    background: var(--blue-mid);
    color: #fff;
    border: none;
    border-radius: .5rem;
    padding: .65rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    line-height: 1.4;
    white-space: nowrap;
}
.health-check-btn:hover { background: var(--blue-dark); }
.health-check-done {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #f0fdf4;
    border: 1.5px solid #22c55e;
    color: #166534;
    border-radius: .5rem;
    padding: .5rem 1.1rem;
    font-size: .95rem;
    font-weight: 600;
}
.health-check-done-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── KOLS — clinical guidance & new elements ───────────────────── */
.kols-tip { background: #f0fdf4; border-left: 3px solid #22c55e; padding: .6rem .85rem; border-radius: 0 .25rem .25rem 0; font-size: .88rem; color: var(--gray-700); margin-top: 1rem; }

.kols-twoday-rule { background: #fffbeb; border: 1px solid #fcd34d; border-radius: .375rem; padding: .6rem .85rem; font-size: .9rem; color: #92400e; margin-top: 1rem; }

/* Med explanation (preventive vs rescue) */
.kols-med-explanation { margin-top: 1rem; padding: 1rem 1.1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .5rem; }
.kols-med-explanation p { font-size: .88rem; color: #334155; line-height: 1.65; margin: 0 0 .75rem; }
.kols-med-explanation p:last-child { margin-bottom: 0; }

/* Fire analogy tip */
.kols-tip--analogy { background: #fff7ed; border-color: #fdba74; color: #7c2d12; margin-top: .75rem; }

/* Tips en venn */
.tip-friend-section { text-align: center; margin: 2rem 0 1rem; padding: 1.5rem 1rem; background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: .75rem; }
.tip-friend-section h3 { font-size: 1rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .35rem; }
.tip-friend-section > p { font-size: .88rem; color: #475569; margin: 0 0 .75rem; }
.tip-friend-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; max-width: 28rem; margin: 0 auto; }
.tip-friend-input { flex: 1; min-width: 12rem; padding: .45rem .7rem; border: 1px solid #cbd5e1; border-radius: .375rem; font-size: .88rem; }
.tip-friend-note { font-size: .75rem; color: #94a3b8; margin: .5rem 0 0; }

/* Doctor clinical guidance collapsible in workflow step view */
.step-clinical-guide summary { color: var(--primary-color); font-size: .8rem; font-weight: 600; cursor: pointer; }
.step-clinical-body { font-size: .82rem; color: var(--gray-700); line-height: 1.65; padding: .5rem .25rem 0; white-space: pre-wrap; }

/* ── KOLS hero — split layout ───────────────────────────────────── */
.kols-hero { display: grid; grid-template-columns: 1fr 340px; gap: 1.75rem; align-items: start; text-align: left; }
.kols-hero-content { /* left column — inherits existing kols-hero styles */ }
.kols-hero-content .kols-hero-cta { justify-content: flex-start; }

.kols-hero-inbox { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: .625rem; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; min-height: 120px; }
.kols-inbox-heading { color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.kols-inbox-scroll { flex: 1; overflow-y: auto; max-height: 180px; }
.kols-inbox-scroll .inbox-item { background: rgba(255,255,255,.92); border-radius: .375rem; padding: .5rem .65rem; margin-bottom: .4rem; font-size: .8rem; }
.kols-inbox-scroll .inbox-meta { font-size: .72rem; color: var(--gray-500); margin-bottom: .2rem; }
.kols-inbox-scroll .inbox-body { color: var(--gray-800); line-height: 1.45; }
.kols-inbox-scroll .inbox-empty { color: rgba(255,255,255,.7); font-size: .85rem; padding: .25rem 0; }
.kols-inbox-link { color: rgba(255,255,255,.85); font-size: .78rem; text-decoration: none; align-self: flex-end; }
.kols-inbox-link:hover { color: #fff; text-decoration: underline; }

@media (max-width: 680px) {
    .kols-hero { grid-template-columns: 1fr; }
    .kols-hero-inbox { max-height: 220px; }
    .kols-hero-inbox.kols-inbox--expanding { max-height: none; overflow: visible; }
}

/* ── KOLS box label (B1, B2 … yellow pill after card title) ─────── */
/* DEV-ONLY box labels — remove before public launch */
.dev-box-label {
    display: none;
    font-size: .6rem;
    font-weight: 600;
    padding: .1rem .4rem;
    border-radius: .25rem;
    background: #fde68a;
    color: #92400e;
    letter-spacing: .03em;
    margin-left: .5rem;
    vertical-align: middle;
    font-family: monospace;
    opacity: .85;
}

.kols-box-label {
    display: none;
    font-size: .62rem;
    font-weight: 700;
    padding: .1rem .38rem;
    border-radius: .25rem;
    background: #fef08a;
    color: #713f12;
    letter-spacing: .04em;
    margin-left: .4rem;
    vertical-align: middle;
    line-height: 1.4;
}
.dev .kols-box-label { display: inline-block; }

/* ── KOLS questions card (full-width, between row 1 and row 2) ───── */
.kols-card--questions { margin-bottom: 1.25rem; }
.kols-card--questions .question-field { margin-bottom: 1rem; }

/* ACT — Astma Kontroll Test */
.act-section { background: #fff; border: 1px solid #e2e8f0; border-radius: .625rem; padding: 1.5rem 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.act-entry-point { display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: .6rem .75rem; border-radius: .5rem; background: #f0f7ff; border: 1px solid #bfdbfe; transition: background .15s; }
.act-entry-point:hover { background: #dbeafe; }
.act-entry-icon { font-size: 1.3rem; line-height: 1; }
.act-entry-text { flex: 1; font-size: .95rem; font-weight: 600; color: #1b3a5c; }
.act-entry-arrow { font-size: .8rem; color: #64748b; }
.act-expandable { margin-top: 1rem; }
.act-chart { margin: .75rem 0; padding: .75rem; background: #f8fafc; border-radius: .5rem; border: 1px solid #e2e8f0; }
.act-chart-title { font-size: .8rem; font-weight: 600; color: #1b3a5c; margin: 0 0 .5rem; }
.act-sparkline { display: block; max-width: 100%; height: auto; }
.act-chart-legend { font-size: .7rem; color: #64748b; margin: .4rem 0 0; }
.act-header { margin-bottom: 1.25rem; }
.act-title { font-size: 1rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .3rem; }
.act-lead { font-size: .85rem; color: #64748b; margin: 0; }

.act-last-result { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.act-score-good { background: #f0fdf4; border: 1px solid #86efac; }
.act-score-warn  { background: #fefce8; border: 1px solid #fde047; }
.act-score-poor  { background: #fef2f2; border: 1px solid #fca5a5; }
.act-last-score { font-size: 2.5rem; font-weight: 800; color: #1b3a5c; line-height: 1; white-space: nowrap; }
.act-last-score span { font-size: 1rem; font-weight: 400; color: #64748b; }
.act-last-info { flex: 1; }
.act-last-info strong { display: block; font-size: .95rem; color: #1b3a5c; }
.act-last-info span { font-size: .8rem; color: #64748b; }
.act-last-info p { font-size: .85rem; color: #374151; margin: .25rem 0 0; }
.act-print-btn { margin-left: auto; white-space: nowrap; }

.act-form { margin-top: .5rem; }
.act-question { margin-bottom: 1.25rem; }
.act-q-text { font-size: .9rem; color: #1b3a5c; margin: 0 0 .5rem; line-height: 1.5; }
.act-opts { display: flex; flex-direction: column; gap: .3rem; }
.act-opt { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: #374151; cursor: pointer; padding: .2rem 0; }
.act-opt input { accent-color: #2563a8; width: 1rem; height: 1rem; flex-shrink: 0; cursor: pointer; }
.act-opt:hover span { color: #1b3a5c; }

/* ── KOLS plan list (informational, daily habits) ───────────────── */
.kols-plan-list { margin: .75rem 0 1rem 1.2rem; padding: 0; color: var(--gray-700); line-height: 1.9; font-size: .95rem; }

/* ── KOLS exercise list (Are's static numbered list) ────────────── */
.kols-exercise-list { margin: .75rem 0 .75rem 1.4rem; padding: 0; color: var(--gray-800); line-height: 1.85; font-size: .95rem; font-weight: 500; }
.kols-exercise-list li { margin-bottom: .1rem; }

/* ── KOLS confirm button ────────────────────────────────────────── */
.kols-confirm-form { margin-top: 1.25rem; }
.kols-confirm-btn { display: block; width: 100%; padding: .85rem 1rem; border: none; border-radius: .5rem; background: #2563a8; color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; text-align: center; transition: background .15s, transform .1s; }
.kols-confirm-btn:hover { background: #1d4e8f; }
.kols-confirm-btn:active { transform: scale(.98); }
.kols-confirm-btn--done { background: #16a34a; color: #fff; }
.kols-confirm-btn--done:hover { background: #15803d; }

/* Override kols-hero-lead max-width now that we have a constrained left column */
.kols-hero-content .kols-hero-lead { max-width: none; }

/* Fix: inbox items inherit hero's white text — force dark on the item root */
.kols-inbox-scroll .inbox-item { color: var(--gray-800); }
.kols-inbox-scroll .inbox-subject { color: var(--gray-900); font-weight: 600; }

/* D2 — last active row in patient profile */
.profile-field--wide { grid-column: 1 / -1; }
.profile-last-active { font-size: .88rem; color: var(--gray-700); }
.last-active-time { font-weight: 600; color: var(--gray-900); }
.last-active-never { color: var(--gray-400); font-style: italic; }

/* Hero two-column layout — desktop only */
@media (min-width: 681px) {
    .kols-hero { grid-template-columns: 1fr 400px; }
    .kols-inbox-scroll { max-height: 220px; }
}

/* Inbox panel — solid white card, isolated from hero colour inheritance */
.kols-hero-inbox { background: #fff !important; color: #1e293b !important; border: none !important; }
.kols-hero-inbox .kols-inbox-heading { color: #2563a8; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kols-inbox-scroll .inbox-item { background: #f8fafc !important; color: #1e293b !important; }
.kols-inbox-scroll .inbox-item--unread { background: #f0f9ff !important; border-left: 3px solid #2563a8; }
.kols-inbox-scroll .inbox-from   { color: #1b3a5c !important; }
.kols-inbox-scroll .inbox-date   { color: #64748b !important; }
.kols-inbox-scroll .inbox-body   { color: #334155 !important; }
.kols-inbox-scroll .inbox-subject { color: #0f172a !important; font-weight: 600; }
.kols-inbox-scroll .inbox-empty  { color: #94a3b8 !important; font-style: italic; }
.kols-inbox-link { color: #2563a8 !important; }

/* Mobile hero adjustments */
@media (max-width: 680px) {
    .kols-hero { padding: 1.5rem 1.25rem; }
    .kols-hero-title { font-size: 1.45rem; }
    .kols-hero-inbox { margin-top: .25rem; }
    .kols-inbox-scroll { max-height: 140px; }
}

/* ================================================================
   HOME PAGE — patient-facing landing
   ================================================================ */

/* Hero section */
.home-hero {
    background: linear-gradient(135deg, #1b3a5c 0%, #2563a8 60%, #3b82f6 100%);
    color: #fff;
    padding: 4.5rem 0 4rem;
    margin-bottom: 0;
}
.home-eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; margin: 0 0 .75rem; }
.home-title { font-size: 2.8rem; font-weight: 800; line-height: 1.12; margin: 0 0 1.1rem; }
.home-lead { font-size: 1.12rem; line-height: 1.7; opacity: .9; max-width: 560px; margin: 0 0 1.75rem; }
.home-ctas { display: flex; gap: .75rem; flex-wrap: wrap; }
.home-btn-register { background: #fff; color: #1b3a5c; font-weight: 700; border: none; }
.home-btn-register:hover { background: #f0f9ff; color: #1b3a5c; }
.home-btn-login { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.home-btn-login:hover { background: rgba(255,255,255,.25); }
.home-hero-note { font-size: .78rem; opacity: .65; margin: 1rem 0 0; }
.home-hero-visual { opacity: .85; flex-shrink: 0; }
.home-hero-svg { width: 240px; height: 240px; display: block; }

@media (max-width: 680px) {
    .home-hero { padding: 2.5rem 0 2rem; }
    .home-hero-visual { display: none; }
    .home-title { font-size: 1.75rem; }
}

/* Specialist trust strip */
.home-specialist-strip {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: #f0f7ff;
    border-left: 4px solid #2563a8;
    border-radius: 0 .625rem .625rem 0;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.5rem;
}
.home-specialist-quote-mark {
    font-size: 4rem;
    line-height: 1;
    color: #2563a8;
    opacity: .35;
    font-family: Georgia, serif;
    flex-shrink: 0;
    margin-top: -.25rem;
}
.home-specialist-body { flex: 1; }
.home-specialist-quote {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1b3a5c;
    font-style: italic;
    margin: 0 0 .6rem;
}
.home-specialist-name {
    font-size: .85rem;
    font-weight: 700;
    color: #2563a8;
    margin: 0;
}
@media (max-width: 540px) {
    .home-specialist-strip { padding: 1.25rem 1rem; gap: .75rem; }
    .home-specialist-quote-mark { font-size: 2.5rem; }
    .home-specialist-quote { font-size: .95rem; }
}

/* Steps section */
.home-steps-section { text-align: center; padding: 3rem 0; margin-bottom: 0; background: #f8fafc; }
.home-section-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .4rem; color: #1b3a5c; }
.home-section-lead { color: #64748b; margin: 0 0 2rem; }
.home-steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; flex-wrap: wrap; }
.home-step { max-width: 220px; text-align: center; padding: 0 1rem; }
.home-step-num { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #2563a8; color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.home-step-title { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; color: #1b3a5c; }
.home-step-body { font-size: .88rem; color: #64748b; line-height: 1.6; margin: 0; }
.home-step-arrow { font-size: 1.5rem; color: #cbd5e1; align-self: center; padding: 0 .25rem; margin-top: -.5rem; }
@media (max-width: 680px) { .home-step-arrow { display: none; } .home-step { max-width: 100%; width: 100%; margin-bottom: 1.25rem; } }

/* Feature cards */
.home-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.home-feature-card { background: #fff; border: 1px solid #e2e8f0; border-radius: .625rem; padding: 1.5rem 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.home-feature-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.home-feature-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.home-feature-title { font-size: 1rem; font-weight: 700; color: #1b3a5c; }
.home-feature-body { font-size: .88rem; color: #64748b; line-height: 1.6; margin: 0; }

/* CTA banner */
.home-cta-banner { background: linear-gradient(90deg, #1b3a5c, #2563a8); border-radius: .75rem; padding: 2.5rem 2rem; text-align: center; margin-bottom: 1.5rem; }
.home-cta-banner-title { color: #fff; font-size: 1.5rem; font-weight: 700; margin: 0 0 .5rem; }
.home-cta-banner-lead { color: rgba(255,255,255,.8); margin: 0 0 1.25rem; }

/* Doctor link */
.home-doctor-link { text-align: center; padding: .5rem 0 1.5rem; }
.home-doctor-link a { color: #64748b; font-size: .85rem; text-decoration: none; }
.home-doctor-link a:hover { color: #2563a8; text-decoration: underline; }

/* ================================================================
   PATIENT REGISTRATION FORMS  (/registrer)
   ================================================================ */

.reg-wrap { max-width: 600px; margin: 0 auto; }

/* Progress bar */
.reg-progress { display: flex; align-items: center; margin-bottom: 2rem; }
.reg-step { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: #94a3b8; white-space: nowrap; }
.reg-step--active { color: #2563a8; }
.reg-step--done { color: #16a34a; }
.reg-step-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.reg-step--active .reg-step-num { background: #2563a8; color: #fff; }
.reg-step--done .reg-step-num { background: #16a34a; color: #fff; font-size: .85rem; }
.reg-step-line { flex: 1; height: 2px; background: #e2e8f0; margin: 0 .5rem; }
.reg-step-line--done { background: #16a34a; }

/* Card container */
.reg-card { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; padding: 2rem 1.75rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.reg-card--success { text-align: center; }
.reg-title { font-size: 1.5rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .4rem; }
.reg-lead { color: #64748b; margin: 0 0 1.5rem; line-height: 1.65; }

/* Success page */
.reg-success-icon { font-size: 3rem; margin-bottom: .75rem; }
.reg-next-steps { background: #f8fafc; border-radius: .5rem; padding: 1.25rem 1.5rem; text-align: left; margin-top: 1.25rem; }
.reg-next-title { font-size: .95rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .75rem; }
.reg-next-list { margin: 0; padding-left: 1.4rem; color: #475569; font-size: .9rem; line-height: 1.9; }

/* Form layout */
.reg-form .form-group { margin-bottom: 1rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-row-2 { grid-template-columns: 1fr; } }
.reg-login-link { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: #64748b; }
.reg-login-link a { color: #2563a8; }

/* Errors */
.reg-errors { background: #fff1f2; border: 1px solid #fecdd3; border-radius: .5rem; padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.reg-errors ul { margin: 0; padding-left: 1.2rem; color: #9f1239; font-size: .88rem; line-height: 1.9; }

/* Doctor list (step 2) */
.reg-doctor-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.reg-doctor-item { display: flex; align-items: center; gap: .85rem; border: 2px solid #e2e8f0; border-radius: .5rem; padding: .75rem 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.reg-doctor-item:hover { border-color: #2563a8; background: #f0f9ff; }
.reg-doctor-item input[type=radio]:checked ~ .reg-doctor-info { color: #2563a8; }
.reg-doctor-item:has(input:checked) { border-color: #2563a8; background: #f0f9ff; }
.reg-doctor-item--none { border-style: dashed; }
.reg-doctor-info { display: flex; flex-direction: column; gap: .1rem; }
.reg-doctor-name { font-weight: 600; color: #1b3a5c; font-size: .95rem; }
.reg-doctor-region { font-size: .8rem; color: #64748b; }

/* Submit button loading state */
.reg-submit { min-width: 200px; }

/* Reg form fields (also used in buddy card) */
.reg-field { margin-bottom: 1rem; }
.reg-label { display: block; font-size: .85rem; font-weight: 600; color: #1b3a5c; margin-bottom: .35rem; }
.reg-input { width: 100%; padding: .55rem .75rem; border: 1.5px solid #cbd5e1; border-radius: .4rem; font-size: .95rem; color: #1e293b; background: #fff; box-sizing: border-box; transition: border-color .15s; }
.reg-input:focus { outline: none; border-color: #2563a8; }

/* Buddy card on /registrer/ferdig */
.reg-buddy-card { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; padding: 1.75rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); margin-top: 1.5rem; }
.reg-buddy-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.reg-buddy-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.reg-buddy-title { font-size: 1.15rem; font-weight: 700; color: #1b3a5c; margin: 0 0 .2rem; }
.reg-buddy-optional { font-size: .82rem; color: #94a3b8; margin: 0; }
.reg-buddy-explainer { display: flex; flex-direction: column; gap: .75rem; background: #f8fafc; border-radius: .5rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.reg-buddy-point { font-size: .88rem; color: #475569; line-height: 1.5; }
.reg-buddy-point strong { display: block; color: #1b3a5c; margin-bottom: .15rem; }
.reg-buddy-point--does strong { color: #16a34a; }
.reg-buddy-point--doesnt strong { color: #b91c1c; }
.reg-buddy-checks { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }
.reg-check-label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: #475569; cursor: pointer; }
.reg-check-label input[type=checkbox] { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: #2563a8; }
.reg-buddy-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.reg-buddy-skip { font-size: .88rem; color: #94a3b8; text-decoration: none; }
.reg-buddy-skip:hover { color: #64748b; text-decoration: underline; }

/* ================================================================
   INHALER SELECTION — B6 on KOLS patient page
   ================================================================ */

.inhaler-section { margin: 1.5rem 0 .75rem; }

/* Picker prompt (no inhaler saved yet) */
.inhaler-picker-intro { font-size: .95rem; color: #475569; margin: 0 0 1rem; line-height: 1.55; }
.inhaler-picker-form { display: flex; flex-direction: column; gap: .75rem; }
.inhaler-select { width: 100%; font-size: 1rem; padding: .7rem .85rem; border: 2px solid #93c5fd; border-radius: .5rem; background: #fff; color: #0c4a6e; }
.inhaler-select:focus { outline: none; border-color: #2563a8; }
.inhaler-save-btn { width: 100%; padding: .8rem 1rem; font-size: 1rem; font-weight: 700; }

/* Saved inhaler card */
.inhaler-saved { background: #f0f9ff; border: 2px solid #7dd3fc; border-radius: .625rem; padding: 1.1rem 1.25rem; }
.inhaler-saved-label { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #0369a1; margin-bottom: .3rem; }
.inhaler-saved-name { font-size: 1.2rem; font-weight: 700; color: #0c4a6e; line-height: 1.3; }
.inhaler-device { font-weight: 400; color: #0369a1; }
.inhaler-saved-substance { font-size: .85rem; color: #64748b; margin: .25rem 0 1rem; }
.inhaler-saved-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.inhaler-video-btn { background: #0ea5e9; border-color: #0ea5e9; font-size: 1rem; font-weight: 700; width: 100%; text-align: center; }
.inhaler-video-btn:hover { background: #0284c7; border-color: #0284c7; color: #fff; text-decoration: none; }
.inhaler-fk-btn { font-size: .82rem; }
.inhaler-en-fallback { background: none; border: none; padding: 0; font-size: .78rem; color: #64748b; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; align-self: center; }
.inhaler-en-fallback:hover { color: #0ea5e9; }

/* YouTube inhaler modal */
.yt-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.yt-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.yt-modal-box { position: relative; width: 100%; max-width: 760px; background: #0f172a; border-radius: .75rem; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.yt-modal-header { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; background: #1e293b; }
.yt-modal-title { font-size: .9rem; font-weight: 600; color: #e2e8f0; }
.yt-modal-close { background: none; border: none; color: #94a3b8; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 .25rem; }
.yt-modal-close:hover { color: #f1f5f9; }
.yt-modal-embed { position: relative; aspect-ratio: 16/9; background: #000; }
.yt-modal-embed iframe { display: block; }

/* Change inhaler collapsible */
.inhaler-change-details summary { font-size: .85rem; color: #0369a1; cursor: pointer; }
.inhaler-change-details summary:hover { text-decoration: underline; }
.inhaler-change-body { margin-top: .75rem; }
.inhaler-change-body .inhaler-picker-form { flex-direction: row; flex-wrap: wrap; align-items: center; }
.inhaler-change-body .inhaler-select { flex: 1; min-width: 180px; width: auto; font-size: .9rem; padding: .55rem .75rem; }
.inhaler-change-body .inhaler-save-btn { width: auto; padding: .55rem 1rem; font-size: .9rem; }

.inhaler-delete-btn { color: #94a3b8; border-color: #cbd5e1; font-size: .8rem; padding: .4rem .7rem; }
.inhaler-delete-btn:hover { color: #dc2626; border-color: #fca5a5; background: #fff1f2; }

/* Inbox expand button — same look as the link */
.kols-inbox-expand-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}
/* Expanded view: full messages, no height cap */
.kols-inbox-expanded { overflow-y: auto; }
.kols-inbox-expanded .inbox-item { background: rgba(255,255,255,.92) !important; border-radius: .375rem; padding: .55rem .7rem; margin-bottom: .5rem; font-size: .82rem; }
.kols-inbox-expanded .inbox-item--unread { border-left: 3px solid #2563a8; }
.kols-inbox-link--fallback { display: block; margin-top: .75rem; text-align: center; font-size: .8rem; }

/* ── Doctor data tables — mobile responsive ────────────────────── */
@media (max-width: 680px) {
    /* Hide e-post column (always col 2) — too long for mobile */
    .data-table th:nth-child(2),
    .data-table td:nth-child(2) { display: none; }
    /* Tighten cell padding */
    .data-table th,
    .data-table td { padding: .45rem .5rem; }
    /* Shrink table min-width now that email column is gone */
    .data-table { min-width: 320px; font-size: .8rem; }
    /* Keep action button column narrow */
    .data-table td:last-child { white-space: nowrap; }
}

/* Message body paragraphs — tight letter-style spacing */
.inbox-body p, .sent-msg-body p { margin: 0 0 .55em; line-height: 1.55; }
.inbox-body p:last-child, .sent-msg-body p:last-child { margin-bottom: 0; }

/* ── Tech admin page ───────────────────────────────────────────── */
.tech-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: .65rem 1rem;
    font-size: .85rem;
    margin-bottom: 1.25rem;
}
.tech-section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin: 1.25rem 0 .4rem;
}
.tech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    margin-bottom: .5rem;
}
.tech-table th {
    text-align: left;
    font-weight: 600;
    font-size: .72rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: .3rem .5rem;
    white-space: nowrap;
}
.tech-table td {
    padding: .3rem .5rem;
    border-bottom: 1px solid #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.tech-table tr:hover td { background: #f8fafc; }
.tech-url {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: .75rem;
    color: #334155;
}
.tech-devtools {
    border: 1px solid #fca5a5;
    border-radius: .5rem;
    padding: .75rem 1rem;
    background: #fef2f2;
    margin-bottom: 1rem;
}

/* ── DB debug panel (DEV_MODE only) ────────────────────────────── */
.db-debug-panel {
    width: 100%;
    font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
    font-size: .72rem;
    background: #0f172a;
    color: #e2e8f0;
    border-top: 2px solid #334155;
}
.db-debug-summary {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .35rem .75rem;
    cursor: default;
}
.db-debug-label { color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; font-size: .65rem; }
.db-debug-val { font-weight: 700; }
.db-debug-val--green  { color: #4ade80; }
.db-debug-val--amber  { color: #fbbf24; }
.db-debug-val--red    { color: #f87171; }
.db-debug-toggle {
    margin-left: auto;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: .65rem;
    font-family: inherit;
    padding: .18rem .55rem;
    border-radius: .25rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.db-debug-toggle:hover { background: #334155; color: #e2e8f0; }
.db-debug-table-wrap {
    display: none;
    max-height: 220px;
    overflow-y: auto;
    border-top: 1px solid #1e293b;
}
.db-debug-panel.db-debug-open .db-debug-table-wrap { display: block; }
.db-debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .68rem;
}
.db-debug-table th {
    position: sticky;
    top: 0;
    background: #1e293b;
    color: #94a3b8;
    text-align: left;
    padding: .25rem .6rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}
.db-debug-table td {
    padding: .2rem .6rem;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}
.db-debug-table tr:hover td { background: #1e293b; }
.db-debug-slow td { background: rgba(251,191,36,.08) !important; }
.db-debug-slow td:last-child { color: #fbbf24; font-weight: 700; }

/* ── Diagnosis card grid (/lege/maler overview) ─────────────────── */
.diag-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.diag-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.1rem 1.2rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: .6rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.diag-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 10px rgba(59,130,246,.12);
    text-decoration: none;
}
.diag-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3a5f;
}
.diag-card-desc {
    font-size: .8rem;
    color: #64748b;
    line-height: 1.4;
}
.diag-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .4rem;
}
.diag-card-meta {
    font-size: .75rem;
    color: #94a3b8;
}
.diag-card-arrow {
    font-size: 1rem;
    color: #3b82f6;
    transition: transform .15s;
}
.diag-card:hover .diag-card-arrow { transform: translateX(3px); }

/* Delete button — subtle until hover */
.mal-slett-btn { color: #94a3b8 !important; }
.mal-slett-btn:hover { color: #dc2626 !important; border-color: #fca5a5 !important; background: #fff1f2 !important; }

/* ── Personvernerklæring (/personvern) ──────────────────────────── */
.privacy-wrap { max-width: 740px; margin: 0 auto; padding-bottom: 3rem; }
.privacy-updated { font-size: .8rem; color: #94a3b8; margin-top: -.5rem; margin-bottom: 2rem; }
.privacy-section { margin-bottom: 2.25rem; }
.privacy-section h2 { font-size: 1.05rem; font-weight: 700; color: #1e3a5f; margin-bottom: .6rem; padding-bottom: .3rem; border-bottom: 1px solid #e2e8f0; }
.privacy-section h3 { font-size: .95rem; font-weight: 600; color: #334155; margin: 1rem 0 .3rem; }
.privacy-section p, .privacy-section li { font-size: .9rem; line-height: 1.7; color: #374151; }
.privacy-section ul { padding-left: 1.25rem; }
.privacy-section li { margin-bottom: .3rem; }

/* ── Patient data export (/pasient/mine-data) ───────────────────── */
.mydata-wrap { max-width: 740px; margin: 0 auto; padding-bottom: 3rem; }
.mydata-section { margin-bottom: 2rem; }
.mydata-section h2 { font-size: 1rem; font-weight: 700; color: #1e3a5f; margin-bottom: .75rem; padding-bottom: .3rem; border-bottom: 1px solid #e2e8f0; }
.mydata-section--rights { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .5rem; padding: 1rem 1.25rem; }
.mydata-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mydata-table th { text-align: left; padding: .35rem .6rem; font-weight: 600; color: #64748b; width: 35%; vertical-align: top; }
.mydata-table td { padding: .35rem .6rem; color: #1e293b; }
.mydata-table tr { border-bottom: 1px solid #f1f5f9; }
.mydata-workflow { margin-bottom: 1.25rem; }
.mydata-workflow h3 { font-size: .9rem; font-weight: 600; color: #334155; margin-bottom: .5rem; }
.mydata-message { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f1f5f9; font-size: .85rem; }
.mydata-message strong { color: #1e293b; }
.mydata-message p { margin: .4rem 0 0; color: #374151; line-height: 1.6; }
.mydata-meta { color: #94a3b8; font-weight: 400; font-size: .8rem; }

.mydata-rights-note { font-size: .8rem; color: #64748b; margin-bottom: .75rem; line-height: 1.5; }
.mydata-section-desc { font-size: .82rem; color: #64748b; margin-bottom: .75rem; }

/* Message delete UI */
.mydata-msg-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.mydata-dir-badge { font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: #dbeafe; color: #1d4ed8; }
.mydata-dir-badge--out { background: #f1f5f9; color: #64748b; }
.mydata-del-form { margin: 0; display: inline; }
.btn-mydata-del { background: none; border: none; color: #94a3b8; font-size: 1rem; cursor: pointer; padding: 0 .2rem; line-height: 1; }
.btn-mydata-del:hover { color: #ef4444; }
.mydata-del-form--bulk { margin-top: .75rem; }

/* Chat history on mine-data */
.mydata-chat-day { margin-bottom: 1.25rem; }
.mydata-chat-date { font-size: .72rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.mydata-chat-msg { margin-bottom: .5rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .83rem; line-height: 1.55; max-width: 88%; }
.mydata-chat-msg--user { background: #eff6ff; margin-left: auto; }
.mydata-chat-msg--assistant { background: #f8fafc; }
.mydata-chat-meta { display: flex; align-items: baseline; gap: .4rem; margin-bottom: .2rem; }
.mydata-chat-role { font-weight: 600; color: #334155; font-size: .75rem; }
.mydata-chat-time { font-size: .7rem; color: #94a3b8; }
.mydata-chat-body { color: #374151; }

/* Doctor notes in patient portal */
.patient-note-entry { padding: .6rem 0; border-bottom: 1px solid #f1f5f9; }
.patient-note-entry:last-child { border-bottom: none; }
.patient-note-entry--old { opacity: .7; }
.patient-note-meta { font-size: .75rem; color: #94a3b8; margin-bottom: .3rem; display: flex; align-items: center; gap: .4rem; }
.patient-note-badge { background: #dbeafe; color: #1d4ed8; font-size: .65rem; padding: .1rem .4rem; border-radius: 999px; font-weight: 600; }
.patient-note-body { font-size: .85rem; color: #374151; line-height: 1.6; }

@media print {
    .site-nav, .site-footer, .btn, .page-header-row a { display: none !important; }
    .mydata-wrap { max-width: 100%; }
}

/* ============================================================
   PATIENT AI CHAT
   ============================================================ */
.chat-wrap {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px); /* dvh shrinks when keyboard opens (iOS 15.4+) */
    min-height: 400px;
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: .75rem;
    flex-shrink: 0;
}
.chat-header-title { display: flex; flex-direction: column; }
.chat-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.chat-subtitle { font-size: .75rem; color: #94a3b8; margin: 0; }

.chat-disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .6rem .9rem;
    font-size: .8rem;
    color: #92400e;
    margin-bottom: .75rem;
    flex-shrink: 0;
    line-height: 1.5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .25rem 0 .5rem;
}

.chat-bubble {
    max-width: 82%;
    padding: .65rem .9rem;
    border-radius: 16px;
    font-size: .9rem;
    line-height: 1.55;
    word-break: break-word;
}
.chat-bubble--user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble--assistant {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.chat-bubble--intro {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    max-width: 95%;
}
.chat-bubble p { margin: 0 0 .4rem; }
.chat-bubble p:last-child { margin: 0; }

.cite-badge {
    display: inline-block;
    font-size: .62rem;
    font-weight: 700;
    padding: .05rem .35rem;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
    text-decoration: none;
    margin: 0 1px;
    vertical-align: middle;
    letter-spacing: .03em;
    white-space: nowrap;
    line-height: 1.6;
}
.cite-badge:hover { background: #bfdbfe; color: #1e40af; }

.cite-footnote {
    max-width: 82%;
    align-self: flex-start;
    padding: .2rem .9rem .5rem;
}
.cite-footnote-list {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.cite-footnote-item {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}
.cite-footnote-text {
    font-size: .72rem;
    color: #64748b;
    line-height: 1.4;
}

.chat-typing {
    align-self: flex-start;
    background: #f1f5f9;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: .65rem .9rem;
    display: flex;
    gap: 4px;
    align-items: center;
}
.chat-typing span {
    width: 7px; height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: chatDot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
    40%            { transform: scale(1);   opacity: 1; }
}

.chat-input-area {
    flex-shrink: 0;
    padding-top: .5rem;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone home bar */
    border-top: 1px solid #e2e8f0;
    margin-top: .5rem;
}
.chat-form {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}
.chat-form textarea {
    flex: 1;
    resize: none;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: .6rem .8rem;
    font-size: .9rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color .15s;
    max-height: 120px;
}
.chat-form textarea:focus { outline: none; border-color: #2563eb; }
.chat-send-btn { align-self: flex-end; white-space: nowrap; }
.chat-remaining {
    font-size: .75rem;
    color: #94a3b8;
    margin-bottom: .35rem;
    text-align: right;
}
.chat-limit-reached { color: #ef4444; }

/* Doctor read-only transcript */
.chat-doctor-transcript { display: flex; flex-direction: column; gap: .5rem; }
.chat-dr-row {
    padding: .5rem .7rem;
    border-radius: 6px;
    font-size: .85rem;
}
.chat-dr-user      { background: #eff6ff; border-left: 3px solid #2563eb; }
.chat-dr-assistant { background: #f8fafc; border-left: 3px solid #94a3b8; }
.chat-dr-label { font-weight: 600; margin-right: .4rem; }
.chat-dr-date  { color: #94a3b8; font-size: .75rem; }
.chat-dr-body  { margin-top: .3rem; line-height: 1.5; color: #334155; }
.chat-channel-wa { background: #25d366; color: #fff; font-size: .65rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: .4rem; vertical-align: middle; }

/* SMS reminder tab */
.sms-phone-label  { font-size: .8rem; color: var(--gray-700); margin: .5rem 0 .25rem; }
.sms-steps-label  { font-size: .75rem; font-weight: 600; color: var(--gray-600); margin: 0 0 .2rem; }
.sms-steps-summary { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; padding: .5rem .75rem; margin-bottom: .5rem; }
.sms-incomplete-list { margin: 0; padding-left: 1.2rem; font-size: .8rem; color: var(--gray-800); }
.sms-incomplete-list li { margin-bottom: .15rem; }
.sms-no-phone     { font-size: .8rem; color: var(--gray-500); margin: .25rem 0; }
.sms-char-count   { display: block; text-align: right; font-size: .72rem; color: var(--gray-500); margin-top: .2rem; }

@media (max-width: 640px) {
    .chat-wrap {
        height: calc(100vh - 80px);
        height: calc(100dvh - 80px);
        min-height: 300px;
        /* Remove bottom padding from main-content so chat fills the screen */
        margin-bottom: -2rem;
    }
    .chat-bubble { max-width: 92%; }
    .chat-form textarea { font-size: 16px; } /* Prevent iOS auto-zoom on focus */
}

/* WhatsApp QR — button in CTA row, dropdown panel on click */
.wa-toggle-wrap { position: relative; display: inline-block; }
.wa-qr-panel {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    padding: 1rem;
    text-align: center;
    width: 170px;
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
}
.wa-qr-panel img { display: block; margin: 0 auto .5rem; border-radius: .35rem; }
.wa-qr-label { font-size: .72rem; font-weight: 600; color: #25d366; margin: 0 0 .5rem; }
.wa-qr-hint  { font-size: .68rem; color: #64748b; margin: .4rem 0 .5rem; line-height: 1.35; }
.wa-qr-direct {
    display: inline-block;
    font-size: .75rem;
    color: #25d366;
    font-weight: 600;
    text-decoration: none;
}
.wa-qr-direct:hover { text-decoration: underline; }
/* On mobile hide QR image, keep direct link */
@media (max-width: 768px) {
    .wa-qr-panel img { display: none; }
    .wa-qr-label { display: none; }
}

/* WhatsApp button inside chat page — centred with "or" separator, panel opens upward */
.chat-wrap .wa-toggle-wrap {
    display: flex;
    justify-content: center;
    margin: .5rem 1rem 1rem;
    padding-top: .875rem;
    border-top: 1px solid #e2e8f0;
}
.chat-wrap .wa-qr-panel {
    top: auto;
    bottom: calc(100% + .5rem);
    left: 50%;
    transform: translateX(-50%);
}

/* Feel-good activity timeline */
.feel-good-timeline { margin-top: 1.25rem; padding: .9rem 1rem; background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border: 1px solid #bbf7d0; border-radius: .625rem; }
.fgt-heading { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #15803d; margin-bottom: .5rem; }
.fgt-streak { font-size: .9rem; font-weight: 700; color: #15803d; margin-bottom: .6rem; }
.fgt-list { display: flex; flex-direction: column; gap: .35rem; }
.fgt-item { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: #374151; }
.fgt-icon { font-size: 1rem; flex-shrink: 0; }
.fgt-label { flex: 1; }
.fgt-today { font-size: .7rem; font-weight: 600; color: #15803d; background: #dcfce7; padding: .1rem .4rem; border-radius: 999px; }
.fgt-date { font-size: .72rem; color: #94a3b8; }

/* ── Inhaler adherence check-in (astma page) ──────────────────────
   inhaler_checkin_astma.tpl — mobile-first, satisfying tap cards.
   Palette:
     confirmed  : #16a34a / bg #f0fdf4 / border #bbf7d0
     pending    : #64748b / bg #f8fafc / border #e2e8f0
     amber warn : #d97706 / bg #fffbeb / border #fde68a
     teal accent: #0891b2
   ──────────────────────────────────────────────────────────────── */

/* Wrapper inside the B1 card */
.inh-checkin { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

/* Streak badge */
.inh-streak-wrap { display: flex; justify-content: center; }
.inh-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1.5px solid #fcd34d;
    border-radius: 999px;
    padding: .45rem 1.1rem;
    font-size: .9rem;
    font-weight: 700;
    color: #92400e;
    box-shadow: 0 1px 4px rgba(251,191,36,.25);
}

/* Two-column inhaler card row */
.inh-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

/* Individual morning / evening card */
.inh-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.1rem .9rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.inh-card:hover  { border-color: #0891b2; background: #f0f9ff; }
.inh-card:active { transform: scale(.96); }

/* Confirmed state */
.inh-card--done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    cursor: default;
    box-shadow: 0 0 0 3px rgba(22,163,74,.12), 0 2px 8px rgba(22,163,74,.10);
    animation: inh-glow-pulse 2s ease-in-out 1;
}
.inh-card--done:hover  { border-color: #bbf7d0; background: #f0fdf4; }
.inh-card--done:active { transform: none; }

@keyframes inh-glow-pulse {
    0%   { box-shadow: 0 0 0 3px rgba(22,163,74,.12), 0 2px 8px rgba(22,163,74,.10); }
    40%  { box-shadow: 0 0 0 8px rgba(22,163,74,.20), 0 4px 16px rgba(22,163,74,.18); }
    100% { box-shadow: 0 0 0 3px rgba(22,163,74,.12), 0 2px 8px rgba(22,163,74,.10); }
}

.inh-card-icon { font-size: 1.6rem; line-height: 1; }

.inh-card-body { text-align: center; flex: 1; }
.inh-card-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: .2rem;
}
.inh-card-name {
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: .5rem;
    line-height: 1.3;
}

/* Status line — "Bekreft" button or "Gjort" text */
.inh-card-status-btn {
    display: inline-block;
    background: #0891b2;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    border: none;
    border-radius: .5rem;
    padding: .45rem .9rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    width: 100%;
}
.inh-card-status-btn:hover  { background: #0e7490; }
.inh-card-status-btn:active { transform: scale(.96); }

.inh-card-done-label {
    font-size: .8rem;
    font-weight: 700;
    color: #16a34a;
}

/* Big animated checkmark in top-right corner */
.inh-card-check {
    position: absolute;
    top: .6rem;
    right: .7rem;
    font-size: 1.1rem;
    font-weight: 900;
    color: #16a34a;
    opacity: 0;
    transform: scale(.4) rotate(-20deg);
    transition: opacity .25s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.inh-card--done .inh-card-check {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Rescue tracker card */
.inh-rescue-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.inh-rescue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.inh-rescue-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
}
.inh-rescue-today {
    font-size: .82rem;
    color: #475569;
    white-space: nowrap;
}
.inh-rescue-btn {
    width: 100%;
    padding: .75rem 1rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: .625rem;
    font-size: .9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.inh-rescue-btn:hover  { border-color: #94a3b8; background: #f8fafc; }
.inh-rescue-btn:active { transform: scale(.97); }

/* History dots row */
.inh-rescue-history { display: flex; flex-direction: column; gap: .35rem; }
.inh-rescue-history-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #94a3b8;
}
.inh-rescue-dots { display: flex; gap: .45rem; align-items: flex-end; }

/* Each day dot */
.inh-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    flex: 1;
}
.inh-dot-circle {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    transition: background .2s;
}
.inh-dot-circle--none   { background: #f1f5f9; color: #94a3b8; }
.inh-dot-circle--low    { background: #fefce8; color: #ca8a04; border: 1.5px solid #fde68a; }
.inh-dot-circle--warn   { background: #fef3c7; color: #d97706; border: 1.5px solid #fcd34d; }
.inh-dot-circle--danger { background: #fde68a; color: #92400e; border: 1.5px solid #f59e0b; }
.inh-dot-label { font-size: .58rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Amber warning banner */
.inh-rescue-warning {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: .625rem;
    padding: .75rem .9rem;
    font-size: .82rem;
    color: #92400e;
    line-height: 1.5;
}

/* Responsive: stack cards on narrow screens */
@media (max-width: 380px) {
    .inh-card-row { grid-template-columns: 1fr; }
    .inh-card { flex-direction: row; align-items: flex-start; text-align: left; }
    .inh-card-body { text-align: left; }
}

/* ============================================================
   Gamification strip — points, dots & badges
   ============================================================ */
.gamif-strip {
    margin-top: 1.25rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: .875rem;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}
.gamif-stats {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.gamif-stat-line {
    font-size: .88rem;
    color: #166534;
}
.gamif-stat-line strong {
    font-weight: 700;
    color: #15803d;
    font-size: 1rem;
}

/* 7-day dot row */
.gamif-dots {
    display: flex;
    gap: .4rem;
    align-items: center;
}
.gamif-dot {
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
    transition: background .2s;
}
.gamif-dot--active {
    background: #22c55e;
    box-shadow: 0 0 0 2px #bbf7d0;
}

/* Badge shelf */
.gamif-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.gamif-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    background: #fff;
    border: 1.5px solid #bbf7d0;
    border-radius: 2rem;
    padding: .2rem .65rem;
    font-size: .8rem;
    color: #166534;
    font-weight: 600;
    white-space: nowrap;
}

/* Newly earned badge: brief celebration animation */
.gamif-badge--new {
    animation: gamif-pop .5s ease-out;
    border-color: #4ade80;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px #bbf7d0;
}
@keyframes gamif-pop {
    0%   { transform: scale(.8); opacity: .6; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Medals hero panel (Pokémon-Go style) ───────────────────────────────── */
.medals-panel {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: .75rem;
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-self: start;
    min-width: 220px;
}
.medals-panel-header {
    font-size: .8rem;
    color: rgba(255,255,255,.85);
    line-height: 1.3;
}
.medals-panel-header strong {
    color: #fff;
    font-size: .88rem;
}
.medals-panel-dots {
    display: flex;
    gap: .35rem;
    align-items: center;
}
/* Override gamif-dot colours for the dark hero background */
.medals-panel-dots .gamif-dot {
    background: rgba(255,255,255,.2);
}
.medals-panel-dots .gamif-dot--active {
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74,222,128,.35);
}

/* Medal grid */
.medals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .55rem .3rem;
}
/* Category headers span all columns */
.medals-cat-header {
    grid-column: 1 / -1;
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
    padding-top: .5rem;
    margin-top: .2rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
.medals-cat-header--first {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}
.medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    cursor: default;
}
.medal-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    line-height: 1;
    transition: transform .15s;
    flex-shrink: 0;
}
.medal:hover .medal-icon { transform: scale(1.12); }
.medal--earned .medal-icon {
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.4);
    box-shadow: 0 0 10px rgba(255,255,255,.2), 0 0 4px rgba(74,222,128,.3);
}
.medal--locked .medal-icon {
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(255,255,255,.1);
    filter: grayscale(1);
    opacity: .35;
}
.medal--new .medal-icon {
    animation: gamif-pop .6s ease-out;
    border-color: #4ade80;
    box-shadow: 0 0 14px rgba(74,222,128,.6);
}
.medal-lbl {
    font-size: .68rem;
    color: rgba(255,255,255,.75);
    text-align: center;
    line-height: 1.25;
    max-width: 60px;
    word-break: break-word;
}
.medal--earned .medal-lbl { color: rgba(255,255,255,.95); font-weight: 600; }
.medal--locked .medal-lbl { opacity: .4; }

/* Medal hover popup card */
.medal { position: relative; }
.medal-popup {
    display: none;
    position: absolute;
    top: calc(100% + .75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: 200px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: .875rem;
    padding: 1.1rem 1rem 1rem;
    text-align: center;
    box-shadow: 0 10px 36px rgba(0,0,0,.4);
    pointer-events: none;
}
/* Arrow pointing up toward the medal */
.medal-popup::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: #1e293b;
}
.medal:hover .medal-popup { display: block; }
.medal-popup-icon {
    font-size: 2.75rem;
    line-height: 1;
    display: block;
    margin-bottom: .5rem;
}
.medal-popup-title {
    font-size: .92rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .45rem;
    line-height: 1.25;
}
.medal-popup-how {
    font-size: .76rem;
    color: rgba(255,255,255,.72);
    line-height: 1.5;
    margin-bottom: .6rem;
}
.medal-popup-earned {
    font-size: .72rem;
    color: #4ade80;
    font-weight: 600;
}
.medal-popup-locked {
    font-size: .72rem;
    color: rgba(255,255,255,.38);
    font-style: italic;
}

/* Edge correction: leftmost medals in each row — popup shifts right */
.medals-grid .medal:nth-child(4n+1) .medal-popup {
    left: 0;
    transform: none;
}
.medals-grid .medal:nth-child(4n+1) .medal-popup::after {
    left: 29px; /* centre of 58px icon */
    transform: none;
}
/* Edge correction: rightmost medals in each row — popup shifts left */
.medals-grid .medal:nth-child(4n) .medal-popup {
    left: auto;
    right: 0;
    transform: none;
}
.medals-grid .medal:nth-child(4n) .medal-popup::after {
    left: auto;
    right: 29px;
    transform: none;
}

/* Mobile: medals panel collapses to a horizontal strip */
@media (max-width: 767px) {
    .medals-panel {
        background: rgba(255,255,255,.08);
        border-radius: .625rem;
        padding: .75rem .875rem;
        min-width: 0;
    }
    .medals-grid {
        grid-template-columns: repeat(7, 1fr);
    }
    .medal-icon { width: 44px; height: 44px; font-size: 1.4rem; }
    .medal-lbl  { display: none; }
}

/* Buddy current display in settings */
.buddy-current {
    font-size: .9rem;
    color: #475569;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

/* ─── Health Centre ──────────────────────────────────────────────── */

/* Nav role indicator */
.nav-role--hc {
    background: #0d9488;
    color: #fff;
}

/* HC event table */
.hc-event-table td { vertical-align: middle; }

/* HC event / profile forms */
.hc-event-form,
.hc-profile-form {
    max-width: 640px;
}

/* Waiting / holding page */
.hc-waiting {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

/* Approval queue table */
.hc-approval-table td { vertical-align: top; }

/* ─── Patient-facing event cards ─────────────────────────────────── */
.nearby-events {
    margin-top: 0;
}
.kols-card--nearby { padding: 1rem 1.1rem; }
.kols-card--nearby:empty { display: none; }
.nearby-events .kols-card-title {
    font-size: .95rem;
    margin-bottom: .75rem;
}

.nearby-event-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: .6rem;
    padding: .9rem 1rem;
    margin-bottom: .75rem;
    transition: box-shadow .15s;
}
.nearby-event-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.nearby-event-card__header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}
.nearby-event-card__title {
    font-weight: 700;
    font-size: .95rem;
    color: #1e293b;
}
.nearby-event-card__hc {
    font-size: .8rem;
    color: #64748b;
    margin: 0 0 .2rem;
}
.nearby-event-card__location,
.nearby-event-card__date {
    font-size: .82rem;
    color: #475569;
    margin: 0 0 .15rem;
}
.nearby-event-card__desc {
    font-size: .83rem;
    color: #64748b;
    margin: .35rem 0 .5rem;
}
.nearby-event-card__footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
}
.nearby-event-card__interest-btn--active {
    background: #f0fdf4;
    color: #166534;
    border-color: #86efac;
}

.hc-interest-count {
    font-size: .8rem;
    color: #64748b;
}

.hc-badge-recurring {
    font-size: .72rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 2rem;
    padding: .15rem .5rem;
    font-weight: 600;
    white-space: nowrap;
}

/* HC3 — Arrangement edit: two-column layout */
.hc-arrangement-layout {
    display: grid;
    grid-template-columns: minmax(0, 640px) 340px;
    gap: 1.5rem;
    align-items: start;
    max-width: 1020px;
}
@media (max-width: 900px) {
    .hc-arrangement-layout {
        grid-template-columns: 1fr;
    }
    .hc-arrangement-help { order: -1; }
}

.hc-help-list {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.7;
}
.hc-help-list li { margin-bottom: .35rem; }

.hc-help-tip {
    margin-top: 1.25rem;
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    border-radius: 0 .4rem .4rem 0;
    padding: .65rem .9rem;
    font-size: .875rem;
    line-height: 1.55;
    color: #166534;
}

/* ── Medal toast notification ─────────────────────────────────── */
.badge-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1e3a5f;
    color: #fff;
    border-radius: .75rem;
    padding: .85rem 1.2rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    z-index: 9999;
    transform: translateY(120%);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    max-width: 280px;
}
.badge-toast--show { transform: translateY(0); opacity: 1; }
.badge-toast-icon { font-size: 2rem; line-height: 1; }
.badge-toast-title { font-size: .75rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.badge-toast-label { font-weight: 700; font-size: 1rem; }

/* ── Compact hero medals strip ────────────────────────────────── */
.medals-panel--compact { min-width: 0; }
.medals-strip { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.medal--sm .medal-icon { font-size: 1.5rem; }
.medal--sm .medal-lbl { font-size: .6rem; }
.medal--sm { width: 54px; min-height: 54px; }
.medal--next .medal-icon {
    box-shadow: 0 0 0 2px #f59e0b;
    animation: medal-pulse 2s ease-in-out infinite;
}
@keyframes medal-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #f59e0b, 0 0 0 0 rgba(245,158,11,0); }
    50%       { box-shadow: 0 0 0 2px #f59e0b, 0 0 0 6px rgba(245,158,11,.25); }
}
.medals-see-all {
    font-size: .8rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.medals-see-all:hover { text-decoration: underline; }
.medals-panel-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.medals-total-stat { font-size: .8rem; color: #475569; white-space: nowrap; }

/* ── Exercise flashcard widget (B4) ──────────────────────────────── */
.ex-flashcard { margin-top: .75rem; }
.ex-start-row { text-align: center; margin: .75rem 0 .5rem; }
.ex-start-btn {
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.4rem;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.ex-start-btn:hover { background: #0284c7; }
.ex-flashcard--started .ex-card-visual { height: 540px; }
.ex-flashcard--started .ex-start-btn { background: #64748b; }
.ex-flashcard--started .ex-start-btn:hover { background: #475569; }

/* B1 plan anchor links */
.kols-plan-list--linked .kols-plan-anchor {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.kols-plan-list--linked .kols-plan-anchor:hover { color: #2563eb; }
.kols-plan-arrow { font-size: .8em; opacity: .6; }

.ex-cards { position: relative; }
.ex-card {
    display: none;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.ex-card--active { display: flex; }
.ex-card-visual {
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
    font-size: 4.5rem;
    text-align: center;
    padding: 1.25rem 1rem 1rem;
    line-height: 1;
    user-select: none;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ex-card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ex-card-body { padding: .75rem 1rem 1rem; }
.ex-card-counter { font-size: .72rem; color: #94a3b8; margin-bottom: .2rem; font-weight: 600; letter-spacing: .04em; }
.ex-card-name { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin: 0 0 .4rem; }
.ex-card-desc { font-size: .9rem; color: #475569; margin: 0 0 .75rem; line-height: 1.5; }
.ex-card-reps {
    display: inline-block;
    background: #0ea5e9;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 999px;
    letter-spacing: .02em;
}
.ex-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .65rem;
}
.ex-dots {
    display: flex;
    gap: .3rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}
.ex-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}
.ex-dot--active { background: #0ea5e9; transform: scale(1.3); }
.ex-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .4rem .7rem;
    font-size: .82rem;
    cursor: pointer;
    color: #334155;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}
.ex-btn:hover:not(:disabled) { background: #e2e8f0; }
.ex-btn:disabled { opacity: .3; cursor: default; }
.ex-btn--next { background: #0ea5e9; color: #fff; border-color: #0284c7; }
.ex-btn--next:hover:not(:disabled) { background: #0284c7; }
.ex-btn--finish { background: #22c55e; border-color: #16a34a; }
.ex-btn--finish:hover:not(:disabled) { background: #16a34a; }
.ex-checkin { margin-top: .75rem; }

/* ── Exercise image admin grid (/lege/tegneserier #cs-oevelser) ─────────── */
.ex-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    padding: .75rem 1rem 1.5rem;
}
.ex-admin-group { display: flex; flex-direction: column; gap: .5rem; }
.ex-admin-group-title {
    font-weight: 700;
    font-size: .88rem;
    color: #334155;
    padding-bottom: .25rem;
    border-bottom: 1px solid #e2e8f0;
}
.ex-admin-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.ex-admin-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.ex-admin-meta {
    padding: .4rem .6rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: .8rem;
    color: #475569;
}

/* ══════════════════════════════════════════════════════════════════
   Tegneserier — comic strip admin page (/lege/tegneserier)
   ══════════════════════════════════════════════════════════════════ */

/* ── Page wrapper: flush, no card border ── */
.cs-page { padding: 0; }
.cs-page-header { padding: .75rem 1.2rem .5rem; border-bottom: 1px solid var(--gray-200); }
.cs-page-header h1 { margin: 0; font-size: 1rem; font-weight: 700; display: inline; }

/* ── Tabs ── */
.cs-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; padding: 0 1.2rem; }
.cs-tab  { background: none; border: none; border-bottom: 3px solid transparent; padding: .6rem 1.2rem;
           font-size: .9rem; font-weight: 600; color: #888; cursor: pointer; margin-bottom: -2px; }
.cs-tab.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.cs-panel { padding: 0 .75rem 2rem; }

/* ── CLI instructions ── */
.cs-cli-box { background: #f5f5f0; border: 1px solid #ddd; border-radius: 6px;
              padding: .9rem 1.2rem; margin: 1rem 0; font-size: .83rem; }
.cs-cli-box code { background: #e8e8e8; padding: 1px 6px; border-radius: 3px; }

/* ── Diagnosis group header ── */
.cs-diag-group { margin-bottom: 2rem; }
.cs-diag-header { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: #1a73e8;
                  text-transform: uppercase; padding: .75rem 0 .4rem;
                  border-bottom: 2px solid #1a73e8; margin-bottom: .75rem; }

/* ── Script accordion rows ── */
.cs-script-row { border: 1px solid #d0d7e3; border-radius: 8px; margin-bottom: .75rem;
                 background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cs-script-head { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
                  cursor: pointer; user-select: none; border-radius: 8px; }
.cs-script-head:hover { background: #f9f9f9; }
.cs-script-head h3 { margin: 0; font-size: .9rem; font-weight: 600; flex: 1; }
.cs-script-meta { font-size: .73rem; color: #999; white-space: nowrap; }
.cs-chevron { font-size: .75rem; color: #bbb; flex-shrink: 0;
              transition: transform .15s; }
.cs-script-body { display: none; border-top: 2px solid #e8edf5; }
.cs-script-row.open .cs-script-body { display: block; }
.cs-script-row.open .cs-script-head { background: #f0f4ff; border-radius: 8px 8px 0 0; }
.cs-script-row.open .cs-chevron { transform: rotate(180deg); }

/* ── Strip preview: compact thumbnail above editor ── */
.cs-strip-preview { border-bottom: 2px solid #dde; background: #eeecea; }
.cs-strip-preview img { display: block; width: 100%; height: auto; }

/* ── Script editor: two equal columns ── */
.cs-editor-wrap { padding: 1rem .75rem 0; }
.cs-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.cs-editor-col { min-width: 0; }
.cs-editor-col label { font-size: .8rem; font-weight: 600; color: #555;
                       display: block; margin-bottom: .3rem; }
.cs-script-textarea { width: 100%; box-sizing: border-box; font-family: monospace;
                      font-size: .82rem; border: 1px solid #ccc; border-radius: 4px;
                      padding: .5rem; resize: vertical; line-height: 1.5; }
.cs-script-textarea:focus { outline: none; border-color: #1a73e8; }
.cs-editor-actions { padding: .75rem .75rem 1.2rem; display: flex; gap: .5rem;
                     align-items: center; border-top: 1px solid #f0f0f0; margin-top: .75rem; }
.cs-save-msg { font-size: .8rem; color: #2e7d32; display: none; }

/* ── Comic topic pills ── */
.comic-topic-pill { display: inline-block; padding: 2px 10px; border-radius: 12px;
                    font-size: .72rem; font-weight: 700; letter-spacing: .03em; }

/* ── Strips tab — full-width cards ── */
.comic-card { border: 1px solid #ddd; border-radius: 8px; overflow: hidden;
              margin-bottom: 1.5rem; background: #fff;
              box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.comic-card img { width: 100%; height: auto; display: block; border-bottom: 1px solid #eee; }
.comic-card-meta { padding: .8rem 1rem; display: flex; align-items: flex-start; gap: 1rem; }
.comic-card-info { flex: 1; min-width: 0; }
.comic-card-info h3 { margin: 0 0 .2rem; font-size: .95rem; }
.comic-card-info .key-msg { font-size: .8rem; color: #555; margin: .2rem 0 .4rem; }
.comic-card-info .meta-row { font-size: .73rem; color: #aaa; }
.comic-card-actions { flex-shrink: 0; }

/* ── Strip ID and K/A label badges ── */
.cs-strip-id  { display: inline-block; background: #f0f0f0; color: #888;
                font-size: .68rem; font-weight: 700; padding: 1px 7px;
                border-radius: 4px; margin-right: 5px; letter-spacing: .02em; font-family: monospace; }
.cs-ka-label  { display: inline-block; background: #1a3a5c; color: #fff;
                font-size: .72rem; font-weight: 800; padding: 1px 8px;
                border-radius: 4px; margin-right: 5px; letter-spacing: .06em; }

/* ── History tab ── */
.cs-hist-group { margin-bottom: 2rem; }
.cs-hist-group-title { font-size: .92rem; font-weight: 700; padding: .5rem 1rem;
                        background: #f5f5f5; border-left: 4px solid #1a3a5c;
                        margin-bottom: .4rem; }
.cs-hist-row { padding: .5rem .8rem .8rem; border-bottom: 2px solid #e8e8e8; margin-bottom: .25rem; }
.cs-hist-row:last-child { border-bottom: none; }
.cs-hist-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
                font-size: .82rem; margin-bottom: .4rem; }
.cs-hist-thumb img { width: 100%; height: auto; display: block;
                     border-radius: 4px; border: 1px solid #ddd; }
.cs-hist-badge { display: inline-block; padding: 1px 8px; border-radius: 10px;
                 font-size: .7rem; font-weight: 700; }
.cs-hist-latest  { background: #e8f5e9; color: #2e7d32; }
.cs-hist-inactive { background: #fff3e0; color: #e65100; }

/* ── Characters tab ── */
#cs-karakterer { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: 1.2rem; }
.cs-char-card { width: 320px; border: 1px solid #ddd; border-radius: 8px;
                overflow: hidden; background: #fff;
                box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.cs-char-card img { width: 100%; height: auto; display: block;
                    border-bottom: 1px solid #eee; }
.cs-char-meta { padding: .6rem .8rem; display: flex; flex-direction: column; gap: .2rem;
                font-size: .82rem; }
.cs-char-meta strong { font-size: 1rem; }
.cs-char-meta span { color: #aaa; }

/* ── Medals hero: next-goal panel ──────────────────────────────── */
.medals-streak {
    font-size: .82rem;
    color: rgba(255,255,255,.8);
    margin: .4rem 0 .5rem;
}
.medals-streak-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-right: .2rem;
}
.medals-next-goal {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: .5rem;
    padding: .6rem .75rem;
    margin-top: .35rem;
}
.medals-next-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.medals-next-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.medals-next-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fde68a;
}
.medals-next-name { font-size: .88rem; font-weight: 700; color: #fff; }
.medals-next-how { font-size: .78rem; color: rgba(255,255,255,.75); line-height: 1.4; }

/* ── Tip-a-friend hero panel (inside kols-hero, beside medals) ── */
.tip-friend-hero {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: .75rem;
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    align-self: start;
    min-width: 200px;
    max-width: 300px;
}
.tip-friend-hero-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.tip-friend-hero-body { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.tip-friend-hero-title {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
}
.tip-friend-hero-text {
    font-size: .78rem;
    color: rgba(255,255,255,.8);
    line-height: 1.4;
}
.tip-friend-hero-form {
    display: flex;
    gap: .35rem;
}
.tip-friend-hero-input {
    flex: 1;
    min-width: 0;
    padding: .3rem .5rem;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: .35rem;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: .78rem;
}
.tip-friend-hero-input::placeholder { color: rgba(255,255,255,.5); }
.tip-friend-hero-input:focus {
    outline: none;
    border-color: rgba(255,255,255,.6);
    background: rgba(255,255,255,.25);
}
.tip-friend-hero-btn {
    padding: .3rem .6rem;
    border: none;
    border-radius: .35rem;
    background: #fff;
    color: #1e40af;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.tip-friend-hero-btn:hover { background: #e0e7ff; }
.nav-tip-friend { font-weight: 600; }
@media (max-width: 768px) {
    .tip-friend-hero { max-width: none; min-width: 0; }
}

/* ── Medals full page: path layout ─────────────────────────────── */
.mpath-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    padding: 1.1rem 1.3rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.mpath-header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mpath-streak-txt { font-size: .9rem; color: #334155; font-weight: 600; }
.mpath-total-txt { font-size: .85rem; color: #64748b; }
.mpath-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.mpath-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563a8, #06b6d4);
    border-radius: 4px;
    transition: width .5s;
}
.mpath-section {
    margin-bottom: 2.25rem;
}
.mpath-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .6rem;
    flex-wrap: wrap;
}
.mpath-section-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.mpath-section-sub { font-size: .82rem; color: #64748b; margin-top: .15rem; }
.mpath-section-progress { font-size: .78rem; color: #94a3b8; white-space: nowrap; }
.mpath-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding-bottom: .25rem;
}
.mpath-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 .3rem;
    color: #cbd5e1;
    font-size: .85rem;
    align-self: center;
}
.mpath-item {
    flex-shrink: 0;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: .75rem .6rem;
    border-radius: .5rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    position: relative;
}
.mpath-item--earned {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.mpath-item--next {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
.mpath-item--locked {
    opacity: .55;
    background: #f8fafc;
}
.mpath-icon { font-size: 1.75rem; line-height: 1; margin-bottom: .35rem; }
.mpath-item--locked .mpath-icon { filter: grayscale(1); }
.mpath-label { font-size: .78rem; font-weight: 700; color: #1e293b; margin-bottom: .3rem; line-height: 1.2; }
.mpath-item--locked .mpath-label { color: #94a3b8; }
.mpath-how { font-size: .7rem; color: #64748b; line-height: 1.4; }
.mpath-item--locked .mpath-how { color: #94a3b8; }
.mpath-earned-date { font-size: .65rem; color: #16a34a; font-weight: 600; margin-top: .3rem; }
.mpath-next-chip {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #2563a8;
    color: #fff;
    border-radius: .25rem;
    padding: .15rem .35rem;
    margin-top: .3rem;
}
@media (max-width: 640px) {
    .mpath-row { gap: 0; }
    .mpath-item { width: 108px; padding: .6rem .45rem; }
    .mpath-icon { font-size: 1.4rem; }
}

/* ── Public front page redesign ─────────────────────────────────── */
.home-hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.home-btn-primary {
    display: inline-block;
    background: #fff;
    color: #1b3a5c;
    font-weight: 700;
    font-size: 1rem;
    padding: .8rem 1.6rem;
    border-radius: .5rem;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.home-btn-primary:hover { background: #e8f0fb; box-shadow: 0 4px 14px rgba(0,0,0,.16); color: #1b3a5c; }
.home-btn-secondary {
    display: inline-block;
    background: transparent;
    color: rgba(255,255,255,.9);
    font-weight: 600;
    font-size: 1rem;
    padding: .8rem 1.4rem;
    border-radius: .5rem;
    border: 1.5px solid rgba(255,255,255,.45);
    text-decoration: none;
    transition: background .15s;
}
.home-btn-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }
.home-login-hint { margin-top: .9rem; font-size: .95rem; color: rgba(255,255,255,.75); }
.home-login-link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.home-login-link:hover { color: #e8f0fb; }
.home-btn-sm { font-size: .9rem; padding: .6rem 1.2rem; }
.home-btn-lg { font-size: 1.1rem; padding: 1rem 2rem; }

/* Section wrapper — matches hero inner width exactly */
.home-section-inner { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; }

/* Preview mockup + doctor trust grid */
.home-preview-section { padding: 3rem 0; background: #f8fafc; }
.home-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.home-preview-section .home-section-title, .home-preview-section .home-section-lead { text-align: center; }
.home-preview-right {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin-top: 0;
}
.home-doctor-title { font-size: 1.3rem; font-weight: 700; color: #1b3a5c; margin: 1rem 0 .5rem; }
.home-mockup {
    max-width: 360px;
    margin: 1.5rem auto 0;
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 32px rgba(0,0,0,.10);
    overflow: hidden;
}
.home-mockup-bar {
    height: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}
.home-mockup-screen { padding: 1.25rem 1.1rem; }
.home-mockup-greeting { font-size: .85rem; color: #64748b; margin-bottom: .1rem; }
.home-mockup-plan-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: .75rem; }
.home-mockup-tasks { list-style: none; padding: 0; margin: 0 0 .9rem; display: flex; flex-direction: column; gap: .35rem; }
.home-mockup-task {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f1f5f9;
    border-radius: .35rem;
    padding: .45rem .55rem;
    font-size: .8rem;
    color: #334155;
}
.home-mockup-task--done { background: #f0fdf4; color: #166534; }
.home-mockup-check {
    width: .95rem; height: .95rem;
    border: 1.5px solid #94a3b8;
    border-radius: .2rem;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; font-weight: 700;
}
.home-mockup-check--done { background: #4ade80; border-color: #4ade80; color: #14532d; }
.home-mockup-arrow { margin-left: auto; color: #94a3b8; font-size: .75rem; }
.home-mockup-chat-btn {
    display: block;
    background: #1b3a5c;
    color: #fff;
    text-align: center;
    border-radius: .4rem;
    padding: .5rem;
    font-size: .8rem;
    font-weight: 700;
}

/* Features section */
.home-features-section { padding: 3rem 0; background: #fff; }
.home-features-section .home-section-title { text-align: center; margin-bottom: 1.5rem; }

/* Diagnosis cards */
.home-diag-section { padding: 3rem 0; background: #f0f7ff; }
.home-diag-section .home-section-title { text-align: center; margin-bottom: 1.5rem; }
.home-diag-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.home-diag-card {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e2e8f0;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
}
.home-diag-card--kols { border-top: 3px solid #2563a8; }
.home-diag-card--astma { border-top: 3px solid #06b6d4; }
.home-diag-icon { font-size: 2rem; line-height: 1; }
.home-diag-name { font-size: 1.25rem; font-weight: 800; color: #1e293b; margin: 0; }
.home-diag-body { font-size: .92rem; color: #475569; line-height: 1.6; margin: 0; flex: 1; }
.home-diag-card .home-btn-primary { background: #1b3a5c; color: #fff; margin-top: .25rem; align-self: flex-start; }
.home-diag-card .home-btn-primary:hover { background: #2563a8; color: #fff; }

/* Doctor section */
.home-doctor-section { padding: 3rem 0; background: #fff; }
.home-doctor-inner { display: flex; align-items: flex-start; gap: 1.5rem; }
@media (max-width: 680px) { .home-preview-grid { grid-template-columns: 1fr; } .home-mockup { margin: 1.5rem auto 0; } }
.home-doctor-avatar {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b3a5c, #2563a8);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.home-doctor-text { font-size: .95rem; color: #475569; line-height: 1.7; margin: .5rem 0; }
.home-doctor-name { font-size: .88rem; font-weight: 700; color: #2563a8; margin: 0; }

/* Safety box */
.home-safety-section { padding: 3rem 0; }
.home-safety-box {
    display: flex;
    gap: 1.1rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: .5rem;
    padding: 1.25rem 1.4rem;
    align-items: flex-start;
}
.home-safety-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: .05rem; }
.home-safety-title { font-size: 1rem; font-weight: 700; color: #92400e; margin: 0 0 .4rem; }
.home-safety-text { font-size: .9rem; color: #78350f; line-height: 1.6; margin: 0 0 .6rem; }
.home-safety-link { font-size: .88rem; color: #b45309; font-weight: 600; text-decoration: underline; }
.home-safety-link:hover { color: #92400e; }

/* Privacy section */
.home-privacy-section { padding: 3rem 0; background: #f8fafc; }
.home-privacy-section .home-section-title { text-align: center; margin-bottom: 1.25rem; }
.home-privacy-items { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.home-privacy-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    color: #334155;
    font-weight: 500;
}
.home-privacy-check {
    width: 1.4rem; height: 1.4rem;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Final CTA */
.home-final-cta {
    padding: 3rem 0;
    background: linear-gradient(135deg, #1b3a5c 0%, #2563a8 100%);
    text-align: center;
    color: #fff;
}
.home-final-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 .5rem; color: #fff; }
.home-final-lead { font-size: 1rem; opacity: .85; margin: 0 0 1.5rem; }
.home-final-cta .home-btn-primary { font-size: 1.1rem; padding: .9rem 2rem; }

/* Responsive */
@media (max-width: 680px) {
    .home-hero-inner { grid-template-columns: 1fr; gap: 0; }
    .home-diag-cards { grid-template-columns: 1fr; }
    .home-doctor-inner { flex-direction: column; }
    .home-privacy-items { flex-direction: column; align-items: flex-start; }
    .home-step-arrow { display: none; }
    .home-steps { flex-direction: column; align-items: center; }
}

/* ── Admin Email Inbox (/admin/epost) ────────────────────────── */
.admin-inbox { max-width: 1200px; margin: 0 auto; }

.admin-inbox-list-toolbar {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .75rem; border-bottom: 1px solid var(--gray-200, #e5e7eb);
    background: var(--gray-100, #f3f4f6); position: sticky; top: 0; z-index: 1;
}
.admin-inbox-list-title { font-size: .88rem; font-weight: 700; color: var(--gray-800, #1f2937); }
.admin-inbox-list-toolbar .inbox-count { font-size: .75rem; color: var(--gray-400, #9ca3af); margin-right: auto; }

.admin-inbox-view-toggle { display: flex; gap: 0; border: 1px solid var(--gray-300, #d1d5db); border-radius: .375rem; overflow: hidden; }
.admin-view-btn { padding: .3rem .75rem; font-size: .78rem; font-weight: 500; border: none; background: #fff; color: var(--gray-600, #4b5563); cursor: pointer; transition: background .12s, color .12s; }
.admin-view-btn:hover { background: var(--gray-50, #f9fafb); }
.admin-view-btn--active { background: var(--primary, #2563eb); color: #fff; }
.admin-view-btn--active:hover { background: var(--primary, #2563eb); }
.admin-view-btn + .admin-view-btn { border-left: 1px solid var(--gray-300, #d1d5db); }
.admin-inbox-split {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    min-height: 72vh;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
}
.admin-inbox-list {
    border-right: 1px solid var(--gray-200, #e5e7eb);
    overflow-y: auto;
    max-height: 75vh;
    background: var(--gray-50, #f9fafb);
}
.admin-inbox-item {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    cursor: pointer;
    transition: background .12s;
}
.admin-inbox-item:hover { background: #eff6ff; }
.admin-inbox-item--active { background: #dbeafe; }
.admin-inbox-item--unread .admin-inbox-subject { font-weight: 700; }
.admin-inbox-from { font-size: .85rem; color: var(--gray-700, #374151); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-inbox-subject { font-size: .82rem; color: var(--gray-900, #111827); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15rem; }
.admin-inbox-meta { display: flex; gap: .5rem; font-size: .72rem; color: var(--gray-400, #9ca3af); margin-top: .2rem; }
.admin-inbox-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-inbox-empty-list { padding: 2rem; text-align: center; color: var(--gray-400, #9ca3af); }

.admin-inbox-viewer { padding: 1.25rem 1.5rem; overflow-y: auto; max-height: 75vh; }
.admin-inbox-placeholder { display: flex; align-items: center; justify-content: center; min-height: 300px; color: var(--gray-400, #9ca3af); }
.admin-msg-header { margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.admin-msg-row { font-size: .85rem; color: var(--gray-600, #4b5563); line-height: 1.5; }
.admin-msg-row strong { color: var(--gray-500, #6b7280); min-width: 3rem; display: inline-block; }
.admin-msg-subject-row { font-size: 1.05rem; font-weight: 700; color: var(--gray-900, #111827); margin-top: .5rem; }
.admin-msg-body { line-height: 1.65; font-size: .92rem; margin-bottom: 1.25rem; }
.admin-msg-pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: inherit; margin: 0; }

.admin-msg-reply-section { border-top: 1px solid var(--gray-200, #e5e7eb); padding-top: 1rem; }
.admin-msg-actions { display: flex; gap: .5rem; margin-bottom: .75rem; }
.admin-reply-textarea {
    width: 100%; min-height: 220px; padding: .75rem;
    border: 1px solid var(--gray-300, #d1d5db); border-radius: .5rem;
    font-family: inherit; font-size: .9rem; line-height: 1.55; resize: vertical;
}
.admin-reply-textarea:focus { outline: none; border-color: var(--primary, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.admin-reply-actions { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.admin-reply-status { font-size: .85rem; font-weight: 600; }

.admin-replied-badge {
    display: inline-block; font-size: .6rem; font-weight: 700;
    background: #dcfce7; color: #166534; padding: .1rem .4rem;
    border-radius: .25rem; margin-left: .4rem; text-transform: uppercase; letter-spacing: .03em;
}

.btn-ai-draft {
    background: #16a34a; color: #fff; border: none; padding: .45rem 1rem;
    border-radius: .375rem; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .12s;
}
.btn-ai-draft:hover { background: #15803d; }
.btn-ai-draft:disabled { background: #86efac; cursor: wait; }

.admin-msg-header { position: relative; }
.admin-delete-top {
    position: absolute; top: 0; right: 0;
    display: inline-flex; align-items: center; gap: .3rem;
    background: #fff; border: 1px solid #dc2626; color: #dc2626;
    font-size: .75rem; font-weight: 500; line-height: 1;
    cursor: pointer; padding: .3rem .6rem; border-radius: .375rem; transition: background .12s, color .12s;
}
.admin-delete-top svg { flex-shrink: 0; }
.admin-delete-top:hover { background: #dc2626; color: #fff; }

.admin-inbox-group { border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.admin-inbox-group-header {
    display: flex; align-items: center; gap: .5rem;
    padding: .6rem 1rem; cursor: pointer; font-size: .85rem; font-weight: 600;
    color: var(--gray-700, #374151); background: var(--gray-100, #f3f4f6);
    user-select: none; transition: background .12s;
}
.admin-inbox-group-header:hover { background: var(--gray-200, #e5e7eb); }
.admin-inbox-group-arrow { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--gray-500, #6b7280); transition: transform .15s; }
.admin-inbox-group--collapsed .admin-inbox-group-arrow { transform: rotate(-90deg); }
.admin-inbox-group--collapsed .admin-inbox-group-items { display: none; }
.admin-inbox-group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-inbox-group-count {
    font-size: .7rem; font-weight: 700; background: var(--gray-300, #d1d5db); color: var(--gray-700, #374151);
    padding: .1rem .45rem; border-radius: 999px; min-width: 1.2rem; text-align: center;
}

@media (max-width: 768px) {
    .admin-inbox-split { grid-template-columns: 1fr; }
    .admin-inbox-list { max-height: 40vh; border-right: none; border-bottom: 1px solid var(--gray-200, #e5e7eb); }
    .admin-inbox-viewer { max-height: none; }
}


/* ── Admin Patient Overview (/admin/brukere) ────────────────── */
.admin-overview { max-width: 1400px; margin: 0 auto; }
.admin-overview .section-header { margin-bottom: 1rem; }

.admin-ov-summary {
    display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.admin-ov-card {
    flex: 1; min-width: 140px; padding: .8rem 1rem;
    background: #fff; border: 1px solid var(--gray-200, #e5e7eb); border-radius: .5rem;
    text-align: center;
}
.admin-ov-card-num { font-size: 1.5rem; font-weight: 700; color: var(--gray-900, #111827); line-height: 1.2; }
.admin-ov-card-label { font-size: .72rem; color: var(--gray-500, #6b7280); margin-top: .2rem; text-transform: uppercase; letter-spacing: .04em; }

.admin-ov-table-wrap {
    background: #fff; border: 1px solid var(--gray-200, #e5e7eb); border-radius: .5rem;
    overflow-x: auto;
}
.admin-overview-table {
    width: 100%; border-collapse: collapse; font-size: .82rem;
}
.admin-overview-table th {
    text-align: left; padding: .55rem .75rem; font-size: .7rem; font-weight: 600;
    color: var(--gray-500, #6b7280); text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid var(--gray-200, #e5e7eb); background: var(--gray-50, #f9fafb);
    white-space: nowrap;
}
.admin-overview-table td {
    padding: .5rem .75rem; border-bottom: 1px solid var(--gray-100, #f3f4f6);
    vertical-align: middle;
}
.admin-overview-table tr:hover td { background: #f0f7ff; }
.admin-overview-table tr.admin-ov-test td { opacity: .45; }
.admin-overview-table tr.admin-ov-test:hover td { opacity: .7; }

.admin-ov-name { font-weight: 600; color: var(--gray-900, #111827); }
.admin-ov-email { font-size: .72rem; color: var(--gray-400, #9ca3af); }
.admin-ov-muted { color: var(--gray-300, #d1d5db); }
.admin-ov-yes { color: #16a34a; font-weight: 700; }

.admin-ov-bar {
    width: 60px; height: 6px; background: var(--gray-200, #e5e7eb);
    border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: .3rem;
}
.admin-ov-bar-fill { height: 100%; background: #2563eb; border-radius: 3px; min-width: 1px; }
.admin-ov-bar-label { font-size: .72rem; color: var(--gray-500, #6b7280); }

.admin-ov-badge {
    display: inline-block; font-size: .65rem; font-weight: 700; padding: .15rem .45rem;
    border-radius: .25rem; text-transform: uppercase; letter-spacing: .03em;
}
.admin-ov-badge--new      { background: #dbeafe; color: #1d4ed8; }
.admin-ov-badge--active   { background: #dcfce7; color: #166534; }
.admin-ov-badge--ok       { background: #f0fdf4; color: #15803d; }
.admin-ov-badge--inactive { background: #fef3c7; color: #92400e; }
.admin-ov-badge--test     { background: var(--gray-100, #f3f4f6); color: var(--gray-400, #9ca3af); }

@media (max-width: 768px) {
    .admin-ov-summary { flex-direction: column; }
    .admin-ov-card { min-width: auto; }
}
