.quest-wrap{position:relative;flex:none}
.quest-trigger{min-height:44px;padding:9px 12px;border:0;border-radius:12px;background:transparent;color:inherit;font:inherit;font-size:14px;cursor:pointer}
.quest-trigger:hover,.quest-trigger[aria-expanded=true]{background:var(--soft,#f5f5f7)}
.quest-trigger:focus-visible,.quest-panel :is(a,button):focus-visible,.quest-page :is(a,button):focus-visible{outline:2px solid var(--accent,#0071e3);outline-offset:3px}
.quest-panel{position:fixed;right:18px;top:var(--quest-panel-top,76px);width:min(420px,calc(100% - 24px));max-height:var(--quest-panel-height,calc(100dvh - 92px));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom;scroll-padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));padding:20px 18px calc(20px + env(safe-area-inset-bottom,0px));border:1px solid var(--line,#ddd);border-radius:18px;background:var(--panel,#fff);color:var(--text,#222);box-shadow:0 12px 36px #0002;z-index:115}
.quest-panel[hidden],.quest-page[hidden]{display:none}
.quest-panel-head,.quest-period-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.quest-panel h2,.quest-panel h3{margin:0;font-size:18px;line-height:1.4}
.quest-panel-close{flex:none;min-width:44px;min-height:44px;border:0;background:transparent;color:inherit;font-size:24px;border-radius:10px}
.quest-panel-close:hover{background:var(--soft,#f5f5f7)}
.quest-note,.quest-timer,.quest-item-meta,.quest-feedback{font-size:13px;line-height:1.65;overflow-wrap:anywhere}
.quest-note{margin:12px 0 18px;color:inherit;opacity:.85}
.quest-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.quest-tabs button{min-height:44px;border:1px solid var(--line,#ddd);border-radius:10px;padding:9px 14px;background:transparent;color:inherit;font:inherit;font-size:14px}
.quest-tabs button[aria-pressed=true]{background:var(--soft,#f5f5f7);border-color:currentColor;font-weight:600}
.quest-period{min-width:0;margin:20px 0}
.quest-timer{margin:6px 0 12px;font-variant-numeric:tabular-nums}
.quest-list{display:grid;gap:12px;padding:0;margin:0;list-style:none}
.quest-item{min-width:0;padding:15px;border:1px solid var(--line,#ddd);border-radius:14px;background:var(--soft,#f5f5f7)}
.quest-item h4{margin:0 0 6px;font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.quest-item-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:6px 0}
.quest-item progress{display:block;width:100%;height:8px;margin:12px 0;accent-color:var(--accent,#555)}
.quest-claim{min-height:44px;max-width:100%;width:100%;padding:10px 14px;border:1px solid var(--line,#ddd);border-radius:10px;color:inherit;background:var(--panel,#fff);font:inherit;font-size:14px;white-space:normal}
.quest-claim:not(:disabled):hover{border-color:currentColor}
.quest-claim:disabled{cursor:default;opacity:.65}
.quest-links{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:18px}
.quest-links a{text-decoration:underline;text-underline-offset:4px;font-size:14px}
.quest-links button{min-height:44px;padding:8px 12px;border:1px solid var(--line,#ddd);border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:14px}
.quest-page{padding:110px 24px 70px;min-height:100vh;color:var(--text,#222)}
.quest-inner{max-width:1040px;margin:auto;min-width:0}
.quest-page h1{font-size:clamp(36px,5vw,52px);line-height:1.15;margin:32px 0 12px}
.quest-page .quest-list{grid-template-columns:repeat(2,minmax(0,1fr))}
:root:is([data-personal-theme=mist],[data-room-theme=mist]) .quest-panel{background:#17191e;color:#f5f5f7;border-color:#555}
:root:is([data-personal-theme=mist],[data-room-theme=mist]) .quest-item{background:#22252b;color:#f5f5f7;border-color:#555}
:root:is([data-personal-theme=mist],[data-room-theme=mist]) .quest-claim{background:#191c22;border-color:#777;color:#f5f5f7}
@media(max-width:620px){.quest-trigger{font-size:13px;padding:8px}.quest-page{padding:90px 18px 50px}.quest-page .quest-list{grid-template-columns:minmax(0,1fr)}.quest-panel{right:12px}}
/* Opaque surfaces preserve contrast across all owned background artwork. */
:root[data-skin-theme] .quest-panel{background:rgba(var(--panel-rgb),.98);color:var(--text);border-color:var(--line)}
:root[data-skin-theme] .quest-item{background:var(--soft);color:var(--text)}
/* Full-page period tabs use the existing catalog-groups sizing and shared
   submenu-selection theme tokens. The header disclosure panel is unchanged. */
#questPage .quest-tabs{gap:8px;margin:20px 0}
#questPage .quest-tabs button{min-height:0;padding:10px 14px;border:1px solid var(--submenu-line);border-radius:12px;background:var(--submenu-bg);color:var(--submenu-text);font:inherit;font-weight:600;line-height:normal;box-shadow:none;opacity:1;text-shadow:none;-webkit-text-stroke:0}
#questPage .quest-tabs button:hover:not([aria-pressed=true]){background:var(--submenu-hover-bg);color:var(--submenu-hover-text);border-color:var(--submenu-hover-line)}
#questPage .quest-tabs button[aria-pressed=true]{background:var(--submenu-selected-bg);color:var(--submenu-selected-text);border:1px solid var(--submenu-selected-line);box-shadow:none;opacity:1}
#questPage .quest-tabs button:focus-visible{outline:2px solid var(--submenu-focus);outline-offset:var(--submenu-focus-offset)}

/* Match Language's text and interaction colors in every existing palette. */
.quest-trigger{position:relative;color:#555;font-weight:500;line-height:1.4}
.quest-trigger:hover,.quest-trigger[aria-expanded=true]{background:#f2f2f5;color:#111}
:root:is([data-personal-theme="mist"],[data-room-theme="mist"],[data-skin-theme]) .quest-trigger{color:var(--muted)}
:root:is([data-personal-theme="mist"],[data-room-theme="mist"],[data-skin-theme]) .quest-trigger:hover,
:root:is([data-personal-theme="mist"],[data-room-theme="mist"],[data-skin-theme]) .quest-trigger[aria-expanded=true]{background:var(--hover);color:var(--text)}
.quest-trigger[data-claimable=true]::before{content:"";position:absolute;top:4px;left:3px;width:6px;height:6px;border-radius:50%;background:#0071e3;pointer-events:none}
