/* 0.8.0 UI · shared skeleton for the dashboard and the account manager.
   Colours, fonts and decoration come from theme-b.css (默认「夜间探险」) and
   theme-a.css (「图鉴风」); both switch only through <html data-style data-scheme>. */
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:var(--font);background:var(--bg);color:var(--ink);font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;overflow:hidden}
button,input,select{font:inherit;color:inherit}
h1,h2,h3,p{margin:0}
[hidden]{display:none!important}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
svg.ico{width:16px;height:16px;flex:none;vertical-align:-3px}
.sky,.spark{display:none}
.spacer{flex:1}
.note{font-size:11.5px;color:var(--muted);line-height:1.6}
:root{--fire:#EE8130;--water:#6390F0;--grass:#5DBB4A;--electric:#F2C40F;--psychic:#F95587;--ghost:#735797;--fairy:#D685AD;--normal:#A8A77A;--steel:#9EA3BD;--r:16px;--r-btn:11px;
  --font:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans SC",sans-serif;--title:var(--font);--num:var(--font)}

.app{position:relative;z-index:1;height:100vh;display:flex;flex-direction:column;padding:0 22px 10px;max-width:1560px;margin:0 auto}

/* ---------- top bar ---------- */
.topbar{flex:none;display:flex;align-items:center;gap:10px;height:62px;position:relative;z-index:20;min-width:0}
.brand{display:flex;align-items:center;gap:10px;margin-right:2px;flex:none}
.brand .logo{display:grid;place-items:center;width:38px;height:38px}
.brand .logo svg{width:32px;height:32px}
.brand b{display:block;font-family:var(--title);font-size:18px;letter-spacing:.06em;line-height:1.2;white-space:nowrap}
.brand small{display:block;font-size:11px;color:var(--muted);white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}
.conn{display:flex;align-items:center;gap:7px;padding:5px 12px;border-radius:999px;background:var(--chip);font-size:12px;white-space:nowrap;min-width:0;flex:0 1 auto;overflow:hidden}
.conn b,.conn span:last-child{overflow:hidden;text-overflow:ellipsis}
.conn span:last-child{color:var(--muted)}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--muted);flex:none}
.dot.on{background:var(--grass);box-shadow:0 0 0 3px color-mix(in srgb,var(--grass) 25%,transparent)}
.dot.warn{background:var(--electric)}.dot.bad{background:var(--danger)}
.badge{font-size:11px;padding:3px 10px;border-radius:999px;border:1px solid var(--line);color:var(--muted);white-space:nowrap;flex:none}
.badge b{font-weight:500}
.update-pop{position:relative;min-width:0;flex:0 1 auto}
.update-pop summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);padding:5px 10px;border-radius:999px;white-space:nowrap;overflow:hidden}
.update-summary{overflow:hidden;text-overflow:ellipsis}
.update-pop summary::-webkit-details-marker,.fold summary::-webkit-details-marker{display:none}
.pop{position:absolute;right:0;top:calc(100% + 8px);width:340px;z-index:30;padding:14px 16px;background:var(--card-solid);color:var(--ink);border:var(--card-border);border-radius:var(--r);box-shadow:var(--shadow-pop);display:grid;gap:6px;font-size:12px;white-space:normal}
.pop-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.pop-head h2{font-size:14px}
.appearance{display:flex;align-items:center;gap:6px;flex:none}
/* 0.8.2 界面语言 */
.appearance .ui-lang{width:auto;max-width:9.5em;padding:3px 6px;font-size:11.5px;border-radius:999px;border:1px solid var(--line);background:var(--chip);color:var(--muted);font-weight:600}
.theme-switch{display:inline-flex;gap:2px;padding:2px;border-radius:999px;border:1px solid var(--line);background:var(--chip)}
.theme-switch button{padding:4px 8px;font-size:11.5px;border-radius:999px;border:0;background:transparent;color:var(--muted);gap:4px;font-weight:600;box-shadow:none}
.theme-switch button svg{width:14px;height:14px;vertical-align:0}
.theme-switch button span{display:none}
.theme-switch button[aria-checked=true] span{display:inline}
.style-toggle svg{width:15px;height:15px}

