/* Installable app: iOS "Add to Home Screen" sheet, learner home tip and
   "Alerts on this device" status. Linked from notifications/_pwa_head.html
   (kept out of tailwind.css so it needs no CSS build). Tokens only. */

[data-pwa-install][hidden], [data-pwa-home][hidden], .pwa-sheet[hidden] { display: none !important; }
button.ui-menu-item { border: 0; background: transparent; cursor: pointer; text-align: left; }

/* ---------- Sheet ---------- */
html.pwa-sheet-open { overflow: hidden; }
.pwa-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.pwa-sheet-scrim { position: absolute; inset: 0; background: var(--surface-overlay); }
.pwa-sheet-card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface-base); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  font-family: var(--font-sans);
}
.pwa-sheet-card:focus { outline: none; }
@media (min-width: 641px) {
  .pwa-sheet { align-items: center; padding: 24px; }
  .pwa-sheet-card { border-radius: var(--radius-lg); padding-bottom: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .pwa-sheet:not([hidden]) .pwa-sheet-card { animation: pwa-rise var(--dur-base, 200ms) var(--ease-out, ease-out); }
  @keyframes pwa-rise { from { transform: translateY(16px); opacity: 0; } }
}
.pwa-sheet-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.pwa-sheet-ic, .pwa-tip-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-sm); background: var(--brand-secondary-soft, var(--surface-sunken)); color: var(--st-accent-ink, var(--brand-deep));
}
.pwa-sheet-title { margin: 0; font: 600 var(--fs-lg)/1.3 var(--font-sans); letter-spacing: var(--tracking-tight); }
.pwa-sheet-x { width: 36px; height: 36px; }
.pwa-sheet-lead { margin: 12px 0 0; font-size: var(--fs-md); line-height: 1.5; color: var(--text-secondary); }
.pwa-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.pwa-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; font-size: var(--fs-md); line-height: 1.5; }
.pwa-step-n {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: -3px;
  border-radius: var(--radius-full); background: var(--surface-sunken); color: var(--text-primary);
  font: 600 var(--fs-sm)/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
.pwa-steps b { font-weight: 600; }
.pwa-glyph { margin: 0 2px; color: var(--info-solid); }
.pwa-sheet-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); line-height: 1.45; color: var(--text-muted); }
.pwa-sheet-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 640px) { .pwa-sheet-actions .ui-btn { width: 100%; justify-content: center; min-height: 44px; } }

/* ---------- Learner home tip ---------- */
[data-pwa-home] { grid-column: 1 / -1; }
.pwa-tip {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; margin-bottom: 16px; padding: 14px 16px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-base); box-shadow: var(--shadow-xs);
}
.pwa-tip-title { margin: 0; font: 600 var(--fs-md)/1.3 var(--font-sans); color: var(--text-primary); }
.pwa-tip-text { margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-secondary); }
.pwa-tip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.pwa-textbtn {
  display: inline-flex; align-items: center; padding: 4px 6px; margin: -4px -6px; border: 0; background: transparent;
  border-radius: var(--radius-xs); font: 600 var(--fs-sm)/1.2 var(--font-sans); color: var(--text-secondary); cursor: pointer;
}
.pwa-textbtn:hover { background: var(--surface-sunken); color: var(--text-primary); }

/* ---------- Alerts on this device (inbox) ---------- */
.nt-device-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.nt-device-pill[hidden] { display: none; }
.nt-device-chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.nt-device-chip[hidden] { display: none; }
.nt-device-chip:hover { filter: brightness(0.97); }
.nt-device-error { color: var(--danger-fg); }
.nt-device-error[hidden] { display: none; }
