/* Feature-specific styles for Allergi & specialkost mockup v2
   Inherits all base styling from Athena CSS.
   Extends v1 styles with: livshotande-badge, aktivitetsväljare, utflyktsvy,
   rollbar, scope-notice, kioskläge, kommentar från vårdnadshavare.

   Design tokens:
   --livshotande: #D8232A   (röd, Jkpg-möte 8 april)
   --vklass-green: #74BD57  (bekräftelser)
   --prussian: #003253       (rubriker)
*/

/* ============================================
   ROLE BAR – v2: kopplingsinfo och rollväxlare
   ============================================ */
.allergy-role-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #003253;
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.allergy-role-bar__identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.allergy-role-bar__icon {
    font-size: 22px;
    opacity: 0.85;
    flex-shrink: 0;
}

.allergy-role-bar__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.allergy-role-bar__name {
    font-weight: 500;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.allergy-role-bar__detail {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read-only badge för vikarie – visuellt tydligt att redigering ej är möjlig */
.allergy-role-bar__readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.allergy-role-bar__readonly-badge i {
    font-size: 14px;
}

.allergy-role-bar__switcher {
    flex-shrink: 0;
}

/* ============================================
   CONTEXT BAR
   ============================================ */
.allergy-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--cl-super-soft, #e8eaf6);
    border: 1px solid var(--cl-soft, #c5cae9);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.allergy-context-bar__info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--cl-hard, #26418f);
}

.allergy-context-bar__info i {
    font-size: 20px;
}

.allergy-context-bar__select {
    padding: 6px 12px;
    border: 1px solid var(--cl-soft, #c5cae9);
    border-radius: 4px;
    font-size: 0.875rem;
    background: var(--white, #fff);
    color: var(--gray-darker, #333);
    cursor: pointer;
    min-height: 44px; /* Tryckmål 44px enligt brief */
}

/* ============================================
   ACTIVITY SELECTOR – v2 nyhet (avsnitt 4)
   ============================================ */
.allergy-activity-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-light, #ccc);
    background: var(--white, #fff);
}

.allergy-activity-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: var(--white, #fff);
    color: var(--gray-dark, #666);
    font-size: 0.9375rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    font-family: inherit;
}

.allergy-activity-tab i {
    font-size: 20px;
}

.allergy-activity-tab + .allergy-activity-tab {
    border-left: 1px solid var(--gray-light, #ccc);
}

.allergy-activity-tab--active {
    background: #003253;
    color: #fff;
    font-weight: 500;
}

.allergy-activity-tab:hover:not(.allergy-activity-tab--active) {
    background: var(--gray-lightest, #f5f5f5);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.allergy-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.allergy-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: #003253;
}

.allergy-page-header__subtitle {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--gray-dark, #666);
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.allergy-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.allergy-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-light, #ccc);
    background: var(--white, #fff);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-dark, #666);
    min-height: 44px;
    font-family: inherit;
}

.allergy-chip i { font-size: 18px; }

.allergy-chip:hover {
    background: var(--gray-lightest, #f5f5f5);
}

.allergy-chip--active {
    background: var(--cl-super-soft, #e8eaf6);
    border-color: var(--cl-soft, #c5cae9);
    color: var(--cl-hard, #26418f);
    font-weight: 500;
}

/* Filter-chip för livshotande – visuellt distinkt */
.allergy-chip--lifethreatening-active {
    background: #fdf0f0;
    border-color: #D8232A;
    color: #D8232A;
    font-weight: 500;
}

/* ============================================
   CHILDREN LIST TABLE
   ============================================ */
.allergy-list-card {
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.allergy-table {
    width: 100%;
    border-collapse: collapse;
}

.allergy-table thead {
    background: var(--gray-lightest, #fafafa);
    border-bottom: 2px solid var(--gray-light, #e0e0e0);
}

.allergy-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-dark, #666);
}

.allergy-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-lighter, #eee);
    font-size: 0.875rem;
    vertical-align: middle;
}

.allergy-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.allergy-table tbody tr:hover {
    background: var(--gray-lightest, #fafafa);
}

/* Livshotande-rad: röd vänsterkant på tabellraden – ögonblicksläsbar */
.allergy-table tbody tr.allergy-row--lifethreatening {
    border-left: 4px solid #D8232A;
}

.allergy-table tbody tr:focus-visible {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: -2px;
}

.allergy-table__col-name { width: 30%; }
.allergy-table__col-age { width: 10%; }
.allergy-table__col-allergy { width: 35%; }
.allergy-table__col-updated { width: 18%; }
.allergy-table__col-actions { width: 7%; text-align: center; }

/* Child name cell */
.allergy-child-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.allergy-child-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    flex-shrink: 0;
}

.allergy-child-avatar--f { background: #e91e63; }
.allergy-child-avatar--m { background: #2196f3; }

/* Allergy indicators */
.allergy-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.allergy-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.allergy-indicator--allergy {
    background: #fce4ec;
    color: #c62828;
}

.allergy-indicator--intolerance {
    background: #fff3e0;
    color: #e65100;
}

.allergy-indicator--diet {
    background: #e8f5e9;
    color: #2e7d32;
}

.allergy-indicator i { font-size: 14px; }

.allergy-indicator--more {
    background: var(--gray-lighter, #eee);
    color: var(--gray-dark, #666);
    font-weight: 400;
}

.allergy-indicator--protected {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* Livshotande-indikator i listan – varningstriangel med röd färg (Jkpg-möte 8 april: binär flagga, visuellt framhävd) */
.allergy-lifethreatening-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #D8232A;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: #fdf0f0;
    border: 1px solid #D8232A;
    white-space: nowrap;
}

.allergy-lifethreatening-indicator i { font-size: 13px; }

.allergy-no-info {
    font-size: 0.8125rem;
    color: var(--gray, #999);
    font-style: italic;
}

.allergy-updated-text {
    font-size: 0.8125rem;
    color: var(--gray-dark, #666);
}

.allergy-severity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 2px;
}

.allergy-severity-dot--mild { background: #f6a623; }
.allergy-severity-dot--moderate { background: #e67e22; }
.allergy-severity-dot--severe { background: #e74c3c; }

.allergy-table__action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-dark, #666);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allergy-table__action-btn:hover {
    background: var(--gray-lighter, #eee);
    color: var(--cl-hard, #26418f);
}

/* ============================================
   UTFLYKTSVY – kompakta kort, 360px-responsivt
   ============================================ */
.allergy-excursion-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #e8f4fd;
    border: 1px solid #b3d8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #1a5276;
    margin-bottom: 16px;
}

.allergy-excursion-info i { font-size: 20px; flex-shrink: 0; margin-top: 1px; }

.allergy-excursion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Excursion card – tryckbart, tydlig 44px-yta */
.allergy-excursion-card {
    background: var(--white, #fff);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    padding: 0;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    border: 2px solid transparent;
    overflow: hidden;
}

.allergy-excursion-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    transform: translateY(-1px);
}

.allergy-excursion-card:focus-visible {
    outline: 3px solid #003253;
    outline-offset: 2px;
}

/* Röd kantlinje för livshotande i utflyktsvy – ögonblicksläsbar på mobil */
.allergy-excursion-card--lifethreatening {
    border-color: #D8232A;
}

.allergy-excursion-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--gray-lighter, #eee);
}

.allergy-excursion-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    flex-shrink: 0;
}

.allergy-excursion-card__name-block {
    flex: 1;
    min-width: 0;
}

.allergy-excursion-card__name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: #003253;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.allergy-excursion-card__age {
    font-size: 0.75rem;
    color: var(--gray-dark, #666);
}

/* Livshotande-badge i utflyktskortet */
.allergy-excursion-card__lifethreatening {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #D8232A;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.allergy-excursion-card__lifethreatening i { font-size: 13px; }

.allergy-excursion-card__body {
    padding: 10px 14px 12px;
}

.allergy-excursion-card__posts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.allergy-excursion-post {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
}

.allergy-excursion-post__type {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.allergy-excursion-post__type--allergy { background: #c62828; }
.allergy-excursion-post__type--intolerance { background: #e65100; }
.allergy-excursion-post__type--diet { background: #2e7d32; }

.allergy-excursion-post__label {
    flex: 1;
    color: var(--gray-darker, #333);
}

.allergy-excursion-post__action {
    font-size: 0.75rem;
    color: var(--gray, #888);
    padding-left: 12px;
    line-height: 1.4;
}

.allergy-excursion-card__chevron {
    color: var(--gray, #999);
    font-size: 18px;
    flex-shrink: 0;
}

.allergy-excursion-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--gray, #999);
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.allergy-excursion-empty i { font-size: 40px; color: #74BD57; margin-bottom: 8px; display: block; }

/* ============================================
   EMPTY STATES
   ============================================ */
.allergy-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.allergy-empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.allergy-empty-state--no-data .allergy-empty-state__icon { color: var(--gray, #999); }
.allergy-empty-state--no-access .allergy-empty-state__icon { color: #e67e22; }
.allergy-empty-state--wrong-context .allergy-empty-state__icon { color: var(--cl-hard, #26418f); }

.allergy-empty-state__title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 8px;
    color: var(--gray-darker, #333);
}

.allergy-empty-state__text {
    font-size: 0.875rem;
    color: var(--gray-dark, #666);
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   KIOSK-OVERLAY – minimal vy utan detaljer
   ============================================ */
.allergy-kiosk-overlay {
    position: fixed;
    inset: 0;
    background: #f5f5f5;
    z-index: 2000;
    overflow-y: auto;
    padding: 24px;
}

.allergy-kiosk-summary {
    max-width: 600px;
    margin: 0 auto;
}

.allergy-kiosk-summary h2 {
    font-size: 1.25rem;
    color: #003253;
    margin-bottom: 16px;
}

.allergy-kiosk-item {
    background: var(--white, #fff);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.allergy-kiosk-item__name {
    font-weight: 500;
    color: #003253;
}

.allergy-kiosk-item__count {
    font-size: 0.8125rem;
    color: var(--gray-dark, #666);
}

/* Livshotande-prick i kioskläge */
.allergy-kiosk-item__lifethreatening {
    color: #D8232A;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

.allergy-kiosk-exit {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--gray, #999);
    font-size: 0.875rem;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: underline;
}

/* ============================================
   DETAIL SIDE PANEL
   ============================================ */
.allergy-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.allergy-panel-overlay--open {
    opacity: 1;
    pointer-events: auto;
}

.allergy-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white, #fff);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.allergy-detail-panel--open {
    transform: translateX(0);
}

.allergy-detail-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-lighter, #eee);
    flex-shrink: 0;
    background: #003253;
    color: #fff;
}

.allergy-detail-panel__child-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.allergy-detail-panel__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}

.allergy-detail-panel__name {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.allergy-detail-panel__meta {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.8);
    margin: 2px 0 0;
}

.allergy-detail-panel__close {
    background: rgba(255,255,255,0.15);
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allergy-detail-panel__close:hover {
    background: rgba(255,255,255,0.25);
}

/* Avgränsningsnotis – medicinering hanteras separat (avsnitt 1 från mötet) */
.allergy-scope-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4f8;
    border-bottom: 1px solid #d0dde8;
    padding: 8px 20px;
    font-size: 0.8rem;
    color: #4a6a85;
    flex-shrink: 0;
}

.allergy-scope-notice i { font-size: 16px; }

.allergy-detail-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Panel sections */
.allergy-panel-section {
    margin-bottom: 20px;
}

.allergy-panel-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-dark, #666);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-lighter, #eee);
}

.allergy-panel-section__title i { font-size: 18px; }

/* ============================================
   ALLERGY POST CARD
   ============================================ */
.allergy-post-card {
    background: var(--gray-lightest, #fafafa);
    border-radius: 8px;
    border-left: 4px solid;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.allergy-post-card--allergy { border-left-color: #e74c3c; }
.allergy-post-card--intolerance { border-left-color: #e67e22; }
.allergy-post-card--diet { border-left-color: #2e7d32; }

/* Livshotande-post: extra visuell tyngd med röd vänsterkant och röd bakgrund-tint */
.allergy-post-card--lifethreatening {
    border-left-color: #D8232A !important;
    background: #fff8f8;
    box-shadow: 0 0 0 1px rgba(216, 35, 42, 0.15);
}

.allergy-post-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.allergy-post-card__badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.allergy-post-card__type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.allergy-post-card__type-badge--allergy { background: #fce4ec; color: #c62828; }
.allergy-post-card__type-badge--intolerance { background: #fff3e0; color: #e65100; }
.allergy-post-card__type-badge--diet { background: #e8f5e9; color: #2e7d32; }

/* Livshotande-badge på postkortet i detalj-panelen (Jkpg-möte 8 april: binär flagga, visuellt framhävd med röd kant) */
.allergy-post-card__lifethreatening-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: #D8232A;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.allergy-post-card__lifethreatening-badge i { font-size: 13px; }

.allergy-post-card__actions {
    display: flex;
    gap: 4px;
}

.allergy-post-card__action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray, #999);
    padding: 6px;
    border-radius: 50%;
    font-size: 0;
    transition: all 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allergy-post-card__action-btn:hover {
    background: var(--gray-lighter, #eee);
    color: var(--cl-hard, #26418f);
}

.allergy-post-card__action-btn i { font-size: 18px; }

.allergy-post-card__trigger {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-darker, #333);
    margin: 0 0 6px;
}

.allergy-post-card__severity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.allergy-post-card__severity--mild { color: #f6a623; }
.allergy-post-card__severity--moderate { color: #e67e22; }
.allergy-post-card__severity--severe { color: #e74c3c; }

.allergy-post-card__severity i { font-size: 16px; }

.allergy-post-card__tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.allergy-post-card__tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    background: #fff3e0;
    color: #e65100;
}

.allergy-post-card__action-text {
    font-size: 0.8125rem;
    color: var(--gray-dark, #666);
    line-height: 1.5;
    padding: 8px 0;
    border-top: 1px dashed var(--gray-lighter, #eee);
}

/* Kommentar från vårdnadshavare – avsnitt 7, visas under Åtgärd */
.allergy-post-card__guardian-comment {
    font-size: 0.8125rem;
    color: #5d4037;
    line-height: 1.5;
    padding: 8px 10px;
    margin-top: 6px;
    background: #fdf8f3;
    border-left: 3px solid #e8a87c;
    border-radius: 0 4px 4px 0;
}

.allergy-post-card__guardian-comment-label {
    font-weight: 500;
    font-size: 0.75rem;
    color: #795548;
    display: block;
    margin-bottom: 3px;
}

.allergy-post-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--gray, #999);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-lighter, #eee);
}

.allergy-post-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.allergy-post-card__meta-item i { font-size: 14px; }

.allergy-post-card__verification {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
}

.allergy-post-card__verification--verified {
    background: #e8f5e9;
    color: #2e7d32;
}

.allergy-post-card__verification--unverified {
    background: #fff3e0;
    color: #e65100;
}

/* History section */
.allergy-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.allergy-history-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-lighter, #eee);
    font-size: 0.8125rem;
}

.allergy-history-item:last-child { border-bottom: none; }

.allergy-history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cl-soft, #c5cae9);
    margin-top: 6px;
    flex-shrink: 0;
}

.allergy-history-date {
    font-weight: 500;
    color: var(--gray-darker, #333);
    white-space: nowrap;
}

.allergy-history-actor { color: var(--gray-dark, #666); }
.allergy-history-changes { color: var(--gray, #999); margin-top: 2px; }

/* Panel add button */
.allergy-panel-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: 2px dashed var(--gray-light, #ccc);
    border-radius: 8px;
    cursor: pointer;
    color: var(--cl-hard, #26418f);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    min-height: 44px;
    font-family: inherit;
}

.allergy-panel-add-btn:hover {
    border-color: var(--cl-hard, #26418f);
    background: var(--cl-super-soft, #e8eaf6);
}

.allergy-panel-add-btn i { font-size: 20px; }

/* Post ID display */
.allergy-post-id {
    font-family: monospace;
    font-size: 0.6875rem;
    color: var(--gray, #999);
    cursor: help;
}

/* ============================================
   DIALOG
   ============================================ */
.allergy-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
}

.allergy-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--white, #fff);
    border-radius: 12px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

.allergy-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-lighter, #eee);
    background: #003253;
    border-radius: 12px 12px 0 0;
}

.allergy-dialog__title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.allergy-dialog__close {
    background: rgba(255,255,255,0.15);
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 6px;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allergy-dialog__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.allergy-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--gray-lighter, #eee);
}

/* ============================================
   FORM STYLES
   ============================================ */
.allergy-form-group {
    margin-bottom: 16px;
}

.allergy-form-group--half { flex: 1; min-width: 0; }

.allergy-form-row {
    display: flex;
    gap: 16px;
}

.allergy-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-darker, #333);
    margin-bottom: 6px;
}

.allergy-required { color: #e74c3c; }

.allergy-form-select,
.allergy-form-input,
.allergy-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-light, #ccc);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-darker, #333);
    background: var(--white, #fff);
    box-sizing: border-box;
    transition: border-color 0.15s;
    min-height: 44px;
}

.allergy-form-select:focus,
.allergy-form-input:focus,
.allergy-form-textarea:focus {
    outline: none;
    border-color: var(--cl-hard, #26418f);
    box-shadow: 0 0 0 3px rgba(38, 65, 143, 0.1);
}

.allergy-form-textarea { resize: vertical; min-height: 80px; }

.allergy-form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray, #999);
    margin-top: 4px;
}

.allergy-form-hint--lifethreatening {
    color: #8b3a3a;
    background: #fff8f8;
    border-left: 3px solid #D8232A;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
    margin-top: 6px;
}

.allergy-form-error {
    display: block;
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 1em;
}

.allergy-form-select--error,
.allergy-form-input--error {
    border-color: #e74c3c;
}

/* Livshotande-checkbox: prominently styled */
.allergy-form-group--lifethreatening {
    background: #fff8f8;
    border: 1px solid rgba(216, 35, 42, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
}

.allergy-lifethreatening-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.allergy-lifethreatening-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #D8232A;
    flex-shrink: 0;
}

.allergy-lifethreatening-label__text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #D8232A;
}

.allergy-lifethreatening-label__text i { font-size: 20px; }

/* Severity options */
.allergy-severity-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.allergy-severity-option { cursor: pointer; }

.allergy-severity-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.allergy-severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all 0.15s;
    min-height: 44px;
}

.allergy-severity-badge i { font-size: 16px; }

.allergy-severity-badge--mild { background: #fff8e1; color: #f6a623; border-color: #fff8e1; }
.allergy-severity-badge--moderate { background: #fff3e0; color: #e67e22; border-color: #fff3e0; }
.allergy-severity-badge--severe { background: #fce4ec; color: #e74c3c; border-color: #fce4ec; }

.allergy-severity-option input:checked + .allergy-severity-badge--mild { border-color: #f6a623; }
.allergy-severity-option input:checked + .allergy-severity-badge--moderate { border-color: #e67e22; }
.allergy-severity-option input:checked + .allergy-severity-badge--severe { border-color: #e74c3c; }

/* ============================================
   BUTTONS
   ============================================ */
.allergy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
    min-height: 44px;
}

.allergy-btn--primary {
    background: #003253;
    color: #fff;
}

.allergy-btn--primary:hover { background: #004070; }

.allergy-btn--text {
    background: none;
    color: var(--gray-dark, #666);
}

.allergy-btn--text:hover { background: var(--gray-lightest, #f5f5f5); }

.allergy-btn--danger {
    background: #D8232A;
    color: #fff;
}

.allergy-btn--danger:hover { background: #b01c22; }

/* ============================================
   TOOLBAR EXTRAS – roadmap-knapp v3
   ============================================ */
.toolbar-roadmap-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px dashed rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    cursor: not-allowed;
    font-family: inherit;
    white-space: nowrap;
}

.toolbar-roadmap-btn i { font-size: 18px; }

.toolbar-roadmap-btn__label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-roadmap-btn__badge {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .toolbar-roadmap-btn__label { display: none; }
}

/* ============================================
   TOAST
   ============================================ */
.allergy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-darker, #333);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.allergy-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.allergy-toast--success { background: #74BD57; color: #fff; }
.allergy-toast--warning { background: #e67e22; }
.allergy-toast--info { background: #003253; }

/* ============================================
   FAB
   ============================================ */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #003253;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s;
}

.fab:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transform: scale(1.05);
}

.fab i { font-size: 24px; }

/* ============================================
   SR-ONLY UTILITY
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   RESPONSIVE – testa 360px för utflyktsläget
   ============================================ */
@media (max-width: 959px) {
    .allergy-table__col-updated { display: none; }
    .allergy-detail-panel { width: 100%; max-width: 100vw; }
    .allergy-form-row { flex-direction: column; gap: 0; }
    .allergy-context-bar { flex-direction: column; align-items: flex-start; }
    .allergy-role-bar { flex-direction: column; align-items: flex-start; }
    .allergy-role-bar__switcher { width: 100%; }
    .allergy-role-bar__switcher select { width: 100%; }
}

@media (max-width: 599px) {
    .allergy-table__col-age { display: none; }
    .allergy-page-header { flex-direction: column; }
    .allergy-page-header h1 { font-size: 1.25rem; }
    .allergy-dialog {
        width: 100%;
        max-width: 100vw;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        transform: translate(-50%, 0);
        max-height: 85vh;
    }
    .allergy-excursion-grid {
        grid-template-columns: 1fr;
    }
    .allergy-activity-tab span {
        font-size: 0.875rem;
    }
}

/* 360px: utflyktsvy fungerar utan horisontell scroll */
@media (max-width: 400px) {
    .content-container { padding: 8px; }
    .allergy-excursion-card__header { padding: 10px 10px 8px; }
    .allergy-excursion-card__body { padding: 8px 10px 10px; }
    .allergy-role-bar { padding: 8px 10px; }
    .allergy-activity-tab { padding: 10px 8px; }
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */
body.dark-mode .allergy-role-bar { background: #001a2e; }
body.dark-mode .allergy-context-bar { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
body.dark-mode .allergy-context-bar__info { color: var(--cl-super-soft, #c5cae9); }
body.dark-mode .allergy-activity-bar { border-color: #444; background: #1e1e1e; }
body.dark-mode .allergy-activity-tab { background: #1e1e1e; color: #aaa; }
body.dark-mode .allergy-activity-tab--active { background: #003253; color: #fff; }
body.dark-mode .allergy-list-card,
body.dark-mode .allergy-empty-state,
body.dark-mode .allergy-dialog { background: #1e1e1e; }
body.dark-mode .allergy-table thead { background: #2a2a2a; }
body.dark-mode .allergy-table td { border-bottom-color: #333; }
body.dark-mode .allergy-table tbody tr:hover { background: #2a2a2a; }
body.dark-mode .allergy-post-card { background: #2a2a2a; }
body.dark-mode .allergy-post-card--lifethreatening { background: #2d1a1a; }
body.dark-mode .allergy-form-select,
body.dark-mode .allergy-form-input,
body.dark-mode .allergy-form-textarea,
body.dark-mode .allergy-context-bar__select { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
body.dark-mode .allergy-detail-panel { background: #1e1e1e; }
body.dark-mode .allergy-scope-notice { background: #1a2633; border-color: #2a3f52; color: #7aa8c7; }
body.dark-mode .allergy-excursion-card { background: #1e1e1e; }
body.dark-mode .allergy-kiosk-overlay { background: #121212; }
body.dark-mode .allergy-kiosk-item { background: #1e1e1e; }
body.dark-mode .allergy-form-group--lifethreatening { background: #2d1a1a; border-color: rgba(216,35,42,0.3); }
body.dark-mode .allergy-post-card__guardian-comment { background: #2a2217; border-color: #8b6e4e; color: #d4a97a; }