/* ---------- buttons, fields ---------- */
button{cursor:pointer;border-radius:var(--r-btn);border:1px solid var(--line);background:var(--btn);padding:8px 14px;font-weight:600;font-size:13px;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;color:var(--ink)}
button.small{padding:5px 11px;font-size:12px}
button.primary{background:var(--accent);border-color:var(--accent-dark);color:var(--on-accent)}
button.danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--line))}
button.ghost{background:transparent}
button:disabled{opacity:.45;cursor:default}
button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid var(--focus,var(--accent));outline-offset:2px}
.big{padding:10px 20px;font-size:15px}
#start::before{content:"";width:13px;height:13px;background:currentColor;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);flex:none}
select,input[type=number],input[type=password],input:not([type]),input[type=text]{width:100%;padding:7px 10px;border-radius:8px;border:1px solid var(--line);background:var(--field);color:var(--ink);font-size:13px;min-width:0}
select:disabled,input:disabled{opacity:.5}
.banner{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-radius:var(--r);background:var(--sub);border:1px solid var(--line);margin-bottom:10px;font-size:12px}
.banner h2{font-size:14px}
.banner.error{color:var(--danger);display:block;line-height:1.7}

/* ---------- cards ---------- */
.card{background:var(--card);border:var(--card-border);border-radius:var(--r);box-shadow:var(--shadow);padding:15px 18px;min-height:0;min-width:0;position:relative}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex:none}
.card-head h2{font-family:var(--title);font-size:15px}
.chip{font-size:11px;padding:2px 8px;border-radius:999px;background:var(--chip);color:var(--ink)}

/* ---------- dashboard layout ---------- */
/* 0.8.1 (user: 最近捕获和运行日志只露两行): the last row fills the rest of the
   page and keeps at least --rest-min, enough for 4–6 entries in each list. A
   mode panel (外观进度, 活动塔, 速通比较) sits above the log instead of taking a
   full-width row (at least 96 px, scrolling inside); 最近捕获 spans both rows. */
