/* Reusable notification material, color and motion tokens. */
:root{
  --glass-alpha-light:.84;--glass-alpha-dark:.86;--glass-alpha:var(--glass-alpha-light);
  --toast-surface:rgba(255,255,255,var(--glass-alpha));--toast-solid:#fafbfc;--toast-text:#172333;
  --toast-detail:#243146;--toast-border:rgba(35,47,64,.13);--toast-highlight:rgba(255,255,255,.88);
  --glass-rim-width:1px;
  --glass-rim:linear-gradient(135deg,rgba(255,255,255,.96) 0%,rgba(255,255,255,.54) 26%,rgba(172,186,208,.12) 53%,rgba(88,109,139,.18) 74%,rgba(255,255,255,.70) 100%);
  --glass-rim-shadow:inset 0 1px 0 rgba(255,255,255,.86),inset 0 -1px 0 rgba(67,84,108,.045);
  --glass-shadow-float:0 2px 6px rgba(16,24,40,.055),0 14px 40px rgba(16,24,40,.12);
  --glass-shadow-panel:0 4px 12px rgba(16,24,40,.065),0 24px 64px rgba(16,24,40,.17);
  --glass-shadow-card:0 1px 2px rgba(16,24,40,.035);
  --toast-shadow:var(--glass-shadow-float);
  --toast-subtle:rgba(32,45,65,.055);--toast-hover:rgba(32,45,65,.09);
  --toast-accent:var(--accent,#245bd7);--toast-accent-text:#fff;
  --toast-success:#1a623d;--toast-error:#b72437;--toast-warning:#795111;--toast-info:#254b92;
  --toast-radius:20px;--toast-history-radius:16px;--toast-gap:10px;--toast-blur:16px;--toast-close-size:44px;
  --toast-enter:240ms;--toast-exit:180ms;--toast-feedback:140ms;
  --toast-ease:cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"]{
  --glass-alpha:var(--glass-alpha-dark);
  --toast-surface:rgba(10,16,24,var(--glass-alpha));--toast-solid:#232a35;--toast-text:#ffffff;
  --toast-detail:#f8faff;--toast-border:rgba(235,242,255,.10);--toast-highlight:rgba(255,255,255,.075);
  --glass-rim:linear-gradient(135deg,rgba(255,255,255,.22) 0%,rgba(224,235,255,.07) 28%,rgba(255,255,255,.025) 55%,rgba(4,8,14,.42) 76%,rgba(224,235,255,.12) 100%);
  --glass-rim-shadow:inset 0 1px 0 rgba(240,246,255,.07),inset 0 -1px 0 rgba(0,0,0,.30);
  --glass-shadow-float:0 3px 10px rgba(0,0,0,.20),0 18px 46px rgba(0,0,0,.30);
  --glass-shadow-panel:0 4px 14px rgba(0,0,0,.20),0 24px 64px rgba(0,0,0,.38);
  --glass-shadow-card:0 1px 3px rgba(0,0,0,.12);
  --toast-shadow:var(--glass-shadow-float);
  --toast-subtle:rgba(232,240,255,.065);--toast-hover:rgba(232,240,255,.08);
  --toast-accent:#9cbdff;--toast-accent-text:#18263f;
  --toast-success:#7dd4a0;--toast-error:#ff9fa8;--toast-warning:#e4c079;--toast-info:#a5c2ff;
}
.op-toaster{font-family:inherit;pointer-events:none;isolation:isolate;}
.op-toast-list{position:relative;margin:0;padding:0;list-style:none;transition:height var(--toast-enter) var(--toast-ease);}
.op-toast-slot{pointer-events:none;position:absolute;top:0;left:0;width:100%;box-sizing:border-box;transform-origin:top center;
  transition:opacity var(--toast-exit) ease;
  will-change:transform,opacity;list-style:none;}
.op-toast-slot[data-behind="true"]{height:var(--toast-front-height);overflow:hidden;border-radius:var(--toast-radius);}
.op-toast-slot[data-behind="true"] .op-toast-size,.op-toast-slot[data-behind="true"] .op-toast-size *,
.op-toast-slot[data-exiting="true"] .op-toast-size,.op-toast-slot[data-exiting="true"] .op-toast-size *{pointer-events:none!important;}
.op-toast-motion{pointer-events:auto;border-radius:var(--toast-radius);transform-origin:top center;will-change:transform,opacity;}
.op-toast-size{border-radius:var(--toast-radius);}
.op-toast[data-removing="true"]{overflow:hidden;pointer-events:auto;}
.op-toast[data-removing="true"] .op-toast-interior,.op-toast[data-removing="true"] .op-toast-interior *{pointer-events:none!important;}
.op-toast,.op-notice-surface,.ukpop.op-toast-menu{box-sizing:border-box;border:1px solid var(--toast-border);
  border-radius:var(--toast-radius);background:var(--toast-solid);color:var(--toast-text);
  box-shadow:var(--toast-shadow),var(--glass-rim-shadow);}
.op-toast{position:relative;width:100%;padding:15px 15px 13px;
  pointer-events:auto;overflow-wrap:anywhere;text-align:left;max-height:var(--toast-card-max, 80vh);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;min-width:0;}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .op-toast,.op-notice-surface,.ukpop.op-toast-menu{background:var(--toast-surface);backdrop-filter:blur(var(--toast-blur)) saturate(115%);-webkit-backdrop-filter:blur(var(--toast-blur)) saturate(115%);}
}
.op-toast[data-in-history="true"],.op-notice-surface{box-shadow:var(--glass-shadow-card),var(--glass-rim-shadow);border-radius:var(--toast-history-radius);}
.op-notice-surface{position:relative;}
/* The rim is decorative only; it does not own layout, focus or pointer events. */
@supports ((mask-composite:exclude) or (-webkit-mask-composite:xor)){
  :is(.op-toast,.op-notice-surface,.ukpop.op-toast-menu,dialog#ic-drawer)::before{
    content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;
    padding:var(--glass-rim-width);background:var(--glass-rim);pointer-events:none;
    -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;mask-composite:exclude;
  }
}
:root[data-nc-material="solid-fallback"] :is(.op-toast,.op-notice-surface,.ukpop.op-toast-menu,dialog#ic-drawer)::before{display:none;}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  :is(.op-toast,.op-notice-surface,.ukpop.op-toast-menu,dialog#ic-drawer)::before{display:none;}
}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more),(forced-colors:active),(prefers-reduced-data:reduce){
  :is(.op-toast,.op-notice-surface,.ukpop.op-toast-menu,dialog#ic-drawer)::before{display:none;}
}
.op-toast[data-in-history="true"]{max-height:none;overflow:visible;animation:none;}
:root[data-nc-material="solid-fallback"] :is(.op-toast[data-in-history="true"],.op-notice-surface,.ukpop.op-toast-menu){
  background:var(--toast-solid);backdrop-filter:none;-webkit-backdrop-filter:none;}
.op-toast-content{--toast-close-column:32px;display:grid;grid-template-columns:22px minmax(0,1fr) var(--toast-close-column);gap:10px;align-items:start;}
.op-toast-content[data-no-icon="true"]{grid-template-columns:minmax(0,1fr) var(--toast-close-column);}
.op-toast-message{min-width:0;padding-top:1px;}
.op-toast-title{font-size:14px;line-height:1.45;font-weight:600;letter-spacing:0;white-space:pre-wrap;margin:0;}
.op-toast-body{font-size:13px;line-height:1.55;color:var(--toast-detail);white-space:pre-wrap;margin:4px 0 0;
  max-height:min(34vh,260px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.op-toast-status{display:inline-flex;width:22px;height:22px;align-items:center;justify-content:center;
  color:var(--toast-info);padding-top:1px;flex-shrink:0;}
.op-toast[data-toast-type="success"] .op-toast-status{color:var(--toast-success);}
.op-toast[data-toast-type="error"] .op-toast-status{color:var(--toast-error);}
.op-toast[data-toast-type="warning"] .op-toast-status{color:var(--toast-warning);}
.op-toast-status svg{width:20px;height:20px;stroke-width:1.85;}
.op-toast-status[data-status="loading"] svg{animation:op-toast-spin 1s linear infinite;}
.op-toast-status[data-status="success"] svg{animation:op-toast-check var(--toast-enter) var(--toast-ease) both;}
.op-toast-status[data-status="error"] svg{animation:op-toast-check var(--toast-enter) var(--toast-ease) both;}
.op-toast .op-toast-close{margin:-9px -9px -5px -4px;border:0!important;background:transparent!important;color:var(--toast-detail)!important;
  padding:10px!important;min-width:var(--toast-close-size);min-height:var(--toast-close-size);display:inline-flex;align-items:center;justify-content:center;
  border-radius:50%;box-shadow:none!important;cursor:pointer;transition:background var(--toast-feedback),color var(--toast-feedback);}
.op-toast .op-toast-close svg{width:18px;height:18px;}
.op-toast .op-toast-close:hover{background:var(--toast-hover)!important;color:var(--toast-text)!important;}
.op-toast-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap;margin-top:11px;min-width:0;}
.op-toast-action{position:relative;appearance:none;box-sizing:border-box;display:inline-flex;gap:7px;align-items:center;justify-content:center;
  border:1px solid transparent;border-radius:10px;min-height:36px;padding:8px 12px;margin:0;
  font-family:inherit;font-size:12px;line-height:1.25;font-weight:500;
  white-space:normal;overflow-wrap:anywhere;max-width:100%;cursor:pointer;
  background:var(--toast-subtle);color:var(--toast-text);box-shadow:none;
  transition:background var(--toast-feedback),transform var(--toast-feedback),opacity var(--toast-feedback);}
.op-toast-action:hover{background:var(--toast-hover);}
.op-toast-action:active{transform:scale(.98);}
.op-toast-action[data-variant="primary"]{background:var(--toast-accent);color:var(--toast-accent-text);}
.op-toast-action[data-variant="primary"]:hover{filter:brightness(.95);}
.op-toast-action[data-variant="ghost"]{background:transparent;color:var(--toast-detail);}
.op-toast-action:disabled{cursor:default;opacity:.5;transform:none;filter:none;}
.op-toast-action[aria-busy="true"]{opacity:.8;cursor:progress;}
.op-toast-action-label{display:grid;min-width:0;align-items:center;text-align:center;}
.op-toast-action[data-has-spinner="true"]{padding-inline:30px;}
.op-toast-button-spinner{position:absolute;inset-inline-start:10px;top:0;bottom:0;width:14px;display:flex;align-items:center;justify-content:center;}
.op-toast-action svg,.op-toast-close svg{display:block;flex-shrink:0;}
.op-toast-action[aria-haspopup="menu"]{min-width:36px;padding:8px;line-height:1;}
.op-toast-action-label>span{grid-area:1/1;}
.op-toast-action-label>span[aria-hidden="true"]{visibility:hidden;}
.op-toast-action .op-toast-action-spinner{width:14px;height:14px;animation:op-toast-spin 1s linear infinite;}
.op-toast :is(button,[tabindex]):focus-visible,.op-toast-expand:focus-visible{
  outline:2px solid var(--toast-accent);outline-offset:3px;}
.op-toast-menu-wrap{position:relative;max-width:100%;}
.ukpop.op-toast-menu{padding:6px;border-radius:var(--toast-history-radius);min-width:160px;
  max-width:calc(100vw - 16px);max-height:min(420px,calc(100vh - 32px));font-family:inherit;overscroll-behavior:contain;}
.ukpop.op-toast-menu[data-custom-content="true"]{width:320px;}
.op-toast-menu>div{display:flex;flex-direction:column;gap:3px;}
.op-toast-menu :is(button,[tabindex]):focus-visible{outline:2px solid var(--toast-accent);outline-offset:-2px;}
.op-toast-menu .op-toast-action{width:100%;text-align:left;justify-content:flex-start;}
.op-toast-menu .op-toast-action-label{text-align:start;}
.op-toast-menu .op-toast-action:active{transform:none;background:var(--toast-hover);}
.op-toast-action-error{margin:9px 0 0;color:var(--toast-error);font-size:12px;line-height:1.5;white-space:pre-wrap;}
.op-toast-expand{pointer-events:auto;display:block;margin:10px 0 0 auto;min-height:36px;
  font:500 12px/1.4 system-ui,sans-serif;color:var(--toast-detail);background:var(--toast-solid);
  border:1px solid var(--toast-border);border-radius:18px;padding:6px 12px;cursor:pointer;
  box-shadow:0 2px 8px rgba(20,30,48,.06);}
.op-toast-content-change{animation:op-toast-copy var(--toast-enter) ease both;}
.op-toast-history{display:flex;flex-direction:column;gap:10px;}
@keyframes op-toast-enter{from{opacity:0;transform:translate3d(0,-10px,0) scale(.985)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
@keyframes op-toast-spin{to{transform:rotate(360deg)}}
@keyframes op-toast-check{from{opacity:.4;transform:scale(.88)}to{opacity:1;transform:scale(1)}}
@keyframes op-toast-copy{from{opacity:.65}to{opacity:1}}
@media (pointer:coarse){.op-toast-action,.op-toast-expand{min-height:44px;}.op-toast-actions{gap:8px;}}
@media (max-width:420px){.op-toast{padding:14px 14px 12px;}.op-toast-actions{gap:7px;}
  .op-toast-action{flex:0 1 auto;}.op-toast-title{font-size:14px;}.op-toast-body{font-size:13px;}}
@media (prefers-reduced-motion:reduce){
  .op-toast,.op-toast-slot,.op-toast-motion,.op-toast-size,.op-toast-list,.op-toast-status svg,.op-toast-action,.op-toast-content-change{animation:none!important;transition:none!important;}
}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){
  .op-toast,.op-notice-surface,.ukpop.op-toast-menu{background:var(--toast-solid);backdrop-filter:none;-webkit-backdrop-filter:none;border-color:var(--toast-detail);}
}
@media (forced-colors:active){
  .op-toast,.op-notice-surface,.ukpop.op-toast-menu{background:Canvas;color:CanvasText;border-color:CanvasText;box-shadow:none;backdrop-filter:none;}
  .op-toast-body,.op-toast-status{color:CanvasText;}.op-toast-action{border-color:ButtonText;forced-color-adjust:auto;}
}

/* History-only ghost control. Reserve its full hit area in the content grid. */
.op-toast[data-in-history="true"] .op-toast-content{--toast-close-column:var(--toast-close-size);}
.op-toast[data-in-history="true"] .op-toast-content>.op-toast-close{margin-inline:0;}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"],
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]{
  appearance:none;border:0!important;background:transparent!important;box-shadow:none!important;
  border-radius:calc(var(--toast-radius) / 2)!important;color:var(--toast-detail)!important;
  outline:none;cursor:pointer;transform:none;
  transition:background-color var(--toast-feedback),color var(--toast-feedback);
}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"]:hover:not(:disabled),
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]:hover:not(:disabled){
  background:var(--toast-subtle)!important;color:var(--toast-text)!important;
}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"]:active:not(:disabled),
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]:active:not(:disabled){
  background:var(--toast-hover)!important;color:var(--toast-text)!important;
}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"]:focus-visible,
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]:focus-visible{
  outline:2px solid var(--toast-accent);outline-offset:2px;
}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"]:focus:not(:focus-visible),
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]:focus:not(:focus-visible){
  outline:none;
}
:is(dialog#ic-drawer,dialog#operation-history) button.op-toast-close[type="button"]:disabled,
.op-toast[data-in-history="true"] button.op-toast-close[type="button"]:disabled{
  background:transparent!important;opacity:.4;cursor:default;
}

/* Earlier snapshots live in the existing action popover, outside the card flow. */
.op-toast-history{display:flex;flex-direction:column;gap:6px;}
.op-toast-history-empty{margin:0;padding:8px 10px;color:var(--toast-detail);font-size:12px;line-height:1.5;}

.op-toast-history-choice{display:flex;flex-direction:column;gap:3px;min-width:0;overflow-wrap:anywhere;}
.op-toast-history-cases{font-size:11px;line-height:1.45;color:var(--toast-detail);}

.op-toast-history-choice>span:first-child{font-weight:600;}
