/*! notifications.css 1.2.1 | DJ2000-UK/app-workbench */
/* In-app notifications (notifications/notifications.js): small glass capsules
   that rise from the foot of the screen and rest just above the tab bar, or slide
   down from the top while the keyboard, a number pad or a sheet fills the foot
   (DJ, 2026-12-01), with no app icon (DJ, 2026-12-02). Every colour is one of the
   app's own tokens (--panel, --ink, --muted-bright, --void, --tab-accent, --accent
   or --accent-rgb, --danger or --health, --warning or --amber, and the tab bar's
   --glass-rim and the design set's --shadow-bar where they are there), so the
   cards follow the palette in Kaizen, Shinpo, Hokyu and djcns.css alike.

   The stack is a clear, see-through layer from 5 px below the top of the page (or
   the foot of the status bar) down to its foot line, which the script sets
   (data-place, --notify-foot). It clips what passes either line: at the bottom a
   card rises out from behind the tab bar; at the top nothing of a card ever
   reaches the very top, where iOS reads the status bar's colour (docs/IPHONE.md).
   It takes no touches itself; only the cards do. */

.notify-stack {
  --notify-gap: 4px;   /* a card at rest, under the stack's top line (TOP_GAP in the script) */
  --notify-lift: 10px; /* a card at rest, above the stack's foot line: the top of the tab bar or a rest timer */
  --notify-width: 440px;
  --notify-height: 44px; /* one line */
  --notify-accent: var(--tab-accent, var(--accent, rgb(var(--accent-rgb))));
  --notify-danger: var(--danger, var(--health, var(--warning)));
  --notify-warning: var(--warning, var(--amber));
  /* The tab bar's glass (navigation/: --panel at 62%), a little denser, so a line
     of words reads over a busy list as the tab bar's labels do. */
  --notify-glass: color-mix(in srgb, var(--panel) 70%, transparent);
  --notify-blur: blur(16px) saturate(185%) brightness(1.06);
  --notify-rim: var(--glass-rim, linear-gradient(160deg,
    color-mix(in srgb, var(--ink) 42%, transparent),
    color-mix(in srgb, var(--ink) 15%, transparent) 34%,
    color-mix(in srgb, var(--ink) 12%, transparent) 64%,
    color-mix(in srgb, var(--ink) 26%, transparent)));
  --notify-spring: cubic-bezier(.2, 1.18, .32, 1);
  --notify-ease: cubic-bezier(.3, 1, .44, 1);
  position: fixed;
  z-index: var(--notify-z, 400);
  inset: max(5px, env(safe-area-inset-top, 0px)) 0 0 0;
  overflow: hidden;
  pointer-events: none;
  /* The popover the stack becomes over a modal dialog: none of the browser's own look. */
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.notify-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A card: a capsule of the tab bar's own glass with the words and, at most, one
   action (DJ, 2026-12-02: no app icon, smaller, cleaner, as Apple's Liquid Glass).
   One line is 44 px, Apple's least tap target, and its ends are fully round, as
   iOS 26's glass is by default; two lines keep the same 22 px corners. It is as
   wide as its words, centred, at most the tab bar's width. The script sets each
   card's width (--notify-w, measured), so a card coming forward or given new
   words grows or shrinks to fit instead of jumping. */
.notify {
  position: absolute;
  top: var(--notify-gap);
  right: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  width: var(--notify-w, fit-content);
  max-width: min(var(--notify-width), calc(100% - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  min-height: var(--notify-height);
  margin-inline: auto;
  padding: 0 18px;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: calc(var(--notify-height) / 2);
  background: var(--notify-glass);
  -webkit-backdrop-filter: var(--notify-blur);
  backdrop-filter: var(--notify-blur);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--ink) 14%, transparent),
    var(--shadow-bar, 0 8px 24px color-mix(in srgb, var(--void) 48%, transparent));
  color: var(--ink);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 560;
  line-height: 20px;
  letter-spacing: -.012em;
  text-transform: none;
  isolation: isolate;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
  transform-origin: 50% 100%;
  will-change: transform; /* its own layer, so the glass blurs what is under it while it rests too */
  transform: translate3d(0, calc(var(--notify-y, 0px) + var(--notify-drag, 0px)), 0) scale(var(--notify-s, 1));
  transition: transform 520ms var(--notify-spring), opacity 220ms ease, width 360ms var(--notify-ease);
}
/* The rim, bright where light would catch it, and a soft sheen across the top: the tab bar's (navigation/). */
.notify::before,
.notify::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.notify::before {
  z-index: 2;
  padding: 1px;
  background: var(--notify-rim);
  -webkit-mask: linear-gradient(var(--ink) 0 0) content-box, linear-gradient(var(--ink) 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(var(--ink) 0 0) content-box exclude, linear-gradient(var(--ink) 0 0);
}
.notify::after {
  z-index: 0;
  background: radial-gradient(120% 110% at 50% -50%, color-mix(in srgb, var(--ink) 12%, transparent), transparent 62%);
}
.notify > * { position: relative; z-index: 1; }
.notify--action { padding-right: 4px; }

/* At the bottom (the default): the stack's foot is the top of the tab bar, or of
   whatever is held to the foot above it (--notify-foot from the script), else the
   home indicator's. A card rests --notify-lift above that line, centred over the
   dock and never wider than it; cards behind peek out above, scaled about their top. */
.notify-stack[data-place="bottom"] { bottom: var(--notify-foot, env(safe-area-inset-bottom, 0px)); }
/* A rest timer appearing or going while cards show: they glide up or down with it. */
.notify-stack.has-notices[data-place="bottom"] { transition: bottom 280ms cubic-bezier(.2, .8, .2, 1); }
.notify-stack[data-place="bottom"] .notify {
  top: auto;
  bottom: var(--notify-lift);
  max-width: min(var(--notify-width), calc(100% - 2 * max(var(--glass-dock-inset, 8px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
  transform-origin: 50% 0;
}
/* While the + menu is open the cards wait under its dimmed layer (navigation/). */
.notify-stack.is-waiting { z-index: calc(var(--z-tabbar, 90) - 1); }
/* Moving between the edges: no transition, so a card starts afresh from the other edge. */
.notify-stack.is-moving .notify { transition: none; }

/* Behind the front card: only its edge shows, a little dimmer, as wide as the front
   card (the script sets that), so the stack reads as one. */
.notify > * { transition: opacity 180ms ease, visibility 180ms; }
.notify:not([data-depth="0"]) { background: color-mix(in srgb, color-mix(in srgb, var(--panel) 90%, var(--ink)) 78%, transparent); }
.notify:not([data-depth="0"]) > * { opacity: 0; visibility: hidden; }
/* While the front card is lifted, the next one shows its words, ready to come forward. */
.notify-stack.is-lifting .notify[data-depth="1"] { background: var(--notify-glass); }
.notify-stack.is-lifting .notify[data-depth="1"] > :not(.notify__close) { opacity: 1; visibility: visible; }
/* Arriving: past the stack's line, out of sight; it springs in from there. Leaving: back past it. */
.notify[data-state="enter"],
.notify[data-state="leave"] { transform: translate3d(0, calc(-100% - 24px), 0); }
.notify-stack[data-place="bottom"] .notify[data-state="enter"],
.notify-stack[data-place="bottom"] .notify[data-state="leave"] { transform: translate3d(0, calc(100% + 48px), 0); }
.notify[data-state="leave"] { transition: transform 320ms cubic-bezier(.45, 0, .85, .4), opacity 320ms ease; }
.notify[data-state="fade"] { opacity: 0; transition: opacity 240ms ease, transform 240ms ease; }
.notify.is-dragging { transition: none; }

/* "error" and "warning": a small round red or amber "!" before the words. Nothing else carries a mark.
   The "!" is drawn here, not written in the card, so the card's text is its words alone (1.2.1). */
.notify__mark {
  display: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--notify-danger);
  color: var(--void);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.notify__mark::before { content: "!"; }
.notify[data-tone] .notify__mark { display: block; }
.notify[data-tone="warning"] .notify__mark { background: var(--notify-warning); }

.notify__text { display: grid; min-width: 0; flex: 1 1 auto; padding-block: 12px; gap: 1px; overflow-wrap: anywhere; }
.notify__title { font-weight: 650; }
.notify__title[hidden] { display: none; }
.notify__title:not([hidden]) + .notify__body { color: var(--muted-bright, var(--muted)); font-weight: 450; }

/* The action: words in the accent, as Mail's Undo Send and every snackbar's, the
   card's full height to press; pressed, a soft capsule of the accent shows. */
.notify__action {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 64px;
  min-height: var(--notify-height);
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--notify-accent);
  font: inherit;
  font-weight: 650;
  letter-spacing: -.012em;
  text-transform: none;
  cursor: pointer;
  touch-action: none;
}
.notify__action::before {
  position: absolute;
  z-index: -1;
  inset: 5px 0;
  border-radius: 999px;
  content: "";
  transition: background-color 160ms ease;
}
.notify__action[hidden] { display: none; }
.notify__action:active::before { background: color-mix(in srgb, var(--notify-accent) 18%, transparent); }
.notify__action:focus-visible { outline: 2px solid var(--notify-accent); outline-offset: -3px; }
.notify__close:focus-visible { outline: 2px solid var(--notify-accent); outline-offset: 2px; }

/* The ruler the script measures a card's width with: never seen. */
.notify[data-ruler] { width: fit-content; visibility: hidden; transition: none; }

/* The round ×: with a mouse, on the card's corner while it is pointed at or has the
   focus, as on a Mac. A finger swipes or taps instead. */
.notify > .notify__close {
  position: absolute;
  z-index: 3;
  top: -6px;
  left: -6px;
  display: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 50%;
  background: var(--panel-bright, var(--panel));
  color: var(--muted-bright);
  cursor: pointer;
  opacity: 0;
}
.notify__close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) {
  .notify > .notify__close { display: grid; }
  .notify:hover .notify__close,
  .notify:focus-within .notify__close { opacity: 1; }
  .notify { cursor: pointer; }
}

@media (min-width: 900px) {
  .notify-stack { --notify-width: 400px; --notify-lift: 24px; inset-block-start: max(12px, env(safe-area-inset-top, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .notify-stack.has-notices[data-place="bottom"] { transition: none; }
  .notify,
  .notify[data-state="leave"],
  .notify[data-state="fade"] { transition: opacity 160ms ease; }
  .notify[data-state="enter"],
  .notify[data-state="leave"],
  .notify-stack[data-place="bottom"] .notify[data-state="enter"],
  .notify-stack[data-place="bottom"] .notify[data-state="leave"] {
    opacity: 0;
    transform: translate3d(0, calc(var(--notify-y, 0px) + var(--notify-drag, 0px)), 0) scale(var(--notify-s, 1));
  }
  .notify.is-dragging { transition: none; }
}
