/* DiesRent UI kit — dialogs, prompts, loading and toasts (assets/js/ui.js → window.DRUI).
   Self-contained (also used by the super admin, which does not load base.css). Light by default;
   follows html[data-theme="dark"]. Sharp corporate geometry: radius tokens from base.css with fallbacks. */
.drui-layer, .drui-toasts {
  --u-bg: #fff; --u-soft: #f7f8fb; --u-sunken: #f1f2f7; --u-ink: #0b1020; --u-text: #3d4559; --u-muted: #6b7286; --u-faint: #9aa0b2;
  --u-line: #e6e8f0; --u-line-2: #d9dce8; --u-line-3: #c4c9d8;
  --u-primary: #4f46e5; --u-primary-600: #4338ca; --u-primary-700: #3730a3; --u-on-primary: #fff;
  --u-success: #16a34a; --u-danger: #dc2626; --u-warning: #d97706; --u-info: #0284c7;
  --u-grad: var(--p-grad, linear-gradient(120deg, #4f46e5 0%, #7c3aed 45%, #06b6d4 100%));
  --u-grad-btn: var(--p-grad-btn, linear-gradient(105deg, #4338ca 0%, #5b3bdc 38%, #6d28d9 62%, #0e7490 100%));
  --u-r-xs: var(--p-r-xs, 2px); --u-r-sm: var(--p-r-sm, 4px); --u-r: var(--p-r, 6px); --u-r-lg: var(--p-r-lg, 8px); --u-r-xl: var(--p-r-xl, 10px);
  --u-font: var(--p-font, var(--a-font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
  --u-head: var(--p-font-head, var(--u-font));
  --u-mono: var(--p-font-mono, var(--a-mono, ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace));
  --u-ease: cubic-bezier(.16, 1, .3, 1);
  --u-shadow: 0 0 0 1px rgb(11 16 32 / .05), 0 1px 2px rgb(11 16 32 / .06), 0 16px 32px -12px rgb(11 16 32 / .2), 0 44px 88px -28px rgb(11 16 32 / .38);
  --u-toast-shadow: 0 0 0 1px rgb(11 16 32 / .02), 0 1px 2px rgb(11 16 32 / .06), 0 12px 28px -10px rgb(11 16 32 / .2), 0 28px 56px -24px rgb(11 16 32 / .22);
  --u-backdrop: rgb(7 10 22 / .5);
  --u-highlight: inset 0 1px 0 rgb(255 255 255 / .7);
  --tone: var(--u-primary);
  font-family: var(--u-font); font-size: 15px; line-height: 1.5; color: var(--u-text); text-align: left;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
html[data-theme="dark"] .drui-layer, html[data-theme="dark"] .drui-toasts {
  color-scheme: dark;
  --u-bg: #121318; --u-soft: #16171d; --u-sunken: #0e0f13; --u-ink: #f3f4f6; --u-text: #cfd2da; --u-muted: #9196a3; --u-faint: #6b7080;
  --u-line: #23252d; --u-line-2: #2e313b; --u-line-3: #3b3f4b;
  --u-primary: #7c7cf8; --u-primary-600: #8f8ffa; --u-primary-700: #a5a5fb; --u-on-primary: #0b0c0f;
  --u-success: #4ade80; --u-danger: #f87171; --u-warning: #fbbf24; --u-info: #38bdf8;
  --u-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 2px 6px rgb(0 0 0 / .4), 0 30px 80px -20px rgb(0 0 0 / .75);
  --u-toast-shadow: 0 0 0 1px rgb(255 255 255 / .03), 0 2px 6px rgb(0 0 0 / .35), 0 20px 48px -16px rgb(0 0 0 / .7);
  --u-backdrop: rgb(0 0 0 / .62);
  --u-highlight: inset 0 1px 0 rgb(255 255 255 / .04);
}
.drui-layer *, .drui-layer *::before, .drui-layer *::after, .drui-toasts *, .drui-toasts *::before, .drui-toasts *::after { box-sizing: border-box; }

/* page scroll lock while a dialog is open (padding compensation is set inline by ui.js) */
html.drui-lock { overflow: hidden; }

.drui-svg { display: block; width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

/* ---------------------------------------------------------------- layer + backdrop */
.drui-layer { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow: hidden; }
.drui-backdrop {
  position: absolute; inset: 0; background: var(--u-backdrop);
  -webkit-backdrop-filter: blur(6px) saturate(118%); backdrop-filter: blur(6px) saturate(118%);
  opacity: 0; transition: opacity .26s ease;
}
.drui-layer ~ .drui-layer .drui-backdrop { background: rgb(7 10 22 / .24); -webkit-backdrop-filter: none; backdrop-filter: none; }
.drui-layer.is-open .drui-backdrop { opacity: 1; }
.drui-layer.is-closing { pointer-events: none; }
.drui-layer.is-closing .drui-backdrop { opacity: 0; transition-duration: .2s; }

/* ---------------------------------------------------------------- panel */
.drui-panel {
  --w: 560px;
  position: relative; display: flex; flex-direction: column; width: min(var(--w), 100%);
  max-height: calc(100vh - 48px); max-height: min(calc(100dvh - 48px), 900px);
  background: var(--u-bg); color: var(--u-text); border-radius: var(--u-r-lg); box-shadow: var(--u-shadow);
  overflow: hidden; outline: 0;
  opacity: 0; transform: translateY(14px) scale(.975);
  transition: opacity .2s ease, transform .4s var(--u-ease);
}
.drui-panel:focus, .drui-panel:focus-visible { outline: 0; border-radius: var(--u-r-lg); }
.drui-xs { --w: 340px; } .drui-sm { --w: 448px; } .drui-md { --w: 580px; } .drui-lg { --w: 780px; } .drui-xl { --w: 1000px; }
.drui-layer.is-open .drui-panel { opacity: 1; transform: none; }
.drui-layer.is-closing .drui-panel { opacity: 0; transform: translateY(6px) scale(.985); transition: opacity .16s ease, transform .2s ease; }
.drui-layer.is-under .drui-panel { opacity: .55; transform: translateY(-10px) scale(.955); }
.drui-panel.is-nudge { animation: drui-nudge .34s var(--u-ease); }
@keyframes drui-nudge { 0%, 100% { transform: none; } 35% { transform: scale(1.022); } 70% { transform: scale(.996); } }

/* tone: top hairline accent + faint radial wash behind the header */
.drui-panel.is-primary { --tone: var(--u-primary); } .drui-panel.is-success { --tone: var(--u-success); }
.drui-panel.is-danger { --tone: var(--u-danger); } .drui-panel.is-warning { --tone: var(--u-warning); } .drui-panel.is-info { --tone: var(--u-info); }
.drui-panel:not(.is-bare) { background: radial-gradient(560px 190px at 0 0, color-mix(in srgb, var(--tone) 7%, transparent), transparent 72%) no-repeat, var(--u-bg); }
.drui-panel.is-center { background: radial-gradient(420px 200px at 50% 0, color-mix(in srgb, var(--tone) 8%, transparent), transparent 72%) no-repeat, var(--u-bg); }
.drui-panel::before { content: ""; position: absolute; z-index: 3; inset: 0 0 auto; height: 2px; background: var(--tone); pointer-events: none; }
.drui-panel.is-primary::before { background: var(--u-grad); }
.drui-panel.is-bare::before { display: none; }

.drui-grab { display: none; flex: none; width: 36px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--u-line-2); }

/* ---------------------------------------------------------------- header */
.drui-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; flex: none; padding: 24px 24px 0; }
.drui-head.has-ico { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.drui-panel.has-x .drui-head { padding-right: 60px; }
.drui-ico {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--u-r);
  color: var(--tone); background: color-mix(in srgb, var(--tone) 9%, var(--u-bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 26%, transparent), 0 0 0 5px color-mix(in srgb, var(--tone) 6%, transparent), var(--u-highlight);
}
.drui-ico .drui-svg { width: 22px; height: 22px; stroke-width: 1.8; }
.drui-ico::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--tone); opacity: 0; pointer-events: none; }
.drui-htxt { min-width: 0; padding-top: 1px; }
.drui-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font: 600 max(11px, .6875rem)/1.2 var(--u-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--u-muted); }
.drui-kicker::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 1px; background: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 16%, transparent); }
.drui-title { margin: 0; font: 700 1.0625rem/1.35 var(--u-head); letter-spacing: -.016em; color: var(--u-ink); text-wrap: balance; overflow-wrap: anywhere; }
.drui-desc { margin: 6px 0 0; font-size: .9rem; line-height: 1.62; color: var(--u-muted); white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }
.drui-title + .drui-desc { margin-top: 6px; }
.drui-desc p + p { margin-top: 8px; }
.drui-desc a { color: var(--u-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.drui-desc strong, .drui-desc b { color: var(--u-ink); font-weight: 600; }
.drui-desc code { padding: 1px 5px; border: 1px solid var(--u-line); border-radius: var(--u-r-xs); background: var(--u-soft); font: 500 .82em/1.4 var(--u-mono); color: var(--u-ink); }

/* centered variant (alerts) */
.drui-panel.is-center .drui-head { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 34px 32px 0; }
.drui-panel.is-center .drui-ico { width: 56px; height: 56px; margin-bottom: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 26%, transparent), 0 0 0 7px color-mix(in srgb, var(--tone) 6%, transparent), var(--u-highlight); }
.drui-panel.is-center .drui-ico .drui-svg { width: 28px; height: 28px; stroke-width: 1.7; }
.drui-panel.is-center .drui-kicker { justify-content: center; }
.drui-panel.is-center .drui-title { font-size: 1.1875rem; }
.drui-panel.is-center .drui-desc { max-width: 36ch; margin-inline: auto; }

/* ---------------------------------------------------------------- body */
.drui-body { flex: 1 1 auto; min-height: 0; padding: 20px 24px 0; overflow: auto; overscroll-behavior: contain; color: var(--u-text); font-size: .92rem; line-height: 1.6; scrollbar-width: thin; scrollbar-color: var(--u-line-3) transparent; }
.drui-head + .drui-body { padding-top: 18px; }
.drui-head.has-ico + .drui-body { padding-left: 84px; }
.drui-panel.is-prompt .drui-head.has-ico + .drui-body { padding-left: 24px; }
.drui-grab + .drui-body { padding-top: 24px; }
.drui-panel.has-x > .drui-grab + .drui-body { padding-right: 56px; }
.drui-panel:not(.is-bare):not(:has(.drui-foot)) > .drui-body:last-child { padding-bottom: 24px; }
.drui-panel.is-bare > .drui-body, .drui-panel.is-bare.has-x > .drui-grab + .drui-body { padding: 0; }
/* a page element shown inside a bare dialog: drop its own card chrome (DRUI provides it) */
.drui-adopted { width: auto !important; max-width: none !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }

/* ---------------------------------------------------------------- footer + actions */
.drui-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; margin-top: 24px; padding: 14px 24px; background: var(--u-soft); border-top: 1px solid var(--u-line); }
.drui-hint { display: inline-flex; align-items: center; gap: 7px; font: 500 .75rem/1 var(--u-mono); letter-spacing: .02em; color: var(--u-muted); white-space: nowrap; }
.drui-hint kbd { display: inline-grid; place-items: center; min-width: 30px; height: 21px; padding: 0 6px; border: 1px solid var(--u-line-2); border-bottom-width: 2px; border-radius: var(--u-r-sm); background: var(--u-bg); font: 600 max(11px, .6875rem)/1 var(--u-mono); color: var(--u-ink); }
.drui-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.drui-panel.is-center .drui-foot { margin-top: 28px; padding: 16px 24px; }
.drui-panel.is-center .drui-actions { width: 100%; }
.drui-panel.is-center .drui-actions .drui-btn { flex: 1 1 0; }

/* buttons — mirrors .p-btn (base.css) so dialogs look identical in the admin, which has no base.css */
.drui-btn {
  --b-bg: var(--u-bg); --b-bg-h: var(--u-soft); --b-fg: var(--u-ink); --b-bd: var(--u-line-2); --b-bd-h: var(--u-line-3);
  --b-sh: 0 1px 2px rgb(16 24 40 / .06), inset 0 -1px 0 rgb(16 24 40 / .04);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--b-bd); border-radius: var(--u-r);
  background: var(--b-bg); color: var(--b-fg); box-shadow: var(--b-sh);
  font: 650 .875rem/1.2 var(--u-font); letter-spacing: -.006em; white-space: nowrap; text-align: center; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .2s ease, transform .12s ease, opacity .16s;
}
.drui-btn:hover { background: var(--b-bg-h); border-color: var(--b-bd-h); }
.drui-btn:active { transform: translateY(1px); }
.drui-btn:focus-visible { outline: 2px solid var(--u-primary); outline-offset: 2px; border-radius: var(--u-r); }
.drui-btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.drui-btn.is-loading { opacity: 1; cursor: progress; }
.drui-btn.is-loading > span { visibility: hidden; }
.drui-btn.is-loading::after { content: ""; position: absolute; inset: 0; width: 16px; height: 16px; margin: auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drui-spin .7s linear infinite; }
.drui-btn--primary { --b-bg: var(--u-primary); --b-bg-h: var(--u-primary-600); --b-fg: var(--u-on-primary); --b-bd: var(--u-primary-600); --b-bd-h: var(--u-primary-700); --b-sh: inset 0 1px 0 rgb(255 255 255 / .18), 0 1px 2px rgb(30 27 75 / .28), 0 8px 18px -10px rgb(79 70 229 / .7); }
.drui-btn--grad { --b-bg: var(--u-grad-btn); --b-bg-h: var(--u-grad-btn); --b-fg: #fff; --b-bd: transparent; --b-bd-h: transparent; --b-sh: inset 0 1px 0 rgb(255 255 255 / .24), 0 1px 2px rgb(30 27 75 / .35), 0 10px 24px -12px rgb(109 40 217 / .75); }
.drui-btn--grad:hover { filter: brightness(1.06); }
.drui-btn--danger { --b-bg: #dc2626; --b-bg-h: #b91c1c; --b-fg: #fff; --b-bd: #b91c1c; --b-bd-h: #991b1b; --b-sh: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px rgb(127 29 29 / .3), 0 8px 18px -10px rgb(220 38 38 / .6); }
.drui-btn--danger:focus-visible { outline-color: #dc2626; }
.drui-btn--success { --b-bg: #15803d; --b-bg-h: #166534; --b-fg: #fff; --b-bd: #166534; --b-bd-h: #14532d; --b-sh: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px rgb(20 83 45 / .3); }
.drui-btn--dark { --b-bg: var(--u-ink); --b-bg-h: color-mix(in srgb, var(--u-ink) 86%, var(--u-bg)); --b-fg: var(--u-bg); --b-bd: var(--u-ink); --b-bd-h: transparent; --b-sh: inset 0 1px 0 rgb(255 255 255 / .12), 0 1px 2px rgb(11 16 32 / .3); }
.drui-btn--soft { --b-bg: color-mix(in srgb, var(--u-primary) 9%, var(--u-bg)); --b-bg-h: color-mix(in srgb, var(--u-primary) 15%, var(--u-bg)); --b-fg: var(--u-primary-600); --b-bd: color-mix(in srgb, var(--u-primary) 18%, transparent); --b-bd-h: color-mix(in srgb, var(--u-primary) 30%, transparent); --b-sh: none; }
.drui-btn--link { --b-bg: transparent; --b-bg-h: transparent; --b-bd: transparent; --b-bd-h: transparent; --b-fg: var(--u-primary); --b-sh: none; padding-inline: 6px; }
.drui-btn--link:hover { text-decoration: underline; text-underline-offset: 4px; }
html[data-theme="dark"] .drui-btn--primary { --b-sh: inset 0 1px 0 rgb(255 255 255 / .22), 0 1px 2px rgb(0 0 0 / .4); }

/* close button */
.drui-x { position: absolute; z-index: 4; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--u-r-sm); background: transparent; color: var(--u-muted); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.drui-x:hover { background: var(--u-soft); border-color: var(--u-line); color: var(--u-ink); }
.drui-x:focus-visible { outline: 2px solid var(--u-primary); outline-offset: 1px; border-radius: var(--u-r-sm); }
.drui-x .drui-svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- prompt field */
.drui-field { display: grid; gap: 7px; }
.drui-label { font: 600 .8125rem/1.3 var(--u-font); color: var(--u-ink); }
.drui-input {
  width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid var(--u-line-2); border-radius: var(--u-r);
  background: var(--u-bg); color: var(--u-ink); font: 500 .9375rem/1.4 var(--u-font); box-shadow: inset 0 1px 1px rgb(16 24 40 / .03);
  transition: border-color .16s, box-shadow .16s; appearance: none; -webkit-appearance: none;
}
.drui-input::placeholder { color: var(--u-faint); }
.drui-input:hover { border-color: var(--u-line-3); }
.drui-input:focus { outline: 0; border-color: var(--u-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--u-primary) 20%, transparent); }
.drui-input.is-area { min-height: 116px; resize: vertical; }
.drui-input.is-invalid { border-color: var(--u-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--u-danger) 16%, transparent); }
.drui-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 0; }
.drui-meta:empty { display: none; }
.drui-err { display: flex; align-items: center; gap: 7px; margin: 0; font-size: .8rem; font-weight: 550; color: var(--u-danger); }
.drui-err::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }
.drui-err[hidden] { display: none; }
.drui-help { margin: 0; font-size: .78rem; color: var(--u-muted); }
.drui-count { margin-left: auto; font: 500 .72rem/1 var(--u-mono); color: var(--u-muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- loading */
.drui-panel.is-loading { --w: 340px; }
.drui-load { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 22px; overflow: hidden; }
.drui-spin { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--u-primary) 18%, transparent); border-top-color: var(--u-primary); animation: drui-spin .7s linear infinite; }
.drui-load-txt { font: 600 .9rem/1.4 var(--u-font); color: var(--u-ink); }
.drui-load::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42%; height: 2px; background: linear-gradient(90deg, transparent, var(--u-primary), transparent); animation: drui-indet 1.2s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes drui-spin { to { transform: rotate(360deg); } }
@keyframes drui-indet { from { transform: translateX(-100%); } to { transform: translateX(240%); } }

/* ---------------------------------------------------------------- animated glyphs */
.drui-glyph .d1, .drui-glyph .d2, .drui-glyph .d3 { stroke-dasharray: 1; stroke-dashoffset: 0; }
.drui-layer.is-open .drui-glyph .d1 { animation: drui-draw .52s .08s cubic-bezier(.65, 0, .35, 1) both; }
.drui-layer.is-open .drui-glyph .d2 { animation: drui-draw .34s .42s cubic-bezier(.65, 0, .35, 1) both; }
.drui-layer.is-open .drui-glyph .d3 { animation: drui-draw .3s .58s cubic-bezier(.65, 0, .35, 1) both; }
.drui-layer.is-open .drui-glyph .dot { animation: drui-pop .32s .62s var(--u-ease) both; transform-box: fill-box; transform-origin: center; }
.drui-layer.is-open .ico-success .drui-ico::after { animation: drui-ring 1s .7s ease-out both; }
.drui-layer.is-open .ico-error .drui-ico { animation: drui-shake .46s .62s ease both; }
.drui-layer.is-open .ico-warning .drui-ico .drui-svg { animation: drui-tilt .5s .7s ease both; transform-origin: 50% 85%; }
@keyframes drui-draw { from { stroke-dashoffset: 1; opacity: 0; } 12% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes drui-pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes drui-ring { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes drui-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }
@keyframes drui-tilt { 0%, 100% { transform: none; } 30% { transform: rotate(-7deg); } 65% { transform: rotate(5deg); } }

/* ---------------------------------------------------------------- toasts */
.drui-toasts { position: fixed; z-index: 10900; right: 20px; bottom: calc(20px + var(--dr-bottom-offset, 0px)); display: flex; flex-direction: column; gap: 10px; width: min(388px, calc(100vw - 32px)); pointer-events: none; }
.drui-toast {
  --tone: var(--u-info);
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 14px 12px;
  background: var(--u-bg); border: 1px solid var(--u-line); border-radius: var(--u-r-lg); box-shadow: var(--u-toast-shadow);
  color: var(--u-text); font-size: .875rem; line-height: 1.45; overflow: hidden; pointer-events: auto;
  animation: drui-toast-in .44s var(--u-ease) both;
}
.drui-toast.is-success { --tone: var(--u-success); } .drui-toast.is-error { --tone: var(--u-danger); }
.drui-toast.is-warning { --tone: var(--u-warning); } .drui-toast.is-info { --tone: var(--u-info); }
.drui-toast::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--tone); opacity: .9; }
.drui-toast-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--u-r-sm); color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, var(--u-bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 24%, transparent); }
.drui-toast-ico .drui-svg { width: 16px; height: 16px; stroke-width: 2; }
.drui-toast .drui-glyph .d1 { animation: drui-draw .46s .06s cubic-bezier(.65, 0, .35, 1) both; }
.drui-toast .drui-glyph .d2 { animation: drui-draw .3s .32s cubic-bezier(.65, 0, .35, 1) both; }
.drui-toast .drui-glyph .d3 { animation: drui-draw .26s .44s cubic-bezier(.65, 0, .35, 1) both; }
.drui-toast .drui-glyph .dot { animation: drui-pop .3s .46s var(--u-ease) both; transform-box: fill-box; transform-origin: center; }
.drui-toast-txt { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.drui-toast-title { display: block; font-weight: 650; font-size: .875rem; line-height: 1.4; color: var(--u-ink); letter-spacing: -.005em; }
.drui-toast-msg { margin: 0; color: var(--u-ink); font-weight: 500; overflow-wrap: anywhere; }
.drui-toast-title + .drui-toast-msg { margin-top: 2px; color: var(--u-muted); font-weight: 400; font-size: .8125rem; }
.drui-toast-act { flex: none; align-self: center; height: 30px; padding: 0 11px; border: 1px solid var(--u-line-2); border-radius: var(--u-r-sm); background: var(--u-bg); color: var(--u-ink); font: 650 .78rem/1 var(--u-font); cursor: pointer; box-shadow: 0 1px 2px rgb(16 24 40 / .05); transition: background-color .15s, border-color .15s; }
.drui-toast-act:hover { background: var(--u-soft); border-color: var(--u-line-3); }
.drui-toast-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--u-r-sm); background: transparent; color: var(--u-muted); cursor: pointer; transition: background-color .15s, color .15s; }
.drui-toast-x:hover { background: var(--u-soft); color: var(--u-ink); }
.drui-toast-x .drui-svg { width: 14px; height: 14px; }
.drui-toast-act:focus-visible, .drui-toast-x:focus-visible { outline: 2px solid var(--u-primary); outline-offset: 1px; border-radius: var(--u-r-sm); }
.drui-toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--tone) 12%, transparent); }
.drui-toast-bar > i { display: block; height: 100%; background: var(--tone); transform-origin: left center; animation: drui-bar linear forwards; }
.drui-toast.is-out { animation: drui-toast-out .19s ease forwards; pointer-events: none; }
.drui-toast.is-bump { animation: drui-bump .36s var(--u-ease); }
@keyframes drui-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes drui-toast-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes drui-toast-out { to { opacity: 0; transform: translateX(28px) scale(.98); } }
@keyframes drui-bump { 0%, 100% { transform: none; } 40% { transform: scale(1.025); } }

