/* Hosted shell chrome: account control, notices, and the sign-in pages.
   Inside the app it reads the design-system tokens; fallbacks cover pages
   that do not load pf-ds.css. */

/* ---------- Account (inside the app rail) ---------- */
.pfh-account-btn { position: relative; }
.pfh-avatar {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  font: 650 11px/1 var(--ds-font, system-ui, sans-serif); letter-spacing: .02em;
  color: var(--pf-on-accent, #150802);
  background: var(--ds-primary-bg, #ff6a2a);
  box-shadow: 0 0 0 2px var(--pf-surface-1, #101014), 0 0 0 3px var(--pf-border-2, rgba(255,255,255,.14));
}
.pfh-avatar--lg { width: 38px; height: 38px; font-size: 13px; }
.pfh-account-btn[data-mock]::after {
  content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pf-warning, #f6c35b); box-shadow: 0 0 0 2px var(--pf-surface-1, #101014);
}
.pfh-menu {
  position: fixed; z-index: 2147483000; width: 290px; padding: 8px;
  background: color-mix(in srgb, var(--pf-surface-1, #101014) 97%, transparent);
  color: var(--pf-text-1, #f6f6f7);
  border: 1px solid var(--pf-border-2, rgba(255,255,255,.14)); border-radius: var(--ds-r-lg, 14px);
  box-shadow: var(--ds-elev-3, 0 28px 80px -20px rgba(0,0,0,.8));
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  font: 400 13px/1.45 var(--ds-font, system-ui, sans-serif);
  animation: pfh-pop var(--ds-t, 200ms) var(--ds-ease, ease) both;
  /* Anchored to the avatar's bottom edge: on a short window (1366x768) the full menu is taller
     than the space above it, so it scrolls instead of losing its top rows off-screen. */
  max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  transform-origin: left bottom;
}
@supports (height: 100dvh) { .pfh-menu { max-height: calc(100dvh - 24px); } }
.pfh-menu[hidden] { display: none; }
/* The rail's hover label says "Account" over the menu it just opened: hide it while open. */
.rail .pfh-account-btn[aria-expanded="true"] .rail-tip { opacity: 0 !important; visibility: hidden; }
@keyframes pfh-pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.pfh-menu__who { display: flex; align-items: center; gap: 11px; padding: 8px 8px 12px; border-bottom: 1px solid var(--pf-border-1, rgba(255,255,255,.08)); }
.pfh-menu__who > span:last-child { display: grid; gap: 2px; min-width: 0; }
.pfh-menu__user { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfh-menu__role { color: var(--pf-text-3, #7b7b87); font-size: 11.5px; }
.pfh-menu__mode { display: flex; gap: 8px; margin: 8px 0 2px; padding: 8px 10px; line-height: 1.4; border-radius: var(--ds-r-md, 10px); font-size: 11.5px; color: var(--pf-text-2, #a8a8b3); background: color-mix(in srgb, var(--pf-warning, #f6c35b) 9%, transparent); border: 1px solid color-mix(in srgb, var(--pf-warning, #f6c35b) 22%, transparent); }
.pfh-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--pf-warning, #f6c35b); }
.pfh-menu__item {
  appearance: none; display: flex; align-items: center; width: 100%; min-height: 36px; margin-top: 1px; padding: 0 10px;
  border: 0; border-radius: var(--ds-r-sm, 8px); background: transparent; color: var(--pf-text-1, #f6f6f7);
  font: 500 13px/1 var(--ds-font, system-ui, sans-serif); cursor: pointer; text-align: left;
}
.pfh-menu__item:hover { background: var(--ds-fill, rgba(255,255,255,.07)); }
.pfh-menu__item[hidden] { display: none; }
.pfh-menu__section { padding: 10px 4px 8px; border-bottom: 1px solid var(--pf-border-1, rgba(255,255,255,.08)); }
.pfh-menu__section:last-child { border-bottom: 0; padding-bottom: 2px; }
.pfh-menu__links { padding-top: 4px; }
.pfh-menu__label { display: block; margin: 0 4px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-text-3, #7b7b87); }
.pfh-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pfh-theme {
  appearance: none; display: grid; justify-items: center; gap: 6px; padding: 8px 4px 7px; border: 0; border-radius: 10px;
  background: transparent; color: var(--pf-text-2, #a8a8b3); font: 500 11px/1.2 var(--ds-font, system-ui, sans-serif); cursor: pointer;
}
.pfh-theme:hover { background: var(--ds-fill, rgba(255,255,255,.07)); color: var(--pf-text-1, #fff); }
.pfh-theme__sw { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.pfh-theme[aria-pressed="true"] { color: var(--pf-text-1, #fff); }
.pfh-theme[aria-pressed="true"] .pfh-theme__sw { box-shadow: 0 0 0 2px var(--pf-surface-1, #101014), 0 0 0 3.5px var(--pf-accent-ink, #ff6a2a); }
.pfh-theme__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfh-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 8px; padding: 3px; border-radius: 11px; background: var(--ds-fill, rgba(255,255,255,.07)); }
.pfh-seg button {
  appearance: none; min-height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--pf-text-2, #a8a8b3);
  font: 550 12px/1 var(--ds-font, system-ui, sans-serif); cursor: pointer;
  transition: background-color .16s ease-out, color .16s ease-out;
}
.pfh-seg button[aria-pressed="true"] { background: var(--ds-seg-on, rgba(255,255,255,.14)); color: var(--pf-text-1, #fff); box-shadow: var(--ds-seg-on-shadow, none); }
.pfh-seg--3 { grid-template-columns: repeat(3, 1fr); }
.pfh-menu__label--sub { margin-top: 12px; margin-bottom: 0; }
.pfh-menu__hint { display: block; margin: 6px 4px 0; font-size: 11px; line-height: 1.35; color: var(--pf-text-3, #7b7b87); }
.pfh-menu__hint[hidden] { display: none; }
.pfh-count { margin-left: auto; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 650; color: var(--pf-danger, #ff6b7d); background: color-mix(in srgb, var(--pf-danger, #ff6b7d) 14%, transparent); }
.pfh-count--info { color: var(--pf-on-accent, #150802); background: var(--pf-accent-ink, #ff6a2a); }
.pfh-count[hidden] { display: none; }
.pfh-account-btn[data-alerts]::after {
  content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pf-accent-ink, #ff6a2a); box-shadow: 0 0 0 2px var(--pf-bg, #07070a);
}
.pfh-account-btn[data-issues]::after { background: var(--pf-danger, #ff6b7d) !important; }
.pfh-account-btn[data-issues]:not([data-mock])::after {
  content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--pf-bg, #07070a);
}
@media (max-width: 760px) {
  .pfh-menu { left: 12px !important; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)) !important; top: auto !important; width: auto; }
  .pfh-account-btn[data-mock]::after { right: auto; left: 34px; top: 12px; }
  .rail > .pfh-account-btn .pfh-avatar { width: 24px; height: 24px; font-size: 10px; }
}

/* ---------- Live updates: the dot beside the bell (hosted-shell.js mountLiveDot) ----------
   Sits just left of the bell (pf-inbox.css: --pfi-top / --pfi-right, 34px; the phone layer:
   44px at the bar's centre). A status dot, not a chip: round on purpose. Green = live, grey =
   connecting (first seconds), amber breathing = reconnecting; a one-shot ripple per update. */
.pfh-live {
  --pfh-live-c: var(--pf-text-3, #7b7b87);
  position: fixed; z-index: 300;
  top: calc(var(--pfi-top, 14px) + 5px); right: calc(var(--pfi-right, 20px) + 38px);
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; margin: 0;
  border: 0; border-radius: var(--ds-ctl-r, 8px); background: transparent; color: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pfh-live[hidden] { display: none; }
@media (hover: hover) { .pfh-live:hover { background: var(--ds-fill, rgba(255,255,255,.07)); } }
.pfh-live:focus-visible { outline: 2px solid var(--ds-ring, rgba(255,122,61,.55)); outline-offset: 2px; }
html:not([data-pfi]) .pfh-live { right: var(--pfi-right, 20px); }
.pfh-live[data-tone="live"] { --pfh-live-c: var(--pf-success, #4ade9a); }
.pfh-live[data-tone="away"] { --pfh-live-c: var(--pf-warning, #f6c35b); }
.pfh-live__dot {
  position: relative; display: block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pfh-live-c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pfh-live-c) 22%, transparent);
  transition: background-color .3s ease-out, box-shadow .3s ease-out;
}
.pfh-live__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--pfh-live-c); opacity: 0; pointer-events: none;
}
.pfh-live[data-blink] .pfh-live__dot::after { animation: pfh-live-ping 1s var(--ds-ease, ease-out) 1; }
.pfh-live[data-tone="away"] .pfh-live__dot { animation: pfh-live-breathe 1.8s ease-in-out infinite; }
@keyframes pfh-live-ping { from { transform: scale(1); opacity: .6; } to { transform: scale(3.4); opacity: 0; } }
@keyframes pfh-live-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
html[data-pf-motion="off"] .pfh-live .pfh-live__dot, html[data-pf-motion="off"] .pfh-live .pfh-live__dot::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .pfh-live .pfh-live__dot, .pfh-live .pfh-live__dot::after { animation: none !important; } }
.pfh-live__tip {
  position: absolute; top: calc(100% + 8px); right: -40px; z-index: 1;
  display: grid; gap: 3px; box-sizing: border-box; width: max-content; max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: var(--ds-r-md, 10px);
  background: var(--pf-surface-1, #101014); border: 1px solid var(--pf-border-2, rgba(255,255,255,.14));
  box-shadow: var(--ds-elev-3, 0 18px 50px -12px rgba(0,0,0,.6));
  color: var(--pf-text-2, #a8a8b3); font: 400 12px/1.45 var(--ds-font, system-ui, sans-serif); text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none;
  transition: opacity .14s ease-out, transform .14s ease-out, visibility 0s linear .14s;
}
.pfh-live[aria-expanded="true"] .pfh-live__tip, .pfh-live:focus-visible .pfh-live__tip {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
@media (hover: hover) { .pfh-live:hover .pfh-live__tip { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; } }
.pfh-live__head { display: flex; align-items: center; gap: 7px; color: var(--pf-text-1, #f6f6f7); font-size: 12.5px; font-weight: 650; }
.pfh-live__head::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pfh-live-c); flex: none; }
.pfh-live__last { color: var(--pf-text-3, #7b7b87); font-size: 11px; }
.pfh-live__last:empty { display: none; }
/* Phones: the phone layer puts the bell (44px) in the bar's centre; the dot sits beside it in a
   32 x 44 box (the layer's 44px touch height; the bell's 2px gap widens the hit area), and steps
   aside with the bell for full-screen work surfaces. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) and (max-device-width: 1024px) {
  html[data-ds] .pfh-live {
    z-index: 291; width: 32px; height: 44px;
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    right: calc(max(12px, env(safe-area-inset-right, 0px)) + 46px);
  }
  html[data-ds] .pfh-live::before { content: ""; position: absolute; inset: 0 -6px; }
  /* the reconnect / update pill sits in the same band under the bar: the explanation drops below it */
  html[data-ds] body:has(#pfNetPill:not([hidden])) .pfh-live__tip { top: calc(100% + 84px); }
  html[data-ds] body:is(:has(#launchPanel .pfd-row-editor), :has(.queue-drawer:not(.hidden)), :has(#editorDrawer:not(.hidden)), :has(.pe-modal:not(.hidden))) .pfh-live { visibility: hidden; }
}

/* ---------- Notice ---------- */
.pfh-notice {
  position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px)); transform: translateX(-50%);
  z-index: 2147483001; max-width: min(560px, calc(100vw - 32px)); padding: 11px 15px;
  border-radius: var(--ds-r-lg, 14px);
  background: color-mix(in srgb, var(--pf-danger, #ff6b7d) 14%, var(--pf-surface-1, #1a1012));
  border: 1px solid color-mix(in srgb, var(--pf-danger, #ff6b7d) 35%, transparent);
  color: var(--pf-text-1, #ffe8ea);
  font: 500 13px/1.45 var(--ds-font, system-ui, sans-serif);
  box-shadow: var(--ds-elev-3, 0 8px 30px rgba(0,0,0,.4));
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}

.pfh-notice[data-kind=""] {
  background: color-mix(in srgb, var(--pf-surface-1, #16161a) 92%, transparent);
  border-color: var(--pf-border-2, rgba(255,255,255,.14));
}

/* ---------- Fallback chip (pages without the app rail) ---------- */
.pfh-chip {
  position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2147483000; display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 10px;
  border-radius: 999px; background: rgba(16,17,21,.86); border: 1px solid rgba(255,255,255,.12); color: #e8e8ea;
  font: 500 12px/1.2 "Geist", system-ui, -apple-system, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); max-width: calc(100vw - 24px);
}
.pfh-chip__mock { padding: 2px 8px; border-radius: 999px; background: rgba(246,195,91,.16); color: #f6c35b; font-weight: 650; white-space: nowrap; }
.pfh-chip__user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; }
.pfh-chip__role { padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.08); font-weight: 600; }
.pfh-chip__out { appearance: none; border: 1px solid rgba(255,255,255,.16); background: transparent; color: inherit; font: inherit; padding: 4px 11px; min-height: 28px; border-radius: 999px; cursor: pointer; }
.pfh-chip__out:hover { background: rgba(255,255,255,.08); }
.pfh-chip__short { display: none; }
@media (max-width: 640px) { .pfh-chip__user, .pfh-chip__long { display: none; } .pfh-chip__short { display: inline; } }

/* ---------- Sign-in pages ---------- */
.pfh-login-body {
  --bg: #07070a; --card: rgba(18,18,23,.72); --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --text: #f6f6f7; --muted: #a2a2ad; --faint: #72727d; --field: rgba(255,255,255,.04);
  --accent: #ff6a2a; --btn: linear-gradient(180deg, #ff8a4c, #ff6a2a 55%, #f45a1a); --btn-fg: #170903;
  --glow: 0 10px 30px -10px rgba(255,106,42,.7), inset 0 1px 0 rgba(255,255,255,.35);
  margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  color: var(--text);
  background:
    radial-gradient(700px 420px at 50% -8%, rgba(255,106,42,.20), transparent 65%),
    radial-gradient(600px 400px at 50% 115%, rgba(255,106,42,.08), transparent 70%),
    var(--bg);
  font: 400 15px/1.5 "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-login-theme="light"] .pfh-login-body {
  --bg: #f6f6f3; --card: rgba(255,255,255,.85); --line: rgba(17,17,19,.08); --line-2: rgba(17,17,19,.16);
  --text: #111113; --muted: #56565f; --faint: #7a7a83; --field: #fff;
  --btn: linear-gradient(180deg, #2a2a2f, #111113); --btn-fg: #fff; --glow: 0 10px 24px -10px rgba(17,17,19,.55), inset 0 1px 0 rgba(255,255,255,.14);
  background: radial-gradient(700px 420px at 50% -8%, rgba(255,140,80,.16), transparent 65%), var(--bg);
}
.pfh-login {
  width: 100%; max-width: 392px; box-sizing: border-box; text-align: center;
  padding: 36px 30px 28px; border-radius: 24px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 40px 100px -30px rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  animation: pfh-rise .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pfh-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pfh-login__mark { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line-2), 0 12px 30px -8px rgba(255,106,42,.45); }
.pfh-login__title { margin: 18px 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.pfh-login__sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.pfh-login__form { display: grid; gap: 14px; text-align: left; }
.pfh-field { display: grid; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.pfh-field input {
  font: inherit; font-size: 16px; color: var(--text); padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--field); transition: border-color .15s, box-shadow .2s;
}
.pfh-field input:hover { border-color: color-mix(in srgb, var(--text) 26%, transparent); }
.pfh-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.pfh-btn {
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.005em; min-height: 46px; margin-top: 4px;
  border: 0; border-radius: 12px; background: var(--btn); color: var(--btn-fg); box-shadow: var(--glow); cursor: pointer;
  transition: transform .12s, filter .15s, box-shadow .2s;
}
.pfh-btn:hover:not(:disabled) { filter: brightness(1.06); }
.pfh-btn:active:not(:disabled) { transform: translateY(.5px) scale(.99); }
.pfh-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.pfh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pfh-field__hint { font-size: 11.5px; font-weight: 450; color: var(--muted); opacity: .8; }
.pfh-field__opt { font-size: 11px; font-weight: 450; opacity: .7; margin-left: 4px; }
.pfh-login__error { margin: 0; padding: 10px 12px; border-radius: 10px; color: #ff9aa7; font-size: 13px; background: rgba(255,90,110,.08); border: 1px solid rgba(255,90,110,.22); }
html[data-login-theme="light"] .pfh-login__error { color: #b3263f; }
.pfh-login__foot { margin: 22px 0 0; color: var(--faint); font-size: 12.5px; }
.pfh-login__foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.pfh-login__foot a:hover { color: var(--text); border-color: var(--text); }
@media (max-width: 440px) { .pfh-login { padding: 30px 22px 24px; border-radius: 22px; } }
/* An assigned VA page stays hidden even when sidebar layout restores its own hidden flags. */
html[data-pf-role="va"] [data-pfh-denied] { display: none !important; }
.pfh-menu a.pfh-menu__item { text-decoration: none; }
