/* Artllum notifications — one design for every toast, confirm dialog and inline message.
   Four tones, each with its own icon + colour so the meaning reads at a glance:
   success (green tick) · error (orange-red stop) · warning (amber triangle) · info (brand blue i) */

.notify-region {
  position: fixed; z-index: 10000; right: 20px; bottom: 20px;
  display: flex; flex-direction: column-reverse; gap: 10px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
@media (max-width: 640px) {
  .notify-region { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

.notify {
  --tone: var(--brand); --tone-soft: var(--brand-soft);
  pointer-events: auto;
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 12px 12px 14px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--tone);
  border-radius: var(--r-1);
  box-shadow: 0 10px 30px rgba(31, 27, 22, .14), 0 1px 3px rgba(31, 27, 22, .08);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.notify.show { opacity: 1; transform: none; }
.notify.leaving { opacity: 0; transform: translateX(16px); }
.notify.success { --tone: var(--ok);     --tone-soft: var(--ok-soft); }
.notify.error   { --tone: var(--signal); --tone-soft: var(--signal-soft); }
.notify.warning { --tone: #b07400;       --tone-soft: var(--warn-soft); }
.notify.info    { --tone: var(--brand);  --tone-soft: var(--brand-soft); }

.notify-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--tone-soft); color: var(--tone);
}
.notify-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.notify-body { min-width: 0; padding-top: 3px; }
.notify-title { font-weight: 700; font-size: 14px; margin: 0 0 2px; color: var(--ink); }
.notify-msg { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.notify-title + .notify-msg { font-size: 13px; }
.notify-ref { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.notify-ref code { font-family: var(--code); font-size: 12px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; user-select: all; }
.notify-action {
  margin-top: 8px; display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
  background: var(--tone); color: #fff; text-decoration: none;
}
.notify.warning .notify-action { color: #fff; }
.notify-action:hover { filter: brightness(.92); }
.notify-close {
  width: 28px; height: 28px; border: 0; background: none; border-radius: 8px; cursor: pointer;
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
}
.notify-close:hover { background: var(--sunk); color: var(--ink); }
.notify-close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.notify-bar { grid-column: 1 / -1; height: 3px; margin: 6px -12px -12px -14px; background: var(--sunk); border-radius: 0 0 var(--r-1) 0; overflow: hidden; }
.notify-bar span { display: block; height: 100%; background: var(--tone); opacity: .5; transform-origin: left; }

/* ---------- Confirm / alert dialog ---------- */
.notify-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(31, 27, 22, .42);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .18s var(--ease);
}
.notify-overlay.show { opacity: 1; }
.notify-dialog {
  --tone: var(--brand); --tone-soft: var(--brand-soft);
  width: min(440px, 100%); background: var(--paper); color: var(--ink);
  border-radius: var(--r-2); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(31, 27, 22, .25);
  padding: 22px 22px 18px; font-family: var(--font);
  transform: translateY(8px) scale(.98); transition: transform .2s var(--ease);
}
.notify-overlay.show .notify-dialog { transform: none; }
.notify-dialog.danger  { --tone: var(--signal); --tone-soft: var(--signal-soft); }
.notify-dialog.warning { --tone: #b07400;       --tone-soft: var(--warn-soft); }
.notify-dialog.success { --tone: var(--ok);     --tone-soft: var(--ok-soft); }
.notify-dialog-head { display: flex; gap: 12px; align-items: flex-start; }
.notify-dialog .notify-icon { width: 40px; height: 40px; flex-shrink: 0; }
.notify-dialog .notify-icon svg { width: 20px; height: 20px; }
.notify-dialog h2 { font-family: var(--display); font-size: 18px; font-weight: 600; margin: 8px 0 0; line-height: 1.3; }
.notify-dialog p { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); white-space: pre-line; }
.notify-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.notify-btn {
  height: 40px; padding: 0 18px; border-radius: var(--r-1); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
}
.notify-btn:hover { background: var(--sunk); }
.notify-btn.primary { background: var(--tone); border-color: var(--tone); color: #fff; }
.notify-btn.primary:hover { filter: brightness(.92); background: var(--tone); }
@media (max-width: 480px) {
  .notify-dialog-actions { flex-direction: column-reverse; }
  .notify-btn { width: 100%; }
}

/* ---------- Inline messages (forms) — same tones as the toasts ---------- */
.alert {
  display: none; position: relative;
  font-size: 13px; line-height: 1.5;
  border-radius: var(--r-1); padding: 10px 12px 10px 38px; margin-bottom: var(--s-4);
  border: 1px solid; border-left-width: 4px;
}
.alert.show { display: block; }
.alert::before {
  content: ''; position: absolute; left: 12px; top: 11px; width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: var(--alert-icon) center / contain no-repeat; mask: var(--alert-icon) center / contain no-repeat;
}
.alert-err  { background: var(--signal-soft); border-color: #f2c4ad; border-left-color: var(--signal); color: #8f2414;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E"); }
.alert-ok   { background: var(--ok-soft); border-color: #b9e0c4; border-left-color: var(--ok); color: #116b32;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.alert-warn { background: var(--warn-soft); border-color: #ecd49c; border-left-color: #b07400; color: var(--warn);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4L2.8 20h18.4z'/%3E%3Cpath d='M12 10v4M12 17v.01'/%3E%3C/svg%3E"); }
.alert-info { background: var(--brand-soft); border-color: #c7d2ef; border-left-color: var(--brand); color: var(--brand-ink);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.5v.01'/%3E%3C/svg%3E"); }
.alert a { color: inherit; font-weight: 700; }
