/* The document stays still. Only the native quest/history panes scroll. */
html,body{width:100%;height:100%;min-height:0;margin:0;overflow:hidden;overscroll-behavior:none;scroll-behavior:auto}
body{position:relative;isolation:isolate;background:#030711;color:#f5f0e7}
body::before{
 content:'';position:fixed;z-index:-1;pointer-events:none;left:0;top:0;width:100vw;height:100vh;height:100lvh;
 background:linear-gradient(180deg,#03102796 0%,#080c1ac4 25%,#040711f5 48%,#050913fa 65%,#100818c7 86%,#080b15c9 100%),url('./assets/jungle-sunset-v2.png') center center/cover no-repeat;
}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .shell{
 position:fixed;inset:0;margin:0 auto;width:100%;max-width:430px;height:100%;height:100dvh;min-height:0;box-sizing:border-box;
 padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) calc(69px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
 background:none;isolation:isolate;overflow:hidden;
}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .shell::before{display:none!important;content:none!important}
.shell>.grid,.shell>.grid>.main{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;width:100%;margin:0;padding:0;gap:0}
#tab-quests,#tab-history.classic-window{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;max-height:none;margin:0;padding:0;background:none;border:0;box-shadow:none}
#tab-quests .home-dashboard{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;gap:0}
#homeCharacterHost,#historyCharacterHost{
 position:relative;top:auto;flex:none;z-index:2;margin:0;padding:1px 0 4px;border-radius:0;border:0;border-bottom:1px solid #be9a5852;
 background:linear-gradient(135deg,#111b2df5,#121525f5);box-shadow:0 3px 6px #0004;
 backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
.character-dashboard .home-overview{min-height:0;column-gap:14px}
.character-dashboard .category-stats{padding:0;background:#0b1223c9}
.character-dashboard .category-stat{min-height:0;padding:0;gap:3px;grid-template-columns:18px minmax(0,1fr)}
.character-dashboard .category-meter{height:22px;padding:0 3px;border-radius:4px;background:linear-gradient(#303b57,#172337)}
.character-dashboard .category-meter .category-name,.character-dashboard .category-meter b{font-size:11px}
.character-dashboard .category-meter i{background:linear-gradient(90deg,color-mix(in srgb,var(--category) 88%,#26354c),var(--category));box-shadow:inset 0 1px #ffffff36}
.character-dashboard .category-mark svg{width:17px;height:17px;filter:none}
.character-dashboard .home-level-caption{display:none}
.character-dashboard .home-level-progress{margin-top:3px;min-height:24px}
.character-dashboard #homeXpTrack{height:21px;min-height:21px;margin:0;border-radius:5px;background:#101927}
.character-dashboard #homeXp{font-size:12px;line-height:1;font-weight:600;background:#111726b3;padding:2px 6px}
#tab-quests .home-status-strip{display:none!important}
#tab-history .home-status-strip{display:grid;margin:5px 0 2px;min-height:44px;border-radius:7px;background:linear-gradient(115deg,#28253b,#16243a)}
#tab-history .home-status-strip>div{min-height:39px;padding-block:3px;gap:3px}
#tab-history .home-status-strip :is(#homeAden,#homeQuestTotal,#homeCompletionRate){font-size:16px;line-height:1;font-variant-numeric:tabular-nums}
#tab-history #homeCompletionTrack{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:center;min-height:24px;width:calc(100% - 4px);border:1px solid #b7975b69;border-radius:5px;background:#111d31}
#tab-history #homeCompletionTrack .completion-fill{position:absolute;inset:0 auto 0 0;z-index:-1;height:100%;background:linear-gradient(90deg,#b08b36,#f1d26d);transform-origin:left center;transition:transform .65s ease}
#tab-history #homeCompletionTrack .completion-number{display:flex;align-items:center;justify-content:center;position:relative;gap:3px;z-index:2;padding:1px 3px}
#tab-history #homeCompletionTrack .completion-laurel{display:block;width:10px;height:20px}
#tab-history #homeCompletionTrack .completion-laurel svg{display:block;width:100%;height:100%}
#tab-history #homeCompletionTrack #homeCompletionRate{color:#fff0bf;text-shadow:0 1px 2px #000,0 0 3px #111}

#homeQuestList{
 display:flex;flex-direction:column;flex:1;min-height:0;gap:6px;overflow-y:auto;overflow-x:hidden;
 padding:6px 0 10px;scroll-padding:6px 0 10px;scroll-behavior:auto;
 overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;
 clip-path:none!important;contain:layout style;
}
#homeQuestList>.home-quest,#homeQuestList>.recurring-offers,#homeQuestList>.pocket-empty{flex:none}
.home-quest{scroll-margin:6px 0;border-radius:7px;box-shadow:inset 0 1px #fff0c91a,0 1px 3px #0004;transition:border-color .2s,box-shadow .2s}
#tab-quests .home-quest:has(>.quest-drag-handle) .quest-expand{min-height:48px;padding:2px 45px 2px 5px;column-gap:5px;grid-template-columns:27px minmax(0,1fr)}
#tab-quests .quest-progress{min-height:40px;padding:4px 6px;border-radius:4px}
#tab-quests .quest-progress .quest-title{font-size:13px;line-height:1.2}
#tab-quests .quest-progress .quest-percent{font-size:10px}
#tab-quests .quest-category svg{width:22px;height:22px;filter:none}
#tab-quests .quest-drag-handle{top:2px;right:0;width:44px;height:44px}
.home-quest.is-open{box-shadow:inset 0 1px #ffe8b32e,0 0 5px color-mix(in srgb,var(--category) 25%,transparent)}
#tab-quests .quest-progress .quest-progress-fill{background:linear-gradient(100deg,color-mix(in srgb,var(--category) 60%,#18243a),color-mix(in srgb,var(--category) 42%,#142139));box-shadow:inset -1px 0 color-mix(in srgb,var(--category) 80%,transparent)}
.home-quest.is-new{animation-duration:.6s}
.quest-step input:checked{box-shadow:none}
.quest-steps-shell{transition:grid-template-rows .24s ease,opacity .2s ease}

#tab-quests .home-dock{position:relative;inset:auto;left:auto;bottom:auto;transform:none;flex:none;width:100%;max-width:none;margin:0;padding:3px 0 0;z-index:2;background:none;border:0;box-shadow:none}
#tab-quests .home-dock .home-capture{display:none!important}
#tab-quests .home-dock .daily-quest{margin:0;padding:5px 7px;min-height:46px;border-radius:7px;background:linear-gradient(100deg,#101623f5,#1a1b2ee8);box-shadow:inset 0 1px #ffe1a61f}
#tab-quests .home-dock .daily-label{font-size:10px;line-height:1.1;margin:0 0 2px;color:#bfb7a5}
#tab-quests .home-dock #dailyQuest{grid-template-columns:25px minmax(0,1fr) auto;gap:5px}
#tab-quests .home-dock #dailyQuest .daily-copy{gap:1px}
#tab-quests .home-dock #dailyQuest .daily-copy strong{font-size:11px;line-height:1.1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#tab-quests .home-dock #dailyQuest .daily-created{font-size:9px;line-height:1.1}
#tab-quests .home-dock #dailyQuest .daily-icon{width:24px;height:24px;border-radius:5px}
#tab-quests .home-dock #dailyQuest .daily-icon svg{width:20px;height:20px}
#tab-quests .home-dock #dailyQuest button{min-height:44px;padding:4px 6px;font-size:11px;border-radius:5px;box-shadow:none}
#tab-quests .home-dock #dailyQuest p{font-size:10px;line-height:1.25;padding:1px 0}
#tab-history #historyList{flex:1;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;scroll-behavior:auto;touch-action:pan-y;overscroll-behavior-y:contain;margin:5px 0 0;padding:1px 9px!important;border-radius:7px;-webkit-overflow-scrolling:touch;contain:layout style}
#tab-history .history-controls{position:relative;inset:auto;left:auto;bottom:auto;transform:none;flex:none;z-index:2;width:100%;max-width:none;box-sizing:border-box;margin:5px 0 0;padding:5px;gap:4px;border-radius:7px;background:linear-gradient(125deg,#30293b,#142237);backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none}
#tab-history .history-controls .sm-btn,#tab-history .history-controls #undoBtn{min-height:44px;gap:2px;padding:3px;font-size:11px;border-radius:5px;box-shadow:none}
#tab-history .history-controls .sm-btn svg{width:22px;height:22px}
#tab-history .history-controls #textImportBtn{min-height:44px}
#tab-history .restore-tools{flex:none;max-height:82px;margin:4px 0 0;padding:0 8px;overflow:auto;background:#101928}
#tab-history .restore-tools summary{min-height:44px;padding:12px 0}

body:has(:is(#tab-quests,#tab-history):not(.hidden)) .tabbar{position:fixed;z-index:25;left:0;right:0;bottom:0;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);gap:3px;width:100%;max-width:430px;min-height:calc(64px + env(safe-area-inset-bottom));padding:3px 12px calc(3px + env(safe-area-inset-bottom));box-sizing:border-box;border:0;background:linear-gradient(#060b14ed,#080d18);box-shadow:0 -2px 5px #0003;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .tabbar .tab{height:56px;min-height:56px;max-width:none;font-size:11px;padding:3px;gap:3px;border:0;background:none;box-shadow:none}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .tabbar [data-tab=quests]{grid-column:1;grid-row:1}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .tabbar [data-tab=history]{grid-column:3;grid-row:1}
#navAddQuest{grid-column:2;grid-row:1;align-self:center;justify-self:center;display:grid;place-items:center;width:52px;height:52px;min-width:44px;min-height:44px;padding:10px;border:1px solid #d6b96c99;border-radius:50%;background:radial-gradient(ellipse at 30% 20%,#9f794544,transparent 80%),#202331;color:#f4dda0;box-shadow:inset 0 1px #fff0ba3b;touch-action:manipulation}
#navAddQuest svg{width:25px;height:25px;stroke-width:1.5}
#navAddQuest:active{background:#403949}
#navAddQuest:focus-visible{outline:2px solid #f4d48a;outline-offset:2px}
body:has(:is(#tab-quests,#tab-history):not(.hidden)) .tabbar{transform:none}

/* Stationary wisps add smoke texture without any continuously running filter. */
:is(.quest-progress,.category-meter,.focus-meter,#homeXpTrack,#homeCompletionTrack)::after{
 content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-radius:inherit;opacity:.2;
 background:radial-gradient(ellipse at 13% 85%,#ffffff5c 0,transparent 31%),radial-gradient(ellipse at 62% -45%,#ffffff70 0,transparent 45%),radial-gradient(ellipse at 90% 120%,#bbcbed73 0,transparent 42%),linear-gradient(172deg,transparent 38%,#e6eaff23 47%,transparent 53%);
}
:is(.quest-progress,.category-meter,.focus-meter,#homeXpTrack,#homeCompletionTrack)>:is(.quest-title,.quest-percent,.category-name,b,#homeXp,.completion-number){position:relative;z-index:2}
.focus-meter{position:relative;isolation:isolate}
body>#questComposer.quest-composer,#composerBackdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body>#questComposer.quest-composer{background:#111b2afc;box-shadow:0 4px 16px #0008,inset 0 1px #e8d4ad21}
#composerBackdrop{background:#02050cbd}
#questComposer .repeat-choice{min-height:44px}
#questComposer .repeat-choice>svg{width:22px;height:22px;flex:none;color:#e1c172}
#questComposer .repeat-choice.is-selected{border-color:#dcc17d;background:linear-gradient(125deg,#51422e,#222942)}
@media(min-width:410px){.character-dashboard .category-meter .category-name,.character-dashboard .category-meter b{font-size:11.5px}#tab-quests .quest-progress .quest-title{font-size:14px}}
@media(max-height:700px){
 .character-dashboard .home-overview{grid-template-columns:minmax(0,42fr) minmax(0,58fr);column-gap:12px}
 .character-dashboard .home-portrait{max-height:160px}
 .character-dashboard .category-meter{height:19px}
 #tab-history .history-controls .sm-btn{min-height:44px}
 #tab-history .restore-tools{max-height:44px}
}
@media(prefers-reduced-motion:reduce){.character-dashboard :is(.category-meter i,#homeXpFill,#homeCompletionTrack .completion-fill){transition:none!important}}
/* One compact archive row: its context belongs to the copy, not a second header. */
#tab-quests .home-dock .daily-label{display:none}
#tab-quests .home-dock #dailyQuest .daily-copy::before{content:'Из архива';font-size:9px;line-height:1.1;color:#c4ae7b}
