/* Shared action feedback: extends the existing popover, sheet and confirmation. */
.np-action-trigger{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);cursor:pointer}
.np-action-trigger>svg{width:18px;height:18px;flex:none}
.np-action-trigger:hover,.np-action-trigger[aria-expanded="true"]{background:var(--sunk);color:var(--ink);border-color:var(--line)}
.np-action-trigger:focus-visible,.np-drawer-back:focus-visible{outline:3px solid var(--in);outline-offset:2px}
/* Position is provided by the existing anchor logic; no second overlay system. */
#menuSlot .np-menu.pop{min-width:min(250px,calc(100vw - 16px));max-width:min(340px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:8px;border:1px solid var(--outline);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow);overflow-y:auto;overscroll-behavior:contain;scroll-padding:8px}
#menuSlot .np-menu{gap:4px;min-width:0}
#menuSlot .np-menu-title,#menuSlot .mtitle{margin:0 0 8px;padding:8px 12px 12px;border-bottom:1px solid var(--line);font:600 13px/1.5 var(--f-body);color:var(--muted);overflow-wrap:anywhere}
#menuSlot .np-menu .mi{width:100%;min-width:0;min-height:44px;display:flex;align-items:center;gap:12px;padding:12px;border:0;border-radius:10px;background:transparent;color:var(--ink);font:500 14px/1.4 var(--f-body);text-align:left;white-space:normal;cursor:pointer}
#menuSlot .np-menu .mi>svg{width:18px;height:18px;flex:none;color:currentColor}
#menuSlot .np-menu .mi>span{min-width:0;overflow-wrap:anywhere}
#menuSlot .np-menu .mi small{display:block;margin-top:4px;font-size:12px;line-height:1.5;color:var(--muted);font-weight:400}
#menuSlot .np-menu .mi.strong{font-weight:600}
#menuSlot .np-menu .mi.strong>svg{color:var(--in)}
#menuSlot .np-menu .mi:hover:not(:disabled):not([aria-disabled="true"]){background:var(--sunk)}
#menuSlot .np-menu .mi.danger{color:var(--out)}
#menuSlot .np-menu .mi.danger>svg{color:currentColor}
#menuSlot .np-menu .mi.danger:hover:not(:disabled):not([aria-disabled="true"]){background:var(--out-soft)}
#menuSlot .np-menu .mi.danger{border-top:1px solid var(--line);margin-top:4px}
#menuSlot .np-menu .mi.danger+.mi.danger{border-top:0;margin-top:0}
#menuSlot .np-menu .mi:focus-visible{outline:3px solid var(--in);outline-offset:-3px;background:var(--sunk)}
#menuSlot .np-menu .mi:is(:disabled,[aria-disabled="true"]){opacity:1;color:var(--muted);cursor:not-allowed;background:var(--sunk)}
#menuSlot .np-menu .mi:is(:disabled,[aria-disabled="true"])>svg{color:var(--muted)}
#menuSlot .np-menu-separator{border:0;border-top:1px solid var(--line);margin:4px 8px;height:0;flex:none}
#menuSlot .np-menu-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}
#menuSlot .np-menu-head .np-menu-title,#menuSlot .np-menu-head .mtitle{flex:1;margin:0;min-width:0;border-bottom:0}
#menuSlot :is(.np-menu-head,.menu-sheet)>.iconbtn{width:44px;min-width:44px;height:44px;flex:none}
#menuSlot .np-menu-head .iconbtn:focus-visible,#menuSlot .menu-sheet>.iconbtn:focus-visible{outline:3px solid var(--in);outline-offset:2px}
/* Category contents and their menu are sibling buttons, never nested controls. */
.np-category-card.np-category-actions{grid-template-columns:minmax(0,1fr) 44px;align-items:start;gap:8px;cursor:default}
.np-category-actions>.np-category-main{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:12px;align-items:center;width:100%;min-width:0;min-height:44px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.np-category-main>.ib{width:32px;height:32px;border-radius:8px;background:transparent}
.np-category-main>.ib svg{width:16px;height:16px}
.np-category-main>.np-category-meta{grid-column:1/-1;min-width:0;flex-wrap:wrap}
.np-category-main .np-category-meta>.num{overflow-wrap:anywhere;min-width:0;max-width:100%}
.np-category-actions>.np-category-menu{width:44px;height:44px;min-width:44px;min-height:44px;margin:0}
.np-category-actions>.np-category-menu>svg{width:18px;height:18px}
.np-category-main:focus-visible,.np-category-menu:focus-visible{outline:3px solid var(--in);outline-offset:3px}
.khead>div:not(.prof-acts){min-width:0;flex:1}
.khead h2,.khead .meta{overflow-wrap:anywhere}
.khead>.prof-acts{flex:none;display:flex;gap:8px;margin:0;flex-wrap:nowrap}
.khead>.prof-acts .iconbtn{width:44px;height:44px;min-width:44px;min-height:44px;margin:0}
/* A subflow has one explicit return target above its local form. */
.np-drawer-back{max-width:100%;white-space:normal;overflow-wrap:anywhere;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:500 13px/1.4 var(--f-body);text-align:left;cursor:pointer}
.np-drawer-back>svg{width:16px;height:16px;flex:none}
.np-drawer-context{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:12px 16px;border-bottom:1px solid var(--line);background:var(--sunk);color:var(--muted);font-size:12px;line-height:1.5;flex:none;overflow-wrap:anywhere}
.np-drawer-context>span{min-width:0;flex:1 1 160px}
/* Errors remain next to their form, without relying on a disappearing toast. */
.np-inline-error,.np-action-status,.cfbox .cferr{display:flex;align-items:flex-start;gap:8px;margin:12px 0 0;padding:12px;border:1px solid var(--out);border-radius:10px;background:var(--out-soft);color:var(--out);font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.np-inline-error>svg,.np-action-status>svg{width:18px;height:18px;flex:none;margin-top:2px}
.np-action-status{border-color:var(--line);background:var(--sunk);color:var(--muted)}
.np-action-status[data-tone="success"]{border-color:var(--in);background:var(--in-soft);color:var(--ink)}
.np-inline-error:focus,.cfbox .cferr:focus{outline:2px solid var(--out);outline-offset:3px}
.np-inline-error[hidden],.np-action-status[hidden],.cfbox .cferr[hidden],.np-inline-error:empty,.np-action-status:empty,.cfbox .cferr:empty{display:none}
.drawer .field[aria-invalid="true"],.cfbox .field[aria-invalid="true"]{border-color:var(--out);box-shadow:0 0 0 1px var(--out)}
/* Keep the label while saving; disabled is controlled by the action owner. */
:is(.btn,.mi,.np-action-trigger)[aria-busy="true"]{cursor:wait;opacity:1}
:is(.btn,.mi,.np-action-trigger)[aria-busy="true"]::after{content:"";display:inline-block;flex:none;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:npActionSpin .8s linear infinite}
.np-action-trigger[aria-busy="true"]>svg{display:none}
@keyframes npActionSpin{to{transform:rotate(360deg)}}
/* Confirmation only: authentication and recovery dialogs keep their own styles. */
.wz.cfbox{width:min(520px,100%);border-radius:14px;border:1px solid var(--line);color:var(--ink);background:var(--surface)}
.cfbox>form{padding:24px;gap:16px;min-height:0;overscroll-behavior:contain}
.cfbox .wz-hero{width:36px;height:36px;border-radius:10px;background:var(--sunk);color:var(--muted)}
.cfbox .wz-hero>svg{width:20px;height:20px}
.cfbox .wz-hero.warn{background:var(--out-soft);color:var(--out)}
.cfbox h2{font-size:22px;line-height:1.3;letter-spacing:-.025em;overflow-wrap:anywhere;max-width:none}
.cfbox .cfbody{font-size:14px;line-height:1.6;gap:12px;overflow-wrap:anywhere}
.cfbox .cfword{gap:8px;font-size:13px;line-height:1.5}
.cfbox .field{min-height:44px;max-width:100%}
.cfbox>footer{padding:16px 24px;gap:8px;flex:none}
.cfbox>footer>.btn{min-height:44px;padding:10px 12px;white-space:normal;line-height:1.4}
.cfbox>footer>.btn:focus-visible{outline:3px solid var(--in);outline-offset:3px}
.cfbox .btn.danger.solid{background:var(--out);color:var(--surface)}
.cfbox .btn.danger.solid:disabled{opacity:.65}
.cfbox .btn.danger.solid[aria-busy="true"]{opacity:1}
/* Status is still visible after a completed action; controls are not icon-only except close. */
#toastSlot .toast{width:min(560px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:min(45dvh,320px);overflow-y:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border:1px solid var(--outline);border-radius:14px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:400;line-height:1.5;box-shadow:var(--shadow);z-index:50}
#toastSlot .np-toast-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:20px;height:20px;margin-top:12px;color:var(--muted)}
#toastSlot .np-toast-icon>svg{width:18px;height:18px}
#toastSlot .np-toast-message{flex:1;min-width:0;align-self:center;overflow-wrap:anywhere}
#toastSlot .np-toast-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none}
#toastSlot .np-toast-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;min-width:44px;padding:8px;border:0;border-radius:10px;background:transparent;color:var(--ink);font:500 13px/1.4 var(--f-body);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
#toastSlot .np-toast-actions>button:hover{background:var(--sunk)}
#toastSlot .np-toast-actions>button:focus-visible{outline:3px solid var(--in);outline-offset:-3px}
#toastSlot .np-toast-actions>button[data-act="toast-close"]{text-decoration:none}
#toastSlot .np-toast-actions>button>svg{width:16px;height:16px;flex:none}
#toastSlot .toast[data-tone="success"] .np-toast-icon{color:var(--in)}
#toastSlot .toast[data-tone="error"]{border-color:var(--out)}
#toastSlot .toast[data-tone="error"] .np-toast-icon{color:var(--out)}
@media(max-width:760px){
 #menuSlot .menu-sheet{display:flex;flex-direction:column;min-height:0;max-height:min(90dvh,calc(var(--np-viewport-height,100dvh) - 16px));bottom:var(--np-keyboard-inset,0px);padding:8px 12px max(16px,env(safe-area-inset-bottom,0px));border-radius:14px 14px 0 0;overflow:hidden}
 #menuSlot .menu-sheet>.sheet-handle{flex:none;margin:4px auto 8px}
 #menuSlot .menu-sheet>.mtitle,#menuSlot .menu-sheet>.np-menu-title{flex:none;padding:8px 12px 12px}
 #menuSlot .menu-sheet .np-menu{min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:8px;padding:4px}
 #menuSlot .menu-sheet .np-menu .mi{min-height:48px;font-size:14px}
 .np-drawer-context{padding:12px 16px}
 .wz.cfbox{border-radius:14px 14px 0 0}
 .cfbox>form{padding:20px 16px}
 .cfbox h2{font-size:22px}
 .cfbox>footer{padding:12px 16px max(16px,env(safe-area-inset-bottom,0px));gap:8px}
 .cfbox>footer>.spacer{display:none}
 .cfbox>footer>.btn{flex:1 1 132px;min-height:44px}
 .cfbox .field{font-size:16px}
}
@media(max-width:480px){
 #toastSlot .toast{flex-wrap:wrap;gap:8px;padding:12px}
 #toastSlot .np-toast-icon{margin-top:2px}
 #toastSlot .np-toast-message{flex-basis:calc(100% - 28px)}
 #toastSlot .np-toast-actions{width:100%;justify-content:flex-end;gap:8px}
}
@media(prefers-reduced-motion:reduce){
 #menuSlot .np-menu.pop,#menuSlot .menu-sheet,#toastSlot .toast{animation:none;transition:none}
 :is(.btn,.mi,.np-action-trigger)[aria-busy="true"]::after{animation:none}
}
@media(forced-colors:active){
 #menuSlot .np-menu.pop,#menuSlot .np-menu .mi,.wz.cfbox,.np-inline-error,.np-action-status,#toastSlot .toast{border-color:CanvasText}
 #menuSlot .np-menu .mi:focus-visible,.np-action-trigger:focus-visible,.cfbox>footer>.btn:focus-visible{outline-color:Highlight}
}
