/* Shared navigation and responsive page structure. Loaded after the legacy modules. */
html { scrollbar-gutter: stable; scroll-padding-top: 100px; }
.portal { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; background: #091927 !important; color: #ebf2f8; }
.portal [hidden] { display: none !important; }
.portal.menu-open { overflow: hidden; }
.portal :focus-visible { outline: 3px solid #6cdcf0; outline-offset: 4px; }
.portal a { text-underline-offset: 3px; }
.portal button, .portal input, .portal select, .portal textarea { font: inherit; }
.portal img { max-width: 100%; }
.portal .app-shell { display: block; min-height: calc(100vh - 76px); }
.portal .content { width: 100%; max-width: 1400px; min-width: 0; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 64px; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 3000; padding: 12px 20px; color: #061925; background: #6cdcf0; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.portal-header { position: sticky; top: 0; z-index: 1030; background: #0c1e2d; border-bottom: 1px solid #223b4d; }
.portal-header-inner { min-height: 76px; display: flex; align-items: center; gap: 24px; max-width: 1560px; margin: auto; padding: 12px clamp(16px, 3vw, 40px); }
.menu-toggle, .menu-close { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; min-height: 44px; border: 1px solid #345268; border-radius: 10px; color: #ecf5fb; background: transparent; cursor: pointer; }
.menu-toggle { padding: 8px 14px; font-weight: 600 !important; }
.menu-toggle:hover, .menu-close:hover { background: #193547; }
.menu-close { width: 44px; font-size: 28px !important; line-height: 1; }
.portal-brand { display: flex; align-items: center; gap: 12px; color: #f1f8ff; text-decoration: none; font-weight: 650; }
.portal-brand:hover { color: #8fe6f5; }
.portal-logo { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: #65d3e6; color: #08202d; font-weight: 850; font-size: 14px; letter-spacing: -.04em; }
.portal-current-page { border-left: 1px solid #345268; padding-left: 24px; color: #a8becd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-role { margin-left: auto; padding: 4px 10px; border: 1px solid #345268; border-radius: 6px; color: #a8becd; font-size: 12px; white-space: nowrap; }
.navigation-dialog { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(352px, 90vw); height: 100%; height: 100dvh; max-height: none; max-width: none; padding: 24px 20px; background: #0d2232; color: #edf6fc; border: 0; border-right: 1px solid #345268; border-radius: 0 20px 20px 0; box-shadow: 12px 0 48px #0006; overflow-y: auto; overscroll-behavior: contain; }
.navigation-dialog::backdrop { background: #020b13b8; }
.navigation-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 18px; margin-bottom: 8px; border-bottom: 1px solid #2b4354; }
.navigation-heading h2 { margin: 4px 0 0; font-size: 24px; }
.portal-navigation a, .navigation-group > summary { display: flex; align-items: center; min-height: 46px; padding: 10px 14px; margin: 3px 0; border-radius: 9px; color: #d5e4ef; text-decoration: none; font-size: 15px; font-weight: 500; border: 1px solid transparent; }
.portal-navigation a:hover, .navigation-group > summary:hover { background: #18384c; color: white; }
.portal-navigation a.active, .portal-navigation a[aria-current="page"] { background: #173e51; border-color: #327e93; color: #99edf9; font-weight: 650; }
.navigation-group { margin-top: 8px; border-top: 1px solid #253d4f; padding-top: 8px; }
.navigation-group > summary { cursor: pointer; list-style: none; font-weight: 650; }
.navigation-group > summary::-webkit-details-marker { display: none; }
.navigation-group > summary::after { content: "+"; margin-left: auto; color: #94b3c6; font-size: 18px; }
.navigation-group[open] > summary::after { content: "−"; }
.navigation-group a { margin-left: 12px; padding-left: 16px; border-left: 2px solid #2a4659; }
.navigation-account { margin-top: 20px; padding-top: 12px; border-top: 1px solid #2b4354; }
.navigation-footer { margin: 24px 14px 0; font-size: 12px; color: #8ba8bc; }
.no-script-navigation { padding: 16px; background: #0d2232; }

/* Calmer, consistent controls across existing modules. */
.portal .hero, .portal .kiosk-hero, .portal .panel { min-width: 0; padding: 24px; border-radius: 16px; background: #102738; border: 1px solid #2a4254; box-shadow: none; }
.portal .hero h1, .portal .kiosk-hero h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -.03em; }
.portal h2 { font-size: 1.4rem; font-weight: 650; line-height: 1.3; }
.portal h3 { font-size: 1.1rem; font-weight: 650; line-height: 1.4; }
.portal .eyebrow { font-size: 11px; color: #8cbcca !important; letter-spacing: .12em; font-weight: 650; }
.portal .muted, .portal .hero p, .portal .kiosk-hero p { color: #a5becf; }
.portal .form-control, .portal .form-select { min-width: 0; min-height: 44px; border-radius: 8px; font-size: 16px; background: #0b1d2b !important; border-color: #3b576b !important; color: #f1f7fc !important; }
.portal .form-control::placeholder { color: #91aabd; opacity: 1; }
.portal .form-control:focus, .portal .form-select:focus { border-color: #6cdcf0 !important; box-shadow: 0 0 0 3px #6cdcf01f; }
.portal textarea { resize: vertical; }
.portal .btn-gbf, .portal .btn-mini { background: #6cdcf0; border-radius: 9px; font-size: 14px; font-weight: 650; padding: 10px 16px; min-height: 44px; box-shadow: none; line-height: 1.4; }
.portal .btn-gbf:hover, .portal .btn-mini:hover { background: #a0eefa; color: #071a26; }
.portal .btn { min-height: 44px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.portal .btn-outline-light { border-color: #416074 !important; font-weight: 550 !important; }
.portal .btn-outline-danger { border-color: #83505b; color: #ffaeb4; }
.portal .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); align-items: stretch; }
.portal .kpi { padding: 16px 20px; border-radius: 12px; align-self: stretch; }
.portal .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; }
.portal .two-col > *, .portal .row > *, .portal .event-head > *, .portal .person-info { min-width: 0; }
.portal .table-panel, .portal .table-responsive { max-width: 100%; }
.portal .panel:has(> .table) { overflow-x: auto; }
.portal .gbf-kiosk-shell { width: 100%; min-width: 0; }
.portal .modal-content.panel { padding: 12px; background: #112b3e; }
.portal .modal-content .btn-close { filter: none; }
.portal .person-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.portal .slot-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

/* Dugnad: overview first, editors inside native disclosures. */
.dugnad-page { max-width: 1120px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 4px 0 28px; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; margin: 6px 0 8px; letter-spacing: -.04em; }
.page-heading p { color: #a5becf; margin: 0; }
.page-heading .btn-gbf { flex-shrink: 0; }
.dugnad-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.dugnad-search { flex: 1; }
.dugnad-toolbar .form-select { width: 180px; }
.result-count { color: #a5becf; min-width: 85px; font-size: 13px; text-align: right; }
.dugnad-list { display: grid; gap: 16px; }
.portal .dugnad-card { margin: 0; padding: 24px 28px; }
.dugnad-card-heading { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.dugnad-card-heading > div:first-child { min-width: 0; }
.dugnad-card-heading h2 { margin: 4px 0 8px; font-size: 1.4rem; overflow-wrap: anywhere; }
.dugnad-location { color: #92b6c8; font-size: 12px; }
.dugnad-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.state-badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 6px; font-size: 11px; font-weight: 600; padding: 3px 8px; white-space: nowrap; }
.state-badge.positive { background: #173d37; color: #95d6b6; border: 1px solid #315b4c; }
.state-badge.neutral { background: #253b4b; color: #b3c9d8; border: 1px solid #40596b; }
.dugnad-description { color: #aec4d4; margin: 4px 0 16px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; max-width: 86ch; }
.description-more { font-size: 14px; color: #abc5d8; margin: -4px 0 16px; }
.description-more summary { cursor: pointer; color: #82c5d8; }
.description-more p { padding-top: 12px; overflow-wrap: anywhere; }
.dugnad-stats { display: grid; grid-template-columns: 1fr 1fr 1.35fr 1fr; margin: 18px 0; border-radius: 10px; background: #0b2030; border: 1px solid #233e50; padding: 14px 0; }
.dugnad-stats > div { padding: 0 20px; border-right: 1px solid #294152; }
.dugnad-stats > div:last-child { border: 0; }
.dugnad-stats dt { color: #95b2c7; font-size: 12px; font-weight: 450; }
.dugnad-stats dd { font-size: 22px; font-weight: 650; margin: 4px 0 0; line-height: 1.2; }
.dugnad-stats dd span { font-size: 16px; font-weight: 450; color: #92adbf; }
.disclosure > summary { display: flex; gap: 12px; align-items: center; min-height: 46px; cursor: pointer; color: #c1d8e7; list-style: none; font-weight: 600; font-size: 14px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid #95becf; border-bottom: 2px solid #95becf; transform: rotate(45deg); margin: -4px 4px 0 auto; flex-shrink: 0; }
.disclosure[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.summary-note { font-weight: 450; color: #8eafc4; font-size: 12px; margin-left: auto; }
.disclosure > summary .summary-note + :last-child { margin-left: 0; }
.event-work > summary { color: #8de2f3; }
.event-settings { border-top: 1px solid #294354; margin-top: 8px; padding-top: 4px; }
.event-settings > summary { font-size: 13px; font-weight: 450; color: #9ab7ca; }
.portal .create-dugnad { padding: 8px 24px; margin-bottom: 20px; border-style: dashed; }
.create-dugnad[open] { padding-bottom: 24px; }
.dugnad-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0 8px; align-items: start; }
.dugnad-form > *, .dugnad-add-tools > *, .dugnad-slot-overview > * { min-width: 0; }
.dugnad-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: #b9d0df; }
.dugnad-form .wide { grid-column: 1 / -1; }
.form-actions, .dugnad-event-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dugnad-event-actions { margin-top: 20px; padding: 20px 0 8px; border-top: 1px solid #294354; }
.sub-options { font-size: 13px; color: #9db8cb; }
.sub-options summary { cursor: pointer; padding: 8px 0; }
.sub-options label { margin: 8px 0 0; }
.dugnad-add-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0 20px; }
.tool-disclosure { border: 1px solid #36546a; border-radius: 10px; padding: 0 16px; background: #112d40; }
.tool-disclosure[open] { padding-bottom: 16px; }
.dugnad-tasks { display: grid; gap: 16px; padding-top: 12px; }
.dugnad-task { padding: 20px; border: 1px solid #29485c; border-radius: 12px; background: #0c2030; }
.dugnad-task-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dugnad-task-heading h3 { margin: 0; overflow-wrap: anywhere; }
.dugnad-task-heading span { font-size: 12px; }
.dugnad-task > p { font-size: 14px; margin: 8px 0 12px; overflow-wrap: anywhere; }
.edit-disclosure > summary { font-size: 12px; font-weight: 450; min-height: 44px; color: #9cbbcf; }
.edit-disclosure[open] { padding-bottom: 12px; }
.dugnad-slot { border: 1px solid #29485c; border-radius: 9px; margin-top: 12px; padding: 14px 16px 4px; background: #122c3d; }
.dugnad-slot-overview { display: flex; align-items: center; gap: 20px; padding-bottom: 10px; }
.slot-time, .slot-availability { display: grid; gap: 3px; }
.slot-time strong { font-size: 14px; font-weight: 600; }
.slot-time > span, .slot-availability > span:first-child { color: #9cb9cd; font-size: 12px; }
.slot-availability { margin-left: auto; }
.dugnad-slot .edit-disclosure { border-top: 1px solid #2d475a; }
.dugnad-reservations { border-top: 1px solid #2d475a; margin-top: 20px; padding-top: 20px; }
.dugnad-reservations h4 { font-size: 14px; font-weight: 600; }
.reservation-disclosure { border-bottom: 1px solid #29485c; padding: 4px 0; }
.reservation-disclosure > summary { font-weight: 450; }
.empty-inline { color: #9bb6c8; padding: 16px 0; font-size: 14px; }
.empty-state { text-align: center; padding: 40px 20px !important; }
.empty-state p { color: #a6bece; }
.overview-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.overview-link { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid #2a465a; border-radius: 12px; background: #102738; color: #e6f1f8; text-decoration: none; }
.overview-link:hover { border-color: #6ebbc9; color: white; background: #173348; }
.overview-link strong { font-size: 17px; }
.overview-link span { color: #9fbccd; font-size: 14px; }
@media (max-width: 1000px) {
    .portal .two-col { grid-template-columns: minmax(0, 1fr); }
    .portal-current-page { display: none; }
}
@media (max-width: 600px) {
    .portal-header-inner { gap: 12px; min-height: 64px; padding: 10px 16px; }
    .portal-brand-name { display: none; }
    .portal-brand { margin-left: auto; }
    .portal-role { margin-left: 0; font-size: 10px; padding: 3px 6px; }
    .portal .content { padding: 24px 16px 40px; }
    .portal .hero, .portal .panel, .portal .kiosk-hero { padding: 18px; border-radius: 12px; }
    .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
    .page-heading p { font-size: 14px; }
    .dugnad-toolbar { flex-wrap: wrap; gap: 10px; }
    .dugnad-search { flex-basis: 100%; }
    .dugnad-toolbar .form-select { flex: 1; width: auto; }
    .dugnad-card-heading { flex-direction: column-reverse; gap: 6px; }
    .dugnad-card-heading h2 { font-size: 1.25rem; }
    .dugnad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
    .dugnad-stats > div { padding: 12px 14px; border: 0; }
    .dugnad-stats > div:nth-child(odd) { border-right: 1px solid #294152; }
    .dugnad-stats > div:nth-child(-n+2) { border-bottom: 1px solid #294152; }
    .dugnad-stats dd { font-size: 20px; }
    .disclosure > summary { gap: 8px; flex-wrap: wrap; position: relative; padding-right: 20px; }
    .disclosure > summary::after { position: absolute; right: 0; top: 22px; }
    .summary-note { width: 100%; margin: -4px 0 6px; }
    .dugnad-form { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .dugnad-task { padding: 14px; }
    .dugnad-slot { padding: 12px 12px 4px; }
    .dugnad-slot-overview { flex-wrap: wrap; gap: 12px; }
    .dugnad-slot-overview > .btn-gbf { width: 100%; }
    .form-actions > *, .dugnad-event-actions > * { flex: 1 1 auto; }
    .portal .two-col .row > .col { flex-basis: 100%; margin-bottom: 12px; }
    .portal .event-head, .portal .kiosk-header, .portal .slot-row { flex-wrap: wrap; }
}
@media print {
    .portal-header, .navigation-dialog, .no-script-navigation, .skip-link { display: none !important; }
    .portal .content { padding: 0; }
}