.layout{--rest-min:250px;flex:1;min-height:0;overflow-y:auto;display:grid;gap:14px;padding:2px;margin:-2px;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);grid-template-rows:auto auto minmax(var(--rest-min),1fr);grid-template-areas:"hero hero" "metrics metrics" "captures log"}
.layout:has(.mode-panels>:not([hidden])){grid-template-rows:auto auto max-content minmax(var(--rest-min),1fr);grid-template-areas:"hero hero" "metrics metrics" "captures panels" "captures log"}
.hero{grid-area:hero;min-height:auto}.metrics{grid-area:metrics}.captures{grid-area:captures}.log{grid-area:log}
.mode-panels{grid-area:panels;display:grid;gap:14px;min-width:0;max-height:min(210px,30vh);overflow:auto;padding:2px;margin:-2px}
.mode-panels:not(:has(>:not([hidden]))){display:none}
.hero-top{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.status{display:flex;gap:12px;align-items:center;min-width:0;flex:1 1 260px}
.status-dot{width:12px;height:12px;border-radius:50%;background:var(--muted);flex:none}
.status-dot.on{background:var(--grass);animation:pulse 1.8s ease-out infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--grass) 60%,transparent)}100%{box-shadow:0 0 0 10px transparent}}
.status h1{font-family:var(--title);font-size:22px;line-height:1.25}
.status p{margin-top:2px;color:var(--muted);font-size:12px;line-height:1.55}
.actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
.modes{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:12px 0 11px}
.modes-label{font-size:12px;color:var(--muted);margin-right:4px}
.mode-chips{display:contents}
/* 0.8.1: 刷闪光 map switch beside the mode chips (固定地图 / 1～4 图循环) */
.map-quick{display:inline-flex;gap:2px;padding:2px;margin-left:auto;border-radius:999px;border:1px solid var(--line);background:var(--chip)}
.map-quick[hidden]{display:none}
.map-quick button{border:0;box-shadow:none;background:transparent;color:var(--muted);padding:4px 11px;border-radius:999px;font-size:12px;font-weight:600}
.map-quick button[aria-checked=true]{background:var(--electric);color:#23252e}
.mode{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;border:1px solid var(--line);background:var(--chip);font-weight:600;font-size:12px;position:relative}
.mode svg{color:var(--c)}
.mode[aria-checked=true]{background:var(--c);border-color:var(--c);color:#fff}
.mode[aria-checked=true] svg{color:#fff}
.mode.locked{opacity:.55;cursor:not-allowed;filter:grayscale(.6)}
.mode.locked .lock-tag{font-size:10px;font-weight:700;padding:1px 6px;border-radius:999px;border:1px dashed currentColor}
.journey{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;padding:8px 14px;border-radius:calc(var(--r) - 4px);background:var(--sub);font-size:12px;min-width:0}
.partner{display:grid;place-items:center;width:46px;height:40px;margin:-5px -4px -5px -6px;flex:none;overflow:hidden}
.partner .pic img{max-width:44px;max-height:38px}
.partner.empty svg{width:22px;height:22px;opacity:.5}
.dex{font-family:var(--num);color:var(--muted);font-size:12px}
.pokemon-name{font-size:15px;margin-left:-6px}
.bar{width:140px;height:8px;border-radius:99px;background:var(--line);overflow:hidden;flex:none}
.bar>div{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,var(--grass),color-mix(in srgb,var(--grass) 60%,var(--electric)));transition:width .4s}
.journey .sep{flex:1}
.journey b{font-family:var(--num)}
.journey .next{color:var(--muted)}

.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.metrics article{--c:var(--accent);position:relative;background:var(--card);border:var(--card-border);border-radius:var(--r);box-shadow:var(--shadow);padding:12px 16px;overflow:hidden;min-width:0}
.metrics label{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;white-space:nowrap}
.metrics label::before{content:"";width:13px;height:13px;flex:none;background:var(--c);clip-path:var(--shape,polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%))}
.metrics strong{display:block;font-family:var(--num);font-size:30px;line-height:1.15;margin:4px 0 2px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.metrics small{display:block;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metrics .bonk-line{display:inline-block;margin-top:2px;padding:0 6px;border-radius:5px;background:color-mix(in srgb,var(--electric) 22%,transparent);color:var(--ink);max-width:100%}
.m-shiny{--c:var(--electric)!important}
.m-classic{--c:var(--steel)!important;--shape:circle(50%)}
.m-dust{--c:var(--psychic)!important;--shape:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%)}
.m-runs{--c:var(--water)!important;--shape:polygon(0 0,100% 0,80% 35%,100% 70%,22% 70%,22% 100%,0 100%)}
.m-count{--c:var(--fire)!important;--shape:circle(50%)}

.mode-panel .card-head{margin-bottom:6px}
.model-routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin:8px 0 6px}
.model-route{border:1px solid var(--line);border-radius:10px;padding:8px 12px;display:flex;flex-direction:column;gap:2px;background:var(--sub)}
.model-route strong{font-size:12px;font-weight:600}
.model-route span{font-family:var(--num);font-size:15px;font-weight:700;color:var(--psychic)}
.model-route small{font-size:11px;color:var(--muted)}
#event-progress-goals p{font-size:12px;margin:2px 0}
.model-summary{font-size:11.5px;color:var(--muted);line-height:1.8;white-space:pre-line}

/* captures + log */
.captures,.log{display:flex;flex-direction:column}
.tabs{display:flex;gap:4px}
.tab{padding:3px 11px;font-size:12px;border-radius:999px;border:0;background:transparent;color:var(--muted);font-weight:600;box-shadow:none}
.tab.on{background:var(--chip);color:var(--ink)}
.pending-line{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;font-size:12px;margin-bottom:8px;padding:6px 10px;border-radius:8px;background:color-mix(in srgb,var(--electric) 16%,transparent)}
.pending-line::before{content:"";width:12px;height:12px;background:var(--electric);clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%)}
.pending-art{display:inline-flex;gap:8px;align-items:center;margin-left:4px}
.capture-list{overflow:auto;min-height:0;flex:1;display:grid;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:8px;align-content:start;padding:2px 4px 2px 2px}
.capture-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 10px;padding:7px 10px;border-radius:10px;background:var(--sub);min-width:0}
.capture-row.has-art{grid-template-columns:44px minmax(0,1fr);grid-template-rows:auto auto;padding:6px 10px 6px 8px}
.capture-row strong{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.capture-row small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.capture-row.has-art small{grid-column:2}
.capture-row.has-art[data-dex] strong::after{content:attr(data-dex);font:600 10px/1 var(--num);color:var(--muted);margin-left:5px}
.capture-row .ico{grid-row:span 2;width:44px;height:44px;border-radius:11px;display:grid;place-items:center;overflow:visible;position:relative;background:var(--avatar-bg)}
.capture-row .ico .pic-item img{width:26px;height:26px}
.capture-list .empty{grid-column:1/-1;text-align:center;color:var(--muted);padding:22px 8px;font-size:12px}
#events{overflow:auto;flex:1;min-height:0;font-size:12px;padding-right:4px}
#events .empty{text-align:center;color:var(--muted);padding:22px 8px}
.log-row{display:flex;gap:10px;padding:5px 0;border-bottom:1px dashed var(--line);align-items:baseline}
.log-row time{font-family:var(--num);color:var(--muted);flex:none;font-size:11px;font-variant-numeric:tabular-nums}
.log-row span{min-width:0;overflow-wrap:anywhere}
footer{flex:none;display:flex;justify-content:space-between;gap:12px;padding-top:8px;font-size:11px;color:var(--muted);min-width:0}
footer span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------- Pokémon pictures (read from the game page at run time) ---------- */
.pic{display:inline-grid;place-items:center;flex:none;vertical-align:middle}
.pic img{display:block;image-rendering:pixelated;max-width:100%;max-height:100%}
.pic-frame img{width:calc(var(--w,24) * var(--z,1) * 1px);height:calc(var(--h,24) * var(--z,1) * 1px)}
.pic-portrait,.pic-portrait img{width:40px;height:40px}
.pic-item img{width:30px;height:30px}
.pic svg.fallback{width:22px;height:22px;opacity:.6}
.pic-item svg.fallback{width:28px;height:28px;opacity:1}
.mon{position:relative;display:inline-grid;place-items:center;flex:none}
.mon.small{--z:.8;vertical-align:-7px;margin:-10px 2px -6px 3px}
.mon.small .pic img{max-height:28px;max-width:46px}
.mon.small svg.fallback{width:16px;height:16px}
.mon[data-badge]::after{position:absolute;right:-5px;top:-5px;width:15px;height:15px;content:"";z-index:1}
.mon[data-badge=shiny]::after{background:#FFD21F;clip-path:polygon(50% 0,62% 36%,100% 50%,62% 64%,50% 100%,38% 64%,0 50%,38% 36%);filter:drop-shadow(0 0 2px #fff)}
.mon[data-badge=shiny]::before{content:"";position:absolute;right:-7px;top:-7px;width:19px;height:19px;background:#7A5600;clip-path:polygon(50% 0,63% 35%,100% 50%,63% 65%,50% 100%,37% 65%,0 50%,37% 35%);z-index:1}
.mon[data-badge=classic]::after{content:"★";border-radius:50%;display:grid;place-items:center;font-size:9px;line-height:1;color:#fff;background:linear-gradient(145deg,#D9DEEA,#7D86A3);box-shadow:0 0 0 1.5px #3E4560}
.mon[data-badge=new]::after{content:"+";border-radius:50%;display:grid;place-items:center;font:900 12px/1 sans-serif;color:#fff;background:#3FA34D;box-shadow:0 0 0 1.5px #1C5A25}
.mon.small[data-badge]::after{width:11px;height:11px;right:-4px;top:-4px;font-size:7px}
.mon.small[data-badge=shiny]::before{width:14px;height:14px;right:-5.5px;top:-5.5px}

/* ---------- dialogs ---------- */
dialog{color:var(--ink)}
dialog.sheet{width:min(1000px,94vw);max-height:90vh;padding:0;border:var(--card-border);border-radius:var(--r);background:var(--card-solid);box-shadow:var(--shadow-pop);overflow:hidden}
dialog.sheet[open]{display:flex;flex-direction:column}
dialog.small-sheet{width:min(460px,92vw)}
dialog.sheet>form{display:flex;flex-direction:column;min-height:0;max-height:90vh}
dialog::backdrop{background:rgba(12,14,24,.5)}
.sheet-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 20px;border-bottom:1px solid var(--line)}
.sheet-head h2{font-family:var(--title);font-size:17px}
.sheet-pad{padding:16px 20px;display:grid;gap:10px;font-size:13px;line-height:1.75}
.sheet-body{flex:1;min-height:0;padding:16px 20px;overflow:auto;columns:3 270px;column-gap:14px}
.sheet-body>form{display:contents}
.sheet-body .group{break-inside:avoid;margin-bottom:14px}
.sheet-foot{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;padding:10px 20px;border-top:1px solid var(--line);font-size:12px}
.sheet-foot>span:first-child{margin-right:auto}
.sheet-foot .buttons{display:flex;gap:8px}
.group{background:var(--sub);border-radius:calc(var(--r) - 4px);padding:12px 14px;display:grid;gap:4px;min-width:0}
.group h3{font-family:var(--title);font-size:14px;display:flex;align-items:center;gap:6px;margin-bottom:4px}
.group h3 svg{color:var(--accent-ink,var(--accent))}
.f{display:block;font-size:12px;color:var(--muted);margin:6px 0 3px}
.f input{margin-top:3px}
.check{display:flex;gap:8px;align-items:flex-start;font-size:12.5px;margin:5px 0;cursor:pointer}
.check input{margin:3px 0 0;accent-color:var(--accent);flex:none}
.check small{color:var(--muted);display:block;font-size:11px;line-height:1.5}
.seg{border:0;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:8px;min-width:0}
.seg.seg3{grid-template-columns:repeat(3,1fr)}
.seg legend{font-size:12px;color:var(--muted);margin-bottom:5px;padding:0}
.seg label{display:flex;gap:7px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:var(--field);cursor:pointer;min-width:0}
.seg label:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.seg input{accent-color:var(--accent);margin:3px 0 0;flex:none}
.seg strong{display:block;font-size:12.5px}.seg small{display:block;font-size:10.5px;color:var(--muted);line-height:1.4}
.seg:disabled{opacity:.5}.seg:disabled label{cursor:default}
/* 0.9.12 (user): 多图循环「循环哪些图」 */
.cycle-maps{margin:8px 0 2px}
.cycle-maps-head{display:flex;gap:8px;align-items:baseline;font-size:12px;color:var(--muted);margin-bottom:5px}
.cycle-maps-head small{font-size:10.5px}
.cycle-map-list{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.cycle-map-list label{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px 4px;border-radius:9px;border:1px solid var(--line);background:var(--field);font-size:11.5px;cursor:pointer;text-align:center;opacity:.6;position:relative}
.cycle-map-list label:has(input:checked){opacity:1;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.cycle-map-list label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.cycle-map-list label.locked{border-style:dashed}
#wilds-rarity-box.off{opacity:.45}
#wilds-rarity-box.off label{cursor:default}
.cycle-map-list input{position:absolute;opacity:0;pointer-events:none}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.grid2>*{min-width:0}
.completion-settings,.schedule-settings{margin-top:4px}
.schedule-settings{border-top:1px dashed var(--line);padding-top:6px;margin-top:8px}
.bag{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.bag label{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 4px 7px;border-radius:10px;border:1px solid var(--line);background:var(--field);font-size:11.5px;position:relative;cursor:pointer;opacity:.55;text-align:center}
.bag label:has(input:checked){opacity:1;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.bag label:has(input:checked)::after{content:"✓";position:absolute;top:3px;right:6px;font-size:11px;font-weight:800;color:var(--accent-ink,var(--accent))}
.bag label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.bag input{position:absolute;opacity:0;pointer-events:none}
.bag-art{display:grid;place-items:center;width:30px;height:30px}
.fold summary{cursor:pointer;font-size:11.5px;color:var(--muted);margin-top:4px;list-style:none}
.fold summary::before{content:"▸ "}
.fold[open] summary::before{content:"▾ "}
.row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0}
.legend-pick{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 2px}
.legend-pick button{justify-content:flex-start;gap:8px;padding:5px 9px;font-weight:500;font-size:12px;min-height:50px;background:var(--field);min-width:0;white-space:normal}
.legend-pick button .pic img{max-width:52px;max-height:40px}
.legend-pick button .pic{min-width:28px}
.legend-text{text-align:left;line-height:1.3;min-width:0}
.legend-text small{display:block;font-size:10.5px;color:var(--muted)}
.species-row{display:flex;gap:10px;align-items:center}
.species-row select{flex:1}
.species-preview{width:46px;height:46px;flex:none;display:grid;place-items:center;border-radius:12px;border:1px solid var(--line);background:var(--avatar-bg);overflow:hidden}
.species-preview.auto b{font:800 18px/1 var(--num);color:var(--muted)}
.natural-shiny,.schedule-status{font-variant-numeric:tabular-nums}
/* 0.8.1: 本区自然闪 / 经典闪 forecast on the home card (also in the settings panel). */
.hero-natural{margin:7px 4px 0;font-size:12px;line-height:1.5;color:var(--muted);font-variant-numeric:tabular-nums;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.browser-summary{margin:0;flex:1;min-width:0}

/* ---------- narrow windows (min width 900 / 940) ---------- */
@media (max-width:1280px){.style-toggle span{display:none}}
@media (max-width:1180px){
  .topbar .badge#mode{display:none}
  .theme-switch button[aria-checked=true] span{display:none}
  .layout{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
}
@media (max-width:1040px){
  .topbar{gap:7px}
  .brand small{max-width:150px}
  #open-settings span{display:none}
  .metrics strong{font-size:25px}
  .capture-list{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
  .journey .next{flex-basis:100%;order:9}
}
/* 0.7.27 controls carried into 0.8.0: 自选随机池 (main settings + manager dialog), look progress */
.species-pool{border-top:1px dashed var(--line);margin-top:8px;padding-top:6px;display:grid;gap:6px;min-width:0}
.species-region{border-top:1px dashed var(--line);margin-top:8px;padding-top:6px;display:grid;gap:4px;min-width:0}
.pool-tools{display:flex;gap:8px;align-items:center;font-size:11.5px;color:var(--muted)}
.pool-tools input[type=search]{flex:1;min-width:0;padding:6px 10px;border-radius:8px;border:1px solid var(--line);background:var(--field);color:var(--ink);font:inherit;font-size:12px}
.pool-tools span{white-space:nowrap}
.pool-list{max-height:180px;overflow:auto;display:grid;grid-auto-rows:max-content;align-content:start;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:4px 10px;font-size:12px;color:var(--ink);padding:6px 8px;border-radius:8px;background:var(--field);border:1px solid var(--line)}
.pool-list label{display:flex;gap:6px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.pool-list input{accent-color:var(--accent);flex:none;margin:0}
.pool-list .locked{color:var(--muted)}
.subtle{font-size:11.5px;color:var(--muted);line-height:1.6}
.auto-switch{margin:6px 0 0;padding:6px 10px;border-radius:8px;font-size:12px;line-height:1.6;color:inherit;background:color-mix(in srgb,var(--electric) 18%,transparent);border-left:3px solid var(--electric)}
.warn-line{font-size:12px;color:var(--danger);line-height:1.6}
#looks-progress-suspended p{margin:2px 0}
/* 0.8.1: short windows (1280×800 at 125%, 1920×1080 at 150%) compact the hero and
   the stat cards so the two lists keep their 4–6 entries. */
@media (max-height:760px){
  .layout{--rest-min:220px;gap:10px}
  .hero{padding-top:12px;padding-bottom:10px}
  .status h1{font-size:20px}
  .status p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .modes{margin:8px 0 7px}
  .mode{padding:3px 10px}
  .journey{padding:6px 12px}
  .hero-natural{margin-top:5px;-webkit-line-clamp:1}
  .metrics{gap:10px}
  .metrics article{padding:8px 14px}
  .metrics strong{font-size:23px;margin:2px 0 0}
  .capture-row.has-art{grid-template-columns:36px minmax(0,1fr);padding:4px 10px 4px 6px}
  .capture-row .ico{width:36px;height:36px}
  .log-row{padding:4px 0}
}

/* 0.8.2 界面语言: English labels are longer */
.sheet-body select{max-width:100%;min-width:0}
@media (min-width:1041px){html[data-ui-lang="en"] .conn{flex:none}}
@media (max-width:1400px){html[data-ui-lang="en"] .topbar .badge#mode{display:none}html[data-ui-lang="en"] .theme-switch button[aria-checked=true] span{display:none}}
html[data-ui-lang="en"] #dex-source{white-space:normal}
html[data-ui-lang="en"] .sheet-body{columns:auto}
html[data-ui-lang="en"] .sheet-body>form{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:14px;align-items:start}
html[data-ui-lang="en"] .sheet-body .group{margin-bottom:0}
html[data-ui-lang="en"] .metrics small{white-space:normal}
html[data-ui-lang="en"] footer span{white-space:normal}
html[data-ui-lang="en"] footer #pulse{flex:none}
@media (max-width:1040px){html[data-ui-lang="en"] .conn span:last-child{display:none}html[data-ui-lang="en"] .conn{flex:0 1 auto;min-width:112px}}

/* Appearance progress uses confirmed profile cosmetics, independent of quest counters. */
.mode-panels:has(#looks-progress-panel:not([hidden])){max-height:none;min-height:max-content;overflow:visible}
#looks-progress-panel{min-width:0;min-height:max-content}
#looks-progress-bar{display:block;width:100%;height:12px;accent-color:var(--accent,#7f69ce);margin:10px 0 18px}
#look-start-options{padding:12px 0;border-block:1px solid var(--line,#ced3ce);margin-bottom:12px}
#look-start-options select,.looks-progress-details select{width:100%;max-width:100%}
.looks-progress-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:12px;max-height:420px;overflow:auto;margin-top:12px}
.look-progress-row{display:grid;gap:6px;padding:12px;border:1px solid var(--line,#ced3ce);border-radius:10px;min-width:0}
.look-progress-row span,.look-progress-row small{overflow-wrap:anywhere}.look-progress-row progress{width:100%;height:7px;accent-color:var(--accent,#7f69ce)}
.looks-progress-details{margin:12px 0}.looks-progress-details summary{cursor:pointer;margin-bottom:10px}
/* 0.9.20 更新日志 (changelog-ui.js) */
.update-pop .changelog-row{margin:6px 0 0}
dialog.changelog-sheet{width:min(560px,92vw)}
.changelog-body{flex:1;min-height:0;max-height:62vh;overflow:auto;gap:14px}
.changelog-entry h3{margin:0 0 4px;font-size:14px}
.changelog-entry h3 .note{font-weight:400;font-size:12px;color:var(--muted)}
.changelog-entry ul{margin:0;padding-left:18px;display:grid;gap:3px}
.changelog-entry.current{padding:8px 10px;border-radius:10px;background:var(--sub,rgba(127,127,127,.08))}