/* ---------------------------------------------------------------- bottom sheet (phones) */
@media (max-width: 559px) {
  .drui-layer { align-items: flex-end; padding: 0; }
  .drui-panel { width: 100%; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); border-radius: var(--u-r-xl) var(--u-r-xl) 0 0; opacity: 1; transform: translateY(105%); transition: transform .44s var(--u-ease), opacity .2s ease; }
  .drui-panel:focus, .drui-panel:focus-visible { border-radius: var(--u-r-xl) var(--u-r-xl) 0 0; }
  .drui-layer.is-closing .drui-panel { opacity: 1; transform: translateY(105%); transition: transform .26s cubic-bezier(.4, 0, 1, 1); }
  .drui-layer.is-under .drui-panel { opacity: .6; transform: translateY(-8px) scale(.95); }
  .drui-panel.is-dragging { transition: none; }
  .drui-panel.is-nudge { animation-name: drui-nudge-sheet; }
  .drui-grab { display: block; }
  .drui-grab, .drui-head { touch-action: none; }
  .drui-head { padding: 16px 20px 0; gap: 14px; }
  .drui-panel.is-center .drui-head { padding: 22px 22px 0; }
  .drui-panel.has-x .drui-head { padding-right: 56px; }
  .drui-ico { width: 40px; height: 40px; }
  .drui-ico .drui-svg { width: 20px; height: 20px; }
  .drui-body { padding-inline: 20px; }
  .drui-head.has-ico + .drui-body { padding-left: 20px; }
  .drui-panel:not(.is-bare):not(:has(.drui-foot)) > .drui-body:last-child { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .drui-foot { margin-top: 20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .drui-hint { display: none; }
  .drui-actions { width: 100%; flex-wrap: nowrap; }
  .drui-actions .drui-btn { flex: 1 1 0; min-height: 46px; }
  .drui-actions.is-many { flex-direction: column-reverse; }
  .drui-input { font-size: 16px; min-height: 46px; }
  .drui-panel.is-bare > .drui-body { padding-bottom: env(safe-area-inset-bottom); }
  .drui-x { top: 10px; right: 10px; }
  .drui-kicker { font: 650 12.5px/1.2 var(--u-font); letter-spacing: 0; text-transform: none; }
  /* the blocking loader stays a compact centered card */
  .drui-layer.is-loading-layer { align-items: center; padding: 16px; }
  .drui-layer.is-loading-layer .drui-panel { width: min(var(--w), 100%); border-radius: var(--u-r-lg); opacity: 0; transform: scale(.97); }
  .drui-layer.is-loading-layer.is-open .drui-panel { opacity: 1; transform: none; }
  .drui-layer.is-loading-layer .drui-grab { display: none; }

  /* above any sticky bottom bar / bottom nav (--dr-bottom-offset, set by assets/js/help.js) */
  .drui-toasts { left: 12px; right: 12px; bottom: calc(12px + max(var(--dr-bottom-offset, 0px), env(safe-area-inset-bottom))); width: auto; }
  .drui-toast { font-size: 15px; }
  .drui-toast-msg { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .drui-toast-title { font-size: 15px; }
  .drui-toast-act { height: 44px; padding: 0 14px; font-size: 14px; }
  .drui-toast-x { width: 44px; height: 44px; margin: -6px -4px -6px 0; }
  .drui-toast.is-out { animation-name: drui-toast-out-sheet; }
  /* a bottom sheet is open: keep toasts clear of its actions */
  html.drui-lock .drui-toasts { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
}
/* touch screens: the close button is a full 44 px target (QA) */
@media (pointer: coarse) {
  .drui-x { width: 44px; height: 44px; top: 6px; right: 6px; }
  .drui-panel.has-x .drui-head { padding-right: 60px; }
}
@keyframes drui-nudge-sheet { 0%, 100% { transform: none; } 40% { transform: translateY(-6px); } }
@keyframes drui-toast-out-sheet { to { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------------------------------------------------------------- motion & print */
@media (prefers-reduced-motion: reduce) {
  .drui-panel, .drui-layer.is-closing .drui-panel, .drui-layer.is-under .drui-panel { transform: none !important; transition: opacity .12s linear !important; }
  .drui-backdrop { transition-duration: .12s !important; }
  .drui-panel.is-nudge, .drui-toast, .drui-toast.is-out, .drui-toast.is-bump, .drui-ico, .drui-ico::after, .drui-ico .drui-svg, .drui-glyph * { animation: none !important; }
  .drui-toast.is-out { opacity: 0; transition: opacity .1s linear; }
  .drui-glyph .d1, .drui-glyph .d2, .drui-glyph .d3 { stroke-dashoffset: 0 !important; }
  .drui-btn, .drui-btn:active { transition: none; transform: none; }
  .drui-spin, .drui-btn.is-loading::after { animation-duration: 1.6s; }
  .drui-load::after { animation: none; width: 100%; opacity: .35; }
}
@media print { .drui-layer, .drui-toasts { display: none !important; } }
