.collection-panel { padding: clamp(15px,3vw,29px); }
.collection-panel h2 { margin: 0 0 12px; font-size: clamp(21px,2.4vw,26px); font-weight: 730; }
.progress-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(165px,100%),1fr)); align-items: end; gap: 12px 16px; margin: 16px 0; }
.progress-filters label { display: grid; gap: 5px; line-height: 1.3; min-width: 0; color: #40564b; font-weight: 640; }
.progress-filters select,.progress-filters input[type="search"] { min-width: 0; width: 100%; min-height: 41px; margin: 0; padding: 8px 10px; border-color: #ccddcf; background: #fbfdf8; color: var(--ink); }
.progress-filters .check-line { display: flex; min-height: 41px; }
.progress-filters input[type="checkbox"] { margin: 0; }
.progress-filters :focus-visible { outline-offset: 2px; }
.collection-meters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: 10px 14px; margin: 8px 0 15px; }
.meter { display: grid; gap: 4px; min-width: 0; border: 1px solid var(--line); background: #f2f6ef; padding: 14px 16px; border-radius: 12px; }
.meter-label { font-weight: 660; font-size: 13px; color: #3a5a49; }
.meter-counts { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; }
.meter strong { font-size: clamp(18px,2.2vw,25px); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.meter small { color: #4d6659; }
.meter progress { width: 100%; height: 8px; margin: 4px 0 1px; accent-color: #477c65; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(210px,100%),1fr)); gap: 9px; }
.progress-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #dce6db; border-radius: 11px; background: #fffefb; min-height: 68px; min-width: 0; overflow-wrap: anywhere; }
.progress-item[data-state="owned"] { border-color: #c9dbca; background: #f7faf4; }
.progress-item[data-state="unowned"] { background: #f2f2ed; border-color: #e0e0d7; }
.progress-item[data-state="unowned"] img,.progress-item[data-state="unowned"] .item-fallback { filter: grayscale(1); opacity: .57; }
.progress-item[data-state="unowned"] strong { color: #5d615a; }
.progress-item[data-state="missing"] small:last-child { color: #815537; }
.progress-item[data-state="short"] small:first-of-type { color: #a23027; font-weight: 740; }
.progress-item img,.item-fallback { flex: 0 0 44px; width: 44px; height: 44px; object-fit: contain; border-radius: 7px; background: #eff4ed; }
.item-body { min-width: 0; }
.item-fallback { display: grid; place-items: center; font-size: 17px; color: #587567; }
.progress-item strong { display: block; font-size: 14px; line-height: 1.4; }
.progress-item small { display: block; color: #496255; line-height: 1.5; }
.more { margin-top: 12px; }
.empty-note { grid-column: 1/-1; margin: 6px 0; color: var(--muted); }
.local-import { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f6f9f3; }
.local-import summary { cursor: pointer; }
.gate-overview { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.gate-overview p { margin: 0; font-weight: 720; }
.gate-levels { padding: 0; margin: 12px 0 23px; display: grid; gap: 6px; list-style: none; }
.gate-level { padding: 8px 12px; display: grid; grid-template-columns: minmax(0,78px) minmax(0,1fr); gap: 8px 10px; align-items: center; border: 1px solid #dce6db; border-radius: 10px; background: #f7faf5; }
.gate-level[data-state="next"] { background: #e7f4e9; border-color: #9bbba1; }
.gate-level[data-state="completed"] { background: #f1f2ed; border-color: #e2e5dd; color: #646c63; }
.level-label { display: grid; }
.level-label strong { font-size: 15px; }
.level-label small { font-size: 11px; }
.level-recipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
.recipe-item { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 0 5px; font-size: 11px; }
.recipe-item img,.recipe-item .item-fallback { height: 33px; width: 33px; grid-row: span 2; object-fit: contain; }
.recipe-item strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.recipe-item[data-state="short"] strong { color: #a53027; }
.recipe-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-level[data-state="completed"] img { filter: grayscale(1); opacity: .58; }
.gate-total { border-top: 1px solid var(--line); padding-top: 10px; scroll-margin: 14px; }
.gate-total h3 { font-size: 20px; }
.gate-total .progress-filters { max-width: 265px; }
@media(max-width: 780px) {
 .recipe-item { grid-template-columns: minmax(0,1fr); justify-items: center; gap: 2px; }
 .recipe-item img,.recipe-item .item-fallback { grid-row: auto; }
 .recipe-name { width: 100%; text-align: center; }
}
@media(max-width: 540px) {
 .progress-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px 10px; }
 .progress-filters label:has(input[type="search"]) { grid-column: 1/-1; }
 .collection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
 .progress-item { align-items: start; gap: 6px; padding: 7px; }
 .progress-item img,.progress-item .item-fallback { flex-basis: 34px; width: 34px; height: 34px; }
 .progress-item strong { font-size: 12px; }
 .progress-item small { font-size: 11px; }
 .gate-level { padding: 5px 5px 7px; gap: 4px; grid-template-columns: minmax(0,40px) minmax(0,1fr); }
 .level-label strong,.recipe-item strong { font-size: 11px; }
 .recipe-item img,.recipe-item .item-fallback { width: 25px; height: 25px; }
 .recipe-name { font-size: 10px; }
}

.picker-label { font-size: 13px; font-weight: 650; color: var(--muted); margin: 5px 0 7px; }
.team-buttons { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.team-buttons button { display: grid; place-items: center; min-width: 0; min-height: 55px; padding: 5px; background: #f6f8f3; }
.team-buttons img { max-width: 100%; max-height: 37px; width: 100%; object-fit: contain; }
.team-buttons button[aria-pressed="true"], .filter-chips button[aria-pressed="true"], .portrait[aria-pressed="true"], .character-picker > button[aria-pressed="true"] { background: #dceee0; border-color: #5e9176; color: #194b37; box-shadow: inset 0 0 0 1px #709d83; }
.gate-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 24px; margin: 14px 0; }
.gate-toolbar label { font-weight: 650; }
.gate-toolbar select { display: block; margin: 5px 0 0; min-width: 120px; min-height: 42px; padding: 7px 12px; }
.gate-toolbar .check-line { min-height: 42px; }
.character-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; margin: 11px 0 16px; }
.character-picker > button { justify-self: start; grid-column: 1/-1; padding: 6px 13px; font-size: 13px; }
.portrait-group { display: flex; align-items: center; gap: 8px; min-width: 0; border: 1px solid #dce7dc; padding: 6px 8px; border-radius: 10px; background: #f6f8f2; }
.unit-emblem { width: 65px; max-height: 36px; flex: 0 0 65px; object-fit: contain; }
.portrait-buttons { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.portrait { display: grid; justify-items: center; gap: 1px; width: 50px; min-height: 54px; padding: 2px; background: #fffdfa; }
.portrait img,.portrait .item-fallback { width: 38px; height: 37px; object-fit: contain; }
.portrait-name { display: block; font-size: 9px; line-height: 1.2; width: 100%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.doll-month { margin: 18px 0; }
.doll-month h3 { margin: 0 0 7px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.filter-chips button { font-size: 13px; padding: 6px 11px; min-height: 42px; border-radius: 9px; }
.collection-toolbar {
 display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 12px 0;
}
.collection-query { flex: 1 1 180px; min-width: 0; max-width: 390px; font-weight: 650; }
.collection-query input { margin: 5px 0 0; min-height: 42px; }
.collection-toolbar .filter-toggle { min-height: 42px; }
.category-filters { margin: 10px 0 15px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #f6f9f3; }
.category-filters summary { color: var(--green); cursor: pointer; font-weight: 630; }
.progress-item[data-state="upcoming"] { border-style: dashed; }
.progress-item[data-state="upcoming"] small:last-child { color: #82612b; }
.talk-remaining { align-self: center; margin: 5px 0; font-weight: 650; color: #325f4b; }
.talk-item { min-width: 0; border: 1px solid var(--line); background: #fcfdf8; border-radius: 9px; padding: 8px 10px; }
.talk-item summary { cursor: pointer; display: grid; grid-template-columns: 41px minmax(0,1fr) 11px; align-items: center; gap: 8px; list-style: none; }
.talk-item summary:after { content: '›'; font-size: 16px; }
.talk-item details[open] summary:after { transform: rotate(90deg); }
.talk-item summary img { width: 41px; height: 41px; object-fit: contain; border-radius: 6px; }
.talk-card-title { min-width: 0; overflow-wrap: anywhere; }
.talk-card-title strong, .talk-card-title small { display: block; font-size: 13px; }
.talk-card-title small { font-size: 11px; color: var(--muted); }
.talk-lines { list-style: none; margin: 7px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); }
.talk-lines li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 6px; padding: 4px 0; font-size: 12px; }
.talk-lines small { color: var(--muted); }
@media(max-width: 740px) { .character-picker { grid-template-columns: minmax(0,1fr); } }
@media(max-width: 460px) {
 .unit-emblem { width: 49px; flex-basis: 49px; }
 .portrait-group { padding: 5px 6px; gap: 5px; }
 .portrait-buttons { gap: 3px; }
 .portrait { width: 40px; min-height: 45px; }
 .portrait img,.portrait .item-fallback { width: 30px; height: 29px; }
 .team-buttons { gap: 4px; }
 .team-buttons button { min-height: 45px; }
 .talk-item summary { grid-template-columns: 27px minmax(0,1fr) 7px; gap: 5px; }
 .talk-item summary img { width: 27px; height: 29px; }
}
