/* The master status pill, the "Default" reset control and its confirm
   popover, the paused empty state, and the <640px bottom-sheet layout. Split
   out of notifications.css (already at the source line gate) rather than
   grown into it, matching how notification-groups.css and
   notification-items.css were already split off it for the same reason. */

/* The master pill: the one thing in this header that must read as on/off at
   a glance, not just by its text. ON takes the accent fill everything else in
   this panel already uses for "live" (the badge, a pinned dot); OFF is a
   quiet outline — present, but clearly inert. It now only ever navigates to
   Settings (see notification-master.js) — reading the state and changing it
   are no longer the same gesture. */
.notification-master {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.notification-master-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
}

.notification-master.is-on {
  background: linear-gradient(135deg, #00a9bf, #0086ad);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 169, 191, 0.35);
}

.notification-master.is-on .notification-master-dot {
  background: #ffffff;
}

:root[data-alyssiun-atmosphere="neo"] .notification-master.is-on {
  background: linear-gradient(135deg, #00e5ff, #00b8d4);
  color: #03181d;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.4);
}

.notification-master.is-off {
  background: none;
  border-color: var(--desktop-border);
  color: var(--desktop-muted);
}

.notification-master.is-off .notification-master-dot {
  background: var(--desktop-muted);
}

.notification-master.is-off:hover {
  border-color: var(--desktop-muted);
  color: var(--desktop-text);
}

.notification-default-wrap {
  position: relative;
  margin-left: auto;
}

.notification-default {
  padding: 6px 12px;
  border: 1px solid var(--desktop-border);
  border-radius: 999px;
  background: none;
  color: var(--desktop-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.notification-default:hover {
  border-color: var(--desktop-muted);
  color: var(--desktop-text);
}

/* One tap must never be enough to undo everything a person configured — this
   sits between the button and actually applying anything. */
.notification-default-confirm {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  width: 200px;
  padding: 12px;
  border: 1px solid var(--desktop-border);
  border-radius: 11px;
  background: var(--desktop-surface);
  box-shadow: var(--desktop-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.notification-default-confirm[hidden] {
  display: none;
}

.notification-default-confirm p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--desktop-text);
}

.notification-default-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.notification-default-confirm-actions button {
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.notification-default-confirm-actions [data-default-cancel] {
  background: none;
  color: var(--desktop-muted);
}

.notification-default-confirm-actions [data-default-cancel]:hover {
  color: var(--desktop-text);
}

.notification-default-confirm-actions [data-default-apply] {
  background: #c0603a;
  color: #ffffff;
}

/* Shown instead of the group list while the master switch is off — the
   "quiet empty state" the panel body renders in place of stale cards. */
.notification-paused {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 20px;
  text-align: center;
}

.notification-paused-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.notification-paused-body {
  margin: 0;
  color: var(--desktop-muted);
  font-size: 12px;
  line-height: 1.5;
  max-width: 240px;
}

.notification-paused-resume {
  margin-top: 4px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #00a9bf, #0086ad);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

:root[data-alyssiun-atmosphere="neo"] .notification-paused-resume {
  background: linear-gradient(135deg, #00e5ff, #00b8d4);
  color: #03181d;
}

/* A grab handle only a touch bottom sheet needs; hidden entirely above the
   mobile breakpoint. */
.notification-sheet-handle {
  display: none;
}

@media (max-width: 640px) {
  /* The dropdown becomes a full-width sheet anchored to the bottom of the
     screen — the same panel markup, repositioned rather than rebuilt. */
  .notification-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(80vh, 640px);
    border-radius: 16px 16px 0 0;
    border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .notification-panel.is-dragging {
    transition: none;
  }

  .notification-sheet-handle {
    display: flex;
    justify-content: center;
    flex: none;
    padding: 8px 0 2px;
    touch-action: none;
    cursor: grab;
  }

  .notification-sheet-handle::after {
    content: "";
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--desktop-border);
  }

  /* 44px minimum tap targets throughout, per platform guidance. */
  .notification-close {
    width: 40px;
    height: 40px;
  }

  .notification-master,
  .notification-default {
    min-height: 40px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .notification-master {
    padding-left: 12px;
    padding-right: 14px;
    font-size: 13px;
  }

  .notification-default-confirm {
    width: min(240px, calc(100vw - 32px));
  }

  .notification-group-summary,
  .notification-group-more {
    min-height: 44px;
  }

  .notification-group-menu button {
    padding: 12px 10px;
    font-size: 13px;
  }

  .notification-item,
  .notification-card {
    min-height: 44px;
  }
}
