/* Inline SVG icons — scale with text, prevent stacking in buttons.
   HTML width="24" height="24" provides fallback; CSS overrides to em-based. */
svg.icon {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
}

/* Semantic text colors */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

/* HTMX/idiomorph transitions */
.htmx-swapping { opacity: 0; transition: opacity 0.15s ease-out; }
.htmx-settling { opacity: 1; transition: opacity 0.15s ease-in; }

/* Cloak hidden elements until anvil.js initializes */
[data-cloak] { display: none !important; }

/* HTMX request progress bar — hidden via HTML hidden attribute by default,
   shown by JS adding .active class during HTMX requests. */
#anvil-progress.active {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 10000;
  margin: 0;
  border: none;
  border-radius: 0;
  pointer-events: none;
}

/* Toast notification area */
#anvil-toast {
  position: fixed; bottom: 1rem; right: 1rem;
  z-index: 9999; max-width: 400px;
}
#anvil-toast > div {
  padding: 0.75rem 1rem; margin-top: 0.5rem;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: anvil-toast-in 0.2s ease-out;
}
#anvil-toast > div.error {
  border-color: var(--danger);
  color: var(--danger);
}
@keyframes anvil-toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}
