/* Quests: the quest log (quests-ui.js). Main quest = the one dark hero on the
   card; side quests use the .u-ins inset lists. Colour only on glyphs/bars. */
.qs-card { padding: 12px; }
.qs-card .u-ins { margin-top: 10px; }
.qs-ico { width: 32px !important; height: 32px !important; border-radius: 10px !important; margin: 0 !important; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.qs-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.u-ins .qs-ico { background: var(--panel); }
.qs-row .u-main { display: flex; flex-direction: column; min-width: 0; }
.qs-bar { display: block; height: 5px; border-radius: 3px; background: var(--u-seg); margin-top: 6px; overflow: hidden; }
.qs-bar i { display: block; height: 100%; border-radius: 3px; }
.qs-val { text-align: right; white-space: nowrap; }
.qs-val small, .qs-xpv small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.qs-xpv { color: var(--accent-dark); text-align: right; }
.qs-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--acc-700); white-space: nowrap; flex-shrink: 0; }
.qs-chip svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
:root[data-theme="dark"] .qs-chip { background: rgba(var(--acc-500-rgb), 0.16); color: var(--acc-300); }

/* main quest hero */
.qs-hero { background: var(--tile-dark); color: #fff; border-radius: 20px; padding: 16px; cursor: pointer; position: relative; overflow: hidden; }
.qs-hero:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-theme="dark"] .qs-hero { background: #202328; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.qs-hero-kick { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc-400); }
.qs-hero-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0 2px; }
.qs-hero-sub { font-size: 12px; color: #a7acb4; font-weight: 500; }
.qs-hero-mid { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.qs-ring { flex-shrink: 0; }
.qs-ring .qs-ring-t { stroke: rgba(255, 255, 255, 0.12); }
.qs-ring text { font-size: 10px; font-weight: 700; fill: #fff; font-family: var(--font); }
.qs-hero-steps { flex: 1; min-width: 0; }
.qs-hero-steps > div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #d4d7dc; padding: 3px 0; font-weight: 500; }
.qs-hero-steps > div.ok { color: #fff; }
.qs-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #4a4f57; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.ok > .qs-dot { background: var(--accent); border-color: var(--accent); }
.qs-dot svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.qs-hero-big { font-size: 26px; font-weight: 700; }
.qs-hero-big small { font-size: 12px; color: #a7acb4; font-weight: 600; }
.qs-hero-next { margin-top: 12px; background: rgba(255, 255, 255, 0.07); border-radius: 14px; padding: 9px 11px; font-size: 12px; color: #d4d7dc; display: flex; gap: 8px; align-items: center; font-weight: 500; }
.qs-hero-next svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: var(--acc-400); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-add-row { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 11px; border-radius: 16px; border: 0; background: var(--u-tile); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qs-add-row svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* empty */
.qs-empty { display: flex; gap: 12px; align-items: flex-start; }
.qs-empty .qs-ico { background: var(--u-tile); }
.qs-empty b { font-size: 14.5px; }
.qs-empty p { margin: 3px 0 10px; line-height: 1.45; }
.qs-empty .btn svg, .qs-actions .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.qs-quiet { margin: 4px 2px 0; }

/* the log */
.qs-level { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qs-lvl-n { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--acc-700); font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
:root[data-theme="dark"] .qs-lvl-n { background: rgba(var(--acc-500-rgb), 0.16); color: var(--acc-300); }
.qs-lvl-main { flex: 1; min-width: 0; font-size: 13px; }
.qs-xp { display: block; height: 6px; border-radius: 3px; background: var(--u-seg); margin-top: 5px; overflow: hidden; }
.qs-xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc-400), var(--acc-600)); border-radius: 3px; }
.qs-seg { display: flex; background: var(--u-tile); border-radius: 12px; padding: 3px; }
.qs-seg button { flex: 1; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 0; border-radius: 9px; color: var(--muted); cursor: pointer; }
.qs-seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(var(--n-ink-rgb), 0.08); }
.qs-sheet .ef-sec:first-of-type { margin-top: 16px; }
.qs-done-ico { background: var(--accent) !important; color: #fff; }
.qs-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; align-items: stretch; }
.qs-actions .btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 6px; }
.qs-ghost { background: var(--u-tile); color: var(--text); border: 0; }
.qs-unpin { align-self: center; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* one quest */
.qs-dhero { display: flex; gap: 12px; align-items: flex-start; background: var(--u-tile); border-radius: 18px; padding: 14px; }
.qs-dhero .qs-ico { background: var(--panel); }
.qs-dmain { flex: 1; min-width: 0; }
.qs-dbig { font-size: 26px; font-weight: 700; line-height: 1.1; margin-bottom: 2px; }
.qs-dbig small { font-size: 12px; font-weight: 600; color: var(--muted); }
.qs-next { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 500; margin: 10px 2px 0; }
.qs-next svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: var(--accent-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-counter { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--u-tile); border-radius: 18px; padding: 10px; margin-top: 10px; text-align: center; }
.qs-counter b { display: block; font-size: 24px; }
.qs-cbtn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--panel); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--u-card); }
.qs-cbtn.on { background: var(--accent); color: #fff; box-shadow: 0 8px 18px var(--accent-glow); }
.qs-cbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.qs-step .qs-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--n-line); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qs-step.ok .qs-tick { background: var(--accent); border-color: var(--accent); }
.qs-tick svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-step.ok .u-name { color: var(--muted); }
div.qs-step { cursor: default; }

/* pin a quest */
.qs-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qs-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--u-tile); border: 0; border-radius: 16px; padding: 12px; font: inherit; color: var(--text); cursor: pointer; }
.qs-tpl .qs-ico { background: var(--panel); margin-bottom: 8px !important; }
.qs-tpl b { font-size: 13px; font-weight: 700; }
.qs-tpl > span:last-child { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.qs-tpl:active, .qs-step:active { transform: scale(0.98); }
.qs-form { display: flex; flex-direction: column; gap: 12px; }
.qs-edit { margin-top: 4px; }
.qs-edit .ef-sec { margin-bottom: 0; }
.qs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qs-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.qs-field input { font: inherit; font-size: 16px; font-weight: 600; color: var(--text); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); width: 100%; min-width: 0; box-sizing: border-box; }
.qs-field input + input { margin-top: 2px; }
.qs-chips { margin: 0; }
.qs-form > p { margin: -4px 2px 0; line-height: 1.45; }
.qs-main-tg { margin-top: 2px; }
.qs-sheet .sh2-rb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-unpin { background: none; border: 0; padding: 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qs-counter > span { flex: 1; }
.qs-sheet .qs-empty { margin-top: 16px; }

/* Home card while quests load, or after a load failed. */
.qs-wait { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.qs-wait p { margin: 0; }

/* Community "Your quests" card (communityCardHtml): the main quest sits light
   in a tile, because the XP race is that page's dark hero. */
.qs-cm { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.qs-cm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qs-cm-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.qs-cm-lv { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.qs-cm-lv .qs-xp { width: 54px; margin: 0; }
.qs-cm .u-ins { margin: 0; }
.qs-cm-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qs-cm-foot .ac-more { margin: 0; white-space: nowrap; }
.qs-cm-pin { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.qs-cm-pin svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.qs-hero.is-light { background: var(--u-tile); color: var(--text); box-shadow: none; }
.qs-hero.is-light .qs-hero-kick { color: var(--acc-700); }
.qs-hero.is-light .qs-hero-sub, .qs-hero.is-light .qs-hero-big small { color: var(--muted); }
.qs-hero.is-light .qs-ring .qs-ring-t { stroke: var(--u-seg); }
.qs-hero.is-light .qs-ring text { fill: var(--text); }
.qs-hero.is-light .qs-hero-steps > div { color: var(--muted); }
.qs-hero.is-light .qs-hero-steps > div.ok { color: var(--text); }
.qs-hero.is-light .qs-dot { border-color: var(--n-line); }
.qs-hero.is-light .qs-hero-next { background: var(--panel); color: var(--muted); }
.qs-hero.is-light .qs-hero-next svg { stroke: var(--acc-600); }
:root[data-theme="dark"] .qs-hero.is-light { background: var(--u-tile); box-shadow: none; }
:root[data-theme="dark"] .qs-hero.is-light .qs-hero-kick { color: var(--acc-400); }
:root[data-theme="dark"] .qs-hero.is-light .qs-ring .qs-ring-t { stroke: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .qs-hero.is-light .qs-hero-next { background: var(--d-raise); }
.qs-cheer { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
/* friends.css sizes every svg on #communityRoot at 14px; undo that here. */
#communityRoot .qs-cm .qs-ring { width: 58px; height: 58px; }
#communityRoot .qs-cm .qs-ico svg { width: 16px; height: 16px; }
#communityRoot .qs-cm .qs-dot svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3.4; }
#communityRoot .qs-cm .qs-hero-next svg { width: 15px; height: 15px; stroke: var(--acc-600); stroke-width: 2.2; }
:root[data-theme="dark"] #communityRoot .qs-cm .qs-hero-next svg { stroke: var(--acc-400); }
#communityRoot .qs-cm .qs-cm-pin svg { width: 13px; height: 13px; stroke-width: 2.4; }
#communityRoot .qs-cm .qs-ring text { stroke: none; }
