/* AP Twin federation - session widget (user menu, idle countdown, active sessions).
   Namespaced (.aps-*) and free of global rules so it can sit in any console's header. */
.aps-user { position: relative; display: inline-flex; align-items: center; font: 500 12.5px/1.3 'Space Grotesk', system-ui, sans-serif; z-index: 60; margin-left: 6px; }
.aps-user.aps-floating { position: fixed; top: 12px; right: 14px; }
.aps-i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.aps-pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 12px; cursor: pointer; font: inherit; color: inherit;
  background: color-mix(in srgb, currentColor 6%, transparent); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); transition: background .2s, border-color .2s; }
.aps-pill:hover, .aps-pill[aria-expanded="true"] { background: color-mix(in srgb, currentColor 11%, transparent); border-color: rgba(34,211,238,.55); }
.aps-pill .aps-i { width: 14px; height: 14px; opacity: .7; transition: transform .2s; }
.aps-pill[aria-expanded="true"] .aps-i { transform: rotate(180deg); }
.aps-av { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; font: 700 11.5px/1 'Space Grotesk', system-ui, sans-serif; color: #04101a;
  background: linear-gradient(135deg, #22d3ee, #a78bfa); box-shadow: 0 0 14px -4px rgba(34,211,238,.8); }
.aps-av.lg { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.aps-who { display: flex; flex-direction: column; text-align: left; max-width: 170px; }
.aps-who b { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aps-who small { font-size: 10.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1280px) { .aps-who { display: none; } }

.aps-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; padding: 8px; border-radius: 16px; color: #e6edf7;
  background: linear-gradient(160deg, rgba(20,30,52,.97), rgba(8,13,26,.97)); border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(18px); animation: aps-pop .18s ease; }
.aps-menu[hidden] { display: none; }
@keyframes aps-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.aps-menu-head { display: flex; gap: 11px; align-items: center; padding: 8px 8px 10px; }
.aps-menu-head b { display: block; font-size: 14px; }
.aps-menu-head span { display: block; font-size: 11.5px; color: #8b9bb7; }
.aps-menu-head .aps-r { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: #67e8f9; margin-top: 2px; }
.aps-meta { display: flex; gap: 8px; align-items: center; margin: 0 4px 6px; padding: 8px 10px; border-radius: 10px; font-size: 11px; color: #9fb0cc; background: rgba(34,211,238,.06); border: 1px solid rgba(34,211,238,.16); }
.aps-meta .aps-i { color: #22d3ee; width: 14px; height: 14px; }
.aps-menu a, .aps-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; text-align: left; }
.aps-menu a:hover, .aps-menu button:hover { background: rgba(255,255,255,.06); }
.aps-menu .aps-i { color: #8b9bb7; }
.aps-menu .danger { color: #fda4b6; } .aps-menu .danger .aps-i { color: #fb7185; }
.aps-menu .danger.subtle { font-size: 12px; opacity: .8; }
.aps-sep { height: 1px; margin: 6px 4px; background: rgba(148,163,184,.16); }

.aps-modal-back { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; background: rgba(2,6,14,.62); backdrop-filter: blur(6px); animation: aps-fade .2s ease; }
.aps-modal-back[hidden] { display: none; }
@keyframes aps-fade { from { opacity: 0; } }
.aps-modal { width: min(400px, 100%); padding: 26px 24px 20px; border-radius: 22px; color: #e6edf7; font: 400 14px/1.5 'Space Grotesk', system-ui, sans-serif; text-align: center;
  background: linear-gradient(160deg, rgba(22,33,58,.98), rgba(8,13,26,.98)); border: 1px solid rgba(148,163,184,.22); box-shadow: 0 40px 90px -30px rgba(0,0,0,.85); animation: aps-pop .22s ease; }
.aps-modal.wide { width: min(640px, 100%); text-align: left; }
.aps-modal h3 { margin: 6px 0 6px; font: 400 21px/1.2 'Marcellus SC', 'Space Grotesk', serif; letter-spacing: .02em; }
.aps-modal p { margin: 0; color: #9fb0cc; font-size: 13.5px; }
.aps-modal-ic { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; color: #fbbf24; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); }
.aps-modal-ic .aps-i { width: 26px; height: 26px; }
.aps-modal b.aps-w-left { color: #fde68a; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.aps-modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.aps-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(148,163,184,.2); background: none; color: #9fb0cc; cursor: pointer; }
.aps-x:hover { color: #fff; background: rgba(255,255,255,.06); }
.aps-modal-act { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.aps-modal:not(.wide) .aps-modal-act { justify-content: center; }
.aps-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 11px; border: 1px solid transparent; font: 600 13px/1 'Space Grotesk', system-ui, sans-serif; cursor: pointer; transition: .2s; }
.aps-btn.primary { color: #04101a; background: linear-gradient(110deg, #22d3ee, #6f8bff 60%, #a78bfa); box-shadow: 0 10px 26px -10px rgba(34,211,238,.8); }
.aps-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.aps-btn.ghost { color: #cbd5e1; background: rgba(255,255,255,.04); border-color: rgba(148,163,184,.26); }
.aps-btn.ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(34,211,238,.5); }
.aps-btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.aps-btn:disabled { opacity: .5; pointer-events: none; }
.aps-s-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.aps-s-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.03); border: 1px solid rgba(148,163,184,.14); }
.aps-s-row.cur { border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.06); }
.aps-s-main { flex: 1; min-width: 0; }
.aps-s-main b { display: block; font-size: 13.5px; }
.aps-s-main b em { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #67e8f9; margin-left: 6px; }
.aps-s-main span { display: block; font-size: 11.5px; color: #8b9bb7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aps-empty { padding: 18px; text-align: center; color: #8b9bb7; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .aps-menu, .aps-modal, .aps-modal-back { animation: none; } }
