/* ============================================================
   PWA SHELL — Completely separate mobile design
   Triggers when rightbar disappears (≤ 1080px)
   Does NOT affect desktop layout at all.
   ============================================================ */

/* Hide PWA elements on desktop */
.pwa-header,
.pwa-footer,
.mob-job-info,
.mob-job-topbar,
.pwa-filter-panel {
  display: none !important;
}
.avatar__status-dot {
  display: none !important;
}
.mob-day-nav {
  display: none !important;
}
.pwa-meeting-sheet {
  display: none !important;
}
.pwa-meeting-pulse {
  display: none;
}

/* ============================================================
   MOBILE MODE — activates when rightbar disappears
   ============================================================ */
@media (max-width: 1080px) {

  /* --- Prevent horizontal scrolling --- */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .main,
  .main__inner {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* --- Show PWA shell --- */
  .pwa-header,
  .pwa-footer {
    display: block !important;
  }

  /* --- Hide old mobile header/footer --- */
  .mobile-header,
  .mobile-footer,
  .mobile-warning-banner {
    display: none !important;
  }

  /* --- Hide desktop header --- */
  .headerbar {
    display: none !important;
  }

  /* --- Hide sidebar --- */
  .sidebar {
    display: none !important;
  }

  /* --- Hide subnav --- */
  .subnav {
    display: none !important;
  }

  /* --- Adjust main layout --- */
  .layout {
    grid-template-columns: 1fr !important;
    padding-top: 56px !important;
    padding-bottom: 72px !important;
  }

  /* ========================================
     PWA HEADER
     ======================================== */
  .pwa-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
  }

  .pwa-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
  }

  /* Menu button */
  .pwa-header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .pwa-header__menu-btn:active {
    background: #f3f4f6;
  }

  /* Logo */
  .pwa-header__logo {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    letter-spacing: -0.3px;
  }

  /* Filter button */
  .pwa-header__filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .pwa-header__filter-btn:active {
    background: #f3f4f6;
  }

  /* ---- Dropdown Menu ---- */
  .pwa-header__dropdown {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 9998;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .pwa-header__dropdown[hidden] {
    display: block !important;
    transform: translateX(-100%);
    pointer-events: none;
  }

  .pwa-header__dropdown.pwa-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .pwa-header__dropdown-inner {
    padding: 16px;
  }

  /* User info */
  .pwa-header__user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
  }

  .pwa-header__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
  }

  .pwa-header__user-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
  }

  .pwa-header__user-email {
    font-size: 13px;
    color: #6b7280;
  }

  .pwa-header__divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
  }

  /* Menu links */
  .pwa-header__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 8px;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .pwa-header__link:active {
    background: #f3f4f6;
  }

  .pwa-header__link--danger {
    color: #dc2626;
  }

  /* Overlay */
  .pwa-header__overlay {
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .pwa-header__overlay.pwa-open {
    opacity: 1;
    pointer-events: auto;
  }

  .pwa-header__overlay[hidden] {
    display: block !important;
  }

  /* ========================================
     PWA FOOTER — Bottom Tab Bar
     ======================================== */
  .pwa-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .pwa-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 64px;
    max-width: 100%;
  }

  /* Tab items */
  .pwa-footer__tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9ca3af;
    flex: 1;
    max-width: 80px;
    padding: 6px 0;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
  }

  .pwa-footer__tab--active {
    color: #4984B8;
  }

  .pwa-footer__tab:active {
    transform: scale(0.93);
  }

  /* Primary (Hem) */
  .pwa-footer__tab--primary {
    color: #ffffff;
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4984B8 0%, #3a6fa0 100%);
    box-shadow: 0 4px 12px rgba(73, 132, 184, 0.3);
    transform: translateY(-6px);
  }

  .pwa-footer__tab--primary.pwa-footer__tab--active {
    background: linear-gradient(135deg, #3a6fa0 0%, #2d5a85 100%);
    color: #ffffff;
  }

  .pwa-footer__tab--primary:active {
    transform: translateY(-4px) scale(0.95);
  }

  /* Icon wrapper */
  .pwa-footer__icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
  }

  .pwa-footer__icon-wrap--lg {
    margin-bottom: 2px;
  }

  /* Icons */
  .pwa-footer__icon {
    width: 22px;
    height: 22px;
  }

  .pwa-footer__icon--lg {
    width: 26px;
    height: 26px;
  }

  /* Avatar in footer */
  .pwa-footer__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid currentColor;
  }

  /* Labels */
  .pwa-footer__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-align: center;
    line-height: 1;
  }

  /* Badge */
  .pwa-footer__badge {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    border: 2px solid #ffffff;
  }

  /* ========================================
     NOTIFICATIONS PAGE — Mobile overrides
     ======================================== */
  .notifications-header {
    padding: 10px 20px !important;
    position: static !important;
    top: auto !important;
    display: none !important;
  }

  .notifications-header__title {
    font-size: 20px !important;
  }

  /* Hide desktop pagination on mobile */
  .notifications-page .pagination {
    display: none !important;
  }

  /* Show only first 10 items, rest hidden until "load more" */
  .notification-item.notif-hidden {
    display: none !important;
  }

  /* Load more button */
  .notif-load-more {
    display: flex;
    justify-content: center;
    padding: 16px 20px 24px;
    background: #fff;
  }

  .notif-load-more__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    padding: 12px 24px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .notif-load-more__btn:active {
    background: #f3f4f6;
  }

  /* Hide PWA chat list header on mobile */
  .pwa-chat__list-header {
    display: none !important;
  }

  /* Hide floating chat widget on mobile */
  .fc-toggle,
  .fc-widget {
    display: none !important;
  }

  /* Hide job action buttons (apply/share/save) on mobile */
  .jobrow__actions {
    display: none !important;
  }

  /* Hide desktop report button on mobile */
  .jobdetail__report-desktop {
    display: none !important;
  }

  /* Mobile top-bar: Tillbaka / Dela / Rapportera */
  .mob-job-topbar {
    display: flex !important;
    gap: 8px;
    margin: 12px 0 6px;
  }

  .mob-job-topbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
  }

  .mob-job-topbar__btn--back {
    background: #f3f4f6;
    color: #374151;
  }
  .mob-job-topbar__btn--back:active {
    background: #e5e7eb;
  }

  .mob-job-topbar__btn--share {
    background: #dbeafe;
    color: #1d4ed8;
  }
  .mob-job-topbar__btn--share:active {
    background: #bfdbfe;
  }

  .mob-job-topbar__btn--report {
    background: #fef2f2;
    color: #dc2626;
  }
  .mob-job-topbar__btn--report:active {
    background: #fee2e2;
  }

  /* ── Mobile Job Detail: Kvalifikationer + Detaljer cards ── */
  .mob-job-info {
    display: block !important;
    margin: 24px 0 32px;
  }

  .mob-job-info__card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }

  .mob-job-info__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    cursor: pointer;
    list-style: none;
    user-select: none;
  }
  .mob-job-info__heading::-webkit-details-marker { display: none; }
  .mob-job-info__heading::after {
    content: '▾';
    font-size: 13px;
    color: #9ca3af;
    transition: transform .2s;
  }
  .mob-job-info__card[open] > .mob-job-info__heading::after {
    transform: rotate(180deg);
  }

  .mob-job-info__rows {
    padding: 0 16px 14px;
  }

  .mob-job-info__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
  }
  .mob-job-info__row:last-child {
    border-bottom: none;
  }

  .mob-job-info__label {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
    margin-right: 12px;
  }

  .mob-job-info__value {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
    word-break: break-word;
  }

  /* Action buttons */
  .mob-job-info__actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
  }

  .mob-job-info__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
  }
  .mob-job-info__btn:active {
    background: #f3f4f6;
  }

  .mob-job-info__btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
  }
  .mob-job-info__btn--primary:active {
    background: #1d4ed8;
  }

  .mob-job-info__btn--saved {
    background: #ecfdf5;
    border-color: #34d399;
    color: #059669;
  }

  .mob-job-info__save-form {
    flex: 1;
    display: flex;
  }
  .mob-job-info__save-form .mob-job-info__btn {
    width: 100%;
  }

  /* ── Hide settings sidebar on mobile ── */
  .sp-sidebar {
    display: none !important;
  }

  /* ── Profile dropdown menu ── */
  .pwa-footer__tab--dropdown {
    position: relative;
    cursor: pointer;
  }

  .pwa-profile-menu {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 8px);
    right: 8px;
    width: 220px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    border: 1px solid #e5e7eb;
    padding: 8px 0;
    z-index: 10000;
  }
  .pwa-profile-menu[hidden] {
    display: none !important;
  }

  .pwa-profile-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background .12s;
  }
  .pwa-profile-menu__item:active {
    background: #f3f4f6;
  }
  .pwa-profile-menu__item svg {
    flex-shrink: 0;
    color: #6b7280;
  }
  .pwa-profile-menu__divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 12px;
  }
  .pwa-profile-menu__overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.2);
  }

  /* ── Filter icon badge ── */
  .pwa-header__filter-btn {
    position: relative;
  }
  .pwa-header__filter-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    border: 2px solid #fff;
    line-height: 1;
  }

  /* ========================================
     PWA FILTER PANEL — Fullscreen Overlay
     ======================================== */
  .pwa-filter-panel {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #f9fafb;
    display: flex !important;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .25s ease;
    pointer-events: none;
  }
  .pwa-filter-panel.pwa-open {
    transform: translateY(0);
    pointer-events: auto;
  }
  .pwa-filter-panel.pwa-open {
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Header */
  .pwa-filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
  }
  .pwa-filter-panel__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
  }
  .pwa-filter-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
  }
  .pwa-filter-panel__close:active {
    background: #f3f4f6;
  }

  /* Body (scrollable) */
  .pwa-filter-panel__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0;
  }

  /* Section accordion */
  .pwa-filter__section {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
  }
  .pwa-filter__section-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .pwa-filter__section-header:active {
    background: #f9fafb;
  }
  .pwa-filter__section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
  }
  .pwa-filter__section-title svg {
    color: #6b7280;
  }
  .pwa-filter__section-header > .pwa-filter__chevron {
    color: #9ca3af;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: 8px;
  }
  .pwa-filter__section.is-open > .pwa-filter__section-header > .pwa-filter__chevron {
    transform: rotate(180deg);
  }

  /* Badge next to section title */
  .pwa-filter__badge {
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 8px;
  }

  /* Section body */
  .pwa-filter__section-body {
    display: none;
    padding: 0 16px 14px;
  }
  .pwa-filter__section.is-open > .pwa-filter__section-body {
    display: block;
  }

  /* County / Category accordion (nested) */
  .pwa-filter__county {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
  }
  .pwa-filter__county-header {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: #fafafa;
  }
  .pwa-filter__county-header:active {
    background: #f3f4f6;
  }
  .pwa-filter__county-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
  }
  .pwa-filter__county-header > .pwa-filter__chevron {
    color: #9ca3af;
    transition: transform .2s;
    flex-shrink: 0;
  }
  .pwa-filter__county.is-open > .pwa-filter__county-header > .pwa-filter__chevron {
    transform: rotate(180deg);
  }

  /* Municipalities / Occupations list */
  .pwa-filter__municipalities {
    padding: 6px 14px 10px;
    background: #fff;
  }

  /* Checkbox items */
  .pwa-filter__check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    -webkit-tap-highlight-color: transparent;
  }
  .pwa-filter__check:last-child {
    border-bottom: none;
  }
  .pwa-filter__check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    flex-shrink: 0;
  }
  .pwa-filter__check span {
    flex: 1;
  }

  .pwa-filter__count {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 400;
  }

  .pwa-filter__loading {
    padding: 12px 0;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
  }

  /* Footer */
  .pwa-filter-panel__footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
  }
  .pwa-filter-panel__clear {
    flex: 1;
    padding: 13px 0;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
  }
  .pwa-filter-panel__clear:active {
    background: #f3f4f6;
  }
  .pwa-filter-panel__apply {
    flex: 2;
    padding: 13px 0;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    cursor: pointer;
  }
  .pwa-filter-panel__apply:active {
    background: #1d4ed8;
  }

  /* ========================================
     COACH CONNECTIONS — Mobile Card Layout
     ======================================== */

  /* Hide table headers, date column, status text column */
  .connections-table thead {
    display: none;
  }
  .connections-table .created-cell,
  .connections-table .status-cell {
    display: none !important;
  }

  /* Make table rows into cards */
  .connections-table {
    border-spacing: 0 10px;
  }
  .connections-table tbody tr {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 0;
  }
  .connections-table td {
    display: block !important;
    padding: 0 !important;
    border: none;
  }
  .connections-table .user-cell {
    flex: 1 1 0%;
    min-width: 0;
  }
  .connections-table .actions-cell {
    flex: 0 0 auto;
    display: flex !important;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
  }

  /* Hide chat icon on mobile (already in footer) */
  .connections-table .action-chat {
    display: none !important;
  }
  .connections-table .actions-cell .inline {
    display: inline;
  }

  /* Avatar status dot (visible on mobile) */
  .avatar {
    position: relative;
  }
  .avatar__status-dot {
    display: block;
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    z-index: 1;
  }
  .avatar__status-dot--online {
    background: #22c55e;
  }
  .avatar__status-dot--offline {
    background: #ef4444;
  }

  /* Smaller icons on mobile */
  .action-icon {
    width: 32px;
    height: 32px;
  }
  .action-icon svg {
    width: 16px;
    height: 16px;
  }

  /* ========================================
     COACH MEETINGS — Mobile Day View
     ======================================== */

  /* Hide "Väntade" and "Gamla" tabs */
  .meeting-tab-btn.tab--pending,
  .meeting-tab-btn.tab--past {
    display: none !important;
  }

  /* Hide desktop week nav, show mobile day nav */
  .week-nav {
    display: none !important;
  }
  .mob-day-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
  }
  .mob-day-nav__btn {
    padding: 8px 14px;
    background: #f4f5f7;
    color: #232629;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .mob-day-nav__btn:active {
    background: #7AAACE;
    color: #fff;
  }
  .mob-day-nav__label {
    font-size: 18px;
    font-weight: 700;
    color: #232629;
    text-align: center;
  }

  /* Calendar: remove horizontal scroll, single column */
  .calendar-wrapper {
    overflow-x: hidden !important;
  }
  .calendar-table {
    min-width: unset !important;
    table-layout: auto !important;
  }

  /* Hide non-active day columns (JS toggles .mob-day-visible) */
  .calendar-table thead th[data-day-index],
  .calendar-table tbody td[data-day-index] {
    display: none !important;
  }
  .calendar-table thead th[data-day-index].mob-day-visible,
  .calendar-table tbody td[data-day-index].mob-day-visible {
    display: table-cell !important;
  }

  /* Make the visible column wider */
  .calendar-table thead th.mob-day-visible {
    width: auto;
  }
  .calendar-table thead th:first-child {
    width: 60px;
  }

  /* Legend on mobile — compact row */
  .calendar-legend {
    display: flex !important;
    gap: 12px;
    padding: 10px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    background: #fafbfc;
    border-top: 1px solid #f0f1f3;
    justify-content: flex-start;
  }
  .legend-item {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
  }
  .legend-dot {
    width: 10px;
    height: 10px;
  }

  /* Hide print button */
  .week-nav__print {
    display: none !important;
  }

  /* ===== Mobile Meeting Button + Bottom Sheet ===== */
  .pwa-footer__tab--meeting {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    font-family: inherit;
    padding: 0;
    color: inherit;
  }

  .pwa-footer__tab--meeting-active .pwa-footer__icon-wrap {
    background: #dc2626;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pwa-vmb-glow 2s ease-in-out infinite;
  }
  .pwa-footer__tab--meeting-active .pwa-footer__icon {
    stroke: #fff;
  }
  .pwa-footer__tab--meeting-active .pwa-footer__label {
    color: #dc2626;
    font-weight: 700;
  }

  .pwa-meeting-pulse {
    position: absolute;
    top: -3px; right: -3px; bottom: -3px; left: -3px;
    border-radius: 50%;
    border: 2px solid #dc2626;
    pointer-events: none;
    animation: pwa-vmb-ping 1.5s cubic-bezier(0,0,0.2,1) infinite;
  }

  @keyframes pwa-vmb-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
  }
  @keyframes pwa-vmb-ping {
    0%   { transform: scale(1); opacity: 1; }
    75%, 100% { transform: scale(1.5); opacity: 0; }
  }

  /* Meeting badge */
  .pwa-meeting-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    color: #fff;
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
  }
  .pwa-meeting-badge--live {
    background: #dc2626;
    animation: pwa-ms-blink 1s infinite;
  }
  .pwa-meeting-badge--soon {
    background: #d97706;
  }

  /* Bottom sheet */
  .pwa-meeting-sheet {
    display: block !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
  }
  .pwa-meeting-sheet[hidden] {
    display: none !important;
  }
  .pwa-meeting-sheet__backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
  }
  .pwa-meeting-sheet__panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    overflow-y: auto;
    animation: pwa-sheet-up 0.25s ease-out;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  @keyframes pwa-sheet-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .pwa-meeting-sheet__handle {
    width: 40px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
    margin: 10px auto;
  }
  .pwa-meeting-sheet__content {
    padding: 0 16px 16px;
  }
  .pwa-meeting-sheet__empty {
    text-align: center;
    color: #9ca3af;
    padding: 32px 0;
    font-size: 15px;
  }

  /* Meeting card inside sheet */
  .pwa-ms-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
  }
  .pwa-ms-card:last-child {
    margin-bottom: 0;
  }
  .pwa-ms-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    margin-bottom: 8px;
  }
  .pwa-ms-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
  }
  .pwa-ms-status--live {
    background: #fef2f2;
    color: #dc2626;
  }
  .pwa-ms-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #dc2626;
    margin-right: 3px;
    vertical-align: middle;
    animation: pwa-ms-blink 1s infinite;
  }
  @keyframes pwa-ms-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }
  .pwa-ms-status--soon {
    background: #fffbeb;
    color: #d97706;
  }
  .pwa-ms-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 12px;
  }
  .pwa-ms-card__actions {
    display: flex;
    gap: 8px;
  }
  .pwa-ms-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
  }
  .pwa-ms-btn--join {
    background: #047857;
    color: #fff;
  }
  .pwa-ms-btn--end {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
  }

  /* ===== Client Meetings Mobile ===== */
  .ml-filter-bar {
    gap: 4px !important;
  }
  .ml-filter-bar__left {
    display: grid !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 10px !important;
  }
  .ml-filter-bar__label {
    font-size: 13px !important;
    white-space: nowrap;
  }
  .ml-filter-bar select {
    width: 100%;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }
  .ml-pending-link {
    grid-column: 1 / -1;
    text-align: center;
    justify-content: center;
  }

  .ml-table thead { display: none !important; }
  .ml-table, .ml-table tbody {
    display: block !important;
  }
  .ml-table {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* Each row = a card with flex-wrap layout */
  .ml-table tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
    background: #fff !important;
    border-radius: 14px !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb !important;
    gap: 0;
    align-items: flex-start;
  }

  .ml-table td {
    padding: 0 !important;
    border: none !important;
    display: block !important;
  }
  .ml-table td::before {
    display: none !important;
  }

  /* Date box: left side */
  .ml-table td[data-label="Datum"] {
    flex: 0 0 auto;
    margin-right: 14px;
  }
  .ml-table td[data-label="Datum"] .ml-date-box {
    width: 50px;
    height: 50px;
  }

  /* Coach: right of date box, fill rest of first line */
  .ml-table td[data-label="Coach"] {
    flex: 1 1 calc(100% - 70px);
    min-width: 0;
    padding-top: 2px !important;
    padding-bottom: 4px !important;
  }

  /* Type + Status: shrink to content, sit side by side */
  .ml-table td[data-label="Mötestyp"] {
    flex: 0 0 auto;
    padding-top: 8px !important;
    padding-right: 6px !important;
  }
  .ml-table td[data-label="Status"] {
    flex: 0 0 auto;
    padding-top: 8px !important;
  }

  /* Separator: force Meddelande + Åtgärder to full row */
  .ml-table td[data-label="Meddelande"] {
    flex: 0 0 100%;
    padding-top: 10px !important;
  }
  .ml-table td[data-label="Åtgärder"] {
    flex: 0 0 100%;
    padding-top: 6px !important;
  }
  .ml-btn--join {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    padding: 11px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    background: #2563eb !important;
  }
  .ml-time-hint {
    font-size: 13px !important;
  }
  .ml-load-more {
    width: 100% !important;
    padding: 14px !important;
  }

  /* Fix modal overlay inside inline td */
  .ml-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
  }
  .ml-modal-overlay.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .ml-modal {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    margin: 16px !important;
  }

  /* ===== Coach Client Detail ===== */
  .client-panel {
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
  }

  .client-panel__sidebar {
    border-right: none !important;
    border-bottom: 1px solid #e0e0e0;
  }

  .client-panel__profile {
    flex-direction: row !important;
    padding: 16px !important;
    gap: 14px;
    border-bottom: none !important;
  }

  .client-panel__avatar {
    width: 52px !important;
    height: 52px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .client-panel__name {
    text-align: left !important;
    font-size: 15px !important;
    margin: 0 !important;
  }

  .client-panel__role {
    align-self: flex-start;
  }

  .client-panel__nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    flex-direction: unset !important;
    padding: 0 !important;
    border-bottom: 1px solid #e0e0e0;
    gap: 0;
  }

  .client-panel__nav-link {
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    justify-content: center;
    text-align: center !important;
  }

  .client-panel__nav-link.active {
    border-left-color: transparent !important;
    border-bottom-color: #0066cc !important;
  }

  .client-panel__actions {
    flex-direction: row !important;
    padding: 10px 16px !important;
  }

  .client-panel__action-btn {
    flex: 1;
  }

  .client-panel__content {
    padding: 16px !important;
  }
}
