/* Approved B: floating rows, a separate tab strip, and short aligned HP bars. */
#party-quest-hud{position:fixed;left:8px;top:180px;width:330px;z-index:12;color:#fff;font:500 12px/1.35 'Segoe UI',sans-serif;text-shadow:0 1px 2px #000;pointer-events:auto;--row-height:38px;--rail:26px}
#party-quest-hud *{box-sizing:border-box}
#party-quest-hud [hidden]{display:none!important}
#party-quest-hud header{position:static;inset:auto;display:flex;align-items:center;gap:4px;width:100%;height:32px;min-height:0;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:none;backdrop-filter:none;transform:none}
#party-quest-hud button{color:inherit;background:transparent;border:0;border-radius:3px;min-height:0;height:auto;padding:0;margin:0;font:inherit;cursor:pointer;text-shadow:inherit;box-shadow:none;max-width:100%}
#party-quest-hud nav{position:static;inset:auto;display:flex;flex:1;gap:2px;height:32px;margin:0;padding:2px;background:#14131140;border-radius:3px;transform:none}
#party-quest-hud nav button{display:flex;flex:1;align-items:center;justify-content:center;gap:6px;padding:2px 5px}
#party-quest-hud nav [aria-selected=true]{background:#ffdc9217;box-shadow:inset 0 0 0 1px #ffe5a7,inset 0 0 9px #ffd87840,0 0 5px #ffd87880;text-shadow:0 0 4px #ffd878,0 1px 2px #000}
#party-quest-hud img{object-fit:contain;flex:none}
#party-quest-hud nav img{width:22px;height:22px}
#party-quest-hud .tracker-collapse{flex:0 0 22px;width:22px;height:32px;background:none;border:0;box-shadow:none;display:flex;align-items:center;justify-content:center}
#party-quest-hud .tracker-collapse img{width:18px;height:18px}
#party-quest-hud .tracker-collapse[aria-expanded=false] img{transform:rotate(180deg)}
#party-quest-hud[data-collapsed]{width:22px}
#party-quest-hud .tracker-content{margin:7px 0 0 var(--rail);padding-top:5px;border-top:1px solid #ffffff55;max-height:var(--tracker-room,240px);overflow:auto;scrollbar-width:none;touch-action:pan-y;overscroll-behavior:contain;background:none}
#party-quest-hud ::-webkit-scrollbar{display:none}
#party-quest-hud .tracker-roster,#party-quest-hud .tracker-quests{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px;row-gap:0;align-items:start;background:#14131118}
#party-quest-hud .tracker-open{width:100%;padding:5px;text-align:left}
#party-quest-hud .tracker-member{display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:19px 4px;column-gap:5px;align-content:center;min-width:0;width:100%;height:var(--row-height);padding:3px 0;border-bottom:1px solid #ffffff25;border-radius:0;text-align:left;background:none}
#party-quest-hud .tracker-head{width:28px;height:28px;grid-row:1/3;align-self:center;border-radius:50%;background:#ffffff16;border:1px solid #ffffff66}
#party-quest-hud .tracker-identity{display:flex;align-items:center;gap:3px;min-width:0}
#party-quest-hud .tracker-job{width:16px;height:16px;filter:drop-shadow(0 1px 1px #0009)}
#party-quest-hud .tracker-level{color:#ffe5a7;font-size:10px}
#party-quest-hud .tracker-name{display:block;overflow:hidden;white-space:nowrap;min-width:0;flex:1}
#party-quest-hud .tracker-name>span{display:block;width:max-content}
#party-quest-hud .tracker-name.overflowing>span{animation:tracker-name-pan 9s ease-in-out infinite alternate}
#party-quest-hud .tracker-member i{grid-column:2;display:block;width:100%;height:3px;align-self:center;border-radius:2px;background:linear-gradient(90deg,#9bea81 var(--hp),#0005 var(--hp));margin:0}
#party-quest-hud details{padding:4px 0;border-bottom:1px solid #ffffff25;min-width:0}
#party-quest-hud summary{cursor:pointer;font-weight:600}
#party-quest-hud p{margin:5px 0;white-space:pre-line}
#party-quest-hud .tracker-action{display:inline-flex;align-items:center;gap:4px;padding:3px}
@keyframes tracker-name-pan{0%,20%{transform:translateX(0)}80%,100%{transform:translateX(var(--name-travel))}}
@media(max-width:950px) and (max-height:600px){
 #party-quest-hud{width:166px;font-size:10px;--row-height:var(--mobile-row-height,26px)}
 #party-quest-hud header,#party-quest-hud nav,#party-quest-hud .tracker-collapse{height:28px}
 #party-quest-hud nav span,#party-quest-hud .tracker-action span{display:none}
 #party-quest-hud nav img{width:21px;height:21px}
 #party-quest-hud .tracker-roster,#party-quest-hud .tracker-quests{grid-template-columns:minmax(0,1fr)}
 #party-quest-hud .tracker-member{grid-template-columns:22px minmax(0,1fr);grid-template-rows:15px 3px;column-gap:4px;padding:1px 0}
 #party-quest-hud .tracker-head{width:21px;height:21px}
 #party-quest-hud .tracker-job{width:15px;height:15px}
 #party-quest-hud .tracker-content{margin-top:5px;padding-top:3px}
}
@media(prefers-reduced-motion:reduce){#party-quest-hud .tracker-name.overflowing>span{animation:none}}

/* Phone landscape: the approved minimal rows open beside the vertical tab rail. */
@media(max-width:950px) and (max-height:600px){
 #party-quest-hud{width:162px;--rail:34px;min-height:0}
 #party-quest-hud header{position:absolute;left:0;top:0;width:28px;height:auto;display:flex;flex-direction:column;gap:4px}
 #party-quest-hud nav{order:0;flex:none;width:28px;height:62px;flex-direction:column;gap:3px;padding:2px}
 #party-quest-hud nav button{width:24px;min-height:27px;padding:1px;flex:1}
 #party-quest-hud [data-tab=quest]{order:0}
 #party-quest-hud [data-tab=party]{order:1}
 #party-quest-hud .tracker-collapse{order:1;height:27px;width:28px;flex:none}
 #party-quest-hud .tracker-content{margin:0 0 0 var(--rail);padding:0 0 0 5px;border-top:0;border-left:1px solid #ffffff40}
 #party-quest-hud[data-collapsed]{width:28px;height:27px}
}

@media(max-width:950px) and (max-height:600px){#party-quest-hud .tracker-member i{width:72px;max-width:100%}}

#party-quest-hud .tracker-voice{display:flex;gap:5px;margin:3px 0 0 var(--rail)}
#party-quest-hud .tracker-voice button{position:relative;width:26px;height:24px;display:grid;place-items:center;opacity:.65}
#party-quest-hud .tracker-voice img{width:18px;height:18px}
#party-quest-hud .tracker-voice [aria-pressed=true]{opacity:1;filter:drop-shadow(0 0 3px #ffe0a0)}
@media(max-width:950px) and (max-height:600px){#party-quest-hud .tracker-voice{margin:3px 0 0 0;flex-direction:column;position:absolute;top:94px;left:0;gap:2px}#party-quest-hud .tracker-voice button{width:28px;height:22px}}

#party-quest-hud .tracker-voice span{display:none}
#party-quest-hud .tracker-member.is-speaking .tracker-head{border-color:#a4ef8a;box-shadow:0 0 5px #93ed75c0}

#party-quest-hud .tracker-member{position:relative;padding-right:22px}
#party-quest-hud .tracker-member-open{position:absolute;inset:0 22px 0 0;border-radius:0;background:transparent;z-index:1}
#party-quest-hud .member-voice{position:absolute;right:0;top:0;bottom:0;width:22px;display:grid;place-items:center;background:transparent;z-index:2}
#party-quest-hud .member-voice img{width:16px;height:16px}
#party-quest-hud .member-voice:hover,#party-quest-hud .member-voice:focus-visible{background:#ffffff20}

.quest-directory{width:min(680px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;border:1px solid #aec3dc;border-radius:10px;background:#faf8f2;color:#214572;font:13px Arial,sans-serif;box-sizing:border-box;overflow:hidden}
.quest-directory::backdrop{background:#0004}.quest-directory .quest-guide-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.quest-directory input{color:inherit;font:inherit;width:100%;box-sizing:border-box;padding:8px;border:1px solid #bacbe1;background:#fff;border-radius:5px}.quest-directory main{height:min(520px,calc(100dvh - 150px));max-height:calc(100dvh - 126px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:none}.quest-directory main::-webkit-scrollbar{display:none}.quest-directory details{border-bottom:1px solid #0002;padding:10px 2px}.quest-directory summary{cursor:pointer;font-weight:600}.quest-directory p{line-height:1.4;margin:8px 0;overflow-wrap:anywhere}.quest-directory h4{margin:12px 0 4px}.quest-directory button{min-height:30px;margin:3px;padding:5px 9px;color:inherit;background:#eef3f8;border:1px solid #b5c8df;border-radius:5px;cursor:pointer}.quest-directory button:disabled{opacity:.5}

/* Tracker controls occupy their own row, never quest-grid cells. */
#party-quest-hud .tracker-quest-toolbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:2px 0 5px;border-bottom:1px solid #ffffff26}
#party-quest-hud .tracker-quest-toolbar button{flex:none;padding:3px 6px;line-height:18px;background:#14131135;border:1px solid #ffffff24}
#party-quest-hud .tracker-route,#party-quest-hud .tracker-empty{grid-column:1/-1;min-width:0;padding:5px 3px;overflow-wrap:anywhere}
#party-quest-hud .tracker-route{border-bottom:1px solid #ffffff26}
#party-quest-hud .tracker-route strong{display:block;font-size:inherit;color:#ffe5a7}
#party-quest-hud .tracker-route p{margin:3px 0 0}
#party-quest-hud .tracker-empty{margin:0;opacity:.75}

#party-quest-hud .tracker-route-title{display:block;width:100%;text-align:left;font-weight:600;color:#ffe5a7;padding:2px 0}#party-quest-hud .tracker-route-title:hover{text-decoration:underline}

#party-quest-hud .tracker-route-details{font-size:.9em;opacity:.8;margin:3px 8px 0 0;padding:2px 0}

#party-quest-hud .tracker-content{overflow-x:hidden;overflow-y:auto;scrollbar-width:none;overscroll-behavior:contain}
#party-quest-hud .tracker-content::-webkit-scrollbar{display:none}
#party-quest-hud .tracker-ingredients{grid-column:1/-1;min-width:0;overflow:hidden;padding:6px 0}
#party-quest-hud .tracker-ingredients>strong{display:block;margin-bottom:6px}
#party-quest-hud .tracker-ingredients>button{white-space:normal;overflow-wrap:anywhere;min-height:34px}
#party-quest-hud .tracker-ingredients>button img{flex:0 0 24px;object-fit:contain}

#party-quest-hud .tracker-content{max-height:min(240px,var(--tracker-room,240px));min-height:0;contain:paint}

#party-quest-hud .tracker-material{display:block;min-width:0}
#party-quest-hud .tracker-material-status{display:block;margin:0 0 6px 30px;color:#ffe5a7;font-size:11px;overflow-wrap:anywhere}
#party-quest-hud .tracker-material button img{flex:0 0 24px}

#party-quest-hud .tracker-material.is-complete>button{opacity:.55;color:#c6cfc0;background:transparent}#party-quest-hud .material-complete{margin-left:auto;padding-right:7px;color:#b4d5a0}
/* Highlight the resumable ingredient quest action without brightening completed items. */
#party-quest-hud .tracker-ingredients>.tracker-action{color:#ffe5a7;font-weight:600}
#party-quest-hud .tracker-ingredients>.tracker-action img{filter:brightness(0) saturate(100%) invert(88%) sepia(27%) saturate(618%) hue-rotate(343deg) brightness(105%) contrast(101%)}
#party-quest-hud .tracker-ingredients>.tracker-action:hover:not(:disabled){color:#ffdc78;text-decoration:underline}
#party-quest-hud .tracker-ingredients>.tracker-action:disabled{opacity:.55}

#party-quest-hud .tracker-route-continue{display:block;width:max-content;min-height:26px;margin:2px 0 4px;padding:4px 0;color:#ffe5a7;font-weight:600}

/* Current-map presence; static filter only changes on presence events. */
#party-quest-hud .tracker-member.is-away{filter:grayscale(1);opacity:.65}
#party-quest-hud .tracker-voice button{opacity:.85}
#party-quest-hud .tracker-voice [aria-pressed=true]{opacity:1;filter:none}
