/* Intrinsic block sizing is explicit: WebKit otherwise stretches an open
   popover grid and its toast to viewport height. No modal/backdrop styling. */
.tx-notifications {
  position: fixed;
  inset: max(16px, env(safe-area-inset-top)) auto auto 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  height: max-content;
  block-size: max-content;
  min-height: 0;
  max-height: min(320px, calc(100dvh - 48px));
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #edf4f7;
  overflow: auto;
  overscroll-behavior: contain;
}
.tx-notifications:popover-open { display: flex; }
.tx-notifications[hidden], .tx-notifications:empty,
.tx-notification[hidden] { display: none; }
.tx-notifications::backdrop {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}
.tx-notification {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  height: auto;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #34454b;
  border-radius: 12px;
  background: #111d23f5;
  box-shadow: 0 5px 18px #0005;
  pointer-events: auto;
  animation: tx-enter .16s ease-out;
  font: 13px/1.4 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.tx-notification > div { flex: 1; min-width: 0; }
.tx-notification strong, .tx-notification small { display: block; }
.tx-notification small {
  font-variant-numeric: tabular-nums;
  color: #9fb0ba;
  margin-top: 3px;
  max-height: 84px;
  overflow: auto;
}
.tx-notification button {
  flex-shrink: 0;
  margin-left: auto;
  padding: 5px 8px;
  background: transparent;
  border: 0;
  color: #aabac1;
  cursor: pointer;
}
.tx-icon { flex-shrink: 0; font-size: 22px; color: #b6f36b; }
.tx-notification[data-state=failed] .tx-icon { color: #f17489; }
.tx-spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid #3e5046;
  border-top-color: #b6f36b;
  border-radius: 50%;
  animation: tx-spin .7s linear infinite;
}
@keyframes tx-spin { to { transform: rotate(360deg); } }
@keyframes tx-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tx-spinner, .tx-notification { animation: none; }
}
