/* Phone notification screen: full screen between the header and the tab bar, minimal list rows,
   swipe-to-delete (mobile-notifications.js). Desktop keeps the header panel from style.css. */
.header-notification-type,
.notification-empty-art,
.mobile-notification-swipe-action { display: none; }

@media (max-width: 720px) {
  html #view-dashboard #mobile-notification-overlay {
    --mn-pad: 16px;
    background: var(--list-surface);
  }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-modal {
    display: flex; flex-direction: column; height: 100%;
    background: var(--list-surface); color: var(--list-ink);
  }

  /* Heading */
  html #view-dashboard #mobile-notification-overlay .mobile-notification-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 8px 6px var(--mn-pad); border: 0; background: none;
  }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-heading h2 {
    margin: 0; color: var(--list-ink); font-size: 20px; font-weight: 700; line-height: 28px; letter-spacing: 0;
  }
  .mobile-notification-heading-actions { display: flex; align-items: center; gap: 2px; }
  .mobile-notification-icon-button {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 50%; background: none; color: var(--list-muted); cursor: pointer;
  }
  .mobile-notification-icon-button.hide { display: none; }
  #btn-mark-all-mobile-notifications { color: #00a76f; }
  .mobile-notification-icon-button:active { background: var(--list-hover); }
  .mobile-notification-icon-button:focus-visible { outline: 2px solid var(--list-ink); outline-offset: -2px; }

  /* Tabs: underline with count chips */
  html #view-dashboard #mobile-notification-overlay .mobile-notification-tabs {
    display: flex; gap: 24px; margin: 0; padding: 0 var(--mn-pad);
    border: 0; border-bottom: 1px solid var(--list-line); border-radius: 0; background: none;
  }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-tabs .header-notification-tab {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0;
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
    background: none; box-shadow: none; color: var(--list-muted); font-size: 14px; font-weight: 600;
  }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-tabs .header-notification-tab.is-active {
    border-bottom-color: var(--list-ink); color: var(--list-ink);
  }
  .mobile-notification-count {
    min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px;
    background: var(--list-head); color: var(--list-ink); font-size: 12px; font-weight: 700; line-height: 24px; text-align: center;
  }
  .mobile-notification-count.is-accent { background: #ff5630; color: #fff; }

  /* List */
  html #view-dashboard #mobile-notification-overlay .mobile-notification-list {
    flex: 1; min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden;
    padding: 0; overscroll-behavior: contain;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-section { margin: 0; padding: 0; }
  html #view-dashboard #mobile-notification-overlay .header-notification-section-title {
    margin: 0; padding: 16px var(--mn-pad) 6px; color: var(--list-muted);
    font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-item {
    position: relative; display: block; margin: 0; padding: 0; overflow: hidden;
    border: 0; border-bottom: 1px dashed var(--list-line); border-radius: 0; background: var(--list-surface); box-shadow: none;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-open {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 40px minmax(0, 1fr) 10px; align-items: start; gap: 14px;
    width: 100%; min-height: 76px; padding: 14px var(--mn-pad);
    border: 0; border-radius: 0; background: var(--list-surface); color: inherit; text-align: left;
    touch-action: pan-y; transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-item.is-unread .header-notification-open {
    background: color-mix(in srgb, var(--list-accent-text) 7%, var(--list-surface));
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-open:focus-visible { outline: 2px solid var(--list-ink); outline-offset: -2px; }
  html #view-dashboard #mobile-notification-overlay .header-notification-item.is-dragging .header-notification-open { transition: none; }

  /* Avatar with a kind badge */
  html #view-dashboard #mobile-notification-overlay .header-notification-avatar {
    grid-column: 1; grid-row: 1; position: relative; width: 40px; height: 40px; margin: 0;
    border-radius: 50%; font-size: 14px; font-weight: 700;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-open::before {
    content: ""; position: absolute; top: 40px; left: calc(var(--mn-pad) + 26px); z-index: 1;
    width: 18px; height: 18px; border: 2px solid var(--list-surface); border-radius: 50%;
    background: var(--mn-kind, #919eab);
  }
  html #view-dashboard #mobile-notification-overlay [data-notification-kind="task"] { --mn-kind: #00b8d9; }
  html #view-dashboard #mobile-notification-overlay [data-notification-kind="kpi"] { --mn-kind: #8e33ff; }
  html #view-dashboard #mobile-notification-overlay [data-notification-kind="schedule"] { --mn-kind: #22c55e; }

  /* Copy */
  html #view-dashboard #mobile-notification-overlay .header-notification-copy {
    grid-column: 2; grid-row: 1; display: grid; gap: 4px; min-width: 0; padding: 0;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-copy > strong,
  html #view-dashboard #mobile-notification-overlay .header-notification-copy > span:not(.header-notification-meta) {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; white-space: normal; text-overflow: clip;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-copy > strong {
    color: var(--list-ink); font-size: 14px; font-weight: 600; line-height: 22px;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-copy > span:not(.header-notification-meta) {
    color: var(--list-muted); font-size: 13px; line-height: 20px;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; overflow: visible; white-space: normal;
    color: var(--list-muted); font-size: 12px; line-height: 18px;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-meta time { font-size: 12px; color: var(--list-muted); }
  html #view-dashboard #mobile-notification-overlay .header-notification-type { display: inline; color: var(--list-muted); white-space: nowrap; }

  /* Unread dot on the right */
  html #view-dashboard #mobile-notification-overlay .header-notification-dot {
    grid-column: 3; grid-row: 1; position: static; width: 8px; height: 8px; margin-top: 7px;
    border-radius: 50%; background: transparent; box-shadow: none;
  }
  html #view-dashboard #mobile-notification-overlay .is-unread .header-notification-dot { background: #00a76f; }

  /* The X stays for keyboard and screen readers; touch users swipe instead. */
  html #view-dashboard #mobile-notification-overlay .header-notification-quick-delete {
    position: absolute; top: 8px; right: 8px; z-index: 2; opacity: 0; pointer-events: none;
  }
  html #view-dashboard #mobile-notification-overlay .header-notification-quick-delete:focus-visible { opacity: 1; pointer-events: auto; }

  /* Swipe action behind the row */
  html #view-dashboard #mobile-notification-overlay .mobile-notification-swipe-action {
    position: absolute; inset: 0 0 0 auto; z-index: 0; display: flex; align-items: center; justify-content: flex-end;
    width: 100%; padding-right: 24px; border: 0; background: #ff5630; color: #fff; font-size: 14px; font-weight: 700;
  }

  /* Empty state */
  html #view-dashboard #mobile-notification-overlay .header-notification-empty {
    display: grid; justify-items: center; gap: 12px; margin: 0; padding: 72px 24px;
    color: var(--list-muted); font-size: 14px; text-align: center;
  }
  html #view-dashboard #mobile-notification-overlay .notification-empty-art {
    display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%;
    background: var(--list-head); color: var(--list-muted);
  }

  /* Footer */
  .mobile-notification-footer { padding: 8px var(--mn-pad) 12px; border-top: 1px solid var(--list-line); }
  .mobile-notification-footer.hide { display: none; }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-clear-all {
    width: 100%; min-height: 44px; border: 0; border-radius: 8px; background: none; box-shadow: none;
    color: #b71d18; font-size: 14px; font-weight: 600;
  }
  html #view-dashboard #mobile-notification-overlay .mobile-notification-clear-all:active { background: var(--list-hover); }

  @media (prefers-reduced-motion: reduce) {
    html #view-dashboard #mobile-notification-overlay .header-notification-open { transition: none; }
  }
}
